2006-10-04 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2006-10-04  Martin Baulig  <martin@ximian.com>
2
3         * generic.cs (GenericMethod): Don't make this abstract.
4         (Constraints.Clone): Added dummy implementation.
5
6 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7
8         Fix #79577
9         * namespace.cs (LookForAnyGenericType): Avoid nullref on
10         'declspaces'.  Avoid allocating arrays willy-nilly.
11
12         Fix #79553
13         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
14         cases out of the switch.
15
16 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
17
18         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
19         message when non-generic type is used with the type arguments.
20         * expression.cs: Updated.
21
22 2006-09-28  Raja R Harinath  <rharinath@novell.com>
23
24         Fix #79013
25         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
26         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
27         Change semantics slightly.  Don't insist on having only one
28         temporary EmptyExpression -- just throttle the creation of new ones.
29
30         Fix #79451
31         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
32         non-interfaces too.  If no methods are found, don't try to create
33         a MethodGroupExpr.
34
35 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
36
37         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
38         generic type.
39
40         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
41         us produce better error message.
42
43 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
44
45         * expression.cs (Binary.ResolveOperator): Warn about a side effect
46         of the `|' operator.
47
48         * report.cs: A new warning added.
49
50 2006-09-27  Martin Baulig  <martin@ximian.com>
51
52         * report.cs
53         (InternalErrorException): Added overloaded ctor taking a params array.
54
55 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
56
57         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
58         Fixed the cases when same error was reported twice.
59
60         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
61         now report symbol information.
62
63 2006-09-25  Martin Baulig  <martin@ximian.com>
64
65         * class.cs: Completely unified with the gmcs version.
66
67 2006-09-25  Martin Baulig  <martin@ximian.com>
68
69         * typemanager.cs (TypeManager.IsNullableType): New public function.
70         (TypeManager.IsNullableTypeOf): Likewise.
71         (TypeManager.IsNullableValueType): Likewise.
72
73         * class.cs (MethodCore): Added the `GenericMethod' argument from
74         gmcs and also unified all classes derived from `MethodCore' with gmcs.
75
76 2006-09-24  Raja R Harinath  <harinath@gmail.com>
77
78         * convert.cs: Unify with gmcs version.
79
80 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
81
82         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
83         verify them as well.
84
85         * report.cs: New warning.
86
87 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
88
89         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
90         for anonymous block with out argument.
91
92 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
93
94         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
95         not used private events only.
96
97 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
98
99         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
100
101         * const.cs (Const.Define): Check for constant type.
102         (Const.IsConstantTypeValid): Looks for valid constant types.
103
104         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
105
106         * ecore.cs (EmptyConstantCast): New common class for all constant based
107         EmptyCast(s).
108
109         * expression.cs (Is.DoResolve): Handle null constant especially.
110         (New.DoResolve): Check for new void().
111         (MemberAccess.DoResolve): Cope with all kind of nulls.
112
113         * literal.cs (NullConstant): Uses EmptyConstantCast.
114         (NullDefault): Based on EmptyConstantCast.
115         (NullLiteral): Uses EmptyConstantCast.
116
117         * statement.cs (Block.ResolveMeta): Check for constant type.
118
119 2006-09-22  Martin Baulig  <martin@ximian.com>
120
121         * delegate.cs, attribute.cs: Merged with the gmcs versions.
122
123 2006-09-22  Raja R Harinath  <rharinath@novell.com>
124
125         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
126         not the null type.
127
128         Fix part of #79451
129         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
130         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
131         code slightly.
132
133 2006-09-22  Martin Baulig  <martin@ximian.com>
134
135         * ecore.cs: Merged with the gmcs version.
136
137         * generic.cs (ConstructedType): New dummy class.
138         (TypeArguments): Don't make this abstract.
139
140         * typemanager.cs
141         (TypeManager.IsGenericTypeDefinition): New method.
142         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
143
144 2006-09-22  Raja R Harinath  <rharinath@novell.com>
145
146         * expression.cs (ComposedCast): Check for arrays of TypedReference
147         before creating the type, not after.
148
149 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
150
151         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
152         after ToType change.
153
154         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
155         when constant must be implicitly convertible.
156
157         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
158
159         * ecore.cs (NullCast): Derives from NullConstant.
160
161         * expression.cs (Is.DoResolve): Removed useless variables.
162         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
163         (New.Constantify): Add enum support.
164         (MemberAccess.DoResolve): Add warning when accessing null constant or
165         variable.
166
167         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
168         property.
169
170         * literal.cs (NullConstant): New abstract class with common
171         functionality for all null specializations.
172         (NullDefault): Represents default(X) when result can be
173         reduced to null.
174         (NullLiteral): Updated.
175
176         * report.cs: Add new warning.
177
178 2006-09-21  Martin Baulig  <martin@ximian.com>
179
180         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
181
182 2006-09-21  Martin Baulig  <martin@ximian.com>
183
184         * generic.cs (GenericConstraints): New dummy class.
185         (Constraints): Likewise.
186         (TypeParameter): Likewise.
187         (TypeParameterName): Likewise.
188         (GenericMethod): Likewise.
189
190         * typemanager.cs (TypeManager.GetGenericArguments): New method.
191
192         * decl.cs: Merged with the gmcs version.
193
194 2006-09-21  Raja R Harinath  <rharinath@novell.com>
195
196         * generic.cs (TypeParameter): Implement IMemberContainer.
197         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
198
199         * rootcontext.cs: Unify with gmcs version.
200
201         * report.cs: Unify with gmcs version.
202         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
203         from gmcs/generics.cs.
204         * generics.cs (TypeParameter): New dummy class.
205
206         * support.cs: Unify with gmcs version.
207
208 2006-09-20  Raja R Harinath  <rharinath@novell.com>
209
210         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
211         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
212
213         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
214         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
215         * mcs.exe.sources: Add generic.cs.
216
217         * codegen.cs: Unify with gmcs version.
218
219         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
220         (EmitContext): Add GenericDeclContainer implementation.
221         * decl.cs (MemberCore, DeclSpace): Likewise.
222         * namespace.cs: Remove #ifdef GMCS_SOURCE.
223
224         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
225         MCS TypeManager has a corresponding dummy method.
226
227 2006-09-19  Martin Baulig  <martin@ximian.com>
228
229         * expression.cs: Completely merged with the gmcs version.
230
231 2006-09-19  Martin Baulig  <martin@ximian.com>
232
233         * expression.cs (Invocation): Merged with the gmcs version.
234         (ArrayAccess.GetStoreOpcode): Likewise.
235
236 2006-09-19  Martin Baulig  <martin@ximian.com>
237
238         * typemanager.cs
239         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
240         (TypeManager.IsGenericMethodDefinition): Likewise.
241
242 2006-09-19  Martin Baulig  <martin@ximian.com>
243
244         * typemanager.cs
245         (TypeManager.IsEqual): Moved the gmcs implementation here.
246         (TypeManager.DropGenericTypeArguments): Likewise.
247         (TypeManager.DropGenericMethodArguments): Likewise.
248         (TypeManager.GetTypeArguments): Moved here from gmcs.
249         (TypeManager.HasGenericArguments): Likewise.
250
251 2006-09-19  Martin Baulig  <martin@ximian.com>
252
253         * expression.cs (Binary): Merged with the gmcs version.
254
255 2006-09-19  Martin Baulig  <martin@ximian.com>
256
257         * expression.cs (Probe, As, Is): Merged with the gmcs version.
258
259 2006-09-19  Martin Baulig  <martin@ximian.com>
260
261         * typemanager.cs: Merged with the gmcs version.
262
263 2006-09-16  Raja R Harinath  <rharinath@novell.com>
264
265         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
266         * driver.cs: Likewise.
267
268 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
269
270         A fix for #79401
271         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
272         only if parent type is class.
273         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
274         update.
275
276 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
277
278         * cs-parser.jay,
279         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
280         keywords are used.
281         * typemanager.cs(CSharpName): Converts NullType to null.
282
283 2006-09-15  Martin Baulig  <martin@ximian.com>
284
285         * typemanager.cs
286         (TypeManager.GetMethodName): Added mcs implementation.
287         (TypeManager.IsEqual): Likewise.
288
289         * ecore.cs
290         (SimpleName.RemoveGenericArity): Added dummy implementation.
291
292         * pending.cs: Merged with the gmcs version.     
293
294 2006-09-15  Martin Baulig  <martin@ximian.com>
295
296         * statement.cs: Merge with the gmcs version.
297
298 2006-09-15  Martin Baulig  <martin@ximian.com>
299
300         * statement.cs (Switch): Merge with the gmcs implementation
301         (without nullables), which is newer.
302
303 2006-09-15  Martin Baulig  <martin@ximian.com>
304
305         * statement.cs (Block.Variables): Make this public.
306         (ToplevelBlock.Parameters): Make this a property.
307         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
308
309 2006-09-15  Martin Baulig  <martin@ximian.com>
310
311         * namespace.cs: Merge with the gmcs version.
312
313 2006-09-15  Martin Baulig  <martin@ximian.com>
314
315         * decl.cs (MemberName): Minor code cleanups.
316
317 2006-09-15  Martin Baulig  <martin@ximian.com>
318
319         * parameter.cs: Merge with the gmcs version.
320
321 2006-09-15  Martin Baulig  <martin@ximian.com>
322
323         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
324         and an error in mcs.
325
326 2006-09-15  Martin Baulig  <martin@ximian.com>
327
328         * flowanalysis.cs: Merged from GMCS; added the generics code into
329         a `GMCS_SOURCE' conditional so we can share this file.
330
331 2006-09-08  Martin Baulig  <martin@ximian.com>
332
333         * typemanager.cs (TypeManager.interlocked_type): New public field.
334         (TypeManager.int_interlocked_compare-exchange): New public field.
335         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
336         enumerator types here and call InitGenericCoreTypes().
337         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
338         after calling InitEnumUnderlyingTypes().
339
340         * rootcontext.cs
341         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
342         `classes_second_stage'. 
343
344 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
345
346         * assign.cs, ecore.cs, expression.cs: Share error message text.
347         * class.cs (FieldMember.Define): Check for varible of static type.
348         * driver.cs (LoadAssembly): Uses error output for errors.
349         * statement.cs: Updated.
350
351 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
352
353         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
354         type instance.
355
356 2006-09-07  Martin Baulig  <martin@ximian.com>
357
358         * driver.cs
359         (MainDriver): Revert r62663 from Marek; see #70506 for details.
360
361 2006-08-29  Miguel de Icaza  <miguel@novell.com>
362
363         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
364         
365 2006-08-17  Miguel de Icaza  <miguel@novell.com>
366
367         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
368         #52019 and #79064, the use of the \uXXXX sequence in source code
369         to represent unicode characters.
370
371 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
372
373         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
374         support.
375         * class.cs, ecore.cs, statement.cs: Merged to one error message.
376
377 2006-08-13  Miguel de Icaza  <miguel@novell.com>
378
379         * assign.cs: Catch attempts to assign to a method groups in += and
380         report as 1656
381
382 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
383
384         A fix for #79056
385         * cs-parser.jay: Don't destroy current array type by typeof of array's.
386
387 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
388
389         * class.cs (Method.Define): Issue a warning when generic method looks like
390         an entry point.
391         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
392         as well.
393
394 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
395  
396         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
397         looking for ctor.
398         * decl.cs (MemberCache.FindMembers): When container is interface we need to
399         search all base interfaces as a member can be ambiguous.
400         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
401         Constructor member type filter. 
402         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
403         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
404         reporting for returned memberinfos.
405         * report.cs: Updated.
406         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
407         version to work on all runtimes.
408         (TypeManager.RealMemberLookup): Removed members filtering.
409
410 2006-08-08  Raja R Harinath  <rharinath@novell.com>
411
412         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
413         (PropertyExpr.EmitAssign): Likewise.
414         * expression.cs (Indirection.EmitAssign): Likewise.
415         (LocalVariableReference.EmitAssign): Likewise.
416         (ParameterReference.EmitAssign): Likewise.
417         (Invocation.EmitArguments): Likewise.
418         (ArrayAccess.EmitAssign): Likewise.
419         (IndexerAccess.EmitAssign): Likewise.
420         (This.EmitAssign): Likewise.
421         (ConditionalLogicalOperator.Emit): Likewise.
422
423         Fix #79026
424         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
425         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
426         leave it in after returning it.
427         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
428
429 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
430
431         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
432         message.
433
434 2006-08-03  Raja R Harinath  <rharinath@novell.com>
435
436         Fix cs0146-3.cs and cs0146-4.cs.
437         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
438         enclosing types don't depend on the current type.
439
440 2006-08-02  Raja R Harinath  <rharinath@novell.com>
441
442         Fix #77963
443         * class.cs (TypeContainer.DoDefineMembers): Use
444         FindBaseMemberWithSameName on Parent, since we're interested in
445         whether we hide inherited members or not.
446         (FindBaseMemberWithSameName): Make slightly more robust.
447
448         Fix the non-generic testcase from #77396
449         * decl.cs (DeclSpace.DeclContainer): Remove override.
450
451         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
452         declspaces for doppelgangers too.
453         (UsingEntry): Implement IResolveContext.
454         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
455         'this' as the resolve context.
456         (LocalAliasEntry): Likewise.
457
458         Implement parts of #77403
459         * roottypes.cs (RootDeclSpace): New.  Used to represent the
460         toplevel declaration space.  Each namespace declaration introduces
461         a "partial" root declaretion space.
462         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
463         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
464         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
465         from 'current_namespace.SlaveDeclSpace'.
466         (namespace_declaration): Likewise.
467         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
468         check.  It can't happen now.
469         * decl.cs (DeclSpace.LookupType): Likewise.
470         * driver.cs (MainDriver): Sanity check.
471
472 2006-08-01  Raja R Harinath  <rharinath@novell.com>
473
474         * decl.cs (DeclSpace.FindNestedType): Remove.
475         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
476         LookupTypeContainer to get the container of the nested type.
477         * class.cs (TypeContainer.FindNestedType): Make non-override.
478
479 2006-07-31  Raja R Harinath  <rharinath@novell.com>
480
481         * decl.cs (DeclSpace.PartialContainer): Move field from ...
482         * class.cs (TypeContainer.PartialContainer): ... here.
483         (TypeContainer.AddBasesForPart): New helper.
484         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
485         instead.
486         * cs-parser.jay (current_class): Convert to DeclSpace.
487         (struct_declaration, interface_declaration, class_declaration):
488         Use AddBasesForPart instead of .Bases directly.
489         * const.cs, iterators.cs: Update to changes.
490
491 2006-07-28  Raja R Harinath  <rharinath@novell.com>
492
493         * class.cs (TypeContainer.AddMemberType): Rename from
494         AddToTypeContainer.
495         (TypeContainer.AddMember): Rename from AddToMemberContainer.
496         (AddTypeContainer): New.  Combine AddClassOrStruct and
497         AddInterface.
498         (AddPartial): Update.  Add 'is_partial' argument.
499         * roottypes.cs: Update to changes.
500         * cs-parser.jay (push_current_class): New helper for handling
501         current_container and current_class.
502         (struct_declaration, interface_declaration, class_declaration):
503         Use it.
504
505 2006-07-26  Raja R Harinath  <rharinath@novell.com>
506
507         * roottypes.cs: Rename from tree.cs.
508
509         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
510         * tree.cs (Tree, ITreeDump): Remove types.
511         * rootcontext.cs (tree, Tree): Remove fields.
512         (root, ToplevelTypes): New.
513         * *.cs: Update to rename.
514
515         * tree.cs (Tree.RecordDecl): Remove.
516         (RootTypes.AddToTypeContainer): Record the toplevel type in its
517         namespace here.
518         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
519
520 2006-07-23  Raja R Harinath  <harinath@gmail.com>
521
522         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
523         DoFlowAnalysis and OmitStructFlowAnalysis here.
524         (ec.With): Rename from WithUnsafe and generalize.
525         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
526         (ec.WithFlowAnalyis): New.
527         * ecore.cs, expression.cs, statement.cs: Update.
528
529 2006-07-22  Raja R Harinath  <harinath@gmail.com>
530
531         * statement.cs (Block.ResolveMeta): Simplify slightly.
532
533         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
534         multiple boolean fields.  Convert InUnsafe, constant_check_state,
535         check_state to flags.
536         (CheckState, ConstantCheckState): Update.
537         (InUnsafe): New read-only property.
538         (FlagsHandle): Rename from CheckStateHandle and convert to handle
539         arbitrary flags.
540         (WithUnsafe): New helper similar to WithCheckState.
541         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
542         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
543
544 2006-07-21  Raja R Harinath  <rharinath@novell.com>
545
546         Make comparisons use the same IL irrespective of whether they're
547         in a 'checked' or 'unchecked' context: one of the issues in #78899
548         * codegen.cs (EmitContext.CheckState): Make read-only property.
549         (EmitContext.ConstantCheckState): Likewise.
550         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
551         helper that implement a save/restore stack for CheckState
552         values.  This is the only way to change check-state.
553         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
554         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
555         (CheckedExpr.EmitBranchable): New forwarding method.
556         (UnCheckedExpr): Likewise.
557         * statement.cs (Block.ResolveMeta): Use WithCheckState.
558         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
559         (Checked.Resolve, checked.DoEmit): Likewise.
560
561 2006-07-20  Miguel de Icaza  <miguel@novell.com>
562
563         * anonymous.cs: Cache the resolved anonymous delegate, and return
564         this so that the ResolveTopBlock is only triggered once, not
565         twice.
566
567         Currently we trigger ResolvetopBlock twice due to a first pass of
568         argument check compatibility, and a second pass that does the
569         actual resolution.   
570         
571 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
572
573         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
574         modifiers.
575         * rootcontext.cs (Reset): Add helper_classes.
576
577 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
578
579         A fix for #78860
580         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
581         correctly.
582
583 2006-07-13  Miguel de Icaza  <miguel@novell.com>
584
585         * statement.cs (Lock): Handle expressions of type
586         TypeManager.null_type specially.  Fixes #78770
587
588 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
589
590         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
591         to an event.
592
593 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
594
595         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
596         for accessors as well.
597         * ecore.cs (EventExpr): Add AccessorTable.
598
599 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
600
601         A fix for #78738
602         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
603         for CS0122 where appropriate.
604         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
605         level attributes.
606         (Filter): Assembly can be null in the case of top level attributes.
607
608 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
609
610         A fix for #78690
611
612         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
613         is done at global level.
614
615 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
616
617         A fix for #77002, Implemented TypeForwarder support.
618
619         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
620         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
621         * typemanager.cs (): Add type_forwarder_attr_type.
622
623 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
624
625         * report.cs: Add CS0469 warning.
626
627 2006-06-21  Martin Baulig  <martin@ximian.com>
628
629         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
630         the `try'-block, so we also report CS0016 etc. there.
631
632 2006-06-21  Martin Baulig  <martin@ximian.com>
633
634         * delegate.cs
635         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
636
637 2006-06-21  Martin Baulig  <martin@ximian.com>
638
639         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
640         also report CS1686 for parameters.
641
642 2006-06-21  Martin Baulig  <martin@ximian.com>
643
644         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
645         instead of an error if the value is not implicitly convertible to
646         the switch types; fixes #77964.
647
648 2006-06-21  Raja R Harinath  <rharinath@novell.com>
649
650         Fix #78673
651         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
652         FieldBuilder is null.
653
654         Fix #78662
655         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
656         'left' and 'right' before error-checking.
657
658 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
659
660         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
661         Fixed bug #78601.
662         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
663         (FieldExpr.DoResolve): likewise.
664         (PropertyExpr.InstanceResolve): likewise.
665         (EventExpr.InstanceResolve): likewise. 
666
667 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
668
669         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
670         attribute applicable tests for attribute argument.
671
672 2006-06-02  Raja R Harinath  <rharinath@novell.com>
673
674         Fix #78079
675         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
676         (Binary.OverloadResolve_PredefinedIntegral): New.
677         (Binary.OverloadResolve_PredefinedFloating): New.
678         (Binary.OverloadResolve_PredefinedString): New.
679         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
680         Follow the standard more closely, and treat numeric promotions in
681         terms of overload resolution.
682         (Binary.CheckShiftArguments): Simplify.
683
684 2006-06-01  Raja R Harinath  <rharinath@novell.com>
685
686         * flowanalysis.cs (MyBitVector): Simplify representation.
687         (MyBitVector.Clone): Avoid allocating BitArray.
688         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
689         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
690         (*): Update.  Change all references to MyBitVector.And and
691         MyBitVector.Or to &= and |=.
692
693 2006-05-29  Raja R Harinath  <rharinath@novell.com>
694
695         Fix cs0231-[34].cs.
696         * cs-parser.jay (formal_parameter_list): Extend the pattern below
697         to param arguments too.
698
699 2006-05-26  Miguel de Icaza  <miguel@novell.com>
700
701         * cs-parser.jay: Catch another parsing form for arglist being
702         followed by other arguments.  Fixes #78313.
703
704 2006-05-24  Raja R Harinath  <rharinath@novell.com>
705
706         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
707         checking of out parameters to ...
708         (FlowBranchingToplevel.Merge): ... here.
709         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
710         set, propagate the origin upward, and only complain if there was
711         no other error.
712         (FlowBranchingException.AddContinueOrigin): Likewise.
713         (FlowBranchingException.AddReturnOrigin): Likewise.
714         (FlowBranchingException.AddGotoOrigin): Likewise.       
715
716 2006-05-23  Raja R Harinath  <rharinath@novell.com>
717
718         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
719         unreachable, skip it.
720         (FlowBranchingException.Merge): Always propagate jumps, even if
721         the finally block renders subsequent code unreachable.
722
723 2006-05-18  Raja R Harinath  <rharinath@novell.com>
724
725         Fix #77601
726         * statement.cs (Goto.Resolve): Move responsibility for resolving
727         'goto' to FlowBranching.AddGotoOrigin.
728         (Goto.SetResolvedTarget): New.  Callback to set the
729         LabeledStatement that's the target of the goto.
730         (Goto.DoEmit): Use Leave instead of Br when crossing an
731         unwind-protect boundary.
732         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
733         LookupLabel and adjust to new semantics.
734         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
735         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
736         Goto.SetResolvedTarget to update target.
737         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
738         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
739         AddBreakOrigin & co.  Delay propagation until ...
740         (FlowBranchingException.Merge): ... this.
741
742         * statement.cs (Block.Resolve): Always depend on flow-branching to
743         determine unreachability.  Kill workaround that originally emitted
744         only one statement after an "unreachable" label (see infloop in
745         test-515.cs).
746
747         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
748         This is still "wrong", but anything better would probably need a
749         multi-pass algorithm.
750         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
751         usage vector.  Force current usage vector to be reachable, to
752         optimistically signify backward jumps.
753         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
754         detected.
755         (FlowBranchingLabeled.Merge): New.  If no backward jump was
756         detected, return the original salted-away usage vector instead,
757         updated with appropriate changes.  Print unreachable warning if
758         necessary.
759         * statement.cs (Block.Resolve): Don't print unreachable warning on
760         a labeled statement.
761
762 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
763
764         * driver.cs: Pass filename without path to AssemblyBuilder's 
765         AddResourceFile. Fixes bug #78407.
766
767 2006-05-17  Raja R Harinath  <rharinath@novell.com>
768
769         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
770         * flowanalysis.cs (FlowBranchingLabeled): ... here.
771         (FlowBranching.MergeChild): Overwrite
772         reachability information from Labeled branchings too.
773
774 2006-05-16  Raja R Harinath  <rharinath@novell.com>
775
776         * statement.cs (Goto.Resolve): Merge jump origins here ...
777         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
778
779         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
780         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
781         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
782         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
783         here, ...
784         * statement.cs (Goto.Resolve): ... not here.
785         (Goto.Emit): Remove CS1632 check.
786
787 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
788
789         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
790         error message.
791
792 2006-05-11  Raja R Harinath  <rharinath@novell.com>
793
794         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
795         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
796         (FlowBranchingException.Label): Likewise.
797
798         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
799         given value.
800         (MyBitVector.Or): Use it to avoid losing information (Count).
801         (FlowBranching.MergeOrigins): Likewise.
802
803         * flowanalysis.cs (UsageVector.IsDirty): Remove.
804         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
805         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
806         (UsageVector.ToString): Simplify.
807         (UsageVector.MergeSiblings): Move here from ...
808         (FlowBranching.Merge): ... here.
809         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
810         not a MyBitVector.
811
812 2006-05-10  Raja R Harinath  <rharinath@novell.com>
813
814         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
815         null bitvector is treated as all-true.
816
817         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
818         (MyBitVector): Rationalize invariants.  'vector != null' implies
819         that we have our own copy of the bitvector.  Otherwise,
820         'InheritsFrom == null' implies all inherited bits are true.
821
822 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
823
824         * statement.cs (LocalInfo): Add IsConstant.
825         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
826         local variable for constants.
827
828 2006-05-09  Raja R Harinath  <rharinath@novell.com>
829
830         * flowanalysis.cs (MyBitVector.Empty): New.
831         (MyBitVector): Don't allow InheritedFrom to be null.
832         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
833         (UsageVector, FlowBranching): Update to changes.
834
835         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
836         recursion.  The 'Parent == null' condition isn't sufficient for
837         anonymous methods.
838         (FlowBranching.AddBreakOrigin): Likewise.
839         (FlowBranching.AddContinueOrigin): Likewise.
840         (FlowBranching.AddReturnOrigin): Likewise.
841         (FlowBranching.StealFinallyClauses): Likewise.
842         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
843         (FlowBranching.CheckOutParameters): Likewise.
844         (FlowBranchingToplevel): Terminate all the above recursions here.
845         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
846         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
847
848         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
849         toplevel block.
850         (FlowBranchingToplevel): New.  Empty for now.
851         (FlowBranching.MergeTopBlock): Update.
852         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
853         branching for the anonymous delegate.
854         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
855
856         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
857         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
858         information at the start of the merge.  Reorganize.
859
860 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
861
862         * class.cs (MethodData.Define): Method cannot implement interface accessor.
863
864 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
865
866         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
867         to newly introduced ctor.
868
869         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
870         message to one place.
871         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
872         global namespace.
873
874 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
875
876         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
877
878         * ecore.cs (Expression.ResolveAsConstant): Updated.
879
880         * statement.cs (ResolveMeta): Updated.
881
882 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
883
884         * cs-parser.jay: __arglist cannot be used in initializer.
885
886 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
887
888         A fix for #77879
889         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
890         private types.
891
892 2006-05-05  Raja R Harinath  <rharinath@novell.com>
893
894         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
895         (LabeledStatement): Add 'name' parameter.
896         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
897         (Block.AddLabel): Update to changes.
898         * cs-parser.jay (labeled_statement): Likewise.
899
900         * flowanalysis.cs (BranchingType.Labeled): New.
901         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
902         (FlowBranchingLabeled): New.  Does nothing for now, but will
903         eventually handle 'goto' flows.
904         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
905         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
906         that's terminated ...
907         (Block.Resolve): ... here.
908
909         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
910         (UsageVector.MergeFinallyOrigins): Likewise.
911         (FlowBranching.InTryOrCatch): Likewise.
912         (FlowBranching.AddFinallyVector): Likewise.
913         (FlowBranchingException): Update to changes.
914
915         Fix #78290
916         * statement.cs (Return.Resolve): Move error checking to ...
917         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
918         (FlowBranchingException): Handle return origins like break and
919         continue origins.
920         (FlowBranching.UsageVector.CheckOutParameters): Remove.
921
922 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
923
924         A fix for #76122
925         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
926         filter.
927
928 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
929
930         A fix for #77543
931         * class.cs (MethodData.Define): Do public accessor check only when method
932         implements an interface.
933
934 2006-05-04  Raja R Harinath  <rharinath@novell.com>
935
936         Remove special handling of 'break'
937         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
938         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
939         (UsageVector.Break): Remove.
940         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
941         reachability.
942         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
943
944         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
945         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
946
947 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
948
949         A fix for #75726
950         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
951         be the interface member.
952
953 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
954
955         A fix for #60069
956         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
957         for emitting small (int) values.
958
959 2006-05-03  Raja R Harinath  <rharinath@novell.com>
960
961         Fix #59427
962         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
963         control-flow passes through the 'finally' after merging-in all the
964         control-flows from 'try' and the 'catch' clauses.
965
966         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
967         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
968         always true at the only non-recursive entry point.
969         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
970         FlowBranchingBreakable.
971         (FlowBranchingLoop): Remove.
972         * statement.cs (Return.DoResolve): Update to changes.
973
974         Fix #76471, #76665
975         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
976         (FlowBranching.CreateBranching): Handle it: create a
977         FlowBranchingContinuable.
978         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
979         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
980         except that it handles the 'continue' command.
981         (FlowBranching.UsageVector.MergeOrigins): Rename from
982         MergeBreakOrigins.
983         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
984         except that it overrides AddContinueOrigin.
985         (FlowBranchingException): Override AddContinueOrigin, similar to
986         AddBreakOrigin.
987         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
988         Create a new branching around the embedded statement.
989         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
990         control flow after the embedded statement.
991         (Continue.Resolve): Move all error checking to AddContinueOrigin.
992
993         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
994         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
995         FlowBranchingBreakable.
996         (FlowBranchingSwitch): Remove.
997
998         Fix test-503.cs
999         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1000         error reporting to ...
1001         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1002         Rename from 'AddBreakVector'.  Add new location argument.  Return
1003         a bool indicating whether the 'break' crosses an unwind-protect.
1004         (FlowBranchingException.AddBreakOrigin): Add.
1005         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1006         flowbranching after updating with the effects of the 'finally'
1007         clause.
1008         (FlowBranchingBreakable): New common base class for
1009         FlowBranchingLoop and FlowBranchingSwitch.
1010
1011         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1012         embedded statement.
1013         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1014
1015 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1016
1017         * statement.cs (Do.Resolve): If the loop is infinite, set the
1018         barrier.
1019         (While.Resolve, For.Resolve): Set a barrier after the embedded
1020         statement.  There's no direct control flow that goes from the end
1021         of the embedded statement to the end of the loop.
1022         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1023         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1024         above ensure that the reachability is correctly computed.
1025
1026         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1027         (UsageVector.MergeBreakOrigins): If the current path is
1028         unreachable, treat it as if all parameters/locals are initialized.
1029         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1030         infinite loops before merging-in break origins.
1031
1032         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1033         (Reachability.Reachable): Split part into ...
1034         (Reachability.Unreachable): ... this.  Simplify.
1035         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1036
1037         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1038         (Reachability.SetThrowsSometimes): Likewise.
1039         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1040         TriState.Always, use corresponding property.
1041         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1042         (Block.Resolve): Likewise.  Remove some redundant checks.
1043
1044 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1045
1046         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1047         (Reachability.Meet): Don't bother checking AlwaysThrows --
1048         barrier is always set.
1049         (FlowBranchingBlock.Merge): Likewise.
1050
1051 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1052
1053         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1054         checks for unreachable.
1055
1056 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1057
1058         A fix for #77980
1059         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1060
1061         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1062         whether field is really assigned.
1063
1064 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1065
1066         * flowanalysis.cs (Reachability): Make 4-argument constructor
1067         private.
1068         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1069         (Reachability.Always): Rename from the highly misleading
1070         'Reachability.Never'.
1071         (FlowBranching.Merge): Update to changes.  Mark an impossible
1072         situation with a 'throw'.
1073         (*): Update to changes.
1074
1075 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1076
1077         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1078         Remove 'Undefined'.
1079         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1080         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1081         (*): Update to changes.
1082         * statement.cs: Update to changes.
1083
1084 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1085
1086         A fix for #78049
1087         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1088
1089 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1090
1091         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1092         dummy UsageVector.
1093
1094         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1095         argument to two arguments: an usage-vector and a bool.  Move call
1096         to FlowBranching.Merge () ...
1097         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1098
1099         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1100         handling of loop and switch reachability to ...
1101         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1102
1103 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1104
1105         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1106         handling to FlowBranchingLoop.InLoop.
1107         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1108
1109 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1110
1111         A fix for #78115
1112         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1113         anonymous method is allowed from AnonymousContainer here.
1114
1115         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1116
1117 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1118
1119         Fix #78156
1120         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1121
1122 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1123
1124         A fix for #49011.
1125         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1126         (DoubleConstant.Reduce): Ditto.
1127
1128 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1129
1130         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1131         Remove 'lvalue_right_side' argument.  Move parts to ...
1132         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1133         (LocalVariable.DoResolveLValue): ... these.
1134
1135 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1136
1137         Fix cs1655.cs
1138         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1139         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1140         (LocalVariableReference.DoResolveBase): Use it to implement new
1141         CS1655 check.
1142         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1143         (Argument.Resolve): Simplify.  Move CS1510 check ...
1144         * ecore.cs (Expression.ResolveLValue): ... here.
1145         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1146         (PropertyExpr.DoResolveLValue): Likewise.
1147         (FieldExpr.Report_AssignToReadonly): Likewise.
1148         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1149         LValueMemberAccess or LValueMemberOutAccess on instance depending
1150         on it.
1151         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1152         DoResolve as appropriate.
1153
1154 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1155
1156         Fix #75800
1157         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1158         implicit conversions on 'out' and 'ref' arguments.
1159
1160         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1161         improve clarity.  Remove dead code.
1162
1163         Fix #66031
1164         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1165         (Catch.Resolve): Resolve VarBlock if it exists.
1166
1167 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1168
1169         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1170         twice, this was some residual code, the enumerator was emitted
1171         properly in the two branche of if later.
1172
1173 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1174
1175         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1176         cast is never an lvalue.
1177         (Cast.DoResolve, Cast.ResolveRest): Combine.
1178         (Argument.Emit): Simplify slightly.  Move 'Expr is
1179         IMemoryLocation' check ...
1180         (Argument.Resolve): ... here.
1181         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1182
1183         Simplifications.  Fix cs0191-2.cs
1184         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1185         CS1649 and CS1651 to ...
1186         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1187         the actual selection of the error code and message to a lookup
1188         table.  Add a dummy return value to simplify callsites.
1189         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1190         readonly fields of other instances of the same type.  Move CS0197
1191         warning from ...
1192         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1193         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1194         resolution of an out or ref argument.  The code simplification
1195         above uses this invariant.
1196
1197 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1198
1199         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1200         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1201         CheckMarshallByRefAccess.  Drop parameter.
1202         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1203         warning.
1204         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1205         InstanceExpression.
1206         * report.cs (AllWarnings): Add CS1690.
1207         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1208         for ref access too.
1209         (LocalVariableReference.DoResolveBase): Update.
1210
1211 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1212
1213         * class.cs (MethodOrOperator): Moved common parts from method class.
1214         detect obsolete attributes.
1215         (Method.Define): Simplified as it reuses code from base.
1216         (Constructor.ValidAttributeTargets): Fixed issue found during
1217         refactoring.
1218         (Destructor.ValidAttributeTargets): Fixed issue found during
1219         refactoring.
1220         (Operator): Finished refactoring set off by #78020. Operator class is now
1221         ordinary method class.
1222
1223         * anonymous.cs: Updated.
1224
1225         * decl.cs (DeclSpace): Add IsGeneric
1226
1227 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1228
1229         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1230
1231 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1232
1233         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1234         detect obsolete attributes.
1235         (Method.CreateEmitContext): Moved to MethodOrOperator.
1236
1237 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1238
1239         A fix for #78048.
1240         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1241         customized exception to make crash detection easier.
1242         (MethodOrOperator): Started to work on new base class for methods and
1243         operators.
1244         (Method): Derives from MethodOrOperator.
1245         (Constructor.Emit): Emits its own attributes.
1246         (AbstractPropertyEventMethod.Emit): Ditto.
1247         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1248         patch.
1249         (Operator.Emit): It's temporary more tricky than should be.
1250         
1251         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1252
1253         * report.cs (InternalErrorException): Add ctor with inner exception.
1254
1255 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1256
1257         A fix for #76744.
1258         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1259         only not visible.
1260
1261 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1262
1263         A fix for #77916.
1264         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1265         array.
1266
1267 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1268
1269         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1270         attribute is present and Guid not.
1271         (Interface.ApplyAttributeBuilder): Ditto.
1272
1273         * attribute.cs: Add error message.
1274
1275 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1276
1277         A fix for #78020.
1278
1279         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1280         sources (it's composite) so hold them in extra array as they are used in
1281         Emit phase only. It worked in the previous versions by mistake.
1282         (Attribute.Emit): Emit attribute for more owners when exist.
1283
1284         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1285         it has now different behaviour.
1286
1287 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1288
1289         * constant.cs (Constant.IsDefaultInitializer): New method.
1290
1291         * class.cs: Updated.
1292
1293         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1294         re-initialize default values. It saves KBs almost for every assembly.
1295         Thanks Zoltan for the idea.
1296         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1297         (ArrayCreation.DoResolve): Resolve only once.
1298         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1299         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1300
1301 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1302
1303         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1304         From #77961.
1305
1306 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1307
1308         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1309         in an embedded statement too.
1310
1311 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1312
1313         Fix #77958
1314         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1315
1316 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1317
1318         A fix for #77966.
1319
1320         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1321         was not specified.
1322
1323         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1324
1325 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1326
1327         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1328         phase.
1329
1330         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1331         LocalTemporary change.
1332
1333         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1334         TypeContainer.
1335         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1336         initializers optimization.
1337         (ClassOrStruct.TypeAttr): Moved from modifiers.
1338         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1339         (FieldBase.ResolveInitializer): Resolves initializer.
1340         (FieldBase.HasDefaultInitializer): New property.
1341
1342         * cs-parser.jay: Removed message.
1343
1344         * expression.cs (CompilerGeneratedThis): New specialization.
1345
1346         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1347
1348 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1349
1350         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1351
1352 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1353
1354         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1355         be now EnumConstants only.
1356
1357 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1358
1359         * attribute.cs, driver.cs: Reset more caches.
1360
1361 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1362
1363         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1364
1365 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1366
1367         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1368         for easier reuse. Updated all overrides.
1369         (IntegralConstant): New base class for all integral constants.
1370         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1371         of the constant range, report custom error.
1372         (UIntConstant.Reduce): Fixed uint conversion.
1373
1374         * ecore.cs, literal.cs: Reduce updates.
1375
1376 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1377
1378         A fix for #75813.
1379
1380         * class.cs (Constructor.Define): Removed extra if for default ctors.
1381         A patch from Atsushi Enomoto.
1382
1383 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1384
1385         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1386         GetAttributableValue.
1387
1388         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1389         when required.
1390
1391         * convert.cs (ImplicitConversionRequired): Error message moved to
1392         DoubleLiteral.
1393
1394         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1395         automatic implicit conversion of an output value.
1396         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1397
1398         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1399         conversion.
1400         (TypeOf.GetAttributableValue): Add extra handling for object type.
1401
1402         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1403         special error message.
1404
1405 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1406
1407         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1408         InternalCall.
1409         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1410         compatible with MS runtime.
1411
1412 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1413
1414         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1415         attribute arguments here.
1416
1417         * class.cs (Indexer.Define): The check was moved to attribute class.
1418
1419 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1420
1421         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1422         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1423         easier.
1424
1425 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1426
1427         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1428         mcs to keep code differences small.
1429         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1430         * typemanager.cs (parameter_default_value_attribute_type): New.
1431         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1432         CS1908 check.
1433
1434 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1435
1436         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1437
1438 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1439
1440         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1441
1442         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1443         the blocks too.
1444
1445 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1446
1447         * doc-bootstrap.cs : fix build.
1448
1449 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1450
1451         * expression.cs (StringConcat.Append): Issue a warning when empty string
1452         is going to append.
1453
1454 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1455
1456         * assign.cs (CompoundAssign.ResolveSource): Removed.
1457
1458         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1459         clean up.
1460
1461         * class.cs (TypeContainer.FindMethods): Removed.
1462         (TypeContainer.CheckMemberUsage): Made static.
1463
1464         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1465
1466         * constant.cs (CheckRange): Removed unused type argument.
1467         (CheckUnsigned): Removed unused type argument.
1468
1469         * cs-parser.jay: Updated after MemberAccess clean up.
1470         Uses Length for empty string test.
1471
1472         * cs-tokenizer.cs: Uses Length for empty string test.
1473         (IsCastToken): Made static.
1474         (is_hex): Made static.
1475         (real_type_suffix): Made static.
1476
1477         * decl.cs (SetupCache): Made static.
1478         (OnGenerateDocComment): Removed unused ds argument.
1479
1480         * delegate.cs (VerifyDelegate): Removed unused argument.
1481
1482         * doc.cs: Uses Length for empty string test.
1483
1484         * driver.cs: Uses Length for empty string test.
1485
1486         * enum.cs (IsValidEnumType): Made static
1487
1488         * expression.cs (EnumLiftUp): Removed unused argument.
1489         (ResolveMethodGroup): Ditto.
1490         (BetterConversion): Ditto.
1491         (GetVarargsTypes): Ditto.
1492         (UpdateIndices): Ditto.
1493         (ValidateInitializers): Ditto.
1494         (MemberAccess.ctor): Ditto.
1495         (GetIndexersForType): Ditto.
1496
1497         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1498
1499         * iterators.cs: Updated after MemberAccess clean up.
1500
1501         * location.cs: Uses Length for empty string test.
1502
1503         * namespace.cs: Uses Length for empty string test.
1504
1505          * report.cs (CheckWarningCode): Made static.
1506
1507         * statement.cs (LabeledStatement): Removed unused argument.
1508
1509         * typemanager.cs (FilterNone): Removed.
1510
1511 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1512
1513         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1514         obsolete.
1515
1516         * class.cs: Updated.
1517
1518 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1519
1520         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1521
1522 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1523
1524         A fix for #77822.
1525
1526         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1527         reporting, it's more tricky than I thought.
1528
1529 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1530
1531         A fix for #77816.
1532
1533         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1534         host container.
1535         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1536         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1537         Add more error reporting; Fixed issue with params.
1538
1539         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1540
1541         * cs-parser.jay: AnonymousMethod requires host container.
1542
1543         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1544
1545 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1546
1547         * class.cs: Change 'TypeContainer ds' constructor argument to
1548         'DeclSpace parent'.  Some classes were missed below due to
1549         different naming convention.
1550
1551         * class.cs (MemberCore.Parent): Delete.  This makes the
1552         ParentContainer changes below enforceable by the compiler.
1553
1554         Treat pointers to enclosing declaration space as 'DeclSpace', not
1555         'TypeContainer'.
1556         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1557         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1558
1559         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1560         of TypeContainer.
1561         (Block.AddThisVariable): Likewise.
1562         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1563         (AbstractPropertyEventMethod.Emit): Likewise.
1564         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1565         (GetMethod.Define, SetMethod.Define): Likewise.
1566         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1567         (DelegateMethod.EmitMethod): Likewise.
1568
1569         Fix regression test-partial-13.cs.
1570         Rationalize use of PartialContainer.  Ensure that the partial
1571         class semantics can be tied to type-correctness, i.e., any
1572         violation will cause a compile error.
1573         * class.cs, const.cs: Access all fields that belong to class
1574         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1575         Resolve()-like functions still use 'Parent'.
1576
1577         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1578         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1579         (PropertyMethod.CheckModifiers): Remove unused argument.
1580         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1581         DeclSpace.
1582
1583 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1584
1585         Make semantics of PartialContainer simpler.
1586         * decl.cs (DeclSpace.IsPartial): Remove.
1587         * class.cs (TypeContainer.IsPartial): Likewise.
1588         (TypeContainer..ctor): Set PartialContainer to point to self.
1589         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1590         (TypeContainer.FindNestedType): Likewise.
1591         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1592
1593 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1594
1595         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1596
1597 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1598
1599         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1600         classes.
1601
1602 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * class.cs (Operator.Define): An error for base conversion was not
1605         reported correctly.
1606
1607 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1608
1609         * iterator.cs : yield break is allowed in try statement which has
1610           catch clauses. Fixed bug #77767.
1611
1612 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1613
1614         A fix for #77593, #77574.
1615
1616         * class.cs (MethodCore.CheckBase): Another if for operator.
1617
1618 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1619
1620         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1621         were not resolved
1622
1623         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1624         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1625         conversion test.
1626         
1627         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1628         not needed.
1629
1630         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1631         Updated after another emitcontext usage was clean up. It should help us to
1632         synchronize with gmcs easier.
1633
1634 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1635
1636         A fix for #77353.
1637
1638         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1639         (Event.Define): ditto
1640         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1641
1642         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1643         Removed redundant code and set NewSlot for Invoke method too.
1644
1645         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1646         (Parameters.MergeGenerated): New method. Use this method when you merge
1647         compiler generated argument with user arguments.
1648
1649 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1650
1651         * attribute.cs (ResolveAsTypeTerminal): Removed.
1652
1653         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1654         specialization for predefined types; 30% speed up.
1655         Finally placed obsolete check to right place.
1656         (Expression.ResolveType): Removed.
1657
1658         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1659         Updated after ResolveType was removed.
1660
1661         * expression.cs (Cast.ctor): Check void cast.
1662         (Binary.ResolveAsTypeTerminal): Is never type.
1663         (Conditional.ResolveAsTypeTerminal): Is never type.
1664
1665         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1666
1667 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1668
1669         Fix #77679.
1670         * expression.cs (ParameterReference.DoResolveBase): Change return
1671         type to bool.
1672         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1673         Update.
1674
1675         Fix #77628.
1676         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1677
1678         Fix #77642.
1679         * typemanager.cs (GetFullNameSignature): Don't nullref on
1680         protected accessors.
1681
1682 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1683
1684         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1685         these two separated members to simplify the code.
1686         (Attribute.Resolve): Refactored to use new fields and methods.
1687         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1688         implemented obsolete attribute checking.
1689         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1690         implemented obsolete checking again. It look line never ending quest ;-)
1691         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1692
1693         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1694
1695         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1696
1697         *class.cs (Property.Define): Add RegisterProperty call.
1698
1699         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1700         argument groups (only 2).
1701
1702         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1703         encoding expression to arguments.
1704         (Expression.ExprClassToResolveFlags): Just turned to property.
1705
1706         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1707         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1708         optimized as well as implemented support for zero-length attributes.
1709
1710         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1711         Add caching of PropertyInfo's.
1712
1713 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1714
1715         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1716         error multiple times.
1717
1718 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1719
1720         New partial class implementation.
1721         A fix for #77027, #77029, #77403
1722
1723         * attribute.cs (Attributable): Made attributes protected.
1724
1725         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1726         the replacements of ClassPart and PartialContainer.
1727         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1728         (TypeContainer.AddInterface): Ditto.
1729         (TypeContainer.AddPartial): The main method for partial classes. It checks
1730         for errors and merges ModFlags and attributes. At the end class is added to
1731         partial_parts list.
1732         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1733         required here.
1734         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1735         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1736         from the rest of partial classes.
1737         (TypeContainer.GetClassBases): Simplified.
1738         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1739         DefineType.
1740         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1741         (TypeContainer.HasExplicitLayout): Uses Flags now.
1742         (PartialContainer): Removed.
1743         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1744         (StaticClass): Was merged with Class.
1745         (Class.GetClassBases): class and static class bases are verified here.
1746         (Class.TypeAttr): Added static attributes when class is static.
1747         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1748         (MemberBase): In some cases we need to call parent container for partial
1749         class. It should be eliminated but it's not easy now.
1750
1751         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1752
1753         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1754         partial classed to accumulate class comments.
1755         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1756
1757         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1758
1759         * driver.cs (MainDriver): Tree.GetDecl was removed.
1760
1761         * modifiers.cs (Modifiers): Add partial modifier.
1762
1763         * tree.cs (Tree.decl): Removed.
1764         (RootTypes): Started to use this class more often for root types
1765         specializations.
1766
1767 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1768
1769         A fix for #77615
1770
1771         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1772         external interface does not have an attribute.
1773
1774 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1775
1776         Another prerequisites for new partial classs implementation.
1777         
1778         * attribute.cs (Attribute.Equal): Implemented.
1779         (Attribute.Emit): Changed as attributes can be applied more than twice.
1780         (Attributes.Emit): Check for duplicate attributes here.
1781
1782         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1783         as a parameter, clean-up.
1784
1785 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1786
1787         A fix for #77485
1788
1789         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1790         contains obsolete attribute check which can in some cases look for base
1791         type of current class which is not initialized yet.
1792         (TypeContainer.BaseType): Replacement of ptype.
1793
1794         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1795
1796 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1797
1798         First of prerequisites for new partial classs implemention.
1799         
1800         * attribute.cs (Attributable): Extended by ResolveContext;
1801         Attributes finally have correct context for resolving in all cases.
1802         (AttachTo): Attribute owner is assigned here.
1803
1804         * codegen.cs (IResolveContext): Introduce new interface to hold
1805         all information needed in resolving phase.
1806         (EmitContext): Implements IResolveContext; more clean-up needed here.
1807         
1808         * decl.cs (MemberCore): Implemented IResolveContext.
1809
1810         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1811         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1812         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1813         Refactored to use new IResolveContext instead of EmitContext; cleanup
1814
1815 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1816
1817         * codegen.cs (EmitScopeInitFromBlock): check here the
1818         capture_context, there is no need to make two calls to the
1819         EmitContext. 
1820
1821         * anonymous.cs: Add some debugging messages that might help me
1822         track other instances of this problem in the future (the
1823         regression of test 467).
1824
1825         * cs-parser.jay: track the variable block, as we need to initalize
1826         any captured variables declared in this block for the "catch"
1827         portion of the "Try" statement.
1828
1829         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1830         scope initialization for captured variables. 
1831
1832         Also, move the emit for the variables after the block location has
1833         been marked.
1834
1835 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1836
1837         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1838
1839 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1840
1841         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1842         commit yesterday, the initialization for the roots is necessary.
1843         What is not necessary is the scope activation.
1844
1845 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1846
1847         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1848         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1849         CS0206 checks.
1850         (Argument.Resolve): Remove CS0206 checks.
1851
1852 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1853
1854         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1855         scopes for all the roots, the scopes will now be emitted when the
1856         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1857
1858         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1859         code.  This reduces a lot of existing cruft.
1860         
1861         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1862         that the ScopeInfo is generated as we enter the scope, not at the
1863         time of use, which is what we used to do before.
1864
1865         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1866         every time a Block is about to be emitted if we have a
1867         CaptureContext. 
1868
1869 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1870
1871         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1872         (Reset): Update.
1873         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1874
1875         * typemanager.cs (cons_param_array_attribute): Make private.
1876         (Reset): Set it to null.
1877         (InitCoreHelpers): Don't initialize it.
1878         (ConsParamArrayAttribute): New.  Initialize it as needed.
1879         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1880
1881 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1882
1883         * expression.cs: There might be errors reported during the
1884         selection of applicable methods.  If there are errors, do not
1885         continue execution as it will lead the compiler to crash.
1886
1887 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1888
1889         * expression.cs: Member access is not allowed on anonymous
1890         methods.  Fixes #77402.
1891
1892 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1893
1894         Fix #77401
1895         * cs-parser.jay (VariableDeclaration): Don't set
1896         current_array_type to null.
1897         (field_declaration, event_declaration, declaration_statement):
1898         Set it to null here.
1899
1900 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1901
1902         * typemanager.cs (GenericParameterPosition): New.
1903         * doc.cs: Use it.
1904
1905 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1906
1907         * doc.cs : To process "include" elements, first we should create
1908           another list than XmlNodeList, because it could result in node
1909           removal, which could result in that the XmlNodeList gives up
1910           yielding next node.
1911
1912           (Also made code identical to gmcs again.)
1913
1914 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1915
1916         * ecore.cs: Introduce an error report that we were not catching
1917         before, if not silent, we must report the error.  Gonzalo ran into
1918         it.
1919
1920 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1921
1922         A fix for bug: #76957
1923         
1924         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1925         ComputeMethodHost before creating the method, this is a new
1926         requirement. 
1927
1928         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1929         that this method references (RegisterScope).  The actual scope
1930         where the method is hosted is computed with the ComputeMethodHost
1931         before we create the method.
1932
1933         Moved the Deepest routine here.
1934
1935         (AnonymousContainer.ComputeMethodHost): New routine used to
1936         compute the proper ScopeInfo that will host the anonymous method.
1937
1938         (ScopeInfo): Deal with multiple roots.  The problem was that we
1939         did not have a unique root where all ScopeInfos could be hanged
1940         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1941         of roots.  
1942
1943         Remove AdjustMethodScope which is now computed at the end.  Remove
1944         LinkScope which did a partial link, instead link all ScopeInfos
1945         before code generation from the new "LinkScopes" routine. 
1946
1947         Simplify all the Add* routines as they no longer need to maintain
1948         the tree, they just need to record that they are using variables
1949         from a ScopeInfo.
1950
1951         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1952         routines to produce the forest of ScopeInfo trees.
1953
1954         * class.cs (TypeContainer.AppendMethod): This is just like
1955         AddMethod, but ensures that an interface implementation method
1956         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1957         methods, but at the end.
1958
1959         We use this functionality to ensure that the generated MoveNext
1960         method in the iterator class is resolved/emitted before the
1961         enumerator methods created.   
1962
1963         This is required because the MoveNext method computes the right
1964         ScopeInfo for the method.  And the other methods will eventually
1965         need to resolve and fetch information computed from the anonymous
1966         method. 
1967
1968 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1969             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1970
1971         Fix rest of #76995.
1972         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1973         the 'aliases' hash.
1974         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1975         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1976
1977 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1978
1979         Fix #76656, cs0231-2.cs.
1980         * cs-parser.jay (formal_parameter_list): Make error case catch
1981         more issues.
1982         (parenthesized_expression_0): Add CS1026 check.
1983         (invocation_expression): Remove unused { $$ = lexer.Location }.
1984
1985 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1986
1987         Fix #76824.
1988         * cs-parser.jay (statement_expression): Don't list out the
1989         individual statement-expressions.  Convert syntax error into
1990         CS0201 check.
1991
1992 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1993
1994         Fix #76874.
1995         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1996         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1997         CheckIntermediateModification.
1998         (FieldExpr.DoResolve): Add new two-argument version that
1999         allows us to resolve the InstanceExpression as an lvalue.
2000         The one-argument variant is now just a wrapper.
2001         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2002         Resolve the lhs as an lvalue if the it has a value type.
2003         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2004         from Assign.DoResolve.
2005         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2006         resolved as an lvalue.
2007         (PropertyExpr.DoResolve): Update.
2008         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2009         has a value type.  Move CS1612 check here from
2010         CheckIntermediateModification.
2011         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2012         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2013         'right_side' of a ResolveLValue on an 'out' argument.
2014         (EmptyExpression.LValueMemberAccess): New.  Used as the
2015         'right_side' of a propagated ResolveLValue on a value type.
2016         (LocalVariableReference.DoResolveBase): Recognize
2017         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2018         Add CS1654 check.
2019         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2020         EmptyExpression.Null.
2021
2022 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2023
2024         * typemanager.cs : added IsGenericParameter(). In mcs it always
2025           return false.
2026         * doc.cs : for generic parameters, use GenericParameterPosition,
2027           not FullName.
2028
2029 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2030
2031         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2032
2033 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2034
2035         This fixes the problem where we used ldfld instead of ldflda to
2036         load the "THIS" pointer on captured parameters, when THIS is a
2037         value type.  See bug #77205.
2038         
2039         * iterators.cs (CapturedThisReference.Emit): Pass false to
2040         EmitThis (we do not need the address).
2041
2042         * codegen.cs (EmitThis): it needs to know whether we need the
2043         address of `this' or not.  This is used by value types.  
2044
2045         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2046         every other call passes false.
2047
2048 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2049
2050         Fix #77221.
2051         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2052         GetOverride.
2053         * expression.cs (Invocation.OverloadResolve): Update.
2054         (Invocation.DoResolve): Avoid double resolution of invocation.
2055
2056 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2057
2058         Fix #77180.
2059         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2060         unary negation of floating point types as 0-expr; negation cannot
2061         overflow in floating point types.
2062
2063         Fix #77204.
2064         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2065         on operands of 'void' type.
2066
2067         Fix #77200.
2068         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2069         and ExclusiveOr for boolean constants too.
2070
2071 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2072
2073         Fix #75636.
2074         * expression.cs (Invocation.OverloadResolve): Replace reflected
2075         override methods with their base virtual methods, rather than
2076         skipping over them.
2077         * typemanager.cs (TypeManager.GetOverride): New.
2078
2079 2006-01-05  Jb Evain  <jbevain@gmail.com>
2080
2081         * class.cs (Property.Define, Indexer.Define): do not tag the
2082         properties as SpecialName | RTSpecialName.
2083
2084 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2085
2086         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2087         doing a low-level comparission of parameter types.  It was lacking
2088         a check for __argslist. 
2089
2090 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2091
2092         * expression.cs (ParameterReference.DoResolveBase): Allow
2093         reference parameters if they are local to this block. 
2094
2095         This allows the ref and out parameters of a delegate to be used in
2096         an anonymous method, for example:
2097
2098         delegate void set (out int x);
2099
2100         set s = delegate (out int x){
2101                 x = 0;
2102         };
2103
2104         This is used by functionality introduced late in the C# language.
2105         
2106         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2107         method that take ref and out parameters. 
2108
2109         Fixes #77119 which was a late change in the spec.
2110
2111 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2112
2113         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2114         parent if its the same scope.  Fixes #77060.
2115
2116 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2117
2118         * driver.cs: Report the case of no source files and no -out:
2119         argument provided.
2120
2121 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2122
2123         Fix #77035.
2124         * expression.cs (ComposedCast.GetSignatureForError): Define.
2125
2126 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2127
2128         Fix #76995
2129
2130         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2131         ListDictionary, to contain the ExternAliasEntry entries (in
2132         addition to the NamespaceEntry.aliases hashtable). This field is
2133         shared between the original entry and its doppelganger (bodyless 
2134         copy of it).
2135         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2136         extern_aliases field.
2137         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2138         lookup in extern_aliases.
2139
2140 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2141
2142         Fix #77006.
2143         * class.cs (TypeContainer.Mark_HasEquals): New.
2144         (TypeContainer.Mark_HasGetHashCode): New.
2145         (ClassPart): Override them.
2146         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2147
2148         Fix #77008.
2149         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2150         'parent' argument to the base constructor.
2151
2152         Remove all mention of TypeContainer from decl.cs.
2153         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2154         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2155         (DeclSpace.DeclSpace): Likewise.
2156         (DeclSpace.DefineMembers): Remove unused argument.
2157         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2158         debugging check -- we don't care if the debug code throws an
2159         InvalidCastException instead of an InternalErrorException.
2160         * class.cs (TypeContainer.DefineMembers): Update to changes.
2161         (TypeContainer.DoDefineMembers): Likewise.
2162         (TypeContainer.GetMethods): Likewise.
2163         (PropertyMember.Define): Likewise.
2164         (MemberBase.Parent): New property that forwards to
2165         MemberCore.Parent, but ensures that we get a TypeContainer.
2166         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2167         (RootContext.PopulateTypes): Likewise.  Remove special case code
2168         for !RootContext.StdLib: DefineMembers is idempotent.
2169
2170 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2171
2172         * convert.cs (ExplicitConversionCore): Check the return value from
2173         ExplicitConversionCore which can return null on failure.  Fixes #76914
2174
2175 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2176
2177         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2178
2179 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2180
2181         * doc.cs : The search for referenced namespace was insufficient to
2182           get global one as it used to do. Fixed bug #76965.
2183
2184 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2185
2186         * doc.cs : check name in cref in the last phase that whether it is
2187           namespace or not.
2188
2189 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2190
2191         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2192           Mono.C5.
2193
2194 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2195
2196         * doc.cs : so it turned out that we cannot skip override check for 
2197           interface members. Fixed bug #76954.
2198
2199 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2200
2201         * cs-tokenizer.cs : fixed bug #75984:
2202           - #warning and #error should not be handled when the source line
2203             is disabled.
2204           - #line is not checked strictly when the source line is disabled.
2205           - #define and #undef is on the other hand checked strictly at any
2206             state.
2207
2208 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2209
2210         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2211           CS1027 report.
2212
2213 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2216
2217         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2218         event initializers.
2219         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2220         (FieldBase.Initializer): Initializer is now optional.
2221         (EventField.Define): Only event field can have initializer.
2222
2223         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2224
2225         * const.cs (Const): Reuse initializer.
2226
2227         * cs-parser.jay: Updated after FieldBase changes.
2228         Added current_array_type to simplify array initializers.
2229
2230         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2231
2232         * expression.cs, iterators.cs: Updated.
2233
2234         * namespace.cs (NamespaceEntry): Made UsingFound private.
2235
2236 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2237
2238         * parameterCollection.cs: Obsolete, removed.
2239         * parser.cs: Obsolete, removed.
2240
2241 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2242
2243         Fix #76849.
2244         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2245
2246         * enum.cs (Enum.Define): Set obsolete context here.
2247
2248 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2249
2250         * doc.cs :
2251           - FindDocumentedMember() now expects 1) paramList as null
2252             when "we don't have to check the number of parameters" and
2253             2) Type.EmptyTypes when "there is no arguments".
2254           - Introduced FoundMember struct to hold the exact type which was
2255             used to find the documented member (the above change broke
2256             test-xml-044; it might be better just to use DeclaringType than
2257             what MS does, like this change does, but it depends on usage.)
2258
2259 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2260
2261         * doc.cs : documented member might be from DeclaringType for nested
2262           types. Fixed bug #76782.
2263
2264 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2265
2266         * anonymous.cs: Have the param code handle leaving copies on the
2267         stack etc. Allows anonymous params to take part in the assignment
2268         code (++, +=, etc). Fixes bug #76550
2269
2270         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2271         it down to the anon code.
2272
2273         * iterators.cs: Use dummy var here
2274
2275         * codegen.cs: Handle new vars
2276
2277 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2278
2279         Fix #76849.
2280         * class.cs (MethodData.Define): Set proper Obsolete context.
2281
2282         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2283         obsolete context.
2284         (FieldExpr.DoResolve): Ditto.
2285
2286 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2287
2288         Fix #76849.
2289         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2290         parent is not obsolete.
2291
2292 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2293
2294         * doc.cs : (FindDocumentedMember) find parameterless members first
2295           and get CS0419 in the early stage. Fixed first case of bug #76727.
2296
2297 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2298
2299         Fix #76859.
2300         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2301         no error was reported.
2302
2303         *expression.cs (Binary.DoResolve): left can be null.
2304
2305 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2306
2307         Fix #76783.
2308         * class.cs (MethodData.Emit): Parameters should be labeled first.
2309
2310 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2311
2312         Fix #76761.
2313         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2314
2315 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2316
2317         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2318
2319         * class.cs (MethodCore): Parameter clean up.
2320         (IMethodData): Added ParameterInfo.
2321         (MethodData): Parameter clean up.
2322         (Indexer.Define): Parameter clean up.
2323
2324         * anonymous.cs,
2325         * codegen.cs,
2326         * cs-parser.jay,
2327         * decl.cs,
2328         * doc.cs,
2329         * ecore.cs,
2330         * flowanalysis.cs,
2331         * iterators.cs,
2332         * pending.cs,
2333         * statement.cs,
2334         * typemanager.cs: Parameter clean up.
2335
2336         * delegate.cs (Define): Get rid of duplicated code.
2337
2338         * expression.cs (ParameterReference): Removed useless parameters
2339         and simplified.
2340         (Invocation): Ditto.
2341
2342         * parameter.cs (ParamsParameter): New class, params specialization.
2343         (ArglistParameter): Attemp to separate arglist.
2344         (Parameter): Refactored to be reusable and faster.
2345         (Parameter.Modifier): Made understandable.
2346         (Parameters): Changed to be used as a class for `this' assembly
2347         parameters. Refactored to use new specialized classes.
2348
2349         * support.cs (ParameterData): Added Types property.
2350         (InternalParameters): Deleted.
2351
2352 2005-08-20  Martin Baulig  <martin@ximian.com>
2353
2354         Merging this patch from GMCS to fix #75867.
2355
2356         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2357         scope if we don't already have it.
2358
2359 2005-11-17  Martin Baulig  <martin@ximian.com>
2360
2361         * anonymous.cs
2362         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2363         inherit the scope from our parent.  Fixes #76653.
2364
2365 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2366
2367         * doc.cs : the previous patch does not actually fix the bug.
2368           PropertyInfo override check is now implemented and really fixed it.
2369         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2370
2371 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2372
2373         * doc.cs : apply "override filter" also to properties.
2374           Fixed bug #76730.
2375
2376 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2377
2378         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2379           no need to check overrides. For classes, omit those results from 
2380           interfaces since they must exist in the class. Fixed bug #76726.
2381
2382 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2383
2384         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2385           with different parameters. Fixed the second problem in #76685.
2386
2387 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2388
2389         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2390           get expected 'protected' access in CheckValidFamilyAccess()).
2391           Fixed bug #76692.
2392
2393 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2394
2395         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2396           Fixed bug #76705.  CS1569 was incorrectly commented out.
2397
2398 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2399
2400         * doc.cs : use Invocation.IsOverride() to do real override check.
2401         * expression.cs : made Invocation.IsOverride() internal.
2402
2403 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2404
2405         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2406           TypeBuilder.FindMembers() and filter overriden base members out.
2407           Fixed bug #76990.
2408
2409 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2410
2411         * doc.cs : ref/out parameters are represented as '@' (instead of
2412           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2413
2414 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2415
2416         * doc.cs : when there was no '.' in cref to methods in doc comment,
2417           then parameters were missing in the output. Fixed bug #76691.
2418
2419 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2420
2421         * driver.cs : don't output docs when there is an error.
2422           Fixed bug #76693.
2423
2424 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2425
2426         * doc.cs :
2427           Now it should detect indexers. Fixed primary concern in bug #76685.
2428           Fixed CS0419 message to not show the identical member signature in
2429           the message.
2430
2431 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2432
2433         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2434           instead of Type.FindMembers() since it does not handle events.
2435           Fixed bug #71604.
2436
2437 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2438
2439         * codegen.cs: Fixed typo (speficied -> specified).
2440
2441 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2442
2443         Fix #76369.
2444         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2445
2446 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2447
2448         * attribute.cs: Changed error message.
2449
2450         * cs-tokenizer.cs: One more check.
2451
2452 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2453
2454         * statement.cs (Block.Resolve): Ignore empty statement.
2455
2456 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2457
2458         * report.cs: Made error/warning methods more strict to avoid
2459         their misuse.
2460
2461         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2462         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2463         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2464         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2465
2466 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2467
2468         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2469         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2470
2471         * class.cs (TypeContainer.IsComImport): New property.
2472         (Constructor.Define): Create proper ctor for ComImport types.
2473
2474         * expression.cs (New.CheckComImport): Fixed.
2475
2476 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2477
2478         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2479         that a parameter has been captured does not mean that we do not
2480         have to do the rest of the processing.  This fixes the second part
2481         of #76592.  If there was another anonymous method capturing
2482         values in the past, the Scope would never be set for the second
2483         method that captured the same parameter.
2484
2485         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2486         properly manipulate the stack.   Second part of fix for #76592.
2487
2488         * expression.cs (New): Add support for invoking "new" on
2489         interfaces that have been flagged with the ComImport attribute and
2490         the CoClass.  Fixes #76637 
2491
2492         * statement.cs (Try.DoEmit): When a variable is captured, do not
2493         try to emit the vi.LocalBuilder variable as it has been captured.
2494         Create a temporary variable and store the results on the
2495         FieldBuilder.  Fixes #76642
2496
2497 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2500
2501         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2502
2503         * expression.cs (Binary.DoResolve): Added && optimalization.
2504     
2505         * typemanager.cs (AddUserType): Removed useless argument.
2506
2507 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2508
2509         * statement.cs (Block.variables): Uses ListDictionary.
2510
2511 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2512
2513         Fix #75969.
2514         * class.cs (PartialContainer.EmitType): Customized to emit
2515         security attributes.
2516         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2517         for partial classes.
2518
2519 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2520
2521         Fix #76599.
2522         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2523         access has to be fixed.
2524         
2525         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2526
2527 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2528
2529         Fix #76590.
2530         * ecore.cs (NullCast.Reduce): Implemented.
2531
2532         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2533         constant type.
2534         
2535         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2536         properly.
2537         (Foreach.Resolve): Catch null properly.
2538
2539 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2540  
2541         * cs-tokenizer.cs: Warning text fix.
2542
2543         * driver.cs: AllWarningNumbers exposed on public interface.
2544
2545         * report.cs (): Reviewed warning numbers.
2546         (IsValidWarning): Use binary search.
2547
2548 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2549  
2550         * driver.cs: Implemeted resource visibility.
2551         (Resources): New class for code sharing between /res: and
2552         /linkres:
2553  
2554 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2555
2556         Fix #76568.
2557         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2558         folding.
2559         
2560         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2561         contants only.
2562         
2563         * ecore.cs (NullCast): Child is contant only.
2564         
2565         * literal.cs (NullLiteral.Reduce): null can be converted to any
2566         reference type.
2567
2568 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2569
2570         * driver.cs: Use Encoding.Default as default code page instead
2571           of ISO-28591.
2572
2573 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2574
2575         Fix #76085.
2576         * expression.cs (Invocation.Error_InvalidArguments): Handle
2577         __arglist parameters.
2578         (Invocation.VerifyArgumentsCompat): Likewise.
2579         * support.cs (ReflectionParameters.GetSignatureForError): Print
2580         __arglist parameters.
2581         (InternalParamters.GetSignatureForError): Likewise.
2582         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2583
2584 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * attribute.cs (GetPropertyValue): Made public.
2587
2588         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2589         Resolve.
2590         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2591         attribute.
2592         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2593         is not defined.
2594         
2595         * driver.cs: Reflect method name change.
2596         
2597         * statement.cs (Try.Resolve): Warn when try has both general
2598         exception handlers.
2599         
2600         * typemanager.cs: runtime_compatibility_attr_type new predefined
2601         type.
2602
2603 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2604
2605         Fix #76419.
2606         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2607         treat it as an empty parameter list.
2608
2609 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2610
2611         Fix #76271.     
2612         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2613         ResolveAsTypeStep silent.
2614         * statement.cs (Block.AddConstant): Mark block as used.
2615         (Block.ResolveMeta): Avoid piling on error messages
2616         if a constant initializer resolution fails.
2617
2618 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2619
2620         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2621         Remove.
2622         (NamespaceEntry.VerifyAllUsing): New.
2623         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2624         behaviour.  Delegates actual resolution of alias to ...
2625         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2626         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2627         Update.
2628         * driver.cs (Driver.MainDriver): Update.
2629         
2630         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2631         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2632         property.
2633         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2634         Remove.
2635         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2636         RootNamespace.DefineNamespacesForAll.
2637
2638 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2639
2640         * typemanager.cs (assemblies, external_aliases, modules)
2641         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2642         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2643         overhead.  Move resposibility ...
2644         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2645         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2646
2647 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2648
2649         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2650         cached_namespaces.  Improve usage.
2651         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2652         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2653         Move from GlobalRootNamespace and simplify.
2654         (RootNamespace.Global): Make instance variable.
2655         (RootNamespace.RootNamespace): Add "alias name" parameter.
2656         (GlobalRootNamespace): Simplify drastically.
2657         (Namespace.Lookup): Don't use GetNamespace.
2658         * typemanager.cs (GetRootNamespace): Rename from
2659         ComputeNamespaceForAlias.
2660         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2661
2662 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * anonymous.cs (AnonymousContainer): Don't crash when container
2665         doesn't exist.
2666
2667 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2668
2669         * expression.cs (Binary.DoResolve): Warn when comparing same
2670         values.
2671
2672 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2673
2674         Fix #76486.
2675         * expression.cs (Binary.DoResolve): It looks like there are no
2676         convetsion rules in enum context.
2677
2678 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2679
2680         Add support for extern alias qualifiers.
2681         * typemanager.cs: Move some LookupTypeReflection code
2682         to namespace.cs, to have cleaner code. Added some methods
2683         to help us keep track of the extern aliased references.
2684         * driver.cs: Add suport for extern alias assemblies on command
2685         line and check for their warnings/errors. Also keep track of the
2686         extern aliased assemblies.
2687         * namespace.cs: Move the global functionality of Namespace
2688         to GlobalRootNamespace/RootNamespace. Now the global namespace
2689         is GlobalRootNamespace.Globa. Also the code moved from 
2690         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2691         Finally added LocalAliasEntry (AliasEntry before) and
2692         ExternAliasEntry, to handle alias statements.
2693         * cs-parser.jay: Add support in the grammar for extern alias
2694         statement.
2695         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2696         Update callings to Namespace (now in GlobalRootNamespace).
2697
2698 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2699
2700         Fix #76371.
2701         * class.cs (TypeContainer.DefineType): Move updating of
2702         topological sort earlier in the code.
2703         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2704
2705 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2706
2707         Fix #76273.
2708         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2709         
2710         * constant.cs (Constant.TryReduce): Moved from Cast class.
2711         (Reduce): Made little bit more OO and fixed missing conversions.
2712         
2713         * ecore.cs (Reduce): Implemented.
2714         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2715         
2716         * literal.cs (Reduce): Implemented.
2717         
2718         * class.cs: Reverted Miguel's wrong commit.
2719
2720 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2721
2722         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2723
2724 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2725
2726         * cs-parser.jay, expression.cs : CS0214 was missing error location
2727           for constants. Fixed bug #76404.
2728
2729 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2730
2731         Fix #76370.
2732         * convert.cs (ExplicitConversionCore): Fixed object->enum
2733         conversion.
2734
2735 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2736
2737         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2738         InstanceExpression.
2739         (PropertyExpr.EmitCall): Likewise.
2740         * expression.cs (Invocation.EmitArguments): Handle case where
2741         arguments == null.
2742         (Invocation.EmitCall): Avoid allocating temporary variable if
2743         there are no arguments.
2744
2745 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2746
2747         Fix #76323.
2748         * convert.cs (ImplicitConversionStandard): Move conversion of
2749         void* to arbitrary pointer types ...
2750         (ExplicitConversionStandard): .. here.
2751         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2752         error to always print typenames.
2753
2754 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2755
2756         * convert.cs (GetConversionOperator): Rename from
2757         GetConversionOperators.  Move operator selection code from ...
2758         (UserDefinedConversion): ... here.
2759
2760 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2761
2762         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2763         conversion.
2764
2765 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2766
2767         * assign.cs (Assign.DoResolve): Error method changed.
2768
2769         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2770         
2771         * const.cs (ResolveValue): Reset in_transit immediately.
2772         
2773         * constant.cs: Error method changed.
2774         
2775         * convert.cs: Removed useless location parameter.
2776         (ExplicitNumericConversion): Don't do double enum check.
2777         (ExplicitConversionCore): Renamed from ExplicitConversion.
2778         (ExplicitUnsafe): Extracted from ExplicitConversion.
2779         (ExplicitConversion): Uses for error reporting.
2780         
2781         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2782         error messages.
2783         (ResolveBoolean): Uses common error method.
2784         (CastToDecimal): Get rid of ec.
2785         (CastFromDecimal): Optimized.
2786         (ConvCast): Get rid of ec.
2787         
2788         * enum.cs (ResolveValue): Reset in_transit immediately.
2789         (Emit): Return after first error.
2790         
2791         * expression.cs: Convert changes.
2792         
2793         * literal.cs: Error method changed.
2794         
2795         * statement.cs: Error method changed.
2796
2797 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2798
2799         * support.cs (SeekableStreamReader.Position): Don't error out when
2800         the requested position is just beyond the end of the current
2801         buffered data.
2802
2803 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2804
2805         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2806         try to keep in sync with the byte count of the underlying Stream.
2807         However, this limits us to a window size of 2048 characters: i.e.,
2808         the maximum lookahead of our lexer/parser can be 2048 characters.
2809
2810 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2811
2812         Fix #76255.
2813         * driver.cs: Fix compilation files with full root path.
2814
2815 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2816
2817         * report.cs (SymbolRelatedToPreviousError): Format the output so
2818         it does not use an open parenthesis that is never closed. 
2819
2820         * driver.cs: Follow coding guidelines
2821
2822 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2823
2824         Fix #72930.
2825         * const.cs (Const.ResolveValue): Check for assigning non-null
2826         value to reference type.
2827
2828 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2829
2830         * anonymous.cs: Implemented ExprClassName.
2831         
2832         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2833         delegate.
2834         
2835         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2836         check.
2837         
2838         * class.cs (StaticClass.DefineContainerMembers): Report protected
2839         members as error.
2840         
2841         * codegen.cs: if(ed) PRODUCTION.
2842         
2843         * convert.cs (Error_CannotImplicitConversion): Better error
2844         distinction.
2845         
2846         * cs-parser.jay: More error checks.
2847         
2848         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2849         
2850         * driver.cs (CSCParseOption): Enabled wrong option check.
2851         
2852         * ecore.cs (Expression.ExprClassName): Turned to property.
2853         (MemberExpr.CheckIntermediateModification): For checking boxed
2854         value types     modification.
2855         
2856         * statement.cs (Fixed.Resolve): Expression type must be
2857         convertible to fixed type.
2858         (CollectionForeach.GetEnumeratorFilter,TryType):
2859         Small refactoring for easier error checking.
2860
2861 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2862
2863         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2864         attributes.
2865         
2866         * class.cs (GeneratedBaseInitializer): New class for customization
2867         compiler generated initializers.
2868         (MemberBase.DoDefine): Check Obsolete attribute here.
2869         (FieldMember.DoDefine): Ditto.
2870         
2871         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2872         constants.
2873         
2874         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2875         (MemberCore.GetObsoleteAttribute): Removed argument.
2876         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2877         (MemberCore.CheckObsoleteType): New helper.
2878         
2879         * delegate.cs,
2880         * enum.cs,
2881         * statement.cs: Updates after MemberCore changes.
2882         
2883         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2884         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2885         
2886         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2887         obsolete attribute for compiler construct.
2888         (As.DoResolve): Cache result.
2889         
2890         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2891
2892 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2893
2894         Fix #76133.
2895         * expression.cs (This.VerifyFixed): In a value type T, the type of
2896         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2897         value type R, 'this' is treated as a value parameter.
2898
2899 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2900
2901         * statement.cs (Lock): Use the TemporaryVariable class instead of
2902         manually using local variables as those do not work when variables
2903         are captured.
2904
2905         * ecore.cs: Moved the TemporaryVariable class from being a nested
2906         class inside Foreach to be a public class that can be employed in
2907         other places. 
2908
2909 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * cs-parser.jay: interface_accessors replaced by
2912         accessor_declarations.
2913
2914         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2915         location.
2916         
2917         * statement.cs (GotoCase.Resolve): Convert null constant to
2918         null case.
2919         (SwitchLabel.ResolveAndReduce): Ditto.
2920         (SwitchLabel.NullStringCase): Custom null stamp.
2921         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2922         
2923         typemanager.cs (CSharpSignature): Don't skip first argument
2924         for full names.
2925
2926 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2927
2928         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2929
2930         * location.cs (InEmacs): in this mode, do not report column
2931         location as it confuses Emacs.
2932
2933 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2936         expression.cs, iterators.cs, literal.cs: Store constants and
2937         literals location.
2938         
2939         * class.cs (MemberBase.ShortName): Pass location.
2940         
2941         * cs-parser.jay: Some location fixes.
2942         
2943         * ecore.cs (Expression.Location): Made virtual.
2944
2945 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2946
2947         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2948         if the underlying types are the same, otherwise we need to produce
2949         code that will do the proper cast.
2950
2951         This was exposed by Marek's constant rewrite which produced
2952         invalid code for the call site:
2953
2954         enum X : long { a }
2955         void Method (X v) {}
2956
2957         Method ((X) 5)
2958
2959         This fixes test-49.cs
2960
2961 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2962
2963         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2964           Type/Object should be allowed as well. Fixed bug #75968.
2965
2966 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2967
2968         * expression.cs : (Binary.DoResolve): when one is enum constant and
2969           another is constant 0, then return enum one *as enum type*.
2970           Fixed bug 74846.
2971
2972 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2973
2974         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2975         internal.
2976
2977         Fix #75941.
2978         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2979         flow-branching for LocalVariableReferences in case we were invoked
2980         from a MemberAccess.
2981         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2982         Carved out of ...
2983         (LocalVariableReference.DoResolveBase): ... this.
2984         (MemberAccess.Resolve): Do the check that was disabled during
2985         SimpleNameResolve.
2986
2987 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2988
2989         * class.cs :
2990           (PartialContainer.Create): check abstract/sealed/static strictly
2991           but abstract/sealed can exist only at one side. Fixed bug #75883.
2992
2993 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2994
2995         Fix #75945.
2996         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2997         specified, don't default to UnmanagedType.I4.
2998
2999 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3000
3001         * expression.cs : conditional operator should check possibly
3002           incorrect assign expression. Fixed bug #75946.
3003
3004 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3005
3006         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3007           Reverting the change. gmcs is much complex than mcs on this matter.
3008
3009 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3010
3011         * cs-tokenizer.cs : To read another token ahead of the actual 
3012           consumption, use new SavedToken and cache token instead of moving
3013           back the stream with SeekableStreamReader (it seemed problematic).
3014         * cs-parser.jay,
3015           driver.cs : Thus use StreamReader directly.
3016         * support.cs : Thus removed SeekableStreamReader.
3017
3018 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3019
3020         Fix #75934.
3021         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3022         (ScopeInfo.EmitScopeType): Use it to construct field names from
3023         names of captured locals.
3024
3025         Fix #75929.
3026         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3027         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3028         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3029         (ExplicitConversion): Remove enum cases already handled by
3030         implicit conversion.  Move implicit conversion check to the beginning.
3031         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3032         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3033         Don't treat System.Enum as a struct.
3034
3035 2005-08-30  Jb Evain  <jbevain@gmail.com>
3036
3037         * attribute.cs: handles as expression in parameters.
3038
3039 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3040
3041         Fix #75802.
3042         * class.cs (TypeContainer.VerifyClsName): Don't use a
3043         PartialContainer when verifying CLS compliance.
3044         (AbstractPropertyEventMethod): Set Parent here, ...
3045         (PropertyMethod): ... not here.
3046
3047 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3048
3049         * attribute.cs : escaped attribute name should not be allowed to be
3050           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3051
3052 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3053
3054         Fix #75927.
3055         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3056         when converting a long constant to unsigned long.
3057         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3058         detect where IsApplicable and VerifyArgumentsCompat disagree.
3059
3060 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3061         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3062
3063         Fix #75848.
3064         * class.cs (TypeContainer.CanElideInitializer): New helper.
3065         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3066         can safely emitting the initializer of a field.
3067
3068 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3069
3070         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3071           allowed inside a switch (without loop). Fixed bug #75433.
3072
3073 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3074
3075         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3076         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3077
3078 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3079
3080         * driver.cs : kinda reverting the default encoding changes (not exact 
3081           revert since I noticed that "codepage:reset" might not work fine).
3082
3083 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3084
3085         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3086           Location. Now getter and setter store location correctly.
3087           (errors/cs0111-12.cs now reports the expected location.)
3088
3089 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3090
3091         * driver.cs : Use default encoding on the environment.
3092           Removed (now that) extra parameter for SeekableStreamReader.
3093         * support.cs : (SeekableStreamReader) third .ctor() argument for
3094           StreamReader is not required (always true). preamble size could
3095           be acquired in simpler and safe way.
3096
3097 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3098
3099         * cs-parser.jay: report CS0642 at warning level 3
3100           and report CS0642 for an if else statement also
3101           fixes bug #74745. Patch by John Luke (and a bit
3102           modified by me).
3103           Removed extra CS0642 warning check for "while",
3104           "for" and "fixed".
3105         * statement.cs: In Block.Resolve(), CS0642 check
3106           is reimplemented to check a sequence of an empty
3107           statement and a block.
3108
3109           Both fix bug #66777.
3110
3111 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3112
3113         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3114         detection until I fix it.
3115         
3116         * cs-tokenizer.cs: Changed error message.
3117         
3118         * cs-parser.jay: Fixed 2 error locations.
3119         
3120         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3121         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3122         properties.
3123         
3124         * enum.cs (GetSignatureForError): Fixed.
3125         
3126         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3127         method detection.
3128         
3129         * class.cs,
3130         * typemanager.cs (RegisterProperty): Removed.
3131         
3132         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3133
3134 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3135
3136         Fix #75874.
3137         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3138         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3139
3140 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3141
3142         * expression.cs : tiny fix is required for not warning positive ulong.
3143           See test-441.cs.
3144
3145 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3146
3147         * expression.cs : add CS0652 check for constant and integral
3148           expression. Fixed bug #53974.
3149
3150 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3151
3152         * expression.cs : in DoNumericPromotions(), check if there is implicit
3153           conversion overload for string (to check CS0034). Fixed bug #52492.
3154
3155 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3156
3157         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3158
3159 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3160
3161         * ecore.cs : report location when it is *not* Null.
3162
3163 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3164
3165         * codegen.cs,
3166           ecore.cs,
3167           flowanalysis.cs,
3168           expression.cs:
3169           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3170           correctly. Fixed bug #75721.
3171
3172 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3173
3174         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3175         loop that performs 'min (pos, char_count)'.
3176
3177         Fix #75862.
3178         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3179         converted value in Operator.OnesComplement.
3180
3181 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3182
3183         * anonymous.cs: If the anon method is pulled into a helper class,
3184         it needs to be `internal' not `private'. Fixes runtime behavior on
3185         msft. bug #75704
3186
3187 2005-08-20  Martin Baulig  <martin@ximian.com>
3188
3189         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3190         scope if we don't already have it.
3191
3192         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3193         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3194         fixes #75867.
3195
3196 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3197
3198         Fix #75803
3199         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3200         is a partial class.
3201
3202 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3203
3204         The big constants rewrite
3205         Fix #75746, #75685 and more
3206         As a side effect saved 1MB for MWF ;-)
3207         
3208         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3209         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3210         enum based for corlib compilation.
3211         
3212         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3213         subtractions.
3214         
3215         * class.cs (FixedField.Define): Use ResolveAsConstant.
3216         
3217         * const.cs (IConstant): Interface constants and enums.
3218         (Const.ResolveValue): New method for constant resolvning.
3219         (ExternalConstant): Constants from imported assemblies.
3220         
3221         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3222         conversion; like enums.
3223         (Constant.ToType): Converts this constant to different type.
3224         (Constant.Increment): Adds 1.
3225         
3226         * convert.cs (ImplicitConversionRequired): Simplified.
3227         
3228         * cs-parser.jay: Create EnumMember directly.
3229         
3230         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3231         
3232         * doc.cs (GenerateEnumDocComment): Removed.
3233         
3234         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3235         (ConvertIntLiteral): Removed.
3236         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3237         
3238         * enum.cs (EnumMember): Implement IConstant.
3239         (Enum.IsValidEnumConstant): Removed.
3240         (Enum.GetNextDefaultValue): Removed.
3241         (Enum.FindMembers): Updated.
3242         (Enum.GenerateDocComment): Iterate enum members.
3243         
3244         * expression.cs (Cast.TryReduce): Handle enums correctly.
3245         (New.Constantify): Made public.
3246         (MemberAccess.DoResolve): Removed contant specific if(s).
3247         
3248         * literal.cs (NullLiteral): Implement new abstract methods.
3249         
3250         * statement.cs (GotoCase.Resolve): Use new constant methods.
3251         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3252         
3253         * typemanager.cs (LookupEnum): Removed.
3254         (IsEnumType): Fixed to work with corlib.
3255         (RegisterConstant): Removed.
3256         (LookupConstant): Removed.
3257         (GetConstant): Changed to work with IConstant.
3258
3259 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3260
3261         * location.cs : Fixed overflown (>255) column number.
3262
3263 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3264
3265         First cut of the qualified-alias-member feature.
3266         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3267         token.
3268         * cs-parser.jay (DOUBLE_COLON): New token.
3269         (namespace_or_type_name): Add rule for recognizing
3270         qualified-alias-members.
3271         (primary_expression): Likewise.
3272         (element_access): Allow QualifiedAliasMember as a possible
3273         type-bearing expression.
3274         (local_variable_type, local_variable_pointer_type): Likewise.
3275         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3276         aliases in the current and enclosing namespace declarations.
3277         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3278         * decl.cs (MemberName.is_double_colon): New.
3279         (MemberName.MemberName): Add new constructor for alias-member.
3280         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3281         * expression.cs (QualifiedAliasMember): New expression type.
3282
3283 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3284
3285         * location.cs : it borked when no argument was specified.
3286
3287 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3288
3289         * location.cs : tiny ToString() format fix.
3290
3291 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3292
3293         * statement.cs : oops, it was missing.
3294
3295 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3296
3297         A set of fixes for precise line/column location.
3298
3299         * location.cs :
3300           "token" field now holds a file/line "delta", a line number offset 
3301           from the segment, and a column number. See also:
3302           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3303           December/009508.html
3304           Removed static IsNull. Use instance IsNull property instead.
3305         * cs-tokenizer.cs :
3306           For some tokens it stores Location. For Identifier it stores
3307           LocatedToken which is a pair of string name and location.
3308           Column numbers are adjusted only at getChar().
3309         * report.cs :
3310           Use Location.ToString() for reporting (it now contains column).
3311         * cs-parser.jay :
3312           Largely modified to use LocatedToken instead of
3313           string (IDENTIFIER), and to acquire Location from some tokens.
3314         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3315           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3316           codegen.cs :
3317           Now MemberName holds Location. DeclSpace.ctor() receives Location
3318           as a parameter. Removed extra parameters to all derived classes.
3319           Replaced Location.IsNull() with instance property.
3320         * assign.cs, expression.cs :
3321           Added .ctor() overload that omits Location.
3322         * attribute.cs :
3323           Added "nameEscaped" flag that indicates the identifier was escaped
3324           in the source file. This fixes bug #57047.
3325
3326 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3327
3328         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3329         New method, looking for lo-case imported cls type.
3330
3331         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3332         here.
3333
3334         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3335
3336         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3337
3338         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3339         all_imported_types.
3340         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3341
3342         Optimized to save 3.5 MB for SWF compilation.
3343
3344 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3345
3346         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3347         (PartialContainer.Create): Moved logic AddToContainer.
3348         (PartialContainer.MarkForDuplicationCheck): Shares name.
3349         
3350         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3351         place.
3352         
3353         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3354         initialization.
3355         (Namespace.GetSignatureForError): New method.
3356         
3357         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3358         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3359
3360 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3361
3362         Fix #75669.
3363         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3364         member lookup rather than qualifier_type, since qualifier_type can
3365         be null.
3366
3367 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3368
3369         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3370         enum member.
3371
3372 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3373
3374         * statement.cs: Copy the local exception into the exception
3375         captured local.  Fixes 75674
3376
3377 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3378
3379         Fix #75658.
3380         * expression.cs (Invocation.OverloadResolve): Don't report error
3381         CS1501 if error CS1502 has been reported.
3382         (New.DoResolve): Delegate CS1501 reporting to
3383         Invocation.OverloadResolve.
3384
3385         Fix #75656.
3386         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3387         invariant-meaning-in-block property in an enclosing block if
3388         necessary.
3389
3390 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3393         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3394         (Switch.CheckSwitch): Just save 50kb for SWF.
3395
3396 2005-07-27  Martin Baulig  <martin@ximian.com>
3397
3398         * anonymous.cs (CaptureContext.AddField): Added
3399         `AnonymousContainer am' argument; compute its toplevel scope if
3400         it's not already computed.  Fixes #75649.
3401
3402 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3403
3404         Fix #75628.
3405         * class.cs (Constructor.Emit): Reset block to null if the block
3406         resolve fails.
3407
3408 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3409
3410         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3411
3412 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3413
3414         * class.cs (MethodData.Define): Check whether accessor implementing
3415         interface is public.
3416
3417         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3418
3419 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3420
3421         Fix #57245
3422         * namespace.cs (LookupType): Moved same type check to...
3423         
3424         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3425         with the same name.
3426
3427 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3428
3429         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3430         already found a typebuilder.
3431         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3432         MemberNames, not strings.
3433
3434         * const.cs (Error_ExpressionMustBeConst): 
3435         Rename from Error_EpressionMustBeConst.
3436         * const.cs, class.cs, statement.cd: Update.
3437
3438 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3439
3440         Fix #65573
3441
3442         * const.cs (Const.LookupConstantValue): Report missing contant expression
3443         everytime.
3444         (Error_EpressionMustBeConstant): Only one error method.
3445
3446         * class.cs, statement.c: Updated.
3447
3448 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3449
3450         * statement.cs (Block.Flags): Add back HasVarargs.
3451         (Block.flags): Make protected.
3452         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3453
3454         * typemanager.cs (types, typecontainers, user_types): Remove.
3455         (UserTypes, TypeContainers): Likewise.
3456         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3457         (CleanUp, Reset): Update.
3458         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3459         (GetNestedType): Use Type.GetNestedType.
3460         (CoreLookupType): Take two arguments, the namespace and the
3461         basename of the type.  Update to use the Namespace.Lookup
3462         mechanism.
3463         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3464         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3465         string concatenation and substring matches.
3466         * class.cs, enum.cs, delegate.cs: Update to changes.
3467
3468 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3469
3470         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3471         Expression and made virtual.
3472
3473         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3474         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3475
3476         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3477
3478         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3479         error message.
3480
3481         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3482         change.
3483
3484 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3485
3486         Fix #57707
3487         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3488         AssemblyCultureAttribute is not used on executable.
3489
3490         * rootcontext.cs,
3491         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3492
3493 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3494
3495         Fix #60638.
3496         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3497         New.  Reports CS0252/CS0253.
3498         Mostly taken from preliminary patch by Duncak Mak.
3499         (Binary.DoResolveOperator): Store results of operator lookup.
3500         Use them to detect if we need to warn about unintended reference
3501         comparisons.
3502
3503 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3504
3505         Fix #72969.
3506         * namespace.cs (Namespace.Lookup): Add back location parameter.
3507         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3508         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3509
3510         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3511         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3512         (Namespace.LookupType): ... this.
3513         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3514         of namespaces.
3515         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3516         purported to handle pointers.
3517         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3518         CoreLookupType.
3519
3520 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3521
3522         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3523         type as namespace.
3524
3525 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3526
3527         * namespace.cs (Namespace.Lookup): Drop location parameter.
3528         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3529         (NamespaceEntry.Lookup): ... this.
3530         (NamespaceEntry.Error_AmbiguousTypeReference):
3531         Move here from DeclSpace.
3532         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3533         names ...
3534         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3535         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3536         Move to NamespaceEntry.
3537         * delegate.cs, expression.cs: Update to changes.
3538
3539 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3540
3541         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3542         CheckAttributeType and refactored.
3543         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3544         ResolveAsTypeTerminal error handling.
3545         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3546         handling.
3547         (GetSignatureForError): Print errors in same way.
3548
3549         * class.cs,
3550         * codegen.cs: Reflect attribute GetSignatureForError change.
3551
3552         * ecore.cs,
3553         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3554
3555         * namespace.cs (UsingEntry): Refactored to make fields private.
3556
3557         * assign.cs,
3558         statement.cs: Error_UnexpectedKind has extra parameter.
3559
3560 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3561
3562         * ecore.cs (IAlias): Remove.
3563         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3564         that implement the interface.
3565         * namespace.cs (Namespace): Likewise.
3566         (Namespace.declspaces): Renamed from 'defined_names'.
3567         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3568         DeclSpace instead of an IAlias.
3569         * tree.cs (Tree.AddDecl): Update.
3570
3571 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3572
3573         * statement.cs (Block.Flags); Remove HasVarargs.
3574         (Block.HasVarargs): Move to ToplevelBlock.
3575         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3576         (Block.Variables): Make protected.  Initialize variable hashtable
3577         if necessary.
3578         (Block.AddVariable): Update.
3579         (Block.Resolve): Update to changes.
3580         (ToplevelBlock.HasVarargs): New boolean.
3581         (ToplevelBlock.ThisVariable): Move here from Block.
3582         (ToplevelBlock.AddThisVariable): Likewise.
3583         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3584         * expression.cs (This.ResolveBase): Update to changes.
3585         (ArglistAccess.DoResolve): Likewise.
3586
3587 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3588
3589         Fix #75321
3590         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3591
3592         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3593         not used and not used & assigned.
3594         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3595
3596 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3597
3598         Fix #75053
3599         * expression.cs (Is.DoResolve): null is never provided type.
3600
3601 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3602
3603         Fix #52496
3604         * cs-parser.jay: Less strict event error rule to catch more errors.
3605
3606 2005-07-08  Martin Baulig  <martin@ximian.com>
3607
3608         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3609         gettter (allowed) or setter (not allowed).
3610
3611         * class.cs (Accessor): Implement IIteratorContainer.
3612         (Accessor.Yields): New public field.
3613         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3614         per-accessor basis.
3615
3616         * cs-parser.jay
3617         (get_accessor_declaration, set_accessor_declaration): Set the
3618         `yields' flag on the accessor, not the property.
3619         (property_declaration): Do the iterators check on a per-accessor
3620         basis and not for the whole property.
3621
3622 2005-07-08  Martin Baulig  <martin@ximian.com>
3623
3624         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3625         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3626
3627 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3628
3629         Fix #74975
3630         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3631         (ExtractSecurityPermissionSet): Cope with self referencing security
3632         attributes properly.
3633
3634         * driver.cs (SetOutputFile): Made public property OutputFile.
3635
3636 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3637
3638         Fix #75486.
3639         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3640         has_nonstatic_fields.  Make into a FieldBase pointer.
3641         (TypeContainer.AddField): Add CS0282 check.
3642         (TypeContainer.EmitType): Update.
3643
3644 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3645
3646         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3647         compare if they start with __.
3648
3649 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3650
3651         * statement.cs (Switch.SwitchGoverningType): Only look at
3652         UserCasts that don't need implicit standard conversions to one of
3653         the allowed switch types (Fixes test-322.cs).
3654         (LocalInfo.Resolve): Re-enable sanity-test.
3655
3656 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3657
3658         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3659         
3660         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3661         
3662         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3663
3664 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3665
3666         Fix #75472.
3667         * ecore.cs (SimpleName.GetSignatureForError): Add.
3668         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3669         (MemberAccess.GetSignatureForError): Add.
3670
3671 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3672  
3673         The big error and warning messages review.
3674         
3675         * anonymous.cs,
3676         * assign.cs,
3677         * attribute.cs,
3678         * class.cs,
3679         * codegen.cs,
3680         * convert.cs,
3681         * cs-parser.jay,
3682         * cs-tokenizer.cs,
3683         * decl.cs,
3684         * delegate.cs,
3685         * doc.cs,
3686         * driver.cs,
3687         * ecore.cs,
3688         * enum.cs,
3689         * expression.cs,
3690         * flowanalysis.cs,
3691         * iterators.cs,
3692         * literal.cs,
3693         * location.cs,
3694         * modifiers.cs,
3695         * namespace.cs,
3696         * parameter.cs,
3697         * pending.cs,
3698         * report.cs,
3699         * rootcontext.cs,
3700         * statement.cs,
3701         * support.cs,
3702         * tree.cs,
3703         * typemanager.cs: Updated.
3704         
3705         * class.cs: (MethodCore.SetYields): Moved here to share.
3706         (PropertyMethod.Define): Moved iterator setup here.
3707         
3708         * iterators.cs: Add orig_method to have full access to parent
3709         container.
3710
3711 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3712
3713         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3714         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3715         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3716         variable of struct type.
3717         * expression.cs (Unary.ResolveOperator): Update to change.
3718         (Indirection.VerifyFixed): Likewise.
3719         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3720         (ParameterReference.VerifyFixed): Value parameters are fixed.
3721         (This.VerifyFixed): Treat 'this' as a value parameter.
3722         * statement.cs (LocalInfo.IsFixed): Remove.
3723
3724 2005-07-01  Martin Baulig  <martin@ximian.com>
3725
3726         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3727         `ec.EmitThis ()' to get the correct scope.
3728
3729 2005-07-01  Martin Baulig  <martin@ximian.com>
3730
3731         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3732         instance is a ParameterReference; fixes #75299.
3733
3734 2005-07-01  Martin Baulig  <martin@ximian.com>
3735
3736         Reverted Marek's latest patch (r46725):
3737         - it contains structural changes which are neither mentioned in
3738           the ChangeLog nor explained anywhere; for example the additional
3739           argument of EmitContext's and Iterator's .ctor's and the
3740           TypeContainer.DefineMembers() change.
3741         - structural changes like this should go in in seperate patches
3742           and not be hidden in a huge patch which just seems to affect
3743           warnings and errors.
3744           a big and hard to understand patch.
3745         - it breaks iterators and causes regressions, for instance in
3746           test-iter-03.cs.      
3747
3748 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3749
3750         Fix #75412.
3751         * expression.cs (Indexers.map): Remove.
3752         (Indexers.Append): Filter out inaccessible setters and getters.
3753         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3754
3755         Fix #75283.
3756         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3757         Refactored from ...
3758         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3759         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3760         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3761         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3762
3763 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3764
3765         Fix #75322
3766         * class.cs (FieldBase.GetInitializerExpression): One more field
3767         for backup.
3768
3769 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3770
3771         * pending.cs: Do not define a proxy if the base method is virtual,
3772         it will be picked up by the runtime (bug 75270).
3773
3774 2005-06-08  Martin Baulig  <martin@ximian.com>
3775
3776         The big Iterators rewrite :-)
3777
3778         * iterators.cs: Rewrite this to use the anonymous methods framework.
3779
3780         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3781         before the TypeContainers; see 2test-21.cs.
3782
3783         * class.cs
3784         (TypeContainer.DefineType): Don't create a new EmitContext if we
3785         already have one (this only happens if we're an Iterator).
3786         (TypeContainer.Define): Also call Define() on all our iterators.
3787         (Method.CreateEmitContext): Added support for iterators.
3788
3789         * anonymous.cs
3790         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3791         (AnonymousContainer.CreateMethodHost): Moved here from
3792         AnonymousMethod and made abstract.
3793         (AnonymousContainer.CreateScopeType): New abstract method.
3794         (AnonymousContainer.IsIterator): New public property.
3795         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3796         get the ScopeTypeBuilder rather than manually defining it here. 
3797         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3798         iterators here.
3799
3800         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3801         before RootContext.DefineTypes().
3802
3803         * codegen.cs (EmitContext.RemapToProxy): Removed.
3804         (EmitContext.CurrentAnonymousMethod): Changed type from
3805         AnonymousMethod -> AnonymousContainer.
3806         (EmitContext.ResolveTopBlock): Protect from being called twice.
3807         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3808         (EmitContext.EmitThis): Removed the iterators hacks; use the
3809         anonymous methods framework for that.
3810
3811         * statement.cs
3812         (ToplevelBlock.Container): Make this a property, not a field.
3813         (ToplevelBlock.ReParent): New public method; move the
3814         ToplevelBlock into a new container.
3815         (Foreach.TemporaryVariable): Simplify.
3816
3817 2005-06-05  Martin Baulig  <martin@ximian.com>
3818
3819         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3820         (Block.AddTemporaryVariable): New public method; creates a new
3821         `LocalInfo' for a temporary variable.
3822         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3823         variables here.
3824         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3825         non-iterator variables.
3826
3827 2005-06-05  Martin Baulig  <martin@ximian.com>
3828
3829         * statement.cs (Foreach.TemporaryVariable): Create the
3830         LocalBuilder in the Emit phase and not in Resolve since in some
3831         situations, we don't have an ILGenerator during Resolve; see
3832         2test-19.cs for an example.
3833
3834 2005-06-04  Martin Baulig  <martin@ximian.com>
3835
3836         **** Merged r45395 from GCS ****
3837
3838         The big Foreach rewrite - Part II.
3839
3840         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3841         with `PropertyInfo ienumerator_getcurrent'.
3842
3843         * codegen.cs (VariableStorage): Removed.
3844
3845         * statement.cs
3846         (Foreach): Derive from Statement, not ExceptionStatement.
3847         (Foreach.CollectionForeach): New nested class.  Moved all the code
3848         dealing with collection foreach here.
3849         (Foreach.ForeachHelperMethods): Removed.
3850         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3851
3852 2005-05-23  Martin Baulig  <martin@ximian.com>
3853
3854         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3855         don't need to.  Fix #75014.
3856
3857 2005-05-20  Martin Baulig  <martin@ximian.com>
3858
3859         Merged r44808 from GMCS.
3860
3861         * class.cs (TypeContainer.CircularDepException): Removed.
3862         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3863         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3864         (CS0146) and interface (CS0529) dependencies here.
3865
3866 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3867
3868         * expression.cs (Invocation.EmitCall): Fix initialization
3869         'this_call' to reflect current behaviour.  Fix indentation.
3870
3871         * convert.cs (FindMostEncompassedType): Add two trivial special
3872         cases (number_of_types == 0 || number_of_types == 1).
3873         (FindMostEncompasingType): Likewise.
3874
3875 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3876
3877         Some cleanups preparing for the fix of #75283.
3878         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3879         error testing.
3880         (EventExpr.InstanceResolve): Likewise.
3881         (EventExpr.DoResolve): Remove redundant checks.
3882
3883 2005-06-10  Duncan Mak  <duncan@novell.com>
3884
3885         * cs-tokenizer.cs (process_directives): New flag for controlling
3886         the processing of preprocessor directives.
3887         (x_token): After seeing a '#', return Token.NONE instead of going
3888         to handle_preprocessing_directive() when not processing
3889         directives. This avoids unnecessary processing during the token peek in
3890         is_punct().
3891
3892         This fixes #74939.
3893
3894         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3895         the existing error reporting methods instead of Report.Error.
3896
3897         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3898         after Raja's rewrite.
3899
3900 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3901
3902         * class.cs: Small fix.
3903
3904 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3905
3906         Fix #75160.
3907         * class.cs (GetPartialBases): Fix return value check of
3908         part.GetClassBases.
3909
3910 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3911
3912         Ensure that partial classes are registered in their enclosing
3913         namespace.  Initial part of fix of #75160.
3914         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3915         Register declspace with namespace here, not in
3916         DeclSpace.RecordDecl.
3917         * cs-parser.jay: Pass namespace to RecordDecl.
3918         * class.cs (PartialContainer.Create): Likewise.
3919         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3920         called.
3921         * decl.cs (Declspace.RecordDecl): Remove.
3922         * namespace.cs (NamespaceEntry.DefineName): Remove.
3923
3924 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3925
3926         * rootcontext.cs: Reset TargetExt as well.
3927
3928 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3929
3930         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3931         -langversion:ISO-1.
3932
3933 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3934
3935         Fix #75080, cs0119.cs.
3936         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3937         of ...
3938         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3939         allowing ExprClass.Type and ExprClass.Namespace for
3940         ResolveFlags.VariableOrValue.
3941         (Expression.Resolve) [1-argument variant]: Change default resolve
3942         flags based on language version.
3943         (Expression.Error_UnexpectedKind): Use a simple string array
3944         rather than an ArrayList.
3945         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3946         not ExprClass.Type.
3947         (TypeOfVoid.DoResolve): Likewise.
3948         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3949         flags argument -- it always has the same value.
3950
3951 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3952
3953         Fix #75081.
3954         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3955         Use it in the error message.
3956         * assign.cs, expression.cs, statement.cs: Update.
3957
3958 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3959
3960         Fix #75088.
3961         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3962         the "almostMatchedMember" case too.
3963         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3964         that failed the accessibility checks to 'almost_match'.
3965
3966 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3967
3968         * attribute.cs: Use internal MethodBuilder methods to set
3969         ExactSpelling and SetLastError on PInvoke methods, instead
3970         of passing them via charset.  Fixes #75060.
3971
3972 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3973
3974         * parameter.cs (Parameter): Remove TODO comment.
3975         (Parameter.DefineParameter): Remove Location parameter.
3976         (Parameters.LabelParameters): Likewise.
3977         * class.cs (Constructor.Emit): Update to change.
3978         (MethodData.Emit): Likewise.
3979         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3980         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3981
3982 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3983
3984         * parameter.cs,
3985           Removed Parameters.Location and added Parameter.Location instead.
3986           Removed Location parameter from Emit() and GetSignature().
3987         * anonymous.cs,
3988           class.cs,
3989           cs-parser.jay,
3990           delegate.cs,
3991           iterators.cs,
3992           statement.cs :
3993           Modified all related calls.
3994
3995 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3996
3997         Improve user-defined conversion handling.
3998         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3999         applicable operators.
4000         (AddConversionOperators): New.  Helper for GetConversionOperators.
4001         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4002         there is only one most encompassed/encompassing type.
4003         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4004         "applicable operator" handling.
4005         (UserConversion): Move cache here from GetConversionOperators.
4006         Directly cache the chosen operator, rather than the whole
4007         MethodGroup.
4008         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4009         case.  Allow conversion of decimal to sbyte and byte too.
4010         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4011         New static methods.  Used to avoid allocating EmptyExpressions in
4012         convert.cs.
4013
4014 2005-05-24  Duncan Mak  <duncan@novell.com>
4015
4016         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4017         another class, used in Convert.ExplicitNumericConversion.
4018         (CastToDecimal): New class, similar to above, but casts to
4019         System.Decimal, used in Convert.ImplicitNumericConversion and also
4020         in explicit convesion from double/float to decimal.
4021
4022         * convert.cs (ImplicitNumericConversion): Handle implicit
4023         conversions to System.Decimal.
4024         (ExplicitNumericConversion): handle explicit conversions to
4025         System.Decimal.
4026
4027         This fixes #68711.
4028         
4029 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4030
4031         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4032         know the type at this stage, just break through.   Fixes #75008 
4033
4034 2005-05-19  Martin Baulig  <martin@ximian.com>
4035
4036         * delegate.cs
4037         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4038         to disable error reporting.
4039
4040         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4041         here since we don't want to report an error; see the new test-336.cs.
4042
4043 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4044
4045         * statement.cs (ToplevelBlock.GetParameterReference)
4046         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4047         Move here from class Block.
4048         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4049         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4050
4051 2005-05-18  Martin Baulig  <martin@ximian.com>
4052
4053         Fix #74978.
4054
4055         * flowanalysis.cs
4056         (FlowBranching.Reachability): Add non-static public And() and Or()
4057         methods.
4058         (FlowBranchingSwitch): New class; do the `break_origins' thing
4059         like in FlowBranchingLoop.
4060         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4061         reachability, not just locals and parameters.
4062         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4063         switch; MergeBreakOrigins() now takes care of that.
4064
4065 2005-05-18  Martin Baulig  <martin@ximian.com>
4066
4067         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4068         a loop and may leave it, reset the barrier; fixes #74974.
4069
4070 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4071         
4072         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4073         is back.
4074         
4075         * cs-parser.jay: Catch more lexical errors.
4076         
4077         * report.cs: Add one more Error method.
4078         
4079         * rootcontext.cs,
4080         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4081
4082 2005-05-17  Martin Baulig  <martin@ximian.com>
4083
4084         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4085         #70970. 
4086
4087 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4088
4089         Fix test-382.cs.  Emit values of decimal constants.
4090         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4091         Carved out of ...
4092         (TypeContainer.AddField): ... this.
4093         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4094         with initializers to include 'Const's.
4095         (ClassPart.RegisterFieldForInitialization): Forward to
4096         PartialContainer.
4097         * const.cs (Const.Const): Pass initializer to base class.
4098         (Const.Define): In case of decimal constants, register them for
4099         initialization in a static constructor.
4100
4101 2005-05-14  Martin Baulig  <martin@ximian.com>
4102
4103         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4104         do not call ResolveUnreachable() on unreachable statements in
4105         here, see the comment in the source code.
4106
4107 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4108
4109         Fix #74934.
4110         * expression.cs (BinaryResolveOperator): If one of the operands of
4111         an equality comparison is 'null' and the other is a pointer type,
4112         convert the null to a NullPointer.
4113         * convert.cs (ImplicitReferenceConversion): If the expression is a
4114         NullLiteral and the target type is a pointer type, return a
4115         NullPointer instead.
4116         (ImplicitConversionStandard): Likewise.
4117
4118 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4119         
4120         * cs-parser.jay: Set readonly context based on special constructs.
4121         
4122         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4123         readonly variable error handling.
4124         
4125         * rootcontext.cs (EmitCode): Don't verify members when error
4126         occurred.
4127         
4128         * statement.cs (LocalInfo): Add reaodnly context information.
4129         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4130
4131 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4132
4133         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4134         for #74041 to initialize 'resolved' to false only for explicit
4135         blocks.  Fixes #74873.
4136
4137 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4138
4139         Fix #74920.
4140         * typemanager.cs (unmanaged_enclosing_types): New.
4141         (IsUnmanagedType): Avoid infloops by using
4142         'unmanaged_enclosing_types' to talk with recursive invocations.
4143
4144 2005-05-13  Martin Baulig  <martin@ximian.com>
4145
4146         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4147         instance variable, not a local.  Fix #74873.
4148         (Block.ResolveUnreachable): Set it to true here.
4149
4150 2005-05-11  Duncan Mak  <duncan@novell.com>
4151
4152         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4153         continuing to process for 'arg'.
4154         (handle_preprocessing_directive): Check the argument of the #endif
4155         directive and report error CS1025 if there are any trailing
4156         characters.
4157
4158         According to the C# spec, having even whitespace after the #endif
4159         directive is illegal; however, because we call arg.TrimEnd ()
4160         beforehand, we have the same behavior as csc, allowing whitespace
4161         after the directive.
4162
4163         Fixes #74892.
4164
4165 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4166
4167         Fix #74863.
4168         
4169         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4170         (Constructor.GetObsoleteAttribute): Implemented correctly.
4171
4172 2005-05-10  Martin Baulig  <martin@ximian.com>
4173
4174         * support.cs (ReflectionParameters.ParameterModifier): Use
4175         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4176         and `ParameterAttributes.In'.  Fixes #74884.
4177
4178 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4179
4180         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4181         
4182         * expression.cs (Argument.GetParameterModifier): Turned to property.
4183         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4184         
4185         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4186         its C# equivalent.
4187         
4188 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4189
4190         Fix #74852.
4191         * decl.cs (MemberCache.AddMethods): Register override methods,
4192         rather than non-override methods.
4193         * typemanager.cs (RegisterOverride): New.
4194         (IsOverride): Update.
4195
4196 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4197
4198         Fix #73105.
4199         
4200         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4201         recursive declaration.
4202         
4203         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4204         
4205 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4206
4207         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4208         
4209         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4210
4211 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4212
4213         Fix #74797.
4214         * decl.cs (DeclSpace.FamilyAccessible): 
4215         Use TypeManager.IsNestedFamilyAccessible.
4216
4217         Fix reopened #64812.
4218         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4219         internal'.
4220
4221 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4222             Abin Thomas  <projectmonokochi@rediffmail.com>
4223             Anoob V E  <projectmonokochi@rediffmail.com>
4224             Harilal P R  <projectmonokochi@rediffmail.com>
4225
4226         Fix #64812.
4227         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4228         allow access to all static members.
4229
4230 2005-05-04  Martin Baulig  <martin@ximian.com>
4231
4232         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4233
4234 2005-05-04  Martin Baulig  <martin@ximian.com>
4235
4236         Fix #74655.
4237
4238         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4239         section at the end; make things work if `default' is not the last
4240         section.        
4241
4242 2005-05-04  Martin Baulig  <martin@ximian.com>
4243
4244         Fix #70400.
4245
4246         * statement.cs (Switch): Replaced the `got_default' field with a
4247         `default_section' one.
4248         (Switch.CheckSwitch): Set `default_section' here.
4249         (Switch.Resolve): If we're a constant switch and the constant is
4250         not found, use the default section.
4251
4252 2005-05-03  Martin Baulig  <martin@ximian.com>
4253
4254         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4255
4256         * statement.cs (Foreach.ArrayForeach): New nested class.
4257         (Foreach.TemporaryVariable): New nested class.
4258         (Foreach.EmitArrayForeach): Removed; this is now in the new
4259         ArrayForeach class.
4260
4261 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4262
4263         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4264         more conservative.
4265         (VerifyPendingMethods): Revert change below.
4266
4267         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4268         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4269         that used to trigger warning -28.  Remove warning -28.
4270         * expression.cs (Invocation.OverloadResolve): Use
4271         TypeManager.IsOverride to distinguish override methods.
4272
4273         Fix #74773.
4274         * pending.cs (VerifyPendingMethods): If a base type implements the
4275         requested interface, don't bother checking individual methods of
4276         the base type.  As a side-effect, this prevents the creation of
4277         unnecessary proxies.
4278
4279 2005-05-02  Martin Baulig  <martin@ximian.com>
4280
4281         Fix #70182.
4282
4283         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4284         Also `And' the locals if the old vector is null.
4285         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4286         null; in this case we basically reset all the variables.        
4287
4288 2005-05-02  Martin Baulig  <martin@ximian.com>
4289
4290         Fix #74529.
4291
4292         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4293         Added `FlowBranching branching' argument; always `and' the
4294         variables instead of `or'ing them unless we're an infinite loop.
4295
4296         * statement.cs (While.Resolve): Create a new sibling unless we're
4297         infinite.       
4298
4299 2005-05-02  Martin Baulig  <martin@ximian.com>
4300
4301         Fix #70140.
4302
4303         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4304         arguments; use it instead of creating a new TopLevelBlock.
4305         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4306         our ConstructorInitializer.
4307
4308         * statement.cs
4309         (TopLevelBlock.TopLevelBranching): New public property.
4310         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4311         and create our `TopLevelBranching'.
4312
4313         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4314         anonymous method host, use `block.TopLevelBranching' rather than
4315         creating a new branching.
4316
4317 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4318
4319         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4320         a ScopeInfo, if any of the current children is a child of the new
4321         entry, move those children there.
4322
4323 2005-04-30  Martin Baulig  <martin@ximian.com>
4324
4325         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4326         at the beginning of a SwitchSection.  Fix #73335.
4327
4328 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4329
4330         Fix #74378
4331         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4332         
4333         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4334         (FieldExpr.DoResolve): Obsolete members are ignored for field
4335         initializers.
4336         
4337 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4338
4339         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4340         of arrays detection.
4341
4342         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4343         verification.
4344         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4345
4346         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4347         arrays report.
4348
4349 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4350
4351         * cs-parser.jay: Use the prefered version of -unsafe in error
4352         message.
4353
4354 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4355
4356         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4357         circumstances.
4358
4359 2005-04-20  John Luke  <john.luke@gmail.com>
4360
4361         * driver.cs: fix typo in error message, --outout to --output
4362
4363 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * codegen.cs (InRefOutArgumentResolving): New field.
4366         
4367         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4368         fields outside contructor.
4369         
4370         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4371         
4372 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4373
4374         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4375         parameter code was not completed ever, so it was not as up-to-date
4376         as local variables.  Must finish it.
4377
4378         The bug fix was to compare the Toplevel of the block, not the
4379         current block.  Thanks for Ben for pointing this out. 
4380
4381 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4382
4383         * decl.cs (AddMethods): Use the declaring type of the problem
4384         method to determine if we want to squash a warning.
4385
4386 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4387
4388         * attribute.cs: Removed debug output.
4389
4390         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4391         
4392         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4393         Report.Stderr.
4394         
4395 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4396
4397         Fix #74481.
4398         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4399         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4400         all null comparisons against reference types.
4401
4402 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4403
4404         Fix# 74565
4405         * class.cs (TypeContainer.CircularDepException) New nested
4406         exception class.
4407         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4408         (TypeContainer.DefineType): Removed error, reset InTransit before
4409         exit.
4410         (Class.DefineType): Throw exception when is in Transit.
4411         Catch exception and report error.
4412         (Struct.DefineType): Throw exception when is in Transit.
4413         Catch exception and report error.
4414         (Interface.DefineType): Throw exception when is in Transit.
4415         Catch exception and report error.
4416
4417         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4418         handle nested exception handlers.
4419
4420         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4421         a catch.
4422
4423         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4424         InFinally and InCatch storage.
4425
4426         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4427         (Catch.Resolve): Set and Restore ec.InCatch.
4428         (Try.Resolve): Set and Restore ec.InFinally.
4429         (Try.HasCatch): True when try has catch.
4430
4431 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4432
4433         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4434           for the same event member, so exclude such cases from warning 419.
4435           Fixed bug #74633.
4436
4437 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4438
4439         * expression.cs (Binary.ResolveOperator): Apply patch from John
4440         Luke to fix bug 59864: operators &, | and ^ on enumerations
4441         require that the same enum type on both sides.
4442
4443         * driver.cs: Add warnings to old flag usage, this is to assist
4444         people who produce Makefiles and hope that the Makefiles will be
4445         used on Windows.
4446
4447         * class.cs (TypeContainer.EmitType): Moved the definition of the
4448         special $PRIVATE$ field from the resolve phase to the Emit phase.
4449         During resolve we do not know if we are a struct with
4450         HasExplicitLayout, we know this only after the attributes for the
4451         type are emitted.
4452
4453         Set the FieldOffset to zero on the dummy field that we create for
4454         the class.   Fixes 74590.
4455
4456 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4457
4458         Fix #73834.
4459         * ecore.cs (PropertyExpr.resolved): New.
4460         (DoResolve): Use it to handle a case of double resolution here.
4461         Handle a case of identical-name-and-type-name.
4462         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4463         resolution by storing the results of expression resolution back
4464         into the "probes" array.
4465
4466 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4467
4468         Fix cs0208-7.cs and cs0208-8.cs.
4469         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4470         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4471         error reporting to point out the reason a struct is not unmanaged.
4472
4473 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4474
4475         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4476           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4477
4478 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4479
4480         Fix #74528.
4481         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4482         IdenticalNameAndTypeName here.
4483         (EventExpr.InstanceResolve): Likewise.
4484
4485 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4486
4487         C# 2.0 DefaultCharSetAttribute implementation
4488         
4489         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4490         which allows us to set GlobalNamespace for every resolve.
4491         (Attribute.ResolveArguments): Cut from Resolve.
4492         (Attribute.GetCharSetValue): Returns CharSet named argument.
4493         (Attribute.DefinePInvokeMethod): Gets default charset from
4494         module settings.
4495         (GlobalAttribute.ResolveAsTypeStep): Override.
4496         (GlobalAttribute.ResolveArguments): Override.
4497         
4498         * class.cs (TypeAttr): Is protected.
4499         
4500         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4501         (ModuleClass.DefaultCharSetType): New memeber.
4502         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4503         
4504         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4505         charset from module.
4506         
4507         * delegate.cs (TypeAttr): Override.
4508         (Delegate.DefineType): Use this TypeAttr.
4509         
4510         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4511         at very early stage (before types are defined) to resolve model
4512         module attributes. It will probably not work with corlib but it
4513         should be ok.
4514         
4515         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4516         charset from module.
4517         
4518         * typemanager.cs (default_charset_type): New type.
4519
4520 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4521
4522         * decl.cs (MemberCache.AddMethods): Don't warn if
4523         System.Object.Finalize has buggy MethodAttributes.
4524
4525         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4526         removed below.
4527
4528 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4529
4530         * doc.cs : detect ambiguous reference to overloaded members.
4531           Fixed bug #71603. MS 1.1 csc does not detect it.
4532
4533 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4534
4535         * doc.cs : delegates must not be referenced with parameters.
4536           Fixed bug #71605.
4537
4538 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4539
4540         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4541
4542 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4543
4544         * driver.cs (MainDriver): Stop processing if the CLS stage found
4545         errors. 
4546
4547         (CompilerCallableEntryPoint.InvokeCompiler): Always
4548         reset after execution;   Take a TextWriter argument for the
4549         output.
4550
4551         * report.cs: Use the error stream instead of hardcoding stderr. 
4552
4553 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4554
4555         * class.cs: Reduce code paths to test, too small of an
4556         optimization to make it worth the extra testing.  Always perform
4557         it. 
4558
4559 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4560
4561         Fix #74510.
4562         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4563         operators that had errors reported on them.
4564
4565 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4566
4567         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4568         argument types.
4569         (Attribute.Resolve): Add named argument type checking.
4570         
4571         * class.cs (FixedField.Define): Use IsPrimitiveType
4572         
4573         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4574         
4575         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4576         unsafe parameter types.
4577         
4578         * statement.cs (Using.ResolveExpression): Add better error description.
4579         
4580         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4581         
4582 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4583
4584         Fix #74484.
4585         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4586         AttributeUsageAttribute in the emitcontext of the attribute class,
4587         not in the emitcontext of the attributable entity it was attached to.
4588         * cs-parser.jay: Use 'current_class', not 'current_container',
4589         when creating a GlobalAttribute.
4590
4591 2005-04-08  Alp Toker  <alp@atoker.com>
4592
4593         * pending.cs: The fix to #58413 failed to compile methods implementing
4594         interfaces with/without params modifiers and vice versa, even though
4595         params modifiers aren't part of the signature. Make the modifier check
4596         less strict as in csc.
4597
4598 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4599             Anoob V E  <projectmonokochi@rediffmail.com>
4600             Harilal P R  <projectmonokochi@rediffmail.com>
4601
4602         Fix #58413.
4603         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4604         modifiers of pending methods.
4605         (PendingImplementation.PendingImplementation): Initialize it.
4606         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4607         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4608         with ParameterData.  Add check for modifiers.
4609         * class.cs (MethodData.Define): Update to changes.
4610
4611 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4612
4613         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4614
4615 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4616
4617         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4618         property.
4619         
4620         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4621         
4622         * rootcontext.cs,
4623         * typemanager.cs: Registered RequiredAttributeAttribute.
4624         
4625 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4626
4627         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4628         Warning CS0169 is back at level 3.
4629         (IMethodData.SetMemberIsUsed): New method.
4630         
4631         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4632         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4633         
4634         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4635
4636         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4637         contants.
4638         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4639         is used.
4640         
4641         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4642         is used.
4643         
4644         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4645         to avoid the problems with nested types.
4646
4647 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4648             Anoob V.E  <projectmonokochi@rediffmail.com>
4649             Harilal P.R  <projectmonokochi@rediffmail.com>
4650             Raja R Harinath  <rharinath@novell.com>
4651
4652         Fix #73820.
4653         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4654         attribute.
4655         * typemanager (GetConstructor): Make public.
4656
4657 2005-04-05  John Luke  <john.luke@gmail.com>
4658             Raja R Harinath  <rharinath@novell.com>
4659
4660         Fix #62232.
4661         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4662         struct too.  Return false quicker in a few cases.
4663         (VerifyUnManaged): Use it.
4664
4665 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4666
4667         Fix #74041.
4668         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4669         not 'unreachable_seen'.
4670
4671 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4672
4673         * attribute.cs (Attribute.GetValue): Removed unused.
4674         
4675         * codegen.cs (CodeGen.TrimExt): Removed unused.
4676         
4677         * cs-parser.jay (output): Removed unused.
4678         
4679         * cs-tokenizer.cs (hex_digits): Removed unused.
4680         
4681         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4682         
4683         * expression.cs (Indirection.LoadExprValue): Removed unused.
4684         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4685         
4686         * iterators.cs (Iterator.param_types): Removed unused.
4687         
4688         * statement.cs (Goto.block): Removed unused.
4689         (ToplevelBlock.did): Removed unused.
4690         (Switch.ResolveConstantSwitch): Removed unused.
4691
4692 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4693
4694         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4695         resetting thingy.
4696
4697 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4698
4699         Fix #74232 and cs0208-3.cs.
4700         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4701         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4702         unmanaged type.  Don't use FieldBuilders when 't' is a
4703         TypeBuilder.  Use ModFlags and MemberType fields.
4704         * class.cs (MemberBase.member_type): Rename from MemberType.
4705         (MemberBase.MemberType): New property.  Determines member_type on
4706         demand.
4707         (MemberBase.DoDefine): Don't initialize MemberType here.
4708         (FieldMember.Define): Likewise.
4709
4710 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4711
4712         Fix #74241
4713         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4714         Attributes are emitted there.
4715         
4716 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4717
4718         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4719         keyword in 'partial enum' too.
4720         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4721         is not allowed).
4722         Report from Kamil Skalski <nazgul@omega.pl>.
4723
4724         Fix #74309.
4725         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4726         have partial containers too.
4727
4728         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4729         in block' checks to Block.CheckInvariantMeaningInBlock.
4730         * statement.cs (Block.GetKnownVariableInfo): Make private.
4731         (Block.IsVariableUsedInChildBlock): Remove.
4732         (Block.IsVariableUsedInBlock): Likewise.
4733         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4734         conflicting declaration.
4735         (Block.AddVariable): Make error messages less long-winded and more
4736         specific.  Show location of conflicting declaration.
4737         * parameter.cs (Parameters.Location): New readonly property.
4738
4739 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4740
4741         Clean up semantics of invoking ResolveMemberAccess.
4742         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4743         can have an instance, ensure that we pass in a non-TypeExpression
4744         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4745         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4746         argument.  Update to changes and simplify.
4747         (FieldExpr.Emitinstance): Remove CS0120 check.
4748         (PropertyExpr.EmitInstance): Likewise.
4749         * expression.cs (Argument.Resolve): Likewise.
4750         (Invocation.DoResolve): Update to changes in semantics of
4751         InstanceExpression.
4752
4753 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4754
4755         Fix #74241
4756         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4757         customization.
4758         
4759         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4760
4761 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4762
4763         Fix difference in behaviour with commandline invocation.
4764         * driver.cs (Driver.Reset): New.
4765         (CompilerCallableEntryPoint): Call it.
4766
4767         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4768         variable" warnings if the boolean expression failed to resolve.
4769
4770 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4771
4772         * attribute.cs: Fix the union of several permissions when some of them
4773         are unrestricted (so the result isn't an unrestricted permission set).
4774         Fix #74036.
4775
4776 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4777
4778         * ecore.cs (MemberExpr): New class.  Convert from interface
4779         IMemberExpr.
4780         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4781         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4782         error checks.
4783         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4784         (MethodGroupExpr.IsExplicitImpl): Remove.
4785         (Expression.GetFieldFromEvent): Remove.
4786         (SimpleName.MemberStaticCheck): Remove.
4787         (SimpleName.DoSimpleNameResolve): Update to changes.
4788         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4789         (MemberAccess.IdenticalNameAndTypeName): Remove.
4790         (MemberAccess.error176): Move to MemberExpr.
4791         (MemberAccess.DoResolve): Update to changes.
4792         (BaseAccess.DoResolve): Likewise.
4793
4794 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4795
4796         C# 2.0 Conditional attribute class implementation
4797         
4798         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4799         Analyzes class whether it has attribute which has ConditionalAttribute
4800         and its condition is not defined.
4801         
4802         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4803         (Class.IsExcluded): New method. Search for at least one defined
4804         condition in ConditionalAttribute of attribute class.
4805
4806 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4807
4808         * ecore.cs (PropertyExpr): Derive from Expression, not
4809         ExpressionStatement.
4810         (PropertyExpr.EmitStatement): Remove.
4811
4812 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4813
4814         Fix #74060.
4815         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4816         internal field "value__" of an enum be private.  The examples for
4817         "value__" that I found on MSDN all used FieldAttributes.Private.
4818
4819         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4820         Don't mention IL method attribute names.
4821
4822         Fix #47991.  Remove a TODO.
4823         * statement.cs (Block.Toplevel): Make into a field.
4824         (Block.Parameters): Move into ToplevelBlock.
4825         (Block.known_variables): Rename from child_variable_names.
4826         (Block.Block): Remove variants that take Parameters.  Initialize
4827         'Toplevel' with the immediately surrounding toplevel block.
4828         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4829         LocalInfo parameter.
4830         (Block.GetKnownVariableInfo): New.
4831         (Block.IsVariableNameUsedInChildBlock): Update.
4832         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4833         the block, even though it may not be in scope.
4834         (Block.AddVariable): Remove Parameters parameter.  Use
4835         Toplevel.Parameters instead.
4836         (Block.AddConstant): Remove Parameters parameter.
4837         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4838         (Block.IsParamaterReference): Likewise.
4839         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4840         (ToplevelBlock.Parameters): New.  Moved from Block.
4841         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4842         initialize Parameters to a non-null value.
4843         * cs-parser.jay: Update to changes.
4844         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4845         simple names that mean different things in the same block.  Use
4846         Block.IsVariableNameUsedInBlock.
4847
4848 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4849
4850         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4851         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4852         GetTypeHandle.  It is possible for a reflected type to derive from
4853         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4854         System.Array during mscorlib compilation).
4855         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4856         contain a method_hash, don't create one either.  Don't create a
4857         deep copy of the base cache's method_hash.
4858         (MemberCache.SetupCache): Rename back from DeepCopy.
4859         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4860         already initialized.  If we see an override function, add its
4861         underlying base virtual function to the member_hash too.
4862
4863         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4864
4865 2005-03-26  Raja R Harinath  <harinath@acm.org>
4866
4867         Fix #73038.
4868         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4869         fails to resolve, ensure that the LHS is still resolved as an
4870         lvalue.
4871
4872 2005-03-25  Raja R Harinath  <harinath@acm.org>
4873
4874         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4875         ec.ContainerType.
4876         (Enum.current_ec): Remove.
4877         (Enum.LookupEnumValue): Remove EmitContext argument.
4878         Just uses the one created during DefineType.
4879         (Enum.FindMembers): Update.
4880         * expression.cs (MemberAccess.DoResolve): Update.
4881
4882 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4883
4884         * assign.cs (Assign.DoResolve): Check for CS1717 when
4885         source and target are same (uses Equals).
4886
4887         * expression.cs (LocalVariableReference, ParameterReference,
4888         This): Implemented Equals, GetHashCode.
4889
4890         * statement.cs (Block.GetParameterReference): Removed useless
4891         local variable.
4892
4893 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4894
4895         Fix cs0128.cs
4896         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4897         blocks before deciding whether the error is cs0136 or cs0128.
4898
4899         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4900         (using_alias_directive, using_namespace_directive): Pass
4901         MemberName, not an expression to Namespace.UsingAlias and
4902         Namespace.Using.
4903         (MakeName): Use the MemberName of the namespace.
4904         * namespace.cs (Namespace.MemberName): New.
4905         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4906         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4907         Likewise.
4908         * decl.cs (MemberName.Name): Make readonly.
4909         (MemberName.FromDotted): New "constructor".
4910         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4911         (MemberCore.Name): Compute from MemberName on demand.
4912         (MemberCore.SetMemberName): Provide a way to change the
4913         MemberName.
4914         (MemberCore.AddToContainer): Don't take a fullname parameter.
4915         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4916         fully qualified name of the container to the member name.
4917         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4918         only if the type is a member of the root container.
4919         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4920         MemberName.Left rather than searching for an embedded ".".
4921         (PartialContainer.CreatePart): Update to changes in RootContext.
4922         (MemberBase.ShortName): Turn into a property.  Use
4923         MemberCore.SetMemberName.
4924         (MemberBase.ExplicitInterfaceName): Remove.
4925         (MemberBase.UpdateMemberName): Remove.
4926         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4927         (PropertyBase.SetMemberName): New override.
4928         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4929         (Tree.GetDecl): New.
4930         (Tree.AllDecls): Rename from Decls.
4931         * attribute.cs, enum.cs, report.cs: Update to changes.
4932         * driver.cs (MainDriver): Use MemberName.FromDotted on
4933         RootContext.MainClass.
4934
4935 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4936
4937         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4938         checks.
4939
4940         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4941
4942 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4943
4944         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4945         property accessor modifiers.
4946
4947         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4948         fixed buffer attribute (CS1716).
4949         (PropertyMethod.HasCustomAccessModifier): When property accessor
4950         has custom modifier.
4951
4952         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4953         modifiers.
4954         (PropertyExpr.DoResolveLValue): Add CS0272.
4955
4956 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4957
4958         * convert.cs: When converting to a pointer, use the proper Conv.U
4959         or Conv.I depending on the source data type.
4960
4961         * cs-tokenizer.cs: Make the size for large decimal constants,
4962         fixes #72957.
4963
4964 2005-03-17  Martin Baulig  <martin@ximian.com>
4965
4966         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4967         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4968
4969 2005-03-17  Martin Baulig  <martin@ximian.com>
4970
4971         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4972         to bool so we can return an error condition.
4973         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4974         returned an error.
4975
4976 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4977
4978         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4979         attributes.
4980
4981 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4982
4983         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4984         Refactor to avoid traversing the list of assemblies, and to avoid
4985         string concatenation.
4986         * typemanager.cs (guid_attr_type): Remove.
4987         (negative_hits, pointers, references): Remove hashes.
4988         (type_hash): New.
4989         (GetConstructedType): New.  Uses type_hash to handle constructed
4990         types (arrays, references, pointers).
4991         (GetReferenceType, GetPointerType): Use it.
4992         (GetNestedType): New.  Uses type_hash to handle nested types of
4993         reflected types.
4994         (LookupType, LookupTypeDirect): Remove.
4995         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4996         'types' hash and LookupTypeReflection directly.
4997         (params_string, params_object): Use GetConstructedType.
4998         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4999         top-level types.
5000         (Namespace.Lookup): Use cached_types.
5001         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5002         provided by old TypeManager.LookupType.
5003         * rootcontext.cs (MakeFQN): Remove.
5004         * decl.cs (DeclSpace.MakeFQN): Likewise.
5005         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5006         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5007         TypeManager.GetConstructedType.
5008         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5009
5010 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5011
5012         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5013         indexers.
5014
5015         * cs-parser.jay: Reports CS1527 for any namespace element.
5016
5017         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5018         Added CS0407.
5019
5020         * expression.cs (ParameterReference.IsAssigned): Changed error to
5021         CS0269.
5022         (Error_WrongNumArguments): Moved CS0245 detection here.
5023
5024         * statement.cs (Return.Resolve): Add CS1622 report.
5025
5026 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5027
5028         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5029
5030 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5031
5032         * attribute.cs expression.cs: Get rid of some allocations.
5033
5034 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5035
5036         * doc.cs : just eliminate the latest change.
5037
5038 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5039
5040         * doc.cs : commented out the latest change. It breaks xml-030.cs
5041
5042 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5043
5044         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5045           fail. So invoke CreateType() in FindDocumentedType().
5046
5047 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5048
5049         * cs-tokenizer.cs : added IsKeyword().
5050         * doc.cs : Detect keyword incorrectly used as identifier.
5051           Allow identifiers prefixed by @.
5052
5053 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5056         It caused exception in namespace resolving (again!).
5057         
5058         * class.cs (Class.ctor): Removed exit.
5059         (PropertyMethod.ctor): ditto.
5060         
5061         * codegen.cs (Codegen.Reset): Reset static data.
5062         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5063         
5064         * cs-tokenizer.cs (Cleanup): Removed.
5065         
5066         * driver.cs (GetSystemDir): Rewrote to one line command.
5067         It caused problem with unloaded dynamic modules.
5068         (UnixParseOption): Removed Exit.
5069         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5070         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5071         Now can be mcs used as library.
5072         
5073         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5074         empty location.
5075         
5076         * location.cs (Reset): Reset static data.
5077         
5078         * namespace.cs (Reset): Reset static data.
5079         
5080         * report.cs (Report.Reset): Reset static data.
5081         
5082         * rootcontext.cs (RootContext.Reset): Reset static data.
5083         
5084         * tree.cs (RootTypes.ctor): Use Location.Null
5085         
5086         * typemanager.cs (TypeManager.Reset): Reset static data.
5087         (CoreLookupType): Removed Exit.
5088         (TypeHandle.Reset): Reset static data.
5089         
5090 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5091
5092         Fix #73516.
5093         * typemanager.cs (ComputeNamespaces): Import namespaces from
5094         referenced modules too.
5095
5096 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5097
5098         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5099         than '.'.
5100
5101 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5102
5103         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5104         enclosing DeclSpace.  This ensures that a name-lookup populates
5105         more caches and there are fewer 'TypeExpression's.  Carve out
5106         nested type lookup into ...
5107         (LookupNestedTypeInHierarchy): ... this.
5108
5109 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5110
5111         Clean up a few partial-class semantics.  
5112         Fixes test-357.cs and cs1618-2.cs.
5113         * cs-parser.jay (struct_declaration): Use 'current_class' as
5114         parent of newly-created struct.  Remove call to Register ().
5115         Use 'pop_current_class' to complete handing the current struct.
5116         (interface_declaration): Likewise.
5117         (class_declaration): Likewise.
5118         (enum_declaration): Use 'current_class' as parent of newly created
5119         enum.
5120         (delegate_declaration): Likewise.
5121         (pop_current_class): New function.  This is used to handle closing
5122         up the 'current_class' and 'current_container', and pointing them
5123         to the enclosing class/container.
5124         (CSharpParser): Initialize 'current_class' too.
5125         * decl.cs (MemberCore): Add check for invariant: a partial
5126         container is not a parsed entity, and thus does not enclose any
5127         parsed members.
5128         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5129         (DeclSpace.BaseTypeExpr): Use it.
5130         (DeclSpace.LookupType): Add check for invariant.
5131         * class.cs (TypeContainer): Add check for invariant: a nested
5132         class should have the same NamespaceEntry as its enclosing class.
5133         (TypeContainer.EmitFieldInitializers): Make virtual.
5134         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5135         MemberCore.
5136         (TypeContainer.Register): Remove.
5137         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5138         null.  Use TypeResolveEmitContext for resolving base types and
5139         interfaces.  Move initialization of Parts.TypeBuilder here from
5140         ...
5141         (TypeContainer.DefineNestedTypes): ... here.
5142         (PartialContainer): Take a Namespace not a NamespaceEntry.
5143         (PartialContainer.Create): Don't use Register.  Call the
5144         appropriate Add... function directly.
5145         (ClassPart): Take both the PartialContainer and the enclosing
5146         class as constructor arguments.
5147         (ClassPart.EmitFieldInitializers): Override.
5148         (ClassPart.PartFindNestedTypes): Remove.
5149         (FieldBase.GetInitializerExpression): Resolve the initializer
5150         expression in the emit context of the enclosing class.
5151         * tree.cs (RootTypes): Remove Register ().
5152         
5153 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5154
5155         * cs-parser.jay: Removed CS0134.
5156         
5157         * driver.cs: Removed CS1901.
5158         
5159         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5160         for predefined types.
5161
5162 2005-03-07  Duncan Mak  <duncan@novell.com>
5163
5164         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5165         well. Fixes bug #73454.
5166
5167 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5168
5169         * cs-tokenizer.cs (xtoken): Add CS1035.
5170         
5171         * class.cs (MethodData.Define): Add CS0683.
5172         (FieldMember.ctor): Add CS0681.
5173
5174 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5175
5176         * ecore.cs (SimpleName.DoResolve): Rename from
5177         SimpleName.DoResolveAllowStatic.
5178         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5179         Pass 'intermediate' flag to MemberStaticCheck.
5180         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5181         of "intermediate" lookups via MemberAccess.
5182         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5183         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5184
5185 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5186
5187         Fix #73394.
5188         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5189         slipped in because of variable names that are identical to a
5190         builtin type's BCL equivalent ('string String;', 'int Int32;').
5191         (PropertyExpr.EmitInstance): Likewise.
5192
5193 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5194
5195         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5196         
5197         * report.cs (warning_ignore_table): Made public.
5198
5199 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5200
5201         Fix #73282.
5202         * class.cs (MethodData.Emit): Pass 'container' to
5203         container.GetObsoleteAttribute instead of 'container.Parent'.
5204
5205 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5206
5207         * cs-parser.jay: Add 1534 error test.
5208
5209         * iterators.cs (Yield.CheckContext): Add error 1629.
5210         (Iterator.ctor): Save unsafe modifier.
5211         (MoveNextMethod.DoEmit): Restore unsafe context.
5212
5213         * namespace.cs (UsingAlias): Better error message.
5214
5215 2005-03-03  Dan Winship  <danw@novell.com>
5216
5217         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5218         the warning message [#73219]
5219
5220 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5221
5222         Fix compile with MCS 1.0.0.0.
5223         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5224         w_restore to not depend on string constant folding.
5225
5226 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5227
5228         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5229         CS0246 check to users who passed 'silent = false'.
5230         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5231         check.
5232         (SimpleName.SimpleNameResolve): Update.
5233         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5234         (MemberAccess.IdenticalNameAndTypeName): Update.
5235         * doc.cs (FindDocumentedTypeNonArray): Update.
5236
5237 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5238
5239         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5240         * parameters.cs (ComputeAndDefineParameters): Remove.
5241         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5242         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5243         Use GetParameterInfo.
5244
5245 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5246
5247         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5248
5249 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5250
5251         Unify DeclSpace.LookupType and DeclSpace.FindType.
5252         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5253         is in charge of defining nested types on demand.
5254         (DeclSpace.LookupType): Use it when the current_type is a
5255         TypeBuilder.  Use LookupTypeDirect for reflected types.
5256         (DeclSpace.FindType): Remove.
5257         (DeclSpace.LookupInterfaceOrClass): Likewise.
5258         (DeclSpace.DefineTypeAndParents): Likewise.
5259         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5260         DeclSpace.LookupType.
5261         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5262         * typemanager.cs (LookupType): Simplify.
5263         (AddUserType): Remove type from negative_hits.
5264         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5265         * class.cs (TypeContainer.FindMembers): Move handling of nested
5266         types ...
5267         (TypeContainer.FindMembers_NestedTypes): ... here.
5268         (TypeContainer.FindNestedType): Implement override.
5269         (ClassPart.FindNestedType): Delegate to PartialContainer.
5270         (ClassPart.PartFindNestedType): Looks up the nested types of the
5271         part alone.
5272
5273 2005-03-02  Martin Baulig  <martin@ximian.com>
5274
5275         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5276         static constructor in static classes.
5277
5278 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5279
5280         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5281         sizeParamIndex is not specified.
5282
5283 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5284
5285         Fix #73117
5286         * report.cs (WarningMessage.IsEnabled): Missing null check.
5287
5288 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5289
5290         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5291         in the fields and not in the properties.
5292
5293 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5294
5295         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5296         fields as well.
5297
5298 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5299
5300         * attribute.cs: Small refactoring (improved robustness).
5301         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5302         (ValidateGuid): Removed.
5303         (Resolve): Removed referenced to above mentioned.
5304         (GetAttributeUsage): Made private and changed to work without
5305         class assistance.
5306         (GetIndexerAttributeValue): Don't crash.
5307         (GetConditionalAttributeValue): Ditto.
5308         (GetClsCompliantAttributeValue): Ditto.
5309         (ExtractSecurityPermissionSet): All attributes exceptions are
5310         error 648.
5311         (GetPropertyValue): New helper.
5312         (GetMethodImplOptions): New method.
5313         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5314         some missing properties.
5315         
5316         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5317         (Method.ApplyAttributeBuilder): Updated.
5318         
5319         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5320         exception.
5321
5322 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5323
5324         Fix #73052.
5325         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5326         non-simple types (array, pointer, reference).
5327
5328 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5329
5330         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5331
5332         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5333         for operators.
5334         (Method.CheckBase): Catch wrong destructor here.
5335         (MethodData.Define): Add errors 550, 668.
5336
5337         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5338
5339         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5340
5341         * pending.cs (VerifyPendingMethods): Add error 551.
5342
5343         * typemanager.cs (CSharpName): Next error report helper.
5344
5345 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5348         attributes. Removed useless attribute double check.
5349         It saves almost 2MBs for corlib.
5350
5351 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5352
5353         Fix #72924.
5354         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5355         called twice in case of error.
5356
5357 2005-02-23  Chris Toshok  <toshok@ximian.com>
5358
5359         Fix compiler portions of #72827.
5360         * statement.cs (Block.Emit): call Begin/EndScope on the
5361         EmitContext instead of the ILGenerator.
5362
5363         * codegen.cs (EmitContext.BeginScope): new method, call
5364         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5365         we have one.)
5366         (EmitContext.BeginScope): same, but EndScope and CloseScope
5367
5368         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5369         offset and call the superclass's OpenScope(int) with it.
5370         (SymbolWriter.CloseScope): get the current il
5371         offset and call superclass's CloseScope(int) with it.
5372
5373 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5374
5375         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5376         CS1677 for out and ref as well.
5377
5378         * class.cs (Method.Define): Add error CS1599 detection.
5379         
5380         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5381         
5382         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5383         
5384         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5385         
5386         * support.cs.cs (ModifierDesc): New helper method.
5387
5388 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5389             Abin Thomas  <projectmonokochi@rediffmail.com>
5390             Anoob V E  <projectmonokochi@rediffmail.com>
5391             Harilal P R  <projectmonokochi@rediffmail.com>
5392
5393         Fix #57851, #72718.
5394         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5395         MemberLookup (used for error reporting) actually returns a result.
5396         Fix error report number (122, not 112).
5397
5398 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5399             Anoob V E  <projectmonokochi@rediffmail.com>
5400             Harilal P R  <projectmonokochi@rediffmail.com>
5401
5402         Fix #71134.
5403         * pending.cs (PendingImplementation.GetAbstractMethods):
5404         Find NonPublic members too.
5405
5406 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5407
5408         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5409         Fixed error 217.
5410         
5411         * class.cs (MethodCore.CheckMethodAgainstBase):
5412         Add error 239 report.
5413
5414 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5415
5416         Fix #68955.
5417         * expression.cs (Invocation.IsApplicable): Make public.
5418         (Invocation.IsParamsMethodApplicable): Likewise.
5419         * delegate.cs (Delegate.VerifyApplicability): Don't use
5420         Invocation.VerifyArgumentCompat for parameter applicability
5421         testing.  Use Invocation.IsApplicable and
5422         Invocation.IsParamsMethodApplicable.
5423
5424 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5425
5426         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5427         
5428         * class.cs (Operator.Define): Add error 217 report.
5429         
5430 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5431
5432         * namespace.cs (UsingEntry.Resolve): Undo change below.
5433
5434 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5435
5436         Fix #72756.
5437         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5438         disable the error message when the extended MemberLookup also
5439         fails.
5440         (Expression.MemberLookupFinal): Update.
5441         (SimpleName.DoSimpleNameResolve): Update.
5442         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5443         Don't use MemberLookupFinal.
5444         (New.DoResolve): Update.
5445         (BaseAccess.CommonResolve): Update.
5446
5447 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5448
5449         Fix #72732.
5450         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5451         occured previously, don't resolve again.
5452
5453 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5454
5455         Fix #69949
5456         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5457         argument. Call ResolveAttributeUsage for unresolved.
5458         when types doesn't match ctor arguments.
5459         
5460         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5461         for nested attribute classes.
5462         (Class.attribute_usage): Removed.
5463         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5464         for attribute class.
5465         
5466         * ecore.cs (IsAttribute): Removed.
5467         
5468         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5469         
5470         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5471         now normal types.
5472         (attribute_types): Removed.
5473         (EmitCode): Global attributes are emited as the latest.
5474
5475 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5476
5477         * class.cs (EmitFieldInitializers): Don't emit field initializer
5478         for default values when optimilization is on.
5479         
5480         * constant.cs (Constant.IsDefaultValue): New property.
5481         
5482         * driver.cs: Add /optimize handling.
5483         
5484         * constant.cs,
5485         * ecore.cs,
5486         * literal.cs: Implement new IsDefaultValue property.
5487         
5488         * rootcontext.cs (Optimize): New field, holds /optimize option.
5489
5490 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5491
5492         Fix crasher in re-opened #72347.
5493         * namespace.cs (Namespace.Lookup): Return null if
5494         DeclSpace.DefineType returns null.
5495
5496         Fix #72678.
5497         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5498
5499 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5500
5501         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5502         now returns null if it cannot resolve to an lvalue.
5503         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5504         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5505         returned null.  Remove check for SimpleName.
5506         (EventExpr.DoResolveLValue): New.
5507         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5508         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5509         error from ...
5510         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5511         avoid CS0131 error.
5512         (Unary.ResolveOperator): Move CS0211 check ...
5513         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5514         CS0131 error.
5515         (Unary.DoResolveLValue): Simplify.
5516         (AddressOf.DoResolveLValue): New.
5517         (ArrayAccess.DoResolveLValue): New.
5518
5519 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5520
5521         * attribute.cs (Attribute.Resolve): Add arguments casting for
5522         when types doesn't match ctor arguments.
5523
5524 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5525
5526         Fix parts of #63202.
5527         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5528         lookup of operator in base type.  Ensure that all checks happen
5529         when the operator resolves to an "op_..." method.
5530
5531 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5532
5533         Fix #71992.
5534         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5535         'ignore_cs0104' parameter.  Pass it to ...
5536         (NamespaceEntry.Lookup): ... this.
5537         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5538         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5539         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5540         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5541         Update.  Request that cs0104 errors be ignored.
5542         (ComposedCast.ResolveAsTypeStep): Update.
5543
5544 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5545
5546         Fix #59209.
5547         * expression.cs (Invocation.BetterFunction): Remove support for
5548         comparing virtual functions and their overrides.
5549         (Invocation.IsOverride): New.
5550         (Invocation.OverloadResolve): Don't consider 'override' functions
5551         during candidate selection.  Store them in a lookaside list.
5552         If the selected method is a 'virtual' function, use the list to
5553         find any overrides that are closer to the LHS type.
5554
5555 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5556
5557         * expression.cs (New.DoResolve): Add complex core type reduction.
5558         (New.Constantify): Converts complex core type syntax like 'new int ()'
5559         to simple constant.
5560         
5561 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5562
5563         * decl.cs (EntryType.EntryType): New constructor to create an
5564         updated copy of a cache entry.
5565         (MemberCache.AddMethods): Use it.
5566         (MemberCache.ClearDeclaredOnly): Remove.
5567         (MemberCache.MemberCache): Update.
5568
5569 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5570
5571         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5572         variable.  This one is represents the actual low-level declaration
5573         of the method, as opposed to the semantic level `IsStatic'.   
5574
5575         An anonymous method which is hosted into a static method might be
5576         actually an instance method.  IsStatic would reflect the
5577         container, while MethodIsStatic represents the actual code
5578         generated.
5579
5580         * expression.cs (ParameterReference): Use the new MethodIsStatic
5581         instead of IsStatic.
5582
5583         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5584         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5585         set on the current EmitContext. 
5586
5587         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5588         resolve our casted expression as an LValue.  This triggers the
5589         proper LValue processing that is later required by Assign.
5590
5591         This fixes 72347.
5592
5593         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5594
5595 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5596
5597         C# 2.0 Fixed buffer implementation
5598
5599         * anonymous.cs: Update after RegisterHelperClass renaming.
5600
5601         * attribute.cs (AttributeTester.fixed_buffer_cache):
5602         Cache of external fixed buffers.
5603         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5604         implementation if field is fixed buffer else null.
5605
5606         * class.cs
5607         (TypeContainer.AddField): Accept FieldMember instead of Field.
5608         (FieldBase.IsFieldClsCompliant): Extracted code from
5609         VerifyClsCompliance descendant customization.
5610         (FixedField): New class handles fixed buffer fields.
5611         (FixedFieldExternal): Keeps information about imported fixed
5612         buffer.
5613         (IFixedField): Make access to internal or external fixed buffer
5614         same.
5615
5616         * cs-parser.jay: Add fixed buffer parsing.
5617
5618         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5619         buffer.
5620
5621         * expression.cs (Indirection): Extended implementation to accept
5622         fixed buffer field.
5623         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5624         (ElementAccess.MakePointerAccess): Get type as parameter.
5625         (DoResolve): Add fixed buffer field expression conversion.
5626         (DoResolveLValue): Ditto.
5627         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5628         (ArrayPtr): Derives from FixedBufferPtr.
5629         (ArrayPtr.Emit): Add extra emit for array elements.
5630
5631         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5632
5633         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5634         for compiler generated types.
5635         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5636
5637         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5638         and consume less memory.
5639         (Fixed.Resolve): Add fixed buffer case.
5640
5641         * typemanager.cs (compiler_generated_attr_ctor,
5642         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5643         (HasElementType): Add our own implementation to work on every
5644         runtime.
5645
5646 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5647
5648         * anonymous.cs (CaptureContext): Track whether `this' has been
5649         referenced.   
5650
5651         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5652         only captured `this' if it was implicitly done (instance
5653         methods/variables were used). 
5654
5655         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5656         `this' must be captured.
5657
5658 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5659  
5660         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5661         is null it means that there has been no need to capture anything,
5662         so we just create a sibling.
5663
5664         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5665
5666         Just a partial fix.  The other half is fairly elusive.
5667         
5668 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5669
5670         Fix #52586, cs0121-4.cs.
5671         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5672         and return a hashtable.
5673         (MemberCache.ClearDeclaredOnly): New.
5674         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5675         the method_hash of a base type too.
5676         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5677         type methods.  Overwrite entries with the same MethodHandle so
5678         that the ReflectedType is correct.  The process leaves in base
5679         virtual functions and their overrides as distinct entries.
5680         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5681         matters since it was boxed in a ArrayList before.
5682         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5683         modifier.
5684         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5685         case of a virtual function and its override (choose the overload
5686         as better).
5687         (Invocation.OverloadResolve): Avoid 'override' members during
5688         'applicable_type' calculation.
5689
5690 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5691
5692         Combine two near-redundant caches.
5693         * typemanager.cs (method_params): Rename from method_internal_params.
5694         (TypeManager.GetParameterData): New.  Replace
5695         Invocation.GetParameterData.
5696         (TypeManager.LookupParametersByBuilder): Remove.
5697         * expression.cs (Invocation.method_parameter_cache): Remove.
5698         (Invocation.GetParameterData): Remove.
5699         Update to changes.
5700         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5701         Update to changes.
5702
5703 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5704
5705         Fix #72015.
5706         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5707         TypeManager.multicast_delegate_type is null, resolve it by looking
5708         up "System.MulticastDelegate".
5709         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5710
5711 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5712             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5713             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5714
5715         Fix cs0164.cs.
5716         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5717         (LabeledStatement.AddReference): New.  Set 'referenced'.
5718         (Goto.Resolve): Use it.
5719
5720 2005-02-05  John Luke  <john.luke@gmail.com>
5721
5722         * driver.cs: remove duplicate -doc line in Usage ()
5723
5724 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5725
5726         * location.cs (Location.AddFile): Fix CS2002 error report.
5727
5728 2005-02-02  Martin Baulig  <martin@ximian.com>
5729
5730         * delegate.cs (Delegate.DefineType): Report an internal error if
5731         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5732         details.        
5733
5734 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5735
5736         Fix a crasher in a variant of #31984.
5737         * const.cs (Constant.CheckBase): New override that defers the
5738         new-or-override check in case the base type hasn't been populated
5739         yet.
5740         (Constant.Define): Ensure the new-or-override check is performed.
5741
5742 2005-02-01  Duncan Mak  <duncan@ximian.com>
5743
5744         * const.cs (LookupConstantValue): Check that `ce' is not null
5745         before calling GetValue ().
5746
5747 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5748
5749         Fix test-334.cs (#69519).
5750         * cs-parser.jay (using_alias_directive): Pass in an expression to
5751         NamespaceEntry.UsingAlias.
5752         (using_namespace_directive): Pass in an expression to
5753         NamespaceEntry.Using.
5754         (namespace_name): Don't flatten to a string.
5755         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5756         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5757         ResolveAsTypeStep.
5758         (NamespaceEntry.UsingEntry): Likewise.
5759         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5760         changes.
5761         (NamespaceEntry.LookupForUsing): Remove.
5762         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5763         names.
5764         (NamespaceEntry.Lookup): Remove support for dotted names.
5765
5766 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5767
5768         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5769         split into two.
5770         (NamespaceEntry.ImplicitParent): Compute on demand.
5771         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5772         parallels the current.
5773         (NamespaceEntry.LookupForUsing): Use it.
5774         (NamespaceEntry.Lookup): If the current namespace-entry is
5775         implicit, don't search aliases and using tables.
5776
5777 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5778
5779         Fix #31984.
5780         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5781         BaseCache here.
5782         (TypeContainer.BaseCache): Compute on demand.
5783         (TypeContainer.FindMembers): Define constants and types if they're
5784         not already created.
5785         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5786         check.
5787         * const.cs (Constant.Define): Make idempotent.
5788
5789 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5790
5791         * pending.cs: Produce better code (no nops produced by using Ldarg
5792         + value).
5793         
5794         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5795         i - 1' it should be arg + 1.
5796
5797         Fixes bug #71819.
5798
5799 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5800
5801         * attribute.cs (Attribute.CheckAttributeType): Make private
5802         non-virtual.
5803         (Attribute.ResolveType): Make virtual.
5804         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5805         handling of RootContext.Tree.Types.
5806
5807 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5808
5809         Update attribute-handling to use the SimpleName/MemberAccess
5810         mechanisms.
5811         * cs-parser.jay (attribute): Pass in an expression to the
5812         constructors of Attribute and GlobalAttribute.
5813         * attribute.cs (Attribute): Take an expression for the name.
5814         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5815         passed in attribute name expression.
5816         (Attribute.CheckAttributeType): Use it.
5817         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5818         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5819         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5820         argument to prevent error messages if the lookup fails.
5821
5822 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5823
5824         * expression.cs (Indirection): Implemented IVariable interface
5825         to support indirection in AddressOf operator.
5826         (PointerArithmetic.Emit): Add optimalization for case where
5827         result can be precomputed.
5828
5829 2005-01-26  Martin Baulig  <martin@ximian.com>
5830
5831         * class.cs (TypeContainer.AttributeTargets): Return the correct
5832         AttributeTargets depending on our `Kind' instead of throwing an
5833         exception; fixes #71632.
5834
5835 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5836
5837         Fix #71257
5838         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5839         constant members.
5840
5841 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5842
5843         Fix #71602.
5844         * expression.cs (MemberAccess.DoResolve): Don't complain with
5845         cs0572 when the LHS of a member access has identical name and type
5846         name.
5847
5848 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5849
5850         Fix #71651, #71675
5851         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5852         CreatePermission.
5853         Create custom PermissionSet only for PermissionSetAttribute.
5854
5855 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5856
5857         Fix #71649
5858         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5859         delegates in static class.
5860
5861 2005-01-24  Martin Baulig  <martin@ximian.com>
5862
5863         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5864         merging an implicit block, just use its reachability.
5865
5866         * statement.cs (Block.Resolve): Make the unreachable code check
5867         work wrt. implicit blocks; see test-337 from #63842.
5868
5869 2005-01-21  Alp Toker  <alp@atoker.com>
5870  
5871         * cs-parser.jay: destructor_declaration's container is PartialContainer
5872         not Class when partial types are used, so use Kind prop instead of
5873         'is'.
5874         
5875 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5876
5877         * cs-parser.jay: Improve error reporting when an interface
5878         declares new types.
5879
5880 2005-01-20  Dick Porter  <dick@ximian.com>
5881
5882         * support.cs: SeekableStreamReader fix from Sandor Dobos
5883         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5884         chars are read.  Fixes bug 70369.
5885
5886 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5887
5888         * cs-parser.jay (catch_clause): Simplify current_block handling
5889         somewhat.
5890
5891 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5892
5893         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5894         code with ImplicitStandardConversion to handle the implicit
5895         conversion of method groups into valid delegate invocations. 
5896
5897         The problem is that in parameter handling we were using this code
5898         path.  Fixes bug #64698
5899
5900 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5901
5902         * cs-parser.jay: Fix several infelicities.
5903         - Avoid assigning to the parser value stack.  Code like 
5904           '$3 = null' is unclean.  Synthesize a value for the code block
5905           instead. 
5906         - Avoid using oob_stack for storing location information.  Use ...
5907         (_mark_): ... this.  New (empty) rule.  Saves the current location
5908         in $$.
5909         (foreach_statement): Avoid using oob_stack for current_block
5910         handling.  Use technique used in for_statement and
5911         using_statement.  Synthesize a value for the code block to store
5912         additional intermediate information.
5913
5914 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5915
5916         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5917         of a different type is only allowed to private fields of a
5918         containing type, not on fields of a base class.
5919
5920         See test-174.cs and error cs0122-9.cs
5921
5922 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5923
5924         Fix test-335.cs (bug #58126).
5925         * cs-parser.jay (argument): Split out non-expression parts of the
5926         rule into 'non_simple_argument'.
5927         (invocation_expression): Support parenthesized invocations with
5928         multiple arguments, and with single non-simple arguments.
5929
5930 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5931
5932         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5933         places.
5934
5935 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5936
5937         Fix cs0038-1.cs, cs1640-6.cs.
5938         * ecore.cs (Expression.Resolve): Remove special-case for
5939         SimpleName in error-handling.
5940         (Expression.almostMatchedMembers): Relax access permission to
5941         protected.
5942         (Expression.MemberLookupFailed): Handle duplicates in
5943         almostMatchedMembers list.
5944         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5945         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5946         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5947         overload if the passed in MemberInfo is a MethodBase.
5948
5949 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5950
5951         Fix #70749
5952         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5953         for non-CAS & merge permission sets properly.
5954
5955 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5956
5957         Improve standard-compliance of simple name and member access 
5958         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5959         * ecore.cs (FullNamedExpression): New abstract base class 
5960         for Namespaces and TypeExpressions.
5961         (ResolveFlags.SimpleName): Remove.
5962         (SimpleName): Remove support for dotted names.
5963         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5964         DeclSpace.FindType and DeclSpace.LookupType.
5965         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5966         (Expression.ExprClassName): Make member function.
5967         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5968         a namespace.  Remove creation of dotted "SimpleName"s.
5969         (MemberAccess.DoResolve): Likewise.
5970         * decl.cs (DeclSpace.Cache): Make private.
5971         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5972         (DeclSpace.FindType): Update.
5973         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5974         FullNamedExpression.
5975         * namespace.cs (Namespace): Derive from FullNamedExpression
5976         so that it can be part of expression resolution.
5977         (Namespace.Lookup): Return an FullNamedExpression.
5978         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5979         namespace.
5980         * rootcontext.cs (NamespaceLookup): Remove.
5981         (LookupType): Move to DeclSpace.
5982         * attribute.cs (CheckAttributeType): Update.
5983         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5984         (FindDocumentedTypeNonArray): Likewise.
5985
5986 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5987
5988         Fix cs0509.cs, cs1632.cs.
5989         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5990         is the same as IsInterface.
5991         (TypeContainer.GetClassBases): Likewise.
5992         * statement.cs (LabeledStatement.ig): New field.
5993         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5994         label.
5995         (LabeledStatement.DoEmit): Check that the label was created with
5996         the same ILGenerator.
5997
5998 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5999
6000         Fix #71058
6001         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6002         accessors to its properties.
6003
6004         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6005         from accessors to property.
6006         
6007 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6008
6009         Fix #70722
6010         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6011         only for overrides.
6012         
6013 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6014
6015         * attribute.cs: Check for null and empty strings.  
6016
6017         I have lost another battle to Paolo.
6018
6019 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6020
6021         Fix #70942
6022         * class.cs (PropertyMethod): Set Parent field in ctors.
6023         (SetMethod.InternalParameters): Add unsafe switch hack.
6024         Override MarkForDuplicationCheck where it is appropriate.
6025
6026         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6027         It says whether container allows members with the same name.
6028         Base default is no.
6029         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6030         Removed is_method parameter.
6031
6032 2005-01-06  Duncan Mak  <duncan@ximian.com>
6033
6034         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6035         because the previous change led to incorrect reporting of CS1032
6036         ("Cannot define/undefine preprocessor symbols after first token in
6037         file"). Instead of using `tokens_seen' as the only flag that
6038         triggers CS1040, introduce `comments_seen'. This new flag is used
6039         to signify having seen comments on the current line, so it is
6040         unset after a newline.
6041
6042 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6043
6044         * doc.cs : When searching for a type, find nested type too.
6045           This fixes bug #71040.
6046
6047 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6048
6049         * doc.cs :
6050           - Warn missing member comment on those classes which also does not
6051             have doc comments. Fixed bug #71041.
6052           - Don't warn missing doc comment on default constructor.
6053             Fixed bug #71042.
6054
6055 2005-01-06  Duncan Mak  <duncan@ximian.com>
6056
6057         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6058         comments, set `tokens_seen' to true. This allows us to detect
6059         misplaced preprocessor directives (i.e. not at the beginning of
6060         the a line, nor after whitespaces). In that case, report error
6061         CS1040. This fixes bug #56460.
6062
6063         * cs-parser.jay (interface_member_declaration): Add checks for
6064         IsExplicitImpl, and report CS0541 error if an interface member is
6065         defined as an explicit interface declaration.
6066
6067 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6068
6069         Fix #70817
6070         * class.cs (PropertyMethod): Set Parent field in ctors.
6071         (SetMethod.InternalParameters): Add unsafe switch hack.
6072         
6073         * decl.cs (MemberCore.Parent): Cannot be readonly.
6074
6075 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6076
6077         * decl.cs (DeclSpace.ResolveType): Remove.
6078         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6079         Merge in code from ...
6080         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6081         * class.cs, enum.cs: Update to changes.
6082
6083 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6084
6085         * anonymous.cs: Ensure that we init the scope of our parent if it
6086         has not been initialized yet.
6087
6088 2004-12-30  Duncan Mak  <duncan@ximian.com>
6089
6090         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6091         if field.FieldBuilder is null. Fixes #70758.
6092
6093         * convert.cs: Fixed some typos and updated some of the comments.
6094         (ImplicitStandardConversionExists):
6095         (TryImplicitIntConversion): If `target_type' is an interface and
6096         the type of `ic' implements this interface, return true or a new
6097         BoxedCast instead of null. This fixes #70468.
6098
6099 2004-12-29  Duncan Mak  <duncan@ximian.com>
6100
6101         * expression.cs (Argument.Emit): Check that Expr is
6102         IMemoryLocation before casting to it, and report CS1510 otherwise.
6103
6104         This fixes #70402.
6105
6106 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6107
6108         * statement.cs (Block.ThisVariable): remove the recursion here, to
6109         make the --profile more sane.
6110
6111 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6112
6113         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6114         assembly, by JB Evain.
6115
6116 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6117
6118         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6119           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6120         "parent" refers to enclosing type/class.  "base" refers to superclass.
6121
6122 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6123
6124         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6125         Ensure that we only have GlobalAttributes.
6126         * attribute.cs (Attribute.Emit): Make non-virtual.
6127         (GlobalAttribute.Emit): Remove.
6128         (Attribute.Resolve): Make virtual.
6129         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6130         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6131         the argument. Don't create one.
6132         (Attribute.GetObsoleteAttribute): Likewise.
6133         (Attribute.GetClsCompliantAttributeValue): Likewise.
6134         * class.cs, decl.cs: Update to changes.
6135
6136 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6137
6138         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6139         
6140         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6141         
6142         * statement.cs (Foreach.Resolve): Add error 186 report.
6143
6144 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6145
6146         * expression.cs (Conditional.DoResolve): Add warning 429.
6147         
6148         * statement.cs (If.Resolve): Add warning 665.
6149
6150 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6151
6152         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6153         except when in the parser, and in GlobalAttribute.
6154         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6155         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6156         RootContext.Tree.Types.NamespaceEntry once work is done.
6157         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6158         and resets RootContext.Tree.Types.NamespaceEntry.
6159
6160 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * cs-parser.jay: Don't create a block for every variable.
6163
6164 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6165
6166         * location.cs: Provide extra information.
6167
6168         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6169         variables from the captured environment, it is the ldarg_0.
6170
6171 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6172
6173         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6174         find a conclusion.
6175         
6176         * class.cs: Changed warning level for 169 to avoid developer
6177         displeasure from warning flooding. It will be changed back when they
6178         fix most of current BCL warnings.
6179         
6180         * RootContext.cs: Pushed default WarningLevel to 3.
6181         
6182         * statement.cs: Removed unused variable.
6183
6184 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6185
6186         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6187         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6188         Add error 502 report.
6189         (StaticClass.DefineType): Add error 441 report.
6190         (Class.AllowedModifiersProp): New virtual property as temporary
6191         extension to AllowedModifiers.
6192         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6193         to share implementation with StaticClass and don't call virtual
6194         methods from ctor.
6195         
6196         * driver.cs (MainDriver): Add error 1558 test.
6197
6198         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6199         report. Moved error 36 test here.
6200
6201         * statement.cs (Throw.Resolve): Add error 724 report.
6202
6203         * typemanager.cs: Add out_attribute_type core type.
6204         
6205 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6206
6207         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6208         3018 report.
6209         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6210
6211         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6212         3017 report.
6213         
6214         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6215
6216         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6217         Add error 3023 report.
6218         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6219
6220         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6221         implementation.
6222
6223 2004-12-12  John Luke  <john.luke@gmail.com>
6224
6225         * driver.cs (AddArgs): take -- into account when
6226         adding arguments, fixes bug 65710 
6227
6228 2004-12-12  Martin Baulig  <martin@ximian.com>
6229
6230         * expression.cs (Unary.TryReduceNegative): Added support for
6231         SByteConstant and ByteConstant.
6232         (Unary.Reduce): Check error values from TryReduceNegative().
6233
6234 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6235
6236         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6237         and report exception as error 182.
6238
6239 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6240
6241         * driver.cs (Main): Fix message when there are warnings.
6242
6243 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6244
6245         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6246
6247 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6248
6249         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6250         Reduced number of warnings.
6251         
6252         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6253
6254 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6255
6256         * driver.cs: Removed message.
6257
6258         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6259
6260 2004-12-08    <vargaz@freemail.hu>
6261
6262         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6263
6264 2004-12-08  Martin Baulig  <martin@ximian.com>
6265
6266         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6267         instead of a CS3002 for properties and indexer.
6268
6269 2004-12-08  Martin Baulig  <martin@ximian.com>
6270
6271         * decl.cs (MemberName.ToString): Make this work again.
6272
6273 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6274
6275         * attribute.cs (Resolve): Add error 591 detection.
6276
6277         * class.cs (FieldMember.Define): Add error 1547 detection.
6278         (Indexer.Define): Add error 620 detection.
6279         (Operator.Define): Add error 590 detection.
6280
6281         * ecore.cs: Missing argument for error 79.
6282
6283         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6284         detection.
6285
6286 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6287
6288         Fix #70106
6289         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6290         only.
6291
6292 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6293
6294         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6295           Some operator comments were suppressed.
6296         * doc.cs : Implicit/explicit operator name in doc comments are like
6297           "op_Explicit(type)~returnType", so added suffix handling.
6298
6299 2004-12-07  Martin Baulig  <martin@ximian.com>
6300
6301         * decl.cs
6302         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6303         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6304         (DeclSpace.ec): New protected field; store the EmitContext here.
6305         (DeclSpace.EmitContext): New public property; moved here from
6306         `TypeContainer'.
6307         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6308         EmitContext.
6309
6310         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6311         (Enum.Emit): Don't create a new EmitContext.
6312
6313         * delegate.cs (Delegate.DefineType): Always create the
6314         EmitContext.
6315
6316         * iterators.cs (Iterators.DefineIterator): Create a new
6317         EmitContext and store it in `ec'.
6318
6319 2004-08-24  Martin Baulig  <martin@ximian.com>
6320
6321         * typemanager.cs
6322         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6323         this for accessibility checks.
6324         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6325         IsNestedFamilyAccessible.
6326         (TypeManager.IsSubclassOf): New method, do what the name actually
6327         says.   
6328
6329 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6330
6331         Fix crash on cs0657-17.cs.
6332         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6333         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6334         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6335         the case where the NamespaceEntry gets overwritten.
6336
6337 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6338
6339         Fixed #69195, #56821
6340         * ecore.cs (ResolveBoolean): Tiny refactoring.
6341
6342         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6343         of right expression resolving when left is false constant and
6344         operator is LogicalAnd OR true constant and operator is LogicalOr.
6345
6346         * statement.cs (ResolveUnreachable): Always reports warning.
6347
6348 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6349
6350         * class.cs: Distinguish between 1721 and 1722 (just a little help
6351         for the programmer).
6352
6353 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6354
6355         * delegate.cs: Only allow this on new versions of the language. 
6356
6357 2004-12-02  Duncan Mak  <duncan@ximian.com>
6358
6359         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6360         Expression class.
6361         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6362         here as a static method. Take an additional bool out parameter
6363         `must_do_cs1540_check' for signaling to InstanceResolve.
6364         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6365         member field from PropertyExpr class and made it an argument of
6366         the method instead.
6367         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6368         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6369         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6370         and `remove_accessor' as well as InstanceResolve: report CS0122
6371         where applicable.
6372
6373         Fixes #70129.
6374
6375 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6376
6377         Fix test-327.cs, test-328.cs, and put in early infrastructure
6378         for eventually fixing #52697.
6379         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6380         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6381         from other methods.
6382         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6383         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6384         (VerifyUsing, error246): Update.
6385         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6386         'NamespaceEntry.LookupNamespaceOrType'.
6387
6388 2004-12-03  Martin Baulig  <martin@ximian.com>
6389
6390         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6391         method as our child, call AnonymousMethod.Compatible() on it.
6392
6393 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6394
6395         Disable XML documentation support in 'basic' profile.
6396         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6397         Redirect XmlElement to System.Object.
6398         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6399         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6400         * mcs.exe.sources: Add doc-bootstrap.cs.
6401         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6402         of doc.cs.
6403
6404 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6405
6406         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6407           comments are allowed.
6408
6409 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6410
6411         * delegate.cs: Add checks for subtypes in paramaters and return values
6412         in VerifyMethod () to add support for Covariance/Contravariance
6413         in delegates.
6414         
6415 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6416
6417         * report.cs: Remove extra closing parenthesis.
6418
6419         * convert.cs (Error_CannotImplicitConversion): If the name of the
6420         types are the same, provide some extra information.
6421
6422         * class.cs (FieldBase): Use an unused bit field from the field to
6423         encode the `has_offset' property from the FieldMember.  This saves
6424         a couple of Ks on bootstrap compilation.
6425
6426         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6427         method as our child, return the AnonymousMethod resolved
6428         expression.
6429
6430         * expression.cs (New.DoResolve): Allow return values from
6431         NewDelegate to also include AnonymousMethods.
6432
6433         Fixes #70150.
6434
6435 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6436
6437         Fix bug #70102
6438         * attribute.cs (Resolve): Improved implementation of params
6439         attribute arguments.
6440
6441         * support.cs (ParameterData): Add HasParams to be faster.
6442
6443 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6444
6445         all things are for /doc support:
6446
6447         * doc.cs: new file that supports XML documentation generation.
6448         * mcs.exe.sources: added doc.cs.
6449         * driver.cs:
6450           Handle /doc command line option.
6451           Report error 2006 instead of 5 for missing file name for /doc.
6452           Generate XML documentation when required, after type resolution.
6453         * cs-tokenizer.cs:
6454           Added support for picking up documentation (/// and /** ... */),
6455           including a new XmlCommentState enumeration.
6456         * cs-parser.jay:
6457           Added lines to fill Documentation element for field, constant,
6458           property, indexer, method, constructor, destructor, operator, event
6459           and class, struct, interface, delegate, enum.
6460           Added lines to warn incorrect comment.
6461         * rootcontext.cs :
6462           Added Documentation field (passed only when /doc was specified).
6463         * decl.cs:
6464           Added DocComment, DocCommentHeader, GenerateDocComment() and
6465           OnGenerateDocComment() and some supporting private members for
6466           /doc feature to MemberCore.
6467         * class.cs:
6468           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6469         * delegate.cs:
6470           Added overriden DocCommentHeader.
6471         * enum.cs:
6472           Added overriden DocCommentHeader and GenerateDocComment().
6473
6474 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6475
6476         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6477         unwrapping the enumeration values, chain to
6478         DoConstantNumericPromotions again, so we can promote things to the
6479         fundamental types (takes care of enums that are bytes, sbytes).
6480
6481         Fixes bug #62054.
6482
6483 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6484
6485         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6486         Fix long-standing bug in type-lookup.  Use FindType instead of
6487         LookupType when ec.ResolvingTypeTree.
6488         (Attribute.ResolveType, Attribute.Resolve)
6489         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6490         Update to changes.
6491         (Attributes.Search): Remove internal version.  Update.
6492         (Attributes.SearchMulti): Update.
6493         (Attributes.GetClsCompliantAttribute): Remove.
6494         (Attributes.GetIndexerNameAttribute): Remove.
6495         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6496         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6497         * class.cs (Indexer.Define): Likewise.
6498
6499 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6500
6501         Fix bug #68790
6502         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6503         MarshallByReference members access.
6504
6505         * expression.cs: Use CheckMarshallByRefAccess;
6506         Better error CS0197 message.
6507
6508         * report.cs: Print whole related error message.
6509
6510 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6511
6512         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6513         the current directory to help debugging.
6514
6515 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6516
6517         * class (GetClassBases): Better error 60 report.
6518         (EventProperty): Disabled warning 67 detection.
6519
6520 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6521
6522         Fix bug #60324
6523         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6524
6525         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6526         precise values.
6527
6528 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6529
6530         Fix bug #49488
6531         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6532
6533         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6534
6535 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6536
6537         * attribute.cs (Attribute.Resolve): Refine error reporting and
6538         report a cs0117 if the identifier does not exist, to distinguish
6539         from 0617 which is a miss-use of the actual identifier.
6540
6541         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6542         between cs0070 and cs0079.
6543
6544         * class.cs (MemberBase.DoDefine): When reporting a wrong
6545         accessibility level, we use MethodCore to compare instead of
6546         Method (this was a regression in some refactoring effort).
6547
6548         So now we correctly report cs0056 again.
6549
6550         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6551         testing the target_type (which was known to be object_type) and
6552         not the source type (which is anonymous_method).
6553
6554         Fixed reporting of error cs1660.
6555
6556         * expression.cs (UserCast.Source): Expose the underlying cast.
6557
6558         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6559         allowed types to find a match to int32 first (most common).
6560
6561         In addition, it ignores any ImplicitUserConversions that did an
6562         internal implicit conversion (as the switch statement allows only
6563         one integral conversion to exist).
6564
6565         * class.cs (PartialContainer.Create): rename `name' to
6566         `member_name' for clarity.  Then replace the string calls with a
6567         call to MemberName.GetPartialName, as now using
6568         MemberName.ToString is an error (this is due to the side effects
6569         it had, that were fixed in the past).
6570
6571         This will restore the error reporting on a number of partial class
6572         errors that were missusing this (and getting an exception as a
6573         results, which is now just a plain textual warning, because
6574         yyparse debug output would crash otherwise).
6575
6576 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6577
6578         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6579
6580 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6581
6582         * rootcontext.cs (LookupType): Make sure to cache lookups that
6583         don't give us a negative result. This saves about 5% of corlib
6584         compilation time.
6585
6586 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * report.cs (AbstractMessage.Print): messages are sent to stderr
6589
6590         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6591         non-interface in the list of interfaces (at this point, either
6592         parent was properly set, or a base class is being listed in the
6593         interfaces section).
6594
6595         This flags error 1722, and resolves the crash from bug 69259.
6596
6597 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6598
6599         * statement.cs (Using.EmitExpressionFinally): make this work right
6600         for valuetypes. Fixes 69926.
6601
6602 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6603
6604         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6605         converted to an enum" here, before we try to change the underlying
6606         type.  This code exists, but it is a different code path than the
6607         one used while encoding constants.
6608
6609         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6610         old bug: when converting from the null literal to a pointer,
6611         return an EmptyCast, not the NullLiteral.
6612
6613         This fixes #69921, the recent null_type changes probably made this
6614         bug more prominent.
6615
6616         (ImplicitReferenceConversionExists): In addition, resynchronized
6617         the code here, so it matches the same code in
6618         ImplicitReferenceConversionExists for the `from any class-type S
6619         to any interface-type T'.
6620         
6621
6622 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6623
6624         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6625
6626 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6627
6628         * cs-parser.jay: Use verbosity accordingly. 
6629
6630 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6631
6632         * expression.cs (Unary.ResolveOperator): Do not report warning;
6633         AddressOf reads from variable.
6634         
6635         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6636
6637 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6638
6639         Fix bug #69462
6640
6641         * attribute.cs (Attributable): Removed CheckTargets.
6642         (Attributes.Emit): Explicit attribute targets are tested here.
6643
6644         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6645         not enabled for interfaces.
6646
6647         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6648         (GetAssemblyName): Ouch next bug there.
6649
6650 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6651
6652         * expression.cs: Error 275 added.
6653         
6654 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6655
6656         Fix bug #69177 (Implemented decimal constant support)
6657
6658         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6659         (BinaryFold): Add DecimalConstant.
6660
6661         * const.cs (Define): Decimal constant 
6662         (is not constant.
6663         (ChangeType): Add decimal type handling.
6664         (LookupConstantValue): Don't set value for decimal type but
6665         emit DecimalConstantAttribute. Needed for constant optimization.
6666
6667         * constant.cs (ToDecimal): New method.
6668         (ConvertToDecimal): New method.
6669         (IntConstant): Implemented ConvertToDecimal.
6670         (DecimalConstant.Emit): Emit optimized version for decimals in
6671         int range.
6672
6673         * expression.cs (ResolveOperator): Changed order of constant
6674         reduction to work correctly with native types which have
6675         overloaded operators.
6676         (ResolveMemberAccess): Extract constant value from attribute
6677         for decimal type.
6678
6679         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6680
6681         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6682         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6683         (ChangeType): Decimal is special.
6684         (TypeToCoreType): Add decimal type.
6685
6686 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6689         decimal types.
6690
6691 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6692
6693         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6694         test cs1667-5.cs.
6695
6696 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6697
6698         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6699
6700         * pending.cs (PendingImplementation): Grab only interfaces.
6701
6702 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6703
6704         * statement.cs (ForeachHelperMethods): Add location member and
6705         error 202 detection.
6706
6707 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6708
6709         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6710         automatically handled by executable.make.
6711         (PROGRAM): Make profile-specific.
6712
6713 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6714
6715         * expression.cs (DoResolveBase): Fixed wrong warning for out
6716         variables.
6717
6718 2004-11-18  Martin Baulig  <martin@ximian.com>
6719
6720         Merged latest changes into gmcs.  Please keep this comment in
6721         here, it makes it easier for me to see what changed in MCS since
6722         the last time I merged.
6723
6724 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6725
6726         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6727         (TypeHandle.GetMemberCache): New.
6728         (TypeHandle.TypeHandle): Update.
6729         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6730         (TypeManager.LookupParentInterfacesCache):
6731         Rename from LookupInterfaceCache.  Optimize slightly.
6732         (TypeManager.MemberLookup_FindMembers): Update.
6733         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6734         multi-type variant.
6735         (AddCacheContents): Rename from AddHashtable.
6736         * class.cs (TypeContainer.parent_container): Remove.
6737         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6738         (TypeContainer.DoDefineMembers): Don't initialize it.
6739         Update to name changes.
6740         
6741 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6742
6743         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6744         that factors the code to check access modifiers on override.  
6745
6746         (PropertyBase): Use the code here.
6747
6748         Patch from Lluis S'anchez, fixes bug #69361.
6749
6750 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6751
6752         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6753         routine that is used to report the use of a captured variable
6754         whose address has been taken.
6755
6756         There are two checks: one when variables are being captured and
6757         the other check is when the address of a variable is taken. 
6758         
6759         (because an anonymous methods might be resolved before *or* after
6760         the address has been taken) and 
6761
6762         * expression.cs (Conditional.DoResolve): Remove the special
6763         casing that Martin added to trueExpr and falseExpr being both
6764         NullLiteral.  We get the right behavior now just by introducing
6765         the null_type into the compiler. 
6766
6767         * convert.cs (ExplicitConversion): Change the code to use
6768         null_type instead of testing `expr is NullLiteral'.
6769         (ImplicitConversionStandard): use null_type too.
6770         (ImplicitReferenceConversionExists): use null_type too.
6771         (ImplicitReferenceConversion): use null_type too.
6772
6773         * literal.cs: The type of `NullLiteral' is now null_type instead
6774         of object_type. 
6775         (Resolve): Set the type here.
6776
6777         * typemanager.cs: Introduce null_type.
6778
6779 2004-11-17  Martin Baulig  <martin@ximian.com>
6780
6781         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6782         direction, like FindMembers() does.  Fixes #69546, testcase is in
6783         test-315.cs.    
6784
6785 2004-11-16  Martin Baulig  <martin@ximian.com>
6786
6787         This is based on a patch from Marek Safar, see bug #69082.
6788         Fixes bugs #63705 and #67130.
6789
6790         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6791         method; create a MemberCache for an interface type and cache the
6792         result.
6793
6794         * decl.cs (IMemberContainer.ParentContainer): Removed.
6795         (IMemberContainer.ParentCache): New property.
6796         (MemberCache.SetupCacheForInterface): Removed.
6797         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6798         to create a cache for an interface's "parent".
6799
6800         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6801         interfaces too.
6802
6803 2004-11-16  Martin Baulig  <martin@ximian.com>
6804
6805         Merged back from gmcs; these changes already went into gmcs a
6806         couple of weeks ago.
6807
6808         * typemanager.cs
6809         (TypeManager.AddUserType): Removed the `ifaces' argument.
6810         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6811         `TypeExpr []'.
6812         (TypeManager.AddUserInterface): Removed.
6813         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6814         `TypeExpr []'.
6815         (TypeManager.GetInterfaces): Likewise.
6816         (TypeManager.GetExplicitInterfaces): Likewise.
6817
6818         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6819
6820         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6821         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6822
6823 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6824
6825         * statement.cs: Avoid adding bools to a hashtable.
6826
6827 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6830         calling an unsafe method from a safe location.
6831
6832 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6833
6834         Fix #69167
6835         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6836
6837 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6838
6839         * namespace.cs (VerifyUsing): use GetPartialName instead of
6840         ToString. 
6841
6842 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6843
6844         * statement.cs (Return.Resolve): Fix regression in typo: if
6845         `in_exc', we have to request a NeedReturnLabel, this was a typo
6846         introduced in the anonymous method check-in.  Fixes #69131.
6847
6848         * Indexers were using the ShortName when defining themselves,
6849         causing a regression in the compiler bootstrap when applying the
6850         patch from 2004-11-02 (first part), now they use their full name
6851         and the bug is gone.
6852
6853 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6854
6855         * driver.cs: Strip the path from the names of embedded resources. Fixes
6856         #68519.
6857
6858 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6859
6860         Fix error message regression: cs0104-2.cs.
6861         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6862         (AliasEntry.Resolve): Update.
6863         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6864         'silent' flag.
6865         (RootContext.LookupType): Update.
6866
6867 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6868
6869         * cs-parser.jay: Add support for handling accessor modifiers
6870         * class: Add support port accessor modifiers and error checking,
6871         define PropertyMethod.Define as virtual (not abstract anymore)
6872         * ecore.cs: Add checking for proeprties access with access modifiers
6873         * iterators.cs: Modify Accessor constructor call based in the modified
6874         constructor
6875 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6876
6877         * expression.cs (StringConcat): Handle being called twice,
6878         as when we have a concat in a field init with more than two
6879         ctors in the class
6880
6881 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6882
6883         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6884         special case explicit implementations, we should always produce
6885         the .property or .event declaration.
6886         
6887         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6888         since it will not return correct data if people use this
6889         unresolved in the presence of using statements (see test-313).
6890
6891         * class.cs (MethodData.Define): If we are an explicit interface
6892         implementation, set the method name to the full name of the
6893         interface plus the name of the method.  
6894
6895         Notice that using the method.MethodName.GetFullName() does not
6896         work, as it will only contain the name as declared on the source
6897         file (it can be a shorthand in the presence of using statements)
6898         and not the fully qualifed type name, for example:
6899
6900         using System;
6901
6902         class D : ICloneable {
6903                 object ICloneable.Clone ()  {
6904                 }
6905         }
6906
6907         Would produce a method called `ICloneable.Clone' instead of
6908         `System.ICloneable.Clone'.
6909
6910         * namespace.cs (Alias.Resolve): Use GetPartialName.
6911         
6912 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6913
6914         * cs-parser.jay: Add error 1055 report.
6915
6916 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6917
6918         * assign.cs (Assign.DoResolve): Only do the transform of
6919         assignment into a New if the types are compatible, if not, fall
6920         through and let the implicit code deal with the errors and with
6921         the necessary conversions. 
6922
6923 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6924
6925         * cs-parser.jay: Add error 1031 report.
6926
6927         * cs-tokenizer.cs: Add location for error 1038.
6928
6929 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6930
6931         * cs-parser.jay: Add error 1016 report.
6932
6933 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6934
6935         * cs-parser.jay: Add errors 1575,1611 report.
6936
6937 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6938
6939         * cs-parser.jay: Add error 1001 report.
6940
6941 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6942
6943         Fix #68850
6944         * attribute.cs (GetMarshal): Add method argument for
6945         caller identification.
6946
6947         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6948         agument for GetMarshal and RuntimeMissingSupport.
6949
6950 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6951
6952         * attribute.cs (ExtractSecurityPermissionSet): Removed
6953         TypeManager.code_access_permission_type.
6954
6955         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6956
6957 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6958
6959         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6960         for obsolete use of a variable here.   Fixes regression on errors
6961         cs0619-25 and cs0619-26.
6962
6963 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6964
6965         Fix #62358, implemented security attribute encoding.
6966
6967         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6968         Tests permitted SecurityAction for assembly or other types.
6969         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6970         data from SecurityPermissionAttribute to PermisionSet class.
6971
6972         * class.cs (ApplyAttributeBuilder): Added special handling
6973         for System.Security.Permissions.SecurityAttribute based types.
6974
6975         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6976         special handling for System.Security.Permissions.SecurityAttribute
6977         based types.
6978
6979         * enum.cs (ApplyAttributeBuilder): Added special handling
6980         for System.Security.Permissions.SecurityAttribute based types.
6981
6982         * parameter.cs (ApplyAttributeBuilder): Added special handling
6983         for System.Security.Permissions.SecurityAttribute based types.
6984
6985         * rootcontext.cs: Next 2 core types.
6986
6987         * typemanager.cs (TypeManager.security_permission_attr_type):
6988         Built in type for the SecurityPermission Attribute.
6989         (code_access_permission_type): Build in type.
6990
6991 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6992
6993         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6994         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6995         all of this information into
6996         EmitContext.EmitCapturedVariableInstance.
6997         
6998         * codegen.cs (EmitCapturedVariableInstance): move here the
6999         funcionality of emitting an ldarg.0 in the presence of a
7000         remapping.   This centralizes the instance emit code.
7001
7002         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7003         then emit a load of this: it means that we have reached the
7004         topmost ScopeInfo: the one that contains the pointer to the
7005         instance of the class hosting the anonymous method.
7006
7007         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7008         captures to the topmost CaptureContext.
7009
7010 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7011
7012         * expression.cs (LocalVariableReference): Move the knowledge about
7013         the iterators into codegen's EmitCapturedVariableInstance.
7014
7015 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7016
7017         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7018         all code paths return a value from an anonymous method (it is the
7019         same as the 161 error, but for anonymous methods).
7020
7021 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7022
7023         The introduction of anonymous methods in the compiler changed
7024         various ways of doing things in the compiler.  The most
7025         significant one is the hard split between the resolution phase
7026         and the emission phases of the compiler.
7027
7028         For instance, routines that referenced local variables no
7029         longer can safely create temporary variables during the
7030         resolution phase: they must do so from the emission phase,
7031         since the variable might have been "captured", hence access to
7032         it can not be done with the local-variable operations from the runtime.
7033         
7034         * statement.cs 
7035
7036         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7037         is a toplevel block.
7038
7039         (ToplevelBlock): A new kind of Block, these are the blocks that
7040         are created by the parser for all toplevel method bodies.  These
7041         include methods, accessors and anonymous methods.
7042
7043         These contain some extra information not found in regular blocks:
7044         A pointer to an optional CaptureContext (for tracking captured
7045         local variables and parameters).  A pointer to the parent
7046         ToplevelBlock.
7047         
7048         (Return.Resolve): Catch missmatches when returning a value from an
7049         anonymous method (error 1662).
7050         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7051         phase.
7052
7053         (Break.Resolve): ditto.
7054
7055         (SwitchLabel): instead of defining the labels during the
7056         resolution phase, we now turned the public ILLabel and ILLabelCode
7057         labels into methods called GetILLabelCode() and GetILLabel() that
7058         only define the label during the Emit phase.
7059
7060         (GotoCase): Track the SwitchLabel instead of the computed label
7061         (its contained therein).  Emit the code by using
7062         SwitchLabel.GetILLabelCode ().
7063
7064         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7065         whether the Local has been captured or not.
7066
7067         (LocalInfo.IsCaptured): New property, used to tell whether the
7068         local has been captured.
7069         
7070         * anonymous.cs: Vastly updated to contain the anonymous method
7071         support.
7072
7073         The main classes here are: CaptureContext which tracks any
7074         captured information for a toplevel block and ScopeInfo used to
7075         track the activation frames for various local variables.   
7076
7077         Each toplevel block has an optional capture context associated
7078         with it.  When a method contains an anonymous method both the
7079         toplevel method and the anonymous method will create a capture
7080         context.   When variables or parameters are captured, they are
7081         recorded on the CaptureContext that owns them, for example:
7082
7083         void Demo () {
7084              int a;
7085              MyDelegate d = delegate {
7086                  a = 1;
7087              }
7088         }
7089
7090         Here `a' will be recorded as captured on the toplevel
7091         CapturedContext, the inner captured context will not have anything
7092         (it will only have data if local variables or parameters from it
7093         are captured in a nested anonymous method.
7094
7095         The ScopeInfo is used to track the activation frames for local
7096         variables, for example:
7097
7098         for (int i = 0; i < 10; i++)
7099                 for (int j = 0; j < 10; j++){
7100                    MyDelegate d = delegate {
7101                         call (i, j);
7102                    }
7103                 }
7104
7105         At runtime this captures a single captured variable `i', but it
7106         captures 10 different versions of the variable `j'.  The variable
7107         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7108         recorded on a child.  
7109
7110         The toplevel ScopeInfo will also track information like the `this'
7111         pointer if instance variables were referenced (this is necessary
7112         as the anonymous method lives inside a nested class in the host
7113         type of the method). 
7114
7115         (AnonymousMethod): Expanded to track the Toplevel, implement
7116         `AnonymousMethod.Compatible' to tell whether an anonymous method
7117         can be converted to a target delegate type. 
7118
7119         The routine now also produces the anonymous method content
7120
7121         (AnonymousDelegate): A helper class that derives from
7122         DelegateCreation, this is used to generate the code necessary to
7123         produce the delegate for the anonymous method that was created. 
7124
7125         * assign.cs: API adjustments for new changes in
7126         Convert.ImplicitStandardConversionExists.
7127
7128         * class.cs: Adjustments to cope with the fact that now toplevel
7129         blocks are of type `ToplevelBlock'. 
7130
7131         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7132         insteda of standard blocks.
7133
7134         Flag errors if params arguments are passed to anonymous methods.
7135
7136         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7137         `CurrentAnonymousMethod' which points to the current Anonymous
7138         Method.  The variable points to the AnonymousMethod class that
7139         holds the code being compiled.  It is set in the new EmitContext
7140         created for the anonymous method.
7141
7142         (EmitContext.Phase): Introduce a variable and an enumeration to
7143         assist in enforcing some rules about when and where we are allowed
7144         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7145         only one that enfonces this right now).
7146
7147         (EmitContext.HaveCaptureInfo): new helper method that returns
7148         whether we have a CapturedContext initialized.
7149
7150         (EmitContext.CaptureVariable): New method used to register that a
7151         LocalInfo must be flagged for capturing. 
7152
7153         (EmitContext.CapturedParameter): New method used to register that a
7154         parameters must be flagged for capturing. 
7155         
7156         (EmitContext.CapturedField): New method used to register that a
7157         field must be flagged for capturing. 
7158
7159         (EmitContext.HaveCapturedVariables,
7160         EmitContext.HaveCapturedFields): Return whether there are captured
7161         variables or fields. 
7162
7163         (EmitContext.EmitMethodHostInstance): This is used to emit the
7164         instance for the anonymous method.  The instance might be null
7165         (static methods), this (for anonymous methods that capture nothing
7166         and happen to live side-by-side with the current method body) or a
7167         more complicated expression if the method has a CaptureContext.
7168
7169         (EmitContext.EmitTopBlock): Routine that drives the emission of
7170         code: it will first resolve the top block, then emit any metadata
7171         and then emit the code.  The split is done so that we can extract
7172         any anonymous methods and flag any captured variables/parameters.
7173         
7174         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7175         during this phase, the ILGenerator should not be used as labels
7176         and local variables declared here might not be accessible to any
7177         code that is part of an anonymous method.  
7178
7179         Exceptions to this include the temporary variables that are
7180         created by some statements internally for holding temporary
7181         variables. 
7182         
7183         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7184         metadata for a cb
7185
7186         (EmitContext.TemporaryReturn): This method is typically called
7187         from the Emit phase, and its the only place where we allow the
7188         ReturnLabel to be defined other than the EmitMeta.  The reason is
7189         that otherwise we would have to duplicate a lot of logic in the
7190         Resolve phases of various methods that today is on the Emit
7191         phase. 
7192
7193         (EmitContext.NeedReturnLabel): This no longer creates the label,
7194         as the ILGenerator is not valid during the resolve phase.
7195
7196         (EmitContext.EmitThis): Extended the knowledge in this class to
7197         work in anonymous methods in addition to iterators. 
7198
7199         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7200         code is necessary on the stack to access the instance to a local
7201         variable (the variable will be accessed as a field).
7202
7203         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7204         EmitContext.EmitAddressOfParameter): Routines to support
7205         parameters (not completed at this point). 
7206         
7207         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7208         will also remove the parameters.
7209
7210         * convert.cs (Convert): Define a `ConstantEC' which points to a
7211         null.  This is just to prefity some code that uses
7212         ImplicitStandardConversion code and do not have an EmitContext
7213         handy.
7214
7215         The idea is to flag explicitly that at that point in time, it is
7216         known that the conversion will not trigger the delegate checking
7217         code in implicit conversions (which requires a valid
7218         EmitContext). 
7219
7220         Everywhere: pass new EmitContext parameter since
7221         ImplicitStandardConversionExists now requires it to check for
7222         anonymous method conversions. 
7223
7224         (Convert.ImplicitStandardConversionExists): If the type of an
7225         expression is the anonymous_method_type, and the type is a
7226         delegate, we invoke the AnonymousMethod.Compatible method to check
7227         whether an implicit conversion is possible. 
7228
7229         (Convert.ImplicitConversionStandard): Only do implicit method
7230         group conversions if the language level is not ISO_1.
7231
7232         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7233         MethodInfo for the Invoke method.  used by Delegate and
7234         AnonymousDelegate.
7235
7236         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7237         method conversions if the target type is a delegate.
7238
7239         Removed extra debugging nops.
7240
7241         (LocalVariableReference): Turn the `local_info' into a public
7242         field. 
7243
7244         Add `prepared' field, the same hack used for FieldExprs to cope
7245         with composed assignments, as Local variables do not necessarily
7246         operate purely on the stack as they used to: they can be captured
7247         fields. 
7248
7249         Add `temp' for a temporary result, like fields.
7250
7251         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7252
7253         It now copes with Local variables that are captured and emits the
7254         proper instance variable to load it from a field in the captured
7255         case. 
7256
7257         (ParameterReference.DoResolveBase): During the resolve phase,
7258         capture parameters if we are in an anonymous method.
7259
7260         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7261         anonymous method, use the EmitContext helper routines to emit the
7262         parameter reference.
7263
7264         * iterators.cs: Set RemapToProxy to true/false during the
7265         EmitDispose class.
7266
7267         * parameters.cs (GetParameterByName): New helper method. 
7268
7269         * typemanager.cs (anonymous_method_type) a new type that
7270         represents an anonyous method.  This is always an internal type,
7271         used as a fencepost to test against the anonymous-methodness of an
7272         expression. 
7273         
7274 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7275
7276         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7277         561 report.
7278         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7279
7280 2004-10-18  Martin Baulig  <martin@ximian.com>
7281
7282         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7283         `Type' directly, but call ResolveType() on it.
7284         (Catch.Resolve): Likewise.
7285         (Foreach.Resolve): Likewise.
7286
7287 2004-10-18  Martin Baulig  <martin@ximian.com>
7288
7289         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7290         `Type' directly, but call ResolveType() on it.
7291         (Probe.DoResolve): Likewise.
7292         (ArrayCreation.LookupType): Likewise.
7293         (TypeOf.DoResolve): Likewise.
7294         (SizeOf.DoResolve): Likewise.
7295
7296 2004-10-18  Martin Baulig  <martin@ximian.com>
7297
7298         * expression.cs (Invocation.BetterFunction): Put back
7299         TypeManager.TypeToCoreType().
7300
7301 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7302
7303         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7304         the ResolveType.
7305
7306 2004-10-18  Martin Baulig  <martin@ximian.com>
7307
7308         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7309         `Type' directly, but call ResolveType() on it.
7310
7311 2004-10-18  Martin Baulig  <martin@ximian.com>
7312
7313         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7314         `Type' directly, but call ResolveType() on it.
7315         (MemberBase.DoDefine): Likewise.
7316
7317         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7318         `Type' directly, but call ResolveType() on it.
7319         (ComposedCast.DoResolveAsTypeStep): Likewise.
7320
7321         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7322         `Type' directly, but call ResolveType() on it.
7323
7324 2004-10-17  John Luke  <john.luke@gmail.com>
7325
7326         * class.cs (Operator.GetSignatureForError): use CSharpName
7327
7328         * parameter.cs (Parameter.GetSignatureForError): Returns
7329         correct name even if was not defined.
7330
7331 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7332
7333         Fix #65816.
7334         * class.cs (TypeContainer.EmitContext): New property.
7335         (DefineNestedTypes): Create an emitcontext for each part.
7336         (MethodCore.DoDefineParameters): Use container's emitcontext.
7337         Pass type array to InternalParameters.
7338         (MemberBase.DoDefine): Use container's emitcontext.
7339         (FieldMember.Define): Likewise.
7340         (Event.Define): Likewise.
7341         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7342         Pass type array to InternalParameters.
7343         (SetIndexerMethod.GetParameterInfo): Likewise.
7344         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7345         * delegate.cs (Define): Pass emitcontext to
7346         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7347         array to InternalParameters.
7348         * expression.cs (ParameterReference.DoResolveBase): Pass
7349         emitcontext to GetParameterInfo.
7350         (ComposedCast.DoResolveAsTypeStep): Remove check on
7351         ec.ResolvingTypeTree.
7352         * parameter.cs (Parameter.Resolve): Change argument to
7353         EmitContext.  Use ResolveAsTypeTerminal.
7354         (Parameter.GetSignature): Change argument to EmitContext.
7355         (Parameters.ComputeSignature): Likewise.
7356         (Parameters.ComputeParameterTypes): Likewise.
7357         (Parameters.GetParameterInfo): Likewise.
7358         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7359         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7360         * support.cs (InternalParameters..ctor): Remove variant that takes
7361         a DeclSpace.
7362         * typemanager.cs (system_intptr_expr): New.
7363         (InitExpressionTypes): Initialize it.
7364
7365 2004-10-12  Chris Toshok  <toshok@ximian.com>
7366
7367         * cs-parser.jay: fix location for try_statement and catch_clause.
7368
7369 2004-10-11  Martin Baulig  <martin@ximian.com>
7370
7371         * report.cs: Don't make --fatal abort on warnings, we have
7372         -warnaserror for that.
7373
7374 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7375
7376         More DeclSpace.ResolveType avoidance.
7377         * decl.cs (MemberCore.InUnsafe): New property.
7378         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7379         with newly created EmitContext.
7380         (FieldMember.Define): Likewise.
7381         * delegate.cs (Delegate.Define): Likewise.
7382         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7383         only if normal name-lookup fails.
7384         (TypeExpr.DoResolve): Enable error-checking.
7385         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7386         (SizeOf.DoResolve): Likewise.
7387         (ComposedCast.DoResolveAsTypeStep): Likewise.
7388         (StackAlloc.DoResolve): Likewise.
7389         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7390         (Block.Unsafe): New property.
7391         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7392         (Unsafe): Set 'unsafe' flag of contained block.
7393         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7394         (Fixed.Resolve): Likewise.
7395         (Catch.Resolve): Likewise.
7396         (Using.ResolveLocalVariableDecls): Likewise.
7397         (Foreach.Resolve): Likewise.
7398
7399 2004-10-05  John Luke <john.luke@gmail.com>
7400
7401         * cs-parser.jay: add location to error CS0175
7402
7403 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7404
7405         * ecore.cs (Expression.Constantity): Add support for turning null
7406         into a constant.
7407
7408         * const.cs (Const.Define): Allow constants to be reference types
7409         as long as the value is Null.
7410
7411 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7412
7413         * namespace.cs (NamespaceEntry.Using): No matter which warning
7414         level is set, check if this namespace name has already been added.
7415
7416 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7417
7418         * expression.cs: reftype [!=]= null should always use br[true,false].
7419         # 67410
7420
7421 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7422
7423         Fix #67108
7424         * attribute.cs: Enum conversion moved to 
7425         GetAttributeArgumentExpression to be applied to the all
7426         expressions.
7427
7428 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7429
7430         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7431         * class.c (TypeContainer.DefineType): Flag error if
7432         base types aren't accessible due to access permissions.
7433         * decl.cs (DeclSpace.ResolveType): Move logic to
7434         Expression.ResolveAsTypeTerminal.
7435         (DeclSpace.ResolveTypeExpr): Thin layer over
7436         Expression.ResolveAsTypeTerminal.
7437         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7438         Refactor code into NestedAccess.  Use it.
7439         (DeclSpace.NestedAccess): New.
7440         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7441         argument to silence errors.  Check access permissions.
7442         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7443         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7444         (Cast.DoResolve): Likewise.
7445         (New.DoResolve): Likewise.
7446         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7447         (TypeOf.DoResolve): Likewise.
7448
7449         * expression.cs (Invocation.BetterConversion): Return the Type of
7450         the better conversion.  Implement section 14.4.2.3 more faithfully.
7451         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7452         section 14.4.2.2 explicit.
7453         (Invocation.OverloadResolve): Update.
7454         (Invocation): Remove is_base field.
7455         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7456         (Invocation.Emit): Likewise.
7457
7458 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7459
7460         * README: Update to changes.
7461
7462 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7463
7464         * cs-parser.jay: Reverted 642 warning fix.
7465
7466 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7467
7468         Fix bug #66615
7469         * decl.cs (FindMemberWithSameName): Indexer can have more than
7470         1 argument.
7471
7472 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7473
7474         * expression.cs (LocalVariableReference.DoResolveLValue):
7475         Do not report warning 219 for out values.
7476         (EmptyExpression.Null): New member to avoid extra allocations.
7477
7478 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7479
7480         * cs-parser.jay: Fix wrong warning 642 report.
7481
7482         * cs-tokenizer.cs (CheckNextToken): New helper;
7483         Inspect next character if is same as expected.
7484
7485 2004-09-23  Martin Baulig  <martin@ximian.com>
7486
7487         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7488         (Convert.ImplicitReferenceConversionExists): Likewise.
7489
7490 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7491
7492         * class.cs (Operator.Define): Add error 448 and 559 report.
7493
7494 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7495
7496         * class.cs (MemberBase.IsTypePermitted): New protected
7497         method for checking error CS0610.
7498
7499 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7500
7501         * class.cs (TypeContainer.HasExplicitLayout): New property
7502         Returns whether container has StructLayout attribute set Explicit.
7503         (FieldMember): New abstract class for consts and fields.
7504         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7505         (Field): Reuse FieldMember.
7506
7507         * const.cs (Const): Reuse FieldMember.
7508
7509         * rootcontext.cs: EmitConstants call moved to class.
7510
7511 2004-09-22  Martin Baulig  <martin@ximian.com>
7512
7513         Thanks to Peter Sestoft for this bug report.
7514
7515         * expression.cs (Conditional): If both the `trueExpr' and the
7516         `falseExpr' is a NullLiteral, return a NullLiteral.
7517
7518 2004-09-22  Martin Baulig  <martin@ximian.com>
7519
7520         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7521         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7522         for the "get_Current" call.
7523
7524 2004-09-22  Martin Baulig  <martin@ximian.com>
7525
7526         Marek and me just fixed one of our oldest bugs: #28562 :-)
7527
7528         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7529
7530         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7531         we're an EnumConstant, just return that.
7532         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7533         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7534         to get the value which'll actually be written into the attribute.
7535         However, we have to use GetValue() to access the attribute's value
7536         in the compiler.        
7537
7538 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7539
7540         * constant.cs (Constant.IsNegative): New abstract property
7541         IsNegative.
7542
7543         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7544         (StackAlloc.DoResolve): Reused IsNegative.
7545
7546 2004-09-21  Martin Baulig  <martin@ximian.com>
7547
7548         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7549         if we're used in an iterator, we may be called from different
7550         methods.
7551
7552         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7553         we actually have an exception block.
7554
7555 2004-09-20  John Luke <jluke@cfl.rr.com>
7556
7557         * class.cs, cs-parser.jay: Improve the error report for 1520:
7558         report the actual line where the error happens, not where the
7559         class was declared.
7560
7561         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7562         Pass location information that was available elsewhere.
7563
7564 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7565
7566         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7567         runtime to delay sign assemblies.
7568
7569 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7570
7571         * cs-parser.jay: Do not report the stack trace, this is barely
7572         used nowadays.
7573
7574 2004-08-22  John Luke  <john.luke@gmail.com>
7575  
7576         * driver.cs : check that a resource id is not already used
7577         before adding it, report CS1508 if it is, bug #63637
7578
7579 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * ecore.cs: Removed dead code.
7582
7583 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7584
7585         * class.cs: Do not report warning CS0067 on the interfaces.
7586
7587 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7588
7589         * cs-parser.jay: Add error 504 report.
7590
7591 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * rootcontext.cs: WarningLevel is 4 by default now.
7594
7595         * statement.cs (Fixed.Resolve): Do not null
7596         VariableInfo.
7597
7598 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7599
7600         Fixed bug #55780
7601         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7602         deep search when property is not virtual.
7603         (PropertyExpr.ResolveAccessors): Make one call for both
7604         accessors.
7605
7606 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7607
7608         Fixed bug #65766
7609         * statement.cs: Error 152 report constains also location.
7610
7611 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7612
7613         Fixed bug #65766
7614         * const.cs: Explicitly set constant as static.
7615
7616 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7617
7618         Fixed bug #64226
7619         * cs-parser.jay: Add error 1017 report.
7620
7621 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7622
7623         Fixed bug #59980, #64224
7624         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7625
7626         * typemanager.cs (IsSpecialMethod): Simplified
7627
7628 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7629
7630         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7631         condition with better params.
7632
7633 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7634
7635         Fixed bug #65238
7636         * attribute.cs (Resolve): Property has to have both
7637         accessors.
7638
7639 2004-09-14  Martin Baulig  <martin@ximian.com>
7640
7641         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7642
7643 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7644
7645         Fixed bug #61902
7646         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7647         called and is obsolete then this member suppress message
7648         when call is inside next [Obsolete] method or type.
7649
7650         * expression.cs: Use TestObsoleteMethodUsage member.
7651
7652 2004-09-14  Martin Baulig  <martin@ximian.com>
7653
7654         * cs-parser.jay: Sync a bit with the GMCS version.
7655
7656 2004-09-14  Martin Baulig  <martin@ximian.com>
7657
7658         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7659         (CSharpParser.yacc_verbose_flag): New public field.
7660
7661         * genericparser.cs: Removed.
7662
7663 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7664
7665         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7666
7667 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7668
7669         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7670
7671 2004-09-10  Martin Baulig  <martin@ximian.com>
7672
7673         Backported my MemberName changes from GMCS into MCS.
7674
7675         - we are now using a special `MemberName' class instead of using
7676         strings; in GMCS, the `MemberName' also contains the type
7677         arguments.
7678
7679         - changed the grammar rules a bit:
7680           * the old `member_name' is now a `namespace_or_type_name':
7681             The rule is that we use `namespace_or_type_name' everywhere
7682             where we expect either a "member name" (GetEnumerator) or a
7683             "member name" with an explicit interface name
7684             (IEnumerable.GetEnumerator).
7685             In GMCS, the explicit interface name may include type arguments
7686             (IEnumerable<T>.GetEnumerator).
7687           * we use `member_name' instead of just `IDENTIFIER' for
7688             "member names":
7689             The rule is that we use `member_name' wherever a member may
7690             have type parameters in GMCS.       
7691
7692         * decl.cs (MemberName): New public class.
7693         (MemberCore.MemberName): New public readonly field.
7694         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7695         (DeclSpace): Likewise.
7696
7697         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7698         * enum.cs (Enum.ctor): Likewise.
7699
7700         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7701         MemberName.     
7702         (AliasEntry.ctor): Take a MemberName, not an Expression.
7703         (AliasEntry.UsingAlias): Likewise.
7704
7705         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7706         (IMethodData.MemberName): Changed type from string to MemberName.
7707         (MemberBase.ExplicitInterfaceName): Likewise.
7708         (AbstractPropertyEventMethod.SetupName): Make this private.
7709         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7710         argument; compute the member name here.
7711         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7712         on the `member.MemberName' and the `prefix'.
7713
7714         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7715         not `type_name'.
7716         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7717         thus, we get a `MemberName' instead of a `string'.  These
7718         declarations may have type parameters in GMCS.
7719         (interface_method_declaration, delegate_declaration): Likewise.
7720         (class_declaration, interface_declaration): Likewise.
7721         (method_header): Use `namespace_or_type_name' instead of
7722         `member_name'.  We may be an explicit interface implementation.
7723         (property_declaration, event_declaration): Likewise.
7724         (member_name): This is now just an `IDENTIFIER', not a
7725         `namespace_or_type_name'.
7726         (type_name, interface_type): Removed.
7727         (namespace_or_type_name): Return a MemberName, not an Expression.
7728         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7729         call GetTypeExpression() on the MemberName to get an expression.
7730         (IndexerDeclaration.interface_type): Changed type from string to
7731         MemberName.
7732         (MakeName): Operate on MemberName's instead of string's.
7733
7734 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7735
7736         Fix bug #55770.
7737         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7738         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7739         lookup to avoid symbols introduced by 'using'.
7740         * rootcontext.cs (NamespaceLookup): Update.
7741
7742 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7743
7744         * class.cs (TypeContainer.DoDefineMembers): Do not call
7745         DefineDefaultConstructor for static classes.
7746
7747 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7748
7749         * attribute.cs (Attribute.Resolve): Add error 653 report.
7750
7751         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7752         report.
7753         (Method.ApplyAttributeBuilder): Add error 685 report.
7754         (Operator.Define): Add error 564 report.
7755
7756         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7757
7758         * expression.cs (Invocation.DoResolve): Add error
7759         245 and 250 report.
7760
7761         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7762         error 674 report.
7763
7764 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7765
7766         * class.cs (ConstructorInitializer.Resolve):
7767         Wrong error number (515->516).
7768
7769 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7770
7771         * class.cs (Indexer.Define): Add error 631 report.
7772
7773 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7774
7775         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7776
7777 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7778
7779         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7780
7781 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7782
7783         * cs-parser.jay: Added error CS0241 report.
7784
7785 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7786
7787         * cs-parser.jay (fixed_statement): Introduce a scope for the
7788         declaration in the 'fixed' statement.
7789
7790 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7791
7792         * cs-parser.jay: Added CS0230 error report.
7793
7794 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7795
7796         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7797
7798 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7799
7800         * expression.cs (Argument.Resolve): Added error CS0192 and
7801         CS0199 report.
7802
7803 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7804
7805         C# 2.0 #pragma warning feature
7806
7807         * cs-tokenizer.cs (PreProcessPragma): New method; 
7808         Handles #pragma directive.
7809
7810         * report.cs (WarningRegions): New class; Support
7811         class for #pragma warning directive. It tests whether
7812         warning is enabled for a given line.
7813
7814 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7815
7816         * const.cs: Add more descriptive error report, tahnks to
7817         Sebastien. 
7818
7819 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7820
7821         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7822
7823 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * expression.cs: Apply patch from Ben: Remove dead code from
7826         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7827         as that code just threw an exception anwyays.
7828
7829         * const.cs: Remove the call to the turnintoconstant, for details
7830         see bug: #63144
7831         
7832         * literal.cs: The type of the null-literal is the null type;  So
7833         we use a placeholder type (literal.cs:System.Null, defined here)
7834         for it.
7835
7836         * expression.cs (Conditional.DoResolve): Remove some old code that
7837         is no longer needed, conversions have been fixed.
7838
7839         (ArrayCreationExpression.DoResolve): Return false if we fail to
7840         resolve the inner expression.
7841
7842 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7843
7844         Fix test-290.cs.
7845         * cs-parser.jay (delegate_declaration): Record a delegate
7846         declaration as a type declaration.
7847         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7848
7849 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * parameter.cs: Do not crash if the type can not be resolved. 
7852
7853         * expression.cs: Report errors with unsafe pointers, fixes #64896
7854
7855 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7856
7857         * expression.cs: Pointer arith always needs to do a conv.i
7858         if the operand is a long. fix 65320
7859
7860 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7861
7862         Fixed cs0619-37.cs, cs0619-38.cs
7863
7864         * enum.cs (GetObsoleteAttribute): Removed.
7865
7866         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7867         on Enum member is double staged. The first is tested member
7868         and then enum.
7869
7870 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7871
7872         Fixed #56986, #63631, #65231
7873
7874         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7875         adds member to name container.
7876         (TypeContainer.AddToTypeContainer): New method, adds type to
7877         name container.
7878         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7879         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7880         AddOperator): Simplified by reusing AddToMemberContainer.
7881         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7882         instead of field.
7883         (Method.CheckForDuplications): Fixed implementation to test all
7884         possibilities.
7885         (MemberBase): Detection whether member is explicit interface
7886         implementation is now in constructor.
7887         (MemberBase.UpdateMemberName): Handles IndexerName.
7888         (Accessor): Changed to keep also location information.
7889         (AbstractPropertyEventMethod): Is derived from MemberCore.
7890         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7891         will be emited or not.
7892         (PropertyBase.AreAccessorsDuplicateImplementation):
7893         Tests whether accessors are not in collision with some method.
7894         (Operator): Is derived from MethodCore to simplify common
7895         operations.
7896
7897         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7898         must be performed.
7899         (DeclSpace.AddToContainer): Adds the member to defined_names
7900         table. It tests for duplications and enclosing name conflicts.
7901
7902         * enum.cs (EnumMember): Clean up to reuse the base structures
7903
7904 2004-09-03  Martin Baulig  <martin@ximian.com>
7905
7906         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7907         into TypeContainer, to make partial classes work again.
7908
7909 2004-09-03  Martin Baulig  <martin@ximian.com>
7910
7911         * rootcontext.cs (RootContext.V2): Removed.
7912
7913 2004-03-23  Martin Baulig  <martin@ximian.com>
7914
7915         * expression.cs (Invocation.OverloadResolve): Added `bool
7916         may_fail' argument and use it instead of the Location.IsNull() hack.
7917
7918 2004-09-03  Martin Baulig  <martin@ximian.com>
7919
7920         Merged latest changes into gmcs.  Please keep this comment in
7921         here, it makes it easier for me to see what changed in MCS since
7922         the last time I merged.
7923
7924 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7925
7926         Fix #61128.
7927         * expression.cs (BetterConversion): Don't allow either conversion 
7928         to be null.  Remove redundant implicit conversion test when 'q ==
7929         null' -- when this function is invoked, we already know that the
7930         implicit conversion exists.
7931         (BetterFunction): Assume that 'best' is non-null.  Remove
7932         redundant reimplementation of IsApplicable when 'best' is null.
7933         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7934         number of arguments.
7935         (IsAncestralType): Extract from OverloadResolve.
7936         (OverloadResolve): Make robust to the MethodGroupExpr being
7937         unsorted.  Implement all the logic of Section 14.5.5.1, and
7938         support overloading of methods from multiple applicable types.
7939         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7940
7941         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7942         (RealError, Warning): Append type of report to related symbol.
7943
7944 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * enum.cs: Fixed CLS-Compliance checks for enum members.
7947         Error tests cs3008-8.cs, cs3014-8.cs
7948
7949 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7950
7951         Fixed bug #62342, #63102
7952         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7953         like ImplementMethod.
7954
7955 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7956
7957         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7958         Fixed bug #65170.
7959
7960 2004-09-02  Martin Baulig  <martin@ximian.com>
7961
7962         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7963         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7964         on the MethodBase.
7965
7966 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7967
7968         C# 2.0 Static classes implemented
7969
7970         * class.cs (TypeContainer): instance_constructors,
7971         initialized_fields, initialized_static_fields,
7972         default_constructor, base_inteface_types are protected to be
7973         accessible from StaticClass.
7974         (TypeContainer.DefineDefaultConstructor): New virtual method
7975         for custom default constructor generating
7976         (StaticClass): New class to handle "Static classes" feature.
7977
7978         * cs-parser.jay: Handle static keyword on class like instance
7979         of StaticClass.
7980
7981         * driver.cs: Added "/langversion" command line switch with two
7982         options (iso-1, default).
7983
7984 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7985
7986         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7987
7988 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7989
7990         * delegate.cs: Style.
7991
7992 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7993
7994         * delegate.cs: Add seperate instance expr field for miguel.
7995
7996 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7997
7998         * PointerArithmetic (Resolve): make sure we are not doing
7999         pointer arith on void*. Also, make sure we are resolved
8000         by not setting eclass until resolve.
8001
8002         All callers: Make sure that PointerArithmetic gets resolved.
8003
8004 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8005
8006         * ArrayCreation (LookupType): If the type does not resolve 
8007         to an array, give an error.
8008
8009 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8010
8011         * statement.cs (Try.Resolve): Fixed bug #64222
8012
8013 2004-08-27  Martin Baulig  <martin@ximian.com>
8014
8015         * class.cs
8016         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8017         crash here.     
8018
8019 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8020
8021         * ecore.cs (Constantify): Get underlying type via
8022         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8023         Windows in special cases.
8024
8025 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8026
8027         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8028         for obtaining also private methods.
8029         (GetRemoveMethod): Used GetRemoveMethod (true)
8030         for obtaining also private methods.
8031
8032 2004-08-24  Martin Baulig  <martin@ximian.com>
8033
8034         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8035         MethodAttributes.HideBySig for operators.
8036
8037 2004-08-23  Martin Baulig  <martin@ximian.com>
8038
8039         Back to the old error reporting system :-)
8040
8041         * report.cs (Message): Removed.
8042         (Report.MessageData, ErrorData, WarningData): Removed.
8043         (Report.Error, Warning): Back to the old system.
8044
8045 2004-08-23  Martin Baulig  <martin@ximian.com>
8046
8047         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8048
8049         * class.cs (TypeContainer.ParentContainer): New public virtual
8050         method; replaces the explicit interface implementation.
8051         (ClassPart.ParentContainer): Override.
8052
8053 2004-08-23  Martin Baulig  <martin@ximian.com>
8054
8055         * statement.cs (Switch): Added support for constant switches; see
8056         #59428 or test-285.cs.
8057
8058 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8059
8060         Fixed bug #62740.
8061         * statement.cs (GetEnumeratorFilter): Removed useless
8062         logic because C# specs is strict. GetEnumerator must be
8063         public.
8064
8065 2004-08-22  Martin Baulig  <martin@ximian.com>
8066
8067         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8068         a switch and may break, reset the barrier.  Fixes #59867.
8069
8070 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8071
8072         CLS-Compliance speed up (~5% for corlib)
8073
8074         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8075         New method. Tests container for CLS-Compliant names
8076
8077         * class.cs (TypeContainer.VerifyClsName): New method.
8078         Checks whether container name is CLS Compliant.
8079         (Constructor): Implements IMethodData.
8080
8081         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8082         low-case table for CLS Compliance test.
8083         (MemberCache.VerifyClsParameterConflict): New method.
8084         Checks method parameters for CS3006 error.
8085
8086         * enum.cs (EnumMember): Is derived from MemberCore.
8087         (Enum.VerifyClsName): Optimized for better performance.
8088
8089 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * report.cs: Renamed Error_T to Error and changed all
8092         references.
8093
8094 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8095
8096         * class.cs (TypeContainer.IndexerArrayList): New inner class
8097         container for indexers.
8098         (TypeContainer.DefaultIndexerName): New constant for default
8099         indexer name. Replaced all "Item" with this constant.
8100         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8101
8102         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8103         DefaultMemberAttribute constructor.
8104
8105 2004-08-05  Martin Baulig  <martin@ximian.com>
8106
8107         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8108         Fix bug #59429.
8109
8110 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8111
8112         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8113         multi platforms problem.
8114
8115         * compiler.csproj: Included shared files.
8116
8117 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8118
8119         Fix bug 60333, 55971 in the more general way
8120         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8121         Added arg_type argument for constant conversion.
8122         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8123
8124 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8125
8126         Fix bug #59760
8127         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8128         OperatorArrayList, MethodCoreArrayList for typecontainer
8129         containers. Changed class member types to these new types.
8130         (MethodArrayList.DefineMembers): Added test for CS0659.
8131
8132 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8133
8134         * cfold.cs: Synchronize the folding with the code in expression.cs
8135         Binary.DoNumericPromotions for uint operands.
8136
8137         * attribute.cs: Revert patch from Raja, it introduced a regression
8138         while building Blam-1.2.1 (hard to isolate a test case).
8139
8140 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8141
8142         Fix for #55382
8143         * class.cs:
8144         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8145         name collision.
8146         (MethodCore.parent_method): New member. The method we're overriding
8147         if this is an override method.
8148         (MethodCore.CheckBase): Moved from Method class and made common.
8149         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8150         private.
8151         (MethodCore.CheckForDuplications): New abstract method. For custom
8152         member duplication search in a container
8153         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8154         method and its return type.
8155         (Event.conflict_symbol): New member. Symbol with same name in the
8156         parent class.
8157
8158         * decl.cs:
8159         (MemberCache.FindMemberWithSameName): New method. The method
8160         is looking for conflict with inherited symbols.
8161
8162 2004-08-04  Martin Baulig  <martin@ximian.com>
8163
8164         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8165
8166         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8167
8168 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8169
8170         * report.cs (Message): New enum for better error, warning reference in
8171         the code.
8172         (MessageData): New inner abstract class. It generally handles printing of
8173         error and warning messages.
8174         Removed unused Error, Warning, Message methods.
8175
8176 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8177
8178         Fix for cs0592-8.cs test
8179         * attribute.cs
8180         (Attributable.ValidAttributeTargets): Made public.
8181         (Attribute.ExplicitTarget): New member for explicit target value.
8182         (Attribute.CheckTargets): Now we translate explicit attribute
8183         target to Target here.
8184
8185 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8186
8187         * ecore.cs (MethodGroupExpr): new IsBase property.
8188
8189         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8190
8191         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8192         rather than an instance expr.
8193
8194         (DelegateCreation.Emit): Use the method group rather than
8195         the instance expression. Also, if you have base.Foo as the
8196         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8197
8198         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8199
8200         (NewDelegate.DoResolve): Only check for the existance of Invoke
8201         if the method is going to be needed. Use MethodGroupExpr.
8202
8203         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8204
8205         * expression.cs: For pointer arith., make sure to use
8206         the size of the type, not the size of the pointer to
8207         the type.
8208
8209 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8210
8211         Fix for #60722
8212         * class.cs (Class): Added error CS0502 test.
8213
8214 2004-08-03  John Luke  <jluke@cfl.rr.com>
8215             Raja R Harinath  <rharinath@novell.com>
8216
8217         Fix for #60997.
8218         * attribute.cs (Attribute.complained_before): New flag.
8219         (Attribute.ResolveType, Attribute.Resolve),
8220         (Attribute.DefinePInvokeMethod): Set it.
8221         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8222         
8223 2004-08-03  Martin Baulig  <martin@ximian.com>
8224
8225         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8226         use a user-defined operator; we still need to do numeric
8227         promotions in case one argument is a builtin type and the other
8228         one has an implicit conversion to that type.  Fixes #62322.
8229
8230 2004-08-02  Martin Baulig  <martin@ximian.com>
8231
8232         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8233         (LocalInfo.IsThis): New public property.
8234         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8235
8236 2004-08-01  Martin Baulig  <martin@ximian.com>
8237
8238         * class.cs (TypeContainer.GetClassBases): Don't set the default
8239         here since we may get called from GetPartialBases().
8240         (TypeContainer.DefineType): If GetClassBases() didn't return a
8241         parent, use the default one.
8242
8243 2004-07-30  Duncan Mak  <duncan@ximian.com>
8244
8245         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8246
8247 2004-07-30  Martin Baulig  <martin@ximian.com>
8248
8249         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8250
8251         * class.cs (SourceMethod): New public class, derive from the
8252         symbol writer's ISourceMethod.
8253         (Method): Use the new symbol writer API.
8254
8255         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8256         as argument and use the new symbol writer.
8257
8258         * location.cs
8259         (SourceFile): Implement the symbol writer's ISourceFile.
8260         (Location.SymbolDocument): Removed.
8261         (Location.SourceFile): New public property.
8262
8263         * symbolwriter.cs: Use the new symbol writer API.
8264
8265 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8266
8267         * Makefile (install-local): Remove.  Functionality moved to
8268         executable.make.
8269
8270 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8271
8272         * Makefile: Install mcs.exe.config file together with mcs.exe.
8273         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8274         correct runtime version.
8275         
8276 2004-07-25  Martin Baulig  <martin@ximian.com>
8277
8278         * class.cs
8279         (TypeContainer.RegisterOrder): Removed, this was unused.
8280         (TypeContainer, interface_order): Removed.
8281         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8282         TypeContainer as argument since we can also be called with a
8283         `PartialContainer' for a partial class/struct/interface.
8284         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8285         of checking whether we're an `Interface' - we could be a
8286         `PartialContainer'.
8287         (PartialContainer.Register): Override; call
8288         AddClass()/AddStruct()/AddInterface() on our parent.
8289
8290         * cs-parser.jay (interface_member_declaration): Add things to the
8291         `current_container', not the `current_class'.
8292
8293         * rootcontext.cs (RegisterOrder): The overloaded version which
8294         takes an `Interface' was unused, removed.
8295
8296         * typemanager.cs (TypeManager.LookupInterface): Return a
8297         `TypeContainer', not an `Interface'.
8298         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8299         contain a `PartialContainer' for an interface, so check it's
8300         `Kind' to figure out what it is.
8301
8302 2004-07-25  Martin Baulig  <martin@ximian.com>
8303
8304         * class.cs (Class.DefaultTypeAttributes): New public constant.
8305         (Struct.DefaultTypeAttributes): Likewise.
8306         (Interface.DefaultTypeAttributes): Likewise.
8307         (PartialContainer.TypeAttr): Override this and add the
8308         DefaultTypeAttributes.
8309
8310 2004-07-25  Martin Baulig  <martin@ximian.com>
8311
8312         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8313         we can just use the `Parent' field instead.
8314
8315 2004-07-25  Martin Baulig  <martin@ximian.com>
8316
8317         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8318
8319 2004-07-25  Martin Baulig  <martin@ximian.com>
8320
8321         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8322         our parts before defining any methods.
8323         (TypeContainer.VerifyImplements): Make this virtual.
8324         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8325         on our PartialContainer.
8326
8327 2004-07-25  Martin Baulig  <martin@ximian.com>
8328
8329         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8330
8331         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8332         argument, we can just use the `Parent' field instead.
8333
8334         * class.cs
8335         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8336         (MemberBase.DoDefine): Likewise.
8337
8338 2004-07-24  Martin Baulig  <martin@ximian.com>
8339
8340         * decl.cs (MemberCore.Parent): New public field.
8341         (DeclSpace.Parent): Moved to MemberCore.
8342
8343         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8344         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8345         parent's .ctor.
8346         (FieldBase, Field, Operator): Likewise.
8347         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8348         (EventField, Event): Likewise.
8349
8350 2004-07-23  Martin Baulig  <martin@ximian.com>
8351
8352         * class.cs (PartialContainer): New public class.
8353         (ClassPart): New public class.
8354         (TypeContainer): Added support for partial classes.
8355         (TypeContainer.GetClassBases): Splitted some of the functionality
8356         out into GetNormalBases() and GetPartialBases().
8357
8358         * cs-tokenizer.cs (Token.PARTIAL): New token.
8359         (Tokenizer.consume_identifier): Added some hacks to recognize
8360         `partial', but only if it's immediately followed by `class',
8361         `struct' or `interface'.
8362
8363         * cs-parser.jay: Added support for partial clases.
8364
8365 2004-07-23  Martin Baulig  <martin@ximian.com>
8366
8367         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8368         a `DeclSpace' and also made it readonly.
8369         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8370         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8371         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8372
8373         * cs-parser.jay: Pass the `current_class', not the
8374         `current_container' (at the moment, this is still the same thing)
8375         to a new Method, Property, Event, Indexer or Constructor.
8376
8377 2004-07-23  Martin Baulig  <martin@ximian.com>
8378
8379         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8380         and removed the `current_interface' one.
8381         (struct_declaration, class_declaration, interface_declaration):
8382         Set `current_class' to the newly created class/struct/interface;
8383         set their `Bases' and call Register() before parsing their body.
8384
8385 2004-07-23  Martin Baulig  <martin@ximian.com>
8386
8387         * class.cs (Kind): New public enum.
8388         (TypeContainer): Made this class abstract.
8389         (TypeContainer.Kind): New public readonly field.
8390         (TypeContainer.CheckDef): New public method; moved here from
8391         cs-parser.jay.
8392         (TypeContainer.Register): New public abstract method.
8393         (TypeContainer.GetPendingImplementations): New public abstract
8394         method.
8395         (TypeContainer.GetClassBases): Removed the `is_class' and
8396         `is_iface' parameters.
8397         (TypeContainer.DefineNestedTypes): Formerly known as
8398         DoDefineType().
8399         (ClassOrStruct): Made this class abstract.
8400
8401         * tree.cs (RootTypes): New public type. 
8402
8403 2004-07-20  Martin Baulig  <martin@ximian.com>
8404
8405         * tree.cs (Tree.RecordNamespace): Removed.
8406         (Tree.Namespaces): Removed.
8407
8408         * rootcontext.cs (RootContext.IsNamespace): Removed.
8409
8410         * cs-parser.jay (namespace_declaration): Just create a new
8411         NamespaceEntry here.
8412
8413 2004-07-20  Martin Baulig  <martin@ximian.com>
8414
8415         * statement.cs (ExceptionStatement): New abstract class.  This is
8416         now used as a base class for everyone who's using `finally'.
8417         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8418         our local variables before using them.
8419
8420         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8421         virtual method.  This is used by Yield.Resolve() to "steal" an
8422         outer block's `finally' clauses.
8423         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8424         argument.
8425
8426         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8427         version which takes an ExceptionStatement.  This version must be
8428         used to create exception branchings.
8429
8430         * iterator.cs
8431         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8432         (Iterator.EmitMoveNext): Added exception support; protect the
8433         block with a `fault' clause, properly handle 'finally' clauses.
8434         (Iterator.EmitDispose): Run all the `finally' clauses here.
8435
8436 2004-07-20  Martin Baulig  <martin@ximian.com>
8437
8438         * iterator.cs: This is the first of a set of changes in the
8439         iterator code.  Match the spec more closely: if we're an
8440         IEnumerable, then GetEnumerator() must be called.  The first time
8441         GetEnumerator() is called, it returns the current instance; all
8442         subsequent invocations (if any) must create a copy.
8443
8444 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8445
8446         * expression.cs: Resolve the constant expression before returning
8447         it. 
8448
8449 2004-07-19  Martin Baulig  <martin@ximian.com>
8450
8451         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8452         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8453         the return type of the new EmitContext.
8454
8455 2004-07-18  Martin Baulig  <martin@ximian.com>
8456
8457         * class.cs (Property.Define): Fix iterators.
8458
8459         * iterators.cs (Iterator.Define): Moved the
8460         `container.AddInterator (this)' call here from the .ctor; only do
8461         it if we resolved successfully.
8462
8463 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8464
8465         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8466         `true' for preprocessing directives that we parse.  The return
8467         value indicates whether we should return to regular tokenizing or
8468         not, not whether it was parsed successfully.
8469
8470         In the past if we were in: #if false ... #line #endif, we would
8471         resume parsing after `#line'.  See bug 61604.
8472
8473         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8474         building: IsEnumType should return true only for enums, not for
8475         enums or System.Enum itself.  This fixes #61593.
8476
8477         Likely what happened is that corlib was wrong: mcs depended on
8478         this bug in some places.  The bug got fixed, we had to add the
8479         hack, which caused bug 61593.
8480
8481         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8482         that was a workaround for the older conditions.
8483
8484 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8485
8486         * assign.cs: IAssignMethod has a new interface, as documented
8487         inline. All assignment code now uses this new api.
8488
8489         * ecore.cs, expression.cs: All classes which implement
8490         IAssignMethod now use the new interface.
8491
8492         * expression.cs (Invocation): add a hack to EmitCall so that
8493         IndexerAccess can be the target of a compound assignment without
8494         evaluating its arguments twice.
8495
8496         * statement.cs: Handle changes in Invocation api.
8497
8498 2004-07-16  Martin Baulig  <martin@ximian.com>
8499
8500         * iterators.cs: Rewrote this.  We're now using one single Proxy
8501         class for both the IEnumerable and the IEnumerator interface and
8502         `Iterator' derives from Class so we can use the high-level API.
8503
8504         * class.cs (TypeContainer.AddIterator): New method.
8505         (TypeContainer.DoDefineType): New protected virtual method, which
8506         is called from DefineType().
8507         (TypeContainer.DoDefineMembers): Call DefineType() and
8508         DefineMembers() on all our iterators.
8509         (TypeContainer.Emit): Call Emit() on all our iterators.
8510         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8511
8512         * codegen.cs (EmitContext.CurrentIterator): New public field.
8513
8514 2004-07-15  Martin Baulig  <martin@ximian.com>
8515
8516         * typemanager.cs
8517         (TypeManager.not_supported_exception_type): New type.   
8518
8519 2004-07-14  Martin Baulig  <martin@ximian.com>
8520
8521         * iterators.cs: Use real error numbers.
8522
8523 2004-07-14  Martin Baulig  <martin@ximian.com>
8524
8525         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8526         requires this to be a System.Collection.IEnumerable and not a
8527         class implementing that interface.
8528         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8529
8530 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8531
8532         * class.cs: Fixed previous fix, it broke some error tests.
8533
8534 2004-07-12  Martin Baulig  <martin@ximian.com>
8535
8536         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8537         Fixes #61293.
8538
8539 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8540
8541         * assign.cs (LocalTemporary): Add new argument: is_address,If
8542         `is_address' is true, then the value that we store is the address
8543         to the real value, and not the value itself.
8544         
8545         * ecore.cs (PropertyExpr): use the new local temporary
8546         stuff to allow us to handle X.Y += z (where X is a struct)
8547
8548 2004-07-08  Martin Baulig  <martin@ximian.com>
8549
8550         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8551         not always return, just like we're doing in Using.Resolve().
8552
8553 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8554
8555         * cs-parser.jay (fixed_statement): flag this as Pinned.
8556
8557 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8558
8559         * typemanager.cs (TypeManager): Removed MakePinned method, this
8560         mechanism is replaced with the .NET 2.x compatible mechanism of
8561         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8562
8563         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8564         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8565         `IsFixed' property which has a different meaning.
8566
8567 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8568
8569         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8570         visible from inside a nested class, not just the names of the
8571         immediately enclosing class.
8572         Fix for bug #60730.
8573
8574 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8575
8576         * expression.cs (BetterConversion): Remove buggy special-case
8577         handling of "implicit constant expression conversions".  At this
8578         point, we already know that the conversion is possible -- we're
8579         only checking to see which is better.
8580
8581 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8582
8583         * cs-parser.jay: Added error CS0210 test.
8584
8585 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8586
8587         * cs-parser.jay: Added error CS0134 test.
8588
8589 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8590
8591         Fix bug #52507
8592         * cs-parser.jay: Added error CS0145 test.
8593
8594 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8595
8596         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8597
8598 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8599         
8600         * expression.cs (StackAlloc.Resolve): The argument may not
8601         be a constant; deal with this case.
8602         
8603 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8604
8605         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8606         GetIndexerAttributeValue.
8607         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8608
8609         * class.cs (Indexer.Define): Added error tests for CS0415,
8610         CS0609.
8611
8612 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8613
8614         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8615         property code.
8616
8617 2004-06-23  Martin Baulig  <martin@ximian.com>
8618
8619         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8620         neither return nor throw, reset the barrier as well.  Fixes #60457.
8621
8622 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8623
8624         * class.cs : EventAttributes is now set to None by default.
8625           This fixes bug #60459.
8626
8627 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8628
8629         Fix bug #60219
8630         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8631         Don't throw exception but return null (it's sufficient now).
8632
8633 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8634
8635         * typemanager.cs (GetArgumentTypes): Faster implementation.
8636
8637 2004-06-18  Martin Baulig  <martin@ximian.com>
8638
8639         * attribute.cs (Attribute.Resolve): Check whether we're an
8640         EmptyCast which a Constant child.  Fixes #60333.
8641
8642 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8643
8644         * statement.cs (EmitCollectionForeach): Account for the fact that
8645         not all valuetypes are in areas which we can take the address of.
8646         For these variables, we store to a temporary variable. Also, make
8647         sure that we dont emit a `callvirt' on a valuetype method.
8648
8649 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8650
8651         * expression.cs (StackAlloc.DoReSolve): Added test for
8652         negative parameter (CS0247).
8653
8654 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8655
8656         Fix bug #59792
8657         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8658
8659 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8660
8661         Fix bug #59781
8662         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8663         ulong.
8664
8665 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8666
8667         Fix bug #58254 & cs1555.cs, cs1556.cs
8668         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8669
8670 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8671
8672         * cs-parser.jay: Added error CS1669 test for indexers.
8673
8674 2004-06-11  Martin Baulig  <martin@ximian.com>
8675
8676         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8677         call this twice: for params and varargs methods.
8678
8679 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8680
8681         * class.cs:
8682         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8683
8684 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8685
8686         * attribute.cs (Attribute.GetValidTargets): Made public.
8687
8688         * class.cs: 
8689         (AbstractPropertyEventMethod): New class for better code sharing.
8690         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8691         CS1667 report.
8692         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8693
8694 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8695
8696         Fix bug #59477.
8697         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8698         that the call to Resolve is part of a MemberAccess.
8699         (Expression.Resolve): Use it for SimpleName resolution.
8700         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8701         Add 'intermediate' boolean argument.
8702         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8703         error message when the SimpleName can be resolved ambiguously
8704         between an expression and a type.
8705         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8706         public.
8707         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8708         call on the left-side.
8709
8710 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8711
8712         * class.cs:
8713         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8714
8715 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8716
8717         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8718
8719 2004-06-11  Martin Baulig  <martin@ximian.com>
8720
8721         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8722         varargs methods if applicable.
8723
8724 2004-06-11  Martin Baulig  <martin@ximian.com>
8725
8726         * expression.cs (Invocation.EmitCall): Don't use
8727         `method.CallingConvention == CallingConventions.VarArgs' since the
8728         method could also have `CallingConventions.HasThis'.
8729
8730 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8731
8732         * class.cs (Event.GetSignatureForError): Implemented.
8733         Fixed crash in error test cs3010.cs
8734
8735 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8736
8737         * cs-tokenizer.cs: Change the way we track __arglist to be
8738         consistent with the other keywords.
8739
8740 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8741
8742         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8743         tomorrow.
8744
8745 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8746
8747         * codegen.cs: Check that all referenced assemblies have a strongname
8748         before strongnaming the compiled assembly. If not report error CS1577.
8749         Fix bug #56563. Patch by Jackson Harper.
8750         * typemanager.cs: Added a method to return all referenced assemblies.
8751         Fix bug #56563. Patch by Jackson Harper.
8752
8753 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8754
8755         * class.cs:
8756         (Method.ApplyAttributeBuilder): Moved and added conditional
8757         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8758
8759         * delegate.cs:
8760         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8761
8762 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8763
8764         Fixed #59640
8765         * class.cs: (EventField.attribute_targets): Changed default target.
8766
8767 2004-06-08  Martin Baulig  <martin@ximian.com>
8768
8769         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8770
8771 2004-06-08  Martin Baulig  <martin@ximian.com>
8772
8773         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8774
8775 2004-06-07  Martin Baulig  <martin@ximian.com>
8776
8777         Added support for varargs methods.
8778
8779         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8780         keyword.
8781
8782         * cs-parser.jay: Added support for `__arglist'.
8783
8784         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8785
8786         * expression.cs (Argument.AType): Added `ArgList'.
8787         (Invocation): Added support for varargs methods.
8788         (ArglistAccess): New public class.
8789         (Arglist): New public class.
8790
8791         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8792
8793         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8794         a method's top-level block if the method has varargs.
8795
8796         * support.cs (ReflectionParameters, InternalParameters): Added
8797         support for varargs methods.    
8798
8799 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8800
8801         * class.cs: Provide location in indexer error report.
8802
8803         * driver.cs: Use standard names.
8804
8805         * namespace.cs: Catch the use of using after a namespace has been
8806         declared also on using aliases.
8807
8808 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8809
8810         Bug #50820.
8811         * typemanager.cs (closure_private_ok, closure_invocation_type)
8812         (closure_qualifier_type, closure_invocation_assembly)
8813         (FilterWithClosure): Move to ...
8814         (Closure): New internal nested class.
8815         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8816         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8817         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8818         (MemberLookup, MemberLookupFailed): Use it.
8819         * expression.cs (New.DoResolve): Treat the lookup for the
8820         constructor as being qualified by the 'new'ed type.
8821         (Indexers.GetIndexersForTypeOrInterface): Update.
8822
8823 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8824
8825         * attribute.cs
8826         (GetConditionalAttributeValue): New method. Returns
8827         condition of ConditionalAttribute.
8828         (SearchMulti): New method.  Returns all attributes of type 't'.
8829         Use it when attribute is AllowMultiple = true.
8830         (IsConditionalMethodExcluded): New method.
8831
8832         * class.cs
8833         (Method.IsExcluded): Implemented. Returns true if method has conditional
8834         attribute and the conditions is not defined (method is excluded).
8835         (IMethodData): Extended interface for ConditionalAttribute support.
8836         (PropertyMethod.IsExcluded): Implemented.
8837
8838         * decl.cs
8839         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8840
8841         * expression.cs
8842         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8843         on the method.
8844
8845 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8846
8847         * expression.cs (ArrayCreationExpression): Make this just an
8848         `expression'. It can't be a statement, so the code here was
8849         dead.
8850
8851 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8852
8853         Fixed #59072
8854         * typemanager.cs (GetFullNameSignature): New method for
8855         MethodBase types.
8856
8857 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8858
8859         Fixed #56452
8860         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8861         Use this method when MethodBuilder is null.
8862         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8863         Added test for error CS0626 (MONO reports error for this situation).
8864         (IMethodData.GetSignatureForError): Extended interface.
8865
8866 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8867
8868         * attribute.cs
8869         (AttributeTester.GetObsoleteAttribute): Returns instance of
8870         ObsoleteAttribute when type is obsolete.
8871
8872         * class.cs
8873         (TypeContainer.VerifyObsoleteAttribute): Override.
8874         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8875         (MethodCode.VerifyObsoleteAttribute): Override.
8876         (MemberBase.VerifyObsoleteAttribute): Override.
8877
8878         * decl.cs
8879         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8880         and report proper error.
8881
8882         *delegate.cs
8883         Delegate.VerifyObsoleteAttribute): Override.
8884
8885         * ecore.cs
8886         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8887         and report proper error.
8888         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8889
8890         * enum.cs
8891         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8892         and enum member.
8893
8894         * expression.cs
8895         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8896         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8897         Added test for ObsoleteAttribute.
8898
8899         * statement.cs
8900         (Catch): Derived from Statement.
8901
8902 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8903  
8904         Fixed bug #59071 & cs0160.cs
8905  
8906         * statement.cs (Try.Resolve): Check here whether order of catch
8907         clauses matches their dependencies.
8908
8909 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8910
8911         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8912         caused a regression: #59343.  Referencing nested classes from an
8913         assembly stopped working.
8914
8915 2004-05-31  Martin Baulig  <martin@ximian.com>
8916
8917         MCS is now frozen for beta 2.
8918
8919 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8920
8921         * convert.cs: add a trivial cache for overload operator resolution.
8922
8923 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8924
8925         * decl.cs: If possible, use lookuptypedirect here. We can only do
8926         this if there is no `.' after the namespace. Avoids using
8927         LookupType, which does lots of slow processing.
8928         (FindNestedType) New method, does what it says :-).
8929         * namespace.cs: use LookupTypeDirect.
8930         * rootcontext.cs: use membercache, if possible.
8931         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8932
8933 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8934
8935         * expression.cs:
8936         According to the spec, 
8937
8938         In a member access of the form E.I, if E is a single identifier,
8939         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8940         field, property, localvariable, or parameter with the same type as
8941         the meaning of E as a type-name (§3.8), then both possible
8942         meanings of E are permitted.
8943
8944         We did not check that E as a simple-name had the same type as E as
8945         a type name.
8946
8947         This trivial check gives us 5-7% on bootstrap time.
8948
8949 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8950
8951         * expression.cs (Invocation.OverloadResolve): Avoid the
8952         use of hashtables and boxing here by allocating on demand.
8953
8954 2004-05-30  Martin Baulig  <martin@ximian.com>
8955
8956         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8957         we're doing a silent lookup.  Don't try to lookup nested types in
8958         TypeManager.object_type (thanks to Ben Maurer).
8959
8960 2004-05-30  Martin Baulig  <martin@ximian.com>
8961
8962         Committing a patch from Ben Maurer.
8963
8964         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8965
8966 2004-05-29  Martin Baulig  <martin@ximian.com>
8967
8968         * class.cs (IMethodData.ShouldIgnore): New method.
8969
8970         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8971         `Location' argument, we don't need it anywhere.  Use
8972         `IMethodData.ShouldIgnore ()' instead of
8973         `MethodData.GetMethodFlags ()'.
8974         (TypeManager.AddMethod): Removed.
8975         (TypeManager.AddMethod2): Renamed to AddMethod.
8976
8977 2004-05-29  Martin Baulig  <martin@ximian.com>
8978
8979         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8980
8981         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8982         converting from a class type S to an interface type and we already
8983         have an object on the stack, don't box it again.  Fixes #52578.
8984
8985 2004-05-29  Martin Baulig  <martin@ximian.com>
8986
8987         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8988         Added support for `params' parameters.  Fixes #59267.
8989
8990 2004-05-29  Martin Baulig  <martin@ximian.com>
8991
8992         * literal.cs (NullPointer): Provide a private .ctor which sets
8993         `type' to TypeManager.object_type.  Fixes #59048.
8994
8995 2004-05-29  Martin Baulig  <martin@ximian.com>
8996
8997         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8998         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8999
9000         * ecore.cs (EventExpr.instance_expr): Make the field private.
9001
9002 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9003
9004         Fixed bug #50080 & cs0214-2.cs
9005         * expression.cs (Cast.DoResolve): Check unsafe context here.
9006         
9007         * statement.cs (Resolve.DoResolve): Likewise.
9008
9009 2004-05-26  Martin Baulig  <martin@ximian.com>
9010
9011         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9012
9013         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9014         (RootContext.LookupType): Pass down the `silent' flag.
9015
9016 2004-05-25  Martin Baulig  <martin@ximian.com>
9017
9018         * expression.cs
9019         (MethodGroupExpr.IdenticalTypeName): New public property.
9020         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9021         expression actually refers to a type.
9022
9023 2004-05-25  Martin Baulig  <martin@ximian.com>
9024
9025         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9026         for #56176 and made it actually work.
9027
9028 2004-05-25  Martin Baulig  <martin@ximian.com>
9029
9030         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9031         (FieldExpr, PropertyExpr): Override and implement
9032         CacheTemporaries.  Fixes #52279.
9033
9034 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9035
9036         * location.cs: In the new compiler listing a file twice is a
9037         warning, not an error.
9038
9039 2004-05-24  Martin Baulig  <martin@ximian.com>
9040
9041         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9042         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9043
9044 2004-05-24  Martin Baulig  <martin@ximian.com>
9045
9046         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9047         walking the `using' list.  Fixes #53921.
9048
9049 2004-05-24  Martin Baulig  <martin@ximian.com>
9050
9051         * const.cs (Const.LookupConstantValue): Added support for
9052         EmptyCast's; fixes #55251.
9053
9054 2004-05-24  Martin Baulig  <martin@ximian.com>
9055
9056         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9057         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9058         which does the CS0135 check.  The reason is that we first need to
9059         check whether the variable actually exists.
9060
9061 2004-05-24  Martin Baulig  <martin@ximian.com>
9062
9063         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9064         than RootContext.LookupType() to find the explicit interface
9065         type.  Fixes #58584.
9066
9067 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9068
9069         * Makefile: Simplify.  Use executable.make.
9070         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9071
9072 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9073
9074         * decl.cs:
9075         * enum.cs:
9076         Use the invariant culture when doing String.Compare for CLS case
9077         sensitivity.
9078         
9079 2004-05-23  Martin Baulig  <martin@ximian.com>
9080
9081         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9082         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9083
9084         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9085         
9086 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9087
9088         * class.cs (MemberBase.Define): Reuse MemberType member for 
9089         resolved type. Other methods can use it too.
9090
9091 2004-05-23  Martin Baulig  <martin@ximian.com>
9092
9093         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9094         the variable also exists in the current block (otherwise, we need
9095         to report a CS0103).  Fixes #58670.
9096
9097 2004-05-23  Martin Baulig  <martin@ximian.com>
9098
9099         * flowanalysis.cs (Reachability.Reachable): Compute this
9100         on-the-fly rather than storing it as a field.
9101
9102 2004-05-23  Martin Baulig  <martin@ximian.com>
9103
9104         * flowanalysis.cs (Reachability.And): Manually compute the
9105         resulting `barrier' from the reachability.      
9106        
9107 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9108
9109         Fix bug #57835
9110         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9111         instance of ObsoleteAttribute when symbol is obsolete.
9112
9113         * class.cs
9114         (IMethodData): Extended interface for ObsoleteAttribute support.
9115
9116 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9117
9118         * attribute.cs: Fix bug #55970
9119
9120 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9121
9122         Fix bug #52705
9123         * attribute.cs
9124         (GetObsoleteAttribute): New method. Creates the instance of
9125         ObsoleteAttribute.
9126         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9127         ObsoleteAttribute when member is obsolete.
9128         (AttributeTester.Report_ObsoleteMessage): Common method for
9129         Obsolete error/warning reporting.
9130
9131         * class.cs
9132         (TypeContainer.base_classs_type): New member for storing parent type.
9133
9134         * decl.cs
9135         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9136         for this MemberCore.
9137
9138 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9139
9140         * attribute.cs, const.cs: Fix bug #58590
9141
9142 2004-05-21  Martin Baulig  <martin@ximian.com>
9143
9144         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9145         out parameters if the end of the method is unreachable.  Fixes
9146         #58098. 
9147
9148 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9149
9150         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9151         Hari was right, why extra method.
9152
9153 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9154
9155         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9156
9157 2004-05-20  Martin Baulig  <martin@ximian.com>
9158
9159         Merged this back from gmcs to keep the differences to a minumum.
9160
9161         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9162         instead of a Declspace.
9163         (Attribute.ResolveType): Likewise.
9164         (Attributes.Search): Likewise.
9165         (Attributes.Contains): Likewise.
9166         (Attributes.GetClsCompliantAttribute): Likewise.
9167
9168         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9169         argument.
9170         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9171         DeclSpace.
9172
9173 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9174
9175         Fix bug #58688 (MCS does not report error when the same attribute
9176         is assigned twice)
9177
9178         * attribute.cs (Attribute.Emit): Distinction between null and default.
9179
9180 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9181
9182         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9183         of a top-level attribute without an attribute target.
9184         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9185         Make non-static.
9186         (Attribute.Conditional_GetConditionName), 
9187         (Attribute.Obsolete_GetObsoleteMessage): Update.
9188         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9189         part of ScanForIndexerName.
9190         (Attribute.CanIgnoreInvalidAttribute): New function.
9191         (Attribute.ScanForIndexerName): Move to ...
9192         (Attributes.ScanForIndexerName): ... here.
9193         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9194         (Attributes.Search): New internal variant that can choose not to
9195         complain if types aren't resolved.  The original signature now
9196         complains.
9197         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9198         complaints suppressed.
9199         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9200         only if it not useful.
9201         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9202         top-level for attributes that are shared between the assembly
9203         and a top-level class.
9204         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9205         * class.cs: Update to reflect changes.
9206         (DefineIndexers): Fuse loops.
9207         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9208         a couple more variants of attribute names.
9209
9210 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9211
9212         Fix bug #52585 (Implemented explicit attribute declaration)
9213
9214         * attribute.cs:
9215         (Attributable.ValidAttributeTargets): New abstract method. It gets
9216         list of valid attribute targets for explicit target declaration.
9217         (Attribute.Target): It holds target itself.
9218         (AttributeSection): Removed.
9219         (Attribute.CheckTargets): New method. It checks whether attribute
9220         target is valid for the current element.
9221
9222         * class.cs:
9223         (EventProperty): New class. For events that are declared like
9224         property (with add and remove accessors).
9225         (EventField): New class. For events that are declared like field.
9226         class.cs
9227
9228         * cs-parser.jay: Implemented explicit attribute target declaration.
9229
9230         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9231         Override ValidAttributeTargets.
9232
9233         * parameter.cs:
9234         (ReturnParameter): Class for applying custom attributes on 
9235         the return type.
9236         (ParameterAtribute): New class. Class for applying custom
9237         attributes on the parameter type.
9238
9239 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9240
9241         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9242         definitions. 
9243
9244         (Method): Allow UNSAFE here.
9245
9246         * modifiers.cs: Support unsafe reporting.
9247
9248 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9249
9250         * decl.cs: Fix bug #58478.
9251
9252 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9253
9254         * statement.cs: When checking for unreachable code on an EmptyStatement,
9255         set the location. Fixes bug #58488.
9256
9257 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9258
9259         * driver.cs: Add -pkg handling.
9260
9261         From Gonzalo: UseShelLExecute=false
9262
9263 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9264
9265         * attribute.cs:
9266         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9267         for attribute.
9268         (Attribute.IsClsCompliaceRequired): Moved to base for better
9269         accesibility.
9270         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9271         when attribute is AttributeUsageAttribute.
9272         (Attribute.GetValidTargets): Simplified.
9273         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9274         attribute for this type.
9275         (Attribute.ApplyAttributes): Method renamed to Emit and make
9276         non-static.
9277         (GlobalAttributeSection): New class for special handling of global
9278         attributes (assembly, module).
9279         (AttributeSection.Emit): New method.
9280
9281         * class.cs: Implemented Attributable abstract methods.
9282         (MethodCore.LabelParameters): Moved to Parameter class.
9283         (Accessor): Is back simple class.
9284         (PropertyMethod): Implemented Attributable abstract class.
9285         (DelegateMethod): Implemented Attributable abstract class.
9286         (Event): New constructor for disctintion between normal Event
9287         and Event with accessors.
9288
9289         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9290
9291         * codegen.cs, const.cs, decl.cs, delegate.cs:
9292         (CommonAssemblyModulClass): Implemented Attributable abstract class
9293         and simplified.
9294
9295         * enum.cs: Implement IAttributeSupport interface.
9296         (EnumMember): New class for emum members. Implemented Attributable
9297         abstract class
9298
9299         * parameter.cs:
9300         (ParameterBase): Is abstract.
9301         (ReturnParameter): New class for easier [return:] attribute handling.
9302
9303         * typemanager.cs: Removed builder_to_attr.
9304
9305 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9306
9307         Fix bug #57151.
9308         * attribute.cs (Attribute.GetPositionalValue): New function.
9309         * class.cs (TypeContainer.VerifyMembers): New function.
9310         (TypeContainer.Emit): Use it.
9311         (ClassOrStruct): New base class for Class and Struct.
9312         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9313         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9314         class.
9315         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9316         then each non-static field should have a FieldOffset attribute.
9317         Otherwise, none of the fields should have a FieldOffset attribute.
9318         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9319         and FieldOffset attributes.
9320         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9321         (TypeManager.field_offset_attribute_type): New core types.
9322         (TypeManager.InitCoreTypes): Initialize them.
9323
9324 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9325
9326         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9327         Return correct type.
9328         From bug #58270.
9329
9330 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9331
9332         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9333         be implicitly converted to ulong.
9334         
9335         * expression.cs: The logic for allowing operator &, | and ^ worked
9336         was wrong, it worked before because we did not report an error in
9337         an else branch.  Fixes 57895.
9338
9339         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9340         allow volatile fields to be reference types.
9341
9342 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9343
9344         * driver.cs: Add support for /debug-
9345
9346 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9347
9348         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9349         Add a 'complain' parameter to silence errors.
9350         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9351         silently overlooked type-resolutions.
9352         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9353         to reflect changes.
9354         (Attributes.Search): New function.
9355         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9356         (Attributes.GetAttributeFullName): Remove hack.
9357         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9358         Update to reflect changes.
9359         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9360         Use Attributes.Search instead of nested loops.
9361
9362 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9363
9364         * decl.cs:
9365         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9366         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9367         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9368
9369         * report.cs: (Report.Warning): Renamed to Warning_T because of
9370         parameter collision.
9371
9372 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9373
9374         * expression.cs (MemberAccess.ResolveMemberAccess):
9375         Exit with non-zero status after Report.Error.
9376         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9377         Likewise.
9378         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9379
9380 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9381
9382         * support.cs: Don't hang when the file is empty.
9383
9384 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9385
9386         * support.cs: In SeekableStreamReader, compute the preamble size of the
9387           underlying stream. Position changes should take into account that initial
9388           count of bytes.
9389
9390 2004-05-03  Todd Berman  <tberman@sevenl.net>
9391
9392         * driver.cs: remove unused GetSysVersion function.
9393
9394 2004-05-03  Todd Berman  <tberman@sevenl.net>
9395
9396         * driver.cs: Remove the hack from saturday, as well as the hack
9397         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9398         link_paths to get that bit proper.
9399
9400 2004-05-01  Todd Berman  <tberman@sevenl.net>
9401
9402         * driver.cs: Try a LoadFrom before a Load, this checks the current
9403         path. This is currently a bug in mono that is be fixed, however, this
9404         provides a workaround for now. This will be removed when the bug
9405         is fixed.
9406
9407 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9408
9409         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9410         incomplete key pairs (#57941).
9411
9412 2004-05-01  Todd Berman  <tberman@sevenl.net>
9413
9414         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9415         from the GAC
9416
9417 2004-04-30  Jackson Harper  <jackson@ximian.com>
9418
9419         * codegen.cs: Open keys readonly.
9420         
9421 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9422
9423         * typemanager.cs: don't report cyclic struct layout when a struct
9424         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9425         which has 2 Pango.Rectangle fields.
9426
9427 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9428
9429         * expression.cs: Handle IntPtr comparisons with IL code
9430         rather than a method call.
9431
9432 2004-04-29  Martin Baulig  <martin@ximian.com>
9433
9434         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9435         the list of PropertyInfo's in class hierarchy and find the
9436         accessor.  Fixes #56013.
9437
9438 2004-04-29  Martin Baulig  <martin@ximian.com>
9439
9440         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9441
9442 2004-04-29  Martin Baulig  <martin@ximian.com>
9443
9444         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9445
9446         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9447
9448 2004-04-29  Martin Baulig  <martin@ximian.com>
9449
9450         * class.cs (ConstructorInitializer.Resolve): Check whether the
9451         parent .ctor is accessible.  Fixes #52146.
9452
9453 2004-04-29  Martin Baulig  <martin@ximian.com>
9454
9455         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9456
9457         * statement.cs (Using.EmitLocalVariableDecls): Use
9458         TypeManager.idisposable_type, not typeof (IDisposable).
9459         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9460
9461 2004-04-29  Martin Baulig  <martin@ximian.com>
9462
9463         * class.cs (Event.Define): Don't emit the field and don't set
9464         RTSpecialName and SpecialName for events on interfaces.  Fixes
9465         #57703. 
9466
9467 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9468
9469         Refactor Attribute.ApplyAttributes.
9470         * attribute.cs (Attributable): New base class for objects that can
9471         have Attributes applied on them.
9472         (Attribute): Make AttributeUsage fields public.
9473         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9474         (Attribute.IsInternalCall): New property.
9475         (Attribute.UsageAttr): Convert to a public read-only property.
9476         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9477         (Attribute.ResolveType, Attribute.Resolve)
9478         (Attribute.ScanForIndexerName): Update to reflect changes.
9479         (Attribute.CheckAttributeTarget): Re-format.
9480         (Attribute.ApplyAttributes): Refactor, to various
9481         Attributable.ApplyAttributeBuilder methods.
9482         * decl.cs (MemberCore): Make Attributable.
9483         * class.cs (Accessor): Make Attributable.
9484         (MethodData.ApplyAttributes): Use proper attribute types, not
9485         attribute names.
9486         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9487         (TypeContainer.ApplyAttributeBuilder)
9488         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9489         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9490         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9491         (Operator.ApplyAttributeBuilder): New factored-out methods.
9492         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9493         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9494         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9495         * parameter.cs (ParameterBase): New Attributable base class
9496         that can also represent Return types.
9497         (Parameter): Update to the changes.
9498
9499 2004-04-29  Jackson Harper  <jackson@ximian.com>
9500
9501         * driver.cs: Prefer the corlib system version when looking for
9502         assemblies in the GAC. This is still a hack, but its a better hack
9503         now.
9504         
9505 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9506
9507         * decl.cs, enum.cs: Improved error 3005 reporting.
9508   
9509         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9510         (related_symbols): New private member for list of symbols
9511         related to reported error/warning.
9512         
9513         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9514
9515 2004-04-29  Martin Baulig  <martin@ximian.com>
9516
9517         * ecore.cs (Expression.Constantify): If we're an enum and
9518         TypeManager.TypeToCoreType() doesn't give us another type, use
9519         t.UnderlyingSystemType.  Fixes #56178.  
9520
9521 2004-04-29  Martin Baulig  <martin@ximian.com>
9522
9523         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9524         interfaces and for each interface, only add members directly
9525         declared in that interface.  Fixes #53255.
9526
9527 2004-04-28  Martin Baulig  <martin@ximian.com>
9528
9529         * expression.cs (ConditionalLogicalOperator): Use a temporary
9530         variable for `left' to avoid that we evaluate it more than once;
9531         bug #52588.
9532
9533 2004-04-28  Martin Baulig  <martin@ximian.com>
9534
9535         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9536         `void[]' (CS1547).
9537
9538 2004-04-28  Martin Baulig  <martin@ximian.com>
9539
9540         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9541         void (CS1547).
9542
9543         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9544         whether the type is not void (CS1547).
9545
9546 2004-04-28  Martin Baulig  <martin@ximian.com>
9547
9548         * expression.cs (Unary.DoResolveLValue): Override this and report
9549         CS0131 for anything but Operator.Indirection.
9550
9551 2004-04-28  Martin Baulig  <martin@ximian.com>
9552
9553         Committing a patch from Ben Maurer; see bug #50820.
9554
9555         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9556         check for classes.
9557
9558         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9559         classes.        
9560
9561 2004-04-28  Martin Baulig  <martin@ximian.com>
9562
9563         Committing a patch from Ben Maurer; see bug #50820.
9564
9565         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9566         check for classes.
9567
9568         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9569         classes.        
9570
9571 2004-04-28  Martin Baulig  <martin@ximian.com>
9572
9573         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9574         (Block.AddLabel): Call DoLookupLabel() to only search in the
9575         current block.
9576
9577 2004-04-28  Martin Baulig  <martin@ximian.com>
9578
9579         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9580         comparing StringConstants and NullLiterals in Equality and Inequality.
9581
9582 2004-04-28  Jackson Harper  <jackson@ximian.com>
9583
9584         * driver.cs: Attempt to load referenced assemblies from the
9585         GAC. This is the quick and dirty version of this method that
9586         doesnt take into account versions and just takes the first
9587         canidate found. Will be good enough for now as we will not have more
9588         then one version installed into the GAC until I update this method.
9589
9590 2004-04-28  Martin Baulig  <martin@ximian.com>
9591
9592         * typemanager.cs (TypeManager.CheckStructCycles): New public
9593         static method to check for cycles in the struct layout.
9594
9595         * rootcontext.cs (RootContext.PopulateTypes): Call
9596         TypeManager.CheckStructCycles() for each TypeContainer.
9597         [Note: We only need to visit each type once.]
9598
9599 2004-04-28  Martin Baulig  <martin@ximian.com>
9600
9601         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9602
9603         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9604         success and added `out object value'.  Use a `bool resolved' field
9605         to check whether we've already been called rather than
9606         `ConstantValue != null' since this breaks for NullLiterals.
9607
9608 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9609
9610         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9611         setting of this flag, since the 'set' method may be non-public.
9612
9613 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9614
9615         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9616         check on current_vector.Block.
9617
9618 2004-04-27  Martin Baulig  <martin@ximian.com>
9619
9620         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9621         a field initializer.  Fixes #56459.
9622
9623 2004-04-27  Martin Baulig  <martin@ximian.com>
9624
9625         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9626         we're not attempting to use an indexer.  Fixes #52154.
9627
9628 2004-04-27  Martin Baulig  <martin@ximian.com>
9629
9630         * statement.cs (Return): Don't create a return label if we don't
9631         need it; reverts my change from January 20th.  Thanks to Ben
9632         Maurer for this.
9633
9634 2004-04-27  Martin Baulig  <martin@ximian.com>
9635
9636         According to the spec, `goto' can only leave a nested scope, but
9637         never enter it.
9638
9639         * statement.cs (Block.LookupLabel): Only lookup in the current
9640         block, don't recurse into parent or child blocks.
9641         (Block.AddLabel): Check in parent and child blocks, report
9642         CS0140/CS0158 if we find a duplicate.
9643         (Block): Removed this indexer for label lookups.
9644         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9645         this already does the error reporting for us.
9646
9647         * flowanalysis.cs
9648         (FlowBranching.UsageVector.Block): New public variable; may be null.
9649         (FlowBranching.CreateSibling): Added `Block' argument.
9650         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9651         label for the target of a `goto' and check whether we're not
9652         leaving a `finally'.
9653
9654 2004-04-27  Martin Baulig  <martin@ximian.com>
9655
9656         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9657         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9658         just for returns).
9659
9660 2004-04-27  Martin Baulig  <martin@ximian.com>
9661
9662         * statement.cs (Block.AddLabel): Also check for implicit blocks
9663         and added a CS0158 check.
9664
9665 2004-04-27  Martin Baulig  <martin@ximian.com>
9666
9667         * flowanalysis.cs (FlowBranchingLoop): New class.
9668         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9669         UsageVector's instead of an ArrayList.
9670         (FlowBranching.Label): Likewise.
9671         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9672         (FlowBranching.AddBreakVector): New method.
9673
9674 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9675
9676         * attribute.cs: Small regression fix: only convert the type if we
9677         the type is different, fixes System.Drawing build.
9678
9679 2004-04-27  Martin Baulig  <martin@ximian.com>
9680
9681         * attribute.cs (Attribute.Resolve): If we have a constant value
9682         for a named field or property, implicity convert it to the correct
9683         type.
9684
9685 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9686
9687         * statement.cs (Block.Block): Implicit blocks share
9688         'child_variable_names' fields with parent blocks.
9689         (Block.AddChildVariableNames): Remove.
9690         (Block.AddVariable): Mark variable as "used by a child block" in
9691         every surrounding block.
9692         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9693         been used in a child block, complain about violation of "Invariant
9694         meaning in blocks" rule.
9695         * cs-parser.jay (declare_local_variables): Don't use
9696         AddChildVariableNames.
9697         (foreach_statement): Don't create an implicit block: 'foreach'
9698         introduces a scope.
9699
9700 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9703         converting from 0L to ulong.  Fixes 57522.
9704
9705 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9706
9707         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9708         derived class hides via 'new' keyword field from base class (test-242.cs).
9709         TODO: Handle this in the more general way.
9710         
9711         * class.cs (CheckBase): Ditto.
9712
9713 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9714
9715         * decl.cs (caching_flags): New member for storing cached values
9716         as bit flags.
9717         (MemberCore.Flags): New enum where bit flags for caching_flags
9718         are defined.
9719         (MemberCore.cls_compliance): Moved to caching_flags.
9720         (DeclSpace.Created): Moved to caching_flags.
9721
9722         * class.cs: Use caching_flags instead of DeclSpace.Created
9723         
9724 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9725
9726         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9727         if we are only a derived class, not a nested class.
9728
9729         * typemanager.cs: Same as above, but do this at the MemberLookup
9730         level (used by field and methods, properties are handled in
9731         PropertyExpr).   Allow for the qualified access if we are a nested
9732         method. 
9733
9734 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9735
9736         * class.cs: Refactoring.
9737         (IMethodData): New inteface; Holds links to parent members
9738         to avoid member duplication (reduced memory allocation).
9739         (Method): Implemented IMethodData interface.
9740         (PropertyBase): New inner classes for get/set methods.
9741         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9742         (Event): New inner classes for add/remove methods.
9743         (Event.DelegateMethod): Implemented IMethodData interface.
9744
9745         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9746         EmitContext (related to class.cs refactoring).
9747
9748 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9749
9750         * delegate.cs (Delegate.VerifyApplicability): If the number of
9751         arguments are the same as the number of parameters, first try to
9752         verify applicability ignoring  any 'params' modifier on the last
9753         parameter.
9754         Fixes #56442.
9755
9756 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9757
9758         * class.cs (TypeContainer.AddIndexer): Use
9759         'ExplicitInterfaceName' to determine if interface name was
9760         explicitly specified.  'InterfaceType' is not initialized at this time.
9761         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9762         Indexers array is already in the required order.  Initialize
9763         'IndexerName' only if there are normal indexers.
9764         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9765         (TypeContainer.Emit): Emit DefaultMember attribute only if
9766         IndexerName is initialized.
9767         Fixes #56300.
9768
9769 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9770
9771         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9772         Fixes #57007
9773
9774 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9775
9776         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9777         attributes.
9778         Fix for #56456.
9779
9780         * attribute.cs (Attribute.Resolve): Check for duplicate named
9781         attributes.
9782         Fix for #56463.
9783
9784 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9785
9786         * iterators.cs (MarkYield): track whether we are in an exception,
9787         and generate code accordingly.  Use a temporary value to store the
9788         result for our state.
9789
9790         I had ignored a bit the interaction of try/catch with iterators
9791         since their behavior was not entirely obvious, but now it is
9792         possible to verify that our behavior is the same as MS .NET 2.0
9793
9794         Fixes 54814
9795
9796 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * iterators.cs: Avoid creating temporaries if there is no work to
9799         do. 
9800
9801         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9802         Enumerations, use TypeManager.EnumToUnderlying and call
9803         recursively. 
9804
9805         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9806         bug #57013
9807
9808         (This.Emit): Use EmitContext.EmitThis to emit our
9809         instance variable.
9810
9811         (This.EmitAssign): Ditto.
9812
9813         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9814         codepaths, we will move all the functionality into
9815         Mono.CSharp.This 
9816
9817         (FieldExpr.EmitAssign): Ditto.
9818
9819         This fixes several hidden bugs that I uncovered while doing a code
9820         review of this today.
9821
9822         * codegen.cs (EmitThis): reworked so the semantics are more clear
9823         and also support value types "this" instances.
9824
9825         * iterators.cs: Changed so that for iterators in value types, we
9826         do not pass the value type as a parameter.  
9827
9828         Initialization of the enumerator helpers is now done in the caller
9829         instead of passing the parameters to the constructors and having
9830         the constructor set the fields.
9831
9832         The fields have now `assembly' visibility instead of private.
9833
9834 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9835
9836         * expression.cs (Argument.Resolve): Check if fields passed as ref
9837         or out are contained in a MarshalByRefObject.
9838
9839         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9840         another compiler type.
9841
9842 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9843
9844         * class.cs (Indexer.Define): use the new name checking method.
9845         Also, return false on an error.
9846         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9847         (is_identifier_[start/part]_character): make static.
9848
9849 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9850
9851         * expression.cs (Binary.ResolveOperator): Do no append strings
9852         twice: since we can be invoked more than once (array evaluation)
9853         on the same concatenation, take care of this here.  Based on a fix
9854         from Ben (bug #56454)
9855
9856 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9857
9858         * codegen.cs: Fix another case where CS1548 must be reported (when 
9859         delay-sign isn't specified and no private is available #56564). Fix
9860         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9861         error when MCS is used on the MS runtime and we need to delay-sign 
9862         (which seems unsupported by AssemblyBuilder - see #56621).
9863
9864 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9865
9866         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9867         (TypeManager.ComputeNamespaces): Faster implementation for
9868         Microsoft runtime.
9869
9870         * compiler.csproj: Updated AssemblyName to mcs.
9871
9872 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9873
9874         * rootcontext.cs: Add new types to the boot resolution.
9875
9876         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9877         MulticastDelegate is not allowed.
9878
9879         * typemanager.cs: Add new types to lookup: System.TypedReference
9880         and ArgIterator.
9881
9882         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9883         check for TypedReference or ArgIterator, they are not allowed. 
9884
9885         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9886         makes us properly catch 1510 in some conditions (see bug 56016 for
9887         details). 
9888
9889 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9890
9891         * CryptoConvert.cs: update from corlib version
9892         with endian fixes.
9893
9894 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9895
9896         * class.cs (Indexer.Define): Check indexername declaration
9897
9898 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9899
9900         * attribute.cs (IsClsCompliant): Fixed problem with handling
9901         all three states (compliant, not-compliant, undetected).
9902
9903 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9904
9905         * attribute.cs (Attribute): Location is now public.
9906         (Resolve): Store resolved arguments (pos_values) in attribute class.
9907         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9908         (GetClsCompliantAttributeValue): New method that gets
9909         CLSCompliantAttribute value.
9910         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9911         if exists else null.
9912         (AttributeTester): New class for CLS-Compliant verification routines.
9913
9914         * class.cs (Emit): Add CLS-Compliant verification.
9915         (Method.GetSignatureForError): Implemented.
9916         (Constructor.GetSignatureForError): Implemented
9917         (Constructor.HasCompliantArgs): Returns if constructor has
9918         CLS-Compliant arguments.
9919         (Constructor.Emit): Override.
9920         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9921         is needed to test only parameters.
9922         (FieldBase.GetSignatureForError): Implemented.
9923         (TypeContainer): New member for storing base interfaces.
9924         (TypeContainer.FindMembers): Search in base interfaces too.
9925
9926         * codegen.cs (GetClsComplianceAttribute): New method that gets
9927         assembly or module CLSCompliantAttribute value.
9928         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9929         for assembly.
9930         (ModuleClass.Emit): Add error 3012 test.
9931
9932         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9933
9934         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9935         state for all decl types.
9936         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9937         if CLS-Compliant tests are required.
9938         (IsClsCompliaceRequired): New method. Analyze whether code
9939         must be CLS-Compliant.
9940         (IsExposedFromAssembly): New method. Returns true when MemberCore
9941         is exposed from assembly.
9942         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9943         value or gets cached value.
9944         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9945         is explicitly marked with CLSCompliantAttribute.
9946         (IsIdentifierClsCompliant): New abstract method. This method is
9947         used to testing error 3005.
9948         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9949         for identifier and parameters CLS-Compliant testing.
9950         (VerifyClsCompliance): New method. The main virtual method for
9951         CLS-Compliant verifications.
9952         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9953         null. I don't know why is null (too many public members !).
9954         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9955         and get value of first CLSCompliantAttribute that found.
9956
9957         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9958         (VerifyClsCompliance): Override and add extra tests.
9959
9960         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9961         clscheck- disable CLS-Compliant verification event if assembly is has
9962         CLSCompliantAttribute(true).
9963
9964         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9965         ApllyAttribute is now called in emit section as in the other cases.
9966         Possible future Emit integration.
9967         (IsIdentifierClsCompliant): New override.
9968         (VerifyClsCompliance): New override.
9969         (GetEnumeratorName): Returns full enum name.
9970
9971         * parameter.cs (GetSignatureForError): Implemented.
9972
9973         * report.cs (WarningData): New struct for Warning message information.
9974         (LocationOfPreviousError): New method.
9975         (Warning): New method. Reports warning based on the warning table.
9976         (Error_T): New method. Reports error based on the error table.
9977
9978         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9979         verifications are done here.
9980
9981         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9982
9983         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9984         CLSCompliantAttribute.
9985         (all_imported_types): New member holds all imported types from other
9986         assemblies.
9987         (LoadAllImportedTypes): New method fills static table with exported types
9988         from all referenced assemblies.
9989         (Modules): New property returns all assembly modules.
9990
9991 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9992
9993         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9994         throwing a parser error.
9995
9996         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9997         which removes the hardcoded get_/set_ prefixes for properties, as
9998         IL allows for the properties to be named something else.  
9999
10000         Bug #56013
10001
10002         * expression.cs: Do not override operand before we know if it is
10003         non-null.  Fix 56207
10004
10005 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10006
10007         * typemanager.cs: support for pinned variables.
10008
10009 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10010
10011         * decl.cs, typemanager.cs: Avoid using an arraylist
10012         as a buffer if there is only one result set.
10013
10014 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10015
10016         * expression.cs: Make sure you cant call a static method
10017         with an instance expression, bug #56174.
10018
10019 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * class.cs (IsDuplicateImplementation): Improve error reporting to
10022         flag 663 (method only differs in parameter modifier).
10023
10024         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10025         in preprocessor directives.
10026
10027         * location.cs (LookupFile): Allow for the empty path.
10028
10029         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10030         better approach for some of that patch, but its failing with the
10031         CharSet enumeration.  For now try/catch will do.
10032
10033         * typemanager.cs: Do not crash if a struct does not have fields.
10034         Fixes 56150.
10035
10036 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10037
10038         * expression.cs: cs0213, cant fix a fixed expression.
10039         fixes 50231.
10040
10041 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10042
10043         * cs-parser.jay: detect invalid embeded statements gracefully.
10044         bug #51113.
10045
10046 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10047
10048         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10049         As a regex:
10050         s/
10051         the invocation type may not be a subclass of the tye of the item/
10052         The type of the item must be a subclass of the invocation item.
10053         /g
10054
10055         Fixes bug #50820.
10056
10057 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10058
10059         * attribute.cs: Added methods to get a string and a bool from an
10060         attribute. Required to information from AssemblyKeyFileAttribute,
10061         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10062         * codegen.cs: Modified AssemblyName creation to include support for
10063         strongnames. Catch additional exceptions to report them as CS1548.
10064         * compiler.csproj: Updated include CryptoConvert.cs.
10065         * compiler.csproj.user: Removed file - user specific configuration.
10066         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10067         Mono.Security assembly. The original class is maintained and tested in
10068         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10069         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10070         like CSC 8.0 (C# v2) supports.
10071         * Makefile: Added CryptoConvert.cs to mcs sources.
10072         * rootcontext.cs: Added new options for strongnames.
10073
10074 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10075
10076         * driver.cs: For --expect-error, report error code `2'
10077         if the program compiled with no errors, error code `1' if
10078         it compiled with an error other than the one expected.
10079
10080 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10081
10082         * compiler.csproj: Updated for Visual Studio .NET 2003.
10083         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10084         * compiler.sln: Updated for Visual Studio .NET 2003.
10085
10086 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10087
10088         * expression.cs: Fix bug #47234. We basically need to apply the
10089         rule that we prefer the conversion of null to a reference type
10090         when faced with a conversion to 'object' (csc behaviour).
10091
10092 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10093
10094         * statement.cs: Shorter form for foreach, eliminates
10095         a local variable. r=Martin.
10096
10097 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10098
10099         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10100         checks if we can use brtrue/brfalse to test for 0.
10101         * expression.cs: use the above in the test for using brtrue/brfalse.
10102         cleanup code a bit.
10103
10104 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10105
10106         * expression.cs: Rewrite string concat stuff. Benefits:
10107
10108         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10109         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10110         rather than a concat chain.
10111
10112         * typemanager.cs: Add lookups for more concat overloads.
10113
10114 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10115
10116         * expression.cs: Emit shorter il code for array init.
10117
10118         newarr
10119         dup
10120         // set 1
10121
10122         // set 2
10123
10124         newarr
10125         stloc.x
10126
10127         ldloc.x
10128         // set 1
10129
10130         ldloc.x
10131         // set 2
10132
10133 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10134
10135         * statement.cs: Before, two switch blocks would be merged if the
10136         total size of the blocks (end_item - begin_item + 1) was less than
10137         two times the combined sizes of the blocks.
10138
10139         Now, it will only merge if after the merge at least half of the
10140         slots are filled.
10141
10142         fixes 55885.
10143
10144 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10145
10146         * class.cs : csc build fix for GetMethods(). See bug #52503.
10147
10148 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10149
10150         * expression.cs: Make sure fp comparisons work with NaN.
10151         This fixes bug #54303. Mig approved this patch a long
10152         time ago, but we were not able to test b/c the runtime
10153         had a related bug.
10154
10155 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10158
10159 2004-03-19  Martin Baulig  <martin@ximian.com>
10160
10161         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10162         error here and not in our caller.
10163
10164 2004-03-19  Martin Baulig  <martin@ximian.com>
10165
10166         * interface.cs: Completely killed this file.
10167         (Interface): We're now a TypeContainer and live in class.cs.
10168
10169         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10170         argument; we're now also called for interfaces.
10171         (TypeContainer.DefineMembers): Allow this method being called
10172         multiple times.
10173         (TypeContainer.GetMethods): New public method; formerly known as
10174         Interface.GetMethod().  This is used by PendingImplementation.
10175         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10176         it's now private and non-static.
10177         (Interface): Moved this here; it's now implemented similar to
10178         Class and Struct.
10179         (Method, Property, Event, Indexer): Added `bool is_interface'
10180         argument to their .ctor's.
10181         (MemberBase.IsInterface): New public field.
10182
10183         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10184         instances instead of InterfaceMethod, InterfaceProperty, etc.
10185         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10186         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10187
10188 2004-03-19  Martin Baulig  <martin@ximian.com>
10189
10190         * class.cs (MethodCore.IsDuplicateImplementation): New private
10191         method which does the CS0111 checking.
10192         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10193         Use IsDuplicateImplementation().
10194
10195 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10196
10197         * decl.cs (FindMemberToOverride): New method to find the correct
10198         method or property to override in the base class.
10199         * class.cs
10200             - Make Method/Property use the above method to find the
10201               version in the base class.
10202             - Remove the InheritableMemberSignatureCompare as it is now
10203               dead code.
10204
10205         This patch makes large code bases much faster to compile, as it is
10206         O(n) rather than O(n^2) to do this validation.
10207
10208         Also, it fixes bug 52458 which is that nested classes are not
10209         taken into account when finding the base class member.
10210
10211         Reviewed/Approved by Martin.
10212
10213 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10214
10215         * interface.cs: In all interface classes removed redundant
10216         member initialization.
10217
10218 2004-03-16  Martin Baulig  <martin@ximian.com>
10219
10220         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10221
10222 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10223
10224         * decl.cs (DefineTypeAndParents): New helper method to define a
10225         type's containers before the type itself is defined;  This is a
10226         bug exposed by the recent changes to Windows.Forms when an
10227         implemented interface was defined inside a class that had not been
10228         built yet.   
10229
10230         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10231
10232         (Check): Loop correctly to report errors modifiers
10233         (UNSAFE was not in the loop, since it was the same as TOP).
10234
10235         * interface.cs: Every interface member now takes a ModFlags,
10236         instead of a "is_new" bool, which we set on the base MemberCore. 
10237
10238         Every place where we called "UnsafeOk" in the interface, now we
10239         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10240         the unsafe settings from the member declaration instead of the
10241         container interface. 
10242
10243         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10244
10245         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10246         `set_indexer_name' to the pending bits (one per type).
10247
10248         We fixed a bug today that was picking the wrong method to
10249         override, since for properties the existing InterfaceMethod code
10250         basically ignored the method name.  Now we make sure that the
10251         method name is one of the valid indexer names.
10252
10253 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10254  
10255         * support.cs (SeekableStreamReader): Keep track of stream byte
10256         positions and don't mix them with character offsets to the buffer.
10257
10258         Patch from Gustavo Giráldez
10259
10260 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10261
10262         * interface.cs (InterfaceSetGetBase): Removed double member
10263         initialization, base class does it as well.
10264
10265 2004-03-13  Martin Baulig  <martin@ximian.com>
10266
10267         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10268         when compiling corlib.
10269
10270 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10271
10272         * convert.cs (ExplicitConversion): We were reporting an error on
10273         certain conversions (object_type source to a value type, when the
10274         expression was `null') before we had a chance to pass it through
10275         the user defined conversions.
10276
10277         * driver.cs: Replace / and \ in resource specifications to dots.
10278         Fixes 50752
10279
10280         * class.cs: Add check for duplicate operators.  Fixes 52477
10281
10282 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10285         that are in the middle of the statements, not only at the end.
10286         Fixes #54987
10287
10288         * class.cs (TypeContainer.AddField): No longer set the
10289         `HaveStaticConstructor' flag, now we call it
10290         `UserDefineStaticConstructor' to diferentiate the slightly
10291         semantic difference.
10292
10293         The situation is that we were not adding BeforeFieldInit (from
10294         Modifiers.TypeAttr) to classes that could have it.
10295         BeforeFieldInit should be set to classes that have no static
10296         constructor. 
10297
10298         See:
10299
10300         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10301
10302         And most importantly Zoltan's comment:
10303
10304         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10305
10306         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10307          before its static fields are used', i.e. initialization does not need
10308          to be triggered by the first access to the type. Setting this flag
10309          helps the JIT to compile better code, since it can run the static
10310          constructor at JIT time, and does not need to generate code to call it
10311          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10312          this flag for lots of classes like String. 
10313          
10314          csc sets this flag if the type does not have an explicit static 
10315          constructor. The reasoning seems to be that if there are only static
10316          initalizers for a type, and no static constructor, then the programmer
10317          does not care when this initialization happens, so beforefieldinit
10318          can be used.
10319          
10320          This bug prevents the AOT compiler from being usable, since it 
10321          generates so many calls to mono_runtime_class_init that the AOT code
10322          is much slower than the JITted code. The JITted code is faster, 
10323          because it does not generate these calls if the vtable is type is
10324          already initialized, which is true in the majority of cases. But the
10325          AOT compiler can't do this."
10326
10327 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10328
10329         * class.cs (MethodData.Emit): Refactor the code so symbolic
10330         information is generated for destructors;  For some reasons we
10331         were taking a code path that did not generate symbolic information
10332         before. 
10333
10334 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10335
10336         * class.cs: Create a Constructor.CheckBase method that
10337         takes care of all validation type code. The method
10338         contains some code that was moved from Define.
10339
10340         It also includes new code that checks for duplicate ctors.
10341         This fixes bug #55148.
10342
10343 2004-03-09  Joshua Tauberer <tauberer@for.net>
10344
10345         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10346         a { ... }-style array creation invokes EmitStaticInitializers
10347         which is not good for reference-type arrays.  String, decimal
10348         and now null constants (NullCast) are not counted toward
10349         static initializers.
10350
10351 2004-03-05  Martin Baulig  <martin@ximian.com>
10352
10353         * location.cs (SourceFile.HasLineDirective): New public field;
10354         specifies whether the file contains or is referenced by a "#line"
10355         directive.
10356         (Location.DefineSymbolDocuments): Ignore source files which
10357         either contain or are referenced by a "#line" directive.        
10358
10359 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10360
10361         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10362         direct access to our parent, so check the method inline there.
10363
10364 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10365
10366         * expression.cs (Invocation.EmitCall): Miguel's last commit
10367         caused a regression. If you had:
10368
10369             T t = null;
10370             t.Foo ();
10371
10372         In Foo the implict this would be null.
10373
10374 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * expression.cs (Invocation.EmitCall): If the method is not
10377         virtual, do not emit a CallVirt to it, use Call.
10378
10379         * typemanager.cs (GetFullNameSignature): Improve the method to
10380         cope with ".ctor" and replace it with the type name.
10381
10382         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10383         as an argument the ConstructorBuilder where it is being defined,
10384         to catch the recursive constructor invocations.
10385
10386 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10387
10388         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10389         routines to check if a type is an enumerable/enumerator allow
10390         classes that implement the IEnumerable or IEnumerator interfaces.
10391
10392         * class.cs (Property, Operator): Implement IIteratorContainer, and
10393         implement SetYields.
10394
10395         (Property.Define): Do the block swapping for get_methods in the
10396         context of iterators.   We need to check if Properties also
10397         include indexers or not.
10398
10399         (Operator): Assign the Block before invoking the
10400         OperatorMethod.Define, so we can trigger the Iterator code
10401         replacement. 
10402
10403         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10404         Property and Operator classes are not created when we parse the
10405         declarator but until we have the block completed, so we use a
10406         singleton SimpleIteratorContainer.Simple to flag whether the
10407         SetYields has been invoked.
10408
10409         We propagate this setting then to the Property or the Operator to
10410         allow the `yield' to function.
10411
10412 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10413
10414         * codegen.cs: Implemented attribute support for modules.
10415         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10416         Assembly/Module functionality.
10417
10418         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10419         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10420         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10421
10422 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10423
10424         * interface.cs (FindMembers): The operation is performed on all base
10425         interfaces and not only on the first. It is required for future CLS Compliance patch.
10426
10427 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10428
10429         * statement.cs, codegen.cs:
10430         This patch deals with patterns such as:
10431
10432         public class List : IEnumerable {
10433
10434                 public MyEnumerator GetEnumerator () {
10435                         return new MyEnumerator(this);
10436                 }
10437
10438                 IEnumerator IEnumerable.GetEnumerator () {
10439                         ...
10440                 }
10441                 
10442                 public struct MyEnumerator : IEnumerator {
10443                         ...
10444                 }
10445         }
10446
10447         Before, there were a few things we did wrong:
10448         1) we would emit callvirt on a struct, which is illegal
10449         2) we emited ldarg when we needed to emit ldarga
10450         3) we would mistakenly call the interface methods on an enumerator
10451         type that derived from IEnumerator and was in another assembly. For example:
10452
10453         public class MyEnumerator : IEnumerator
10454
10455         Would have the interface methods called, even if there were public impls of the
10456         method. In a struct, this lead to invalid IL code.
10457
10458 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10459
10460         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10461           renamed to Emit.
10462
10463         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10464
10465 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10466
10467         * cs-parser.jay: Fix small regression: we were not testing V2
10468         compiler features correctly.
10469
10470         * interface.cs: If the emit context is null, then create one
10471
10472 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10473
10474         * decl.cs (GetSignatureForError): New virtual method to get full name
10475           for error messages.
10476
10477         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10478           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10479
10480         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10481           Duplicated members and code in these classes has been removed.
10482           Better encapsulation in these classes.
10483
10484 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10485
10486         * assign.cs (Assign.DoResolve): When dealing with compound
10487         assignments, there is a new rule in ECMA C# 2.4 (might have been
10488         there before, but it is documented here) that states that in:
10489
10490         a op= b;
10491
10492         If b is of type int, and the `op' is a shift-operator, then the
10493         above is evaluated as:
10494
10495         a = (int) a op b 
10496
10497         * expression.cs (Binary.ResolveOperator): Instead of testing for
10498         int/uint/long/ulong, try to implicitly convert to any of those
10499         types and use that in pointer arithmetic.
10500
10501         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10502         method to print information for from the type, not from the
10503         null-method we were given.
10504
10505 2004-02-01  Duncan Mak  <duncan@ximian.com>
10506
10507         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10508         parsing for cmd, fixes bug #53694.
10509
10510 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10511
10512         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10513         in the member name duplication tests. Property and operator name duplication
10514         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10515
10516 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10517
10518         * interface.cs (PopulateMethod): Fixed crash when interface method
10519         returns not existing type (error test cs0246-3.cs).
10520
10521 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10522
10523         * cs-parser.jay (interface_accessors): Re-write actions to also
10524         store attributes attached to get and set methods. Fix spelling
10525         while at it.
10526
10527         (inteface_property_declaration): Modify accordingly.
10528
10529         (InterfaceAccessorInfo): New helper class to store information to pass
10530         around between rules that use interface_accessors.
10531
10532         * interface.cs (Emit): Apply attributes on the get and set
10533         accessors of properties and indexers too.
10534
10535         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10536         right MethodBuilder when applying attributes to the get and set accessors.
10537
10538 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10539
10540         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10541
10542 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10543
10544         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10545
10546 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10549         changes that treat `yield' specially when present before `break'
10550         or `return' tokens.
10551
10552         * cs-tokenizer.cs: yield is no longer a keyword.
10553
10554 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10555
10556         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10557         setting for default constructors.
10558         For default constructors are almost every time set wrong Modifier. The
10559         generated IL code has been alright. But inside mcs this values was
10560         wrong and this was reason why several of my CLS Compliance tests
10561         failed.
10562
10563 2004-01-22  Martin Baulig  <martin@ximian.com>
10564
10565         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10566         not a QualifiedIdentifier.  This is what `type_name_expression'
10567         was previously doing.
10568         (type_name_expression): Removed; the code is now in
10569         `namespace_or_type_name'.
10570         (qualified_identifier): Removed, use `namespace_or_type_name'
10571         instead.
10572         (QualifiedIdentifier): Removed this class.      
10573
10574 2004-01-22  Martin Baulig  <martin@ximian.com>
10575
10576         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10577         not a string as alias name.
10578
10579 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10580
10581         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10582         #52730 bug, and instead compute correctly the need to use a
10583         temporary variable when requesting an address based on the
10584         static/instace modified of the field and the constructor.
10585  
10586 2004-01-21  Martin Baulig  <martin@ximian.com>
10587
10588         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10589         class and namespace before looking up aliases.  Fixes #52517.
10590
10591 2004-01-21  Martin Baulig  <martin@ximian.com>
10592
10593         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10594         assinged in a 'try'; fixes exception4.cs.
10595
10596 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10597         * class.cs : Implemented parameter-less constructor for TypeContainer
10598
10599         * decl.cs: Attributes are now stored here. New property OptAttributes
10600
10601         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10602
10603         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10604
10605 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10606
10607         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10608           (CSharpSignature): New method for indexer and property signature.
10609
10610 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10611
10612         * pending.cs (IsVirtualFilter): Faster implementation.
10613
10614 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10615
10616         * typemanager.cs: Avoid inclusion of same assembly more than once.
10617
10618 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10619
10620         * cs-parser.jay: Fixed problem where the last assembly attribute
10621           has been applied also to following declaration (class, struct, etc.)
10622           
10623 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10624
10625         * class.cs: Added error CS0538, CS0539 reporting.
10626         Fixed crash on Microsoft runtime when field type is void.
10627
10628         * cs-parser.jay: Added error CS0537 reporting.
10629
10630         * pending.cs: Added error CS0535 reporting.
10631         Improved error report for errors CS0536, CS0534.
10632
10633 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10634
10635         Merge a few bits from the Anonymous Method MCS tree.
10636
10637         * statement.cs (ToplevelBlock): New class for toplevel methods,
10638         will hold anonymous methods, lifted variables.
10639
10640         * cs-parser.jay: Create toplevel blocks for delegates and for
10641         regular blocks of code. 
10642
10643 2004-01-20  Martin Baulig  <martin@ximian.com>
10644
10645         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10646         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10647         and `NeedExplicitReturn'; added `IsLastStatement'.
10648         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10649         have a `ReturnLabel' or we're not unreachable.
10650
10651         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10652         child's reachability; don't just override ours with it.  Fixes
10653         #58058 (lluis's example).
10654         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10655         InFinally(), InLoop(), InSwitch() and
10656         BreakCrossesTryCatchBoundary() methods.
10657
10658         * statement.cs (Return): Do all error checking in Resolve().
10659         Unless we are the last statement in a top-level block, always
10660         create a return label and jump to it.
10661         (Break, Continue): Do all error checking in Resolve(); also make
10662         sure we aren't leaving a `finally'.
10663         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10664         statement in a top-level block.
10665         (Block.Flags): Added `IsDestructor'.
10666         (Block.IsDestructor): New public property.
10667
10668 2004-01-20  Martin Baulig  <martin@ximian.com>
10669
10670         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10671
10672 2004-01-20  Martin Baulig  <martin@ximian.com>
10673
10674         * statement.cs (Statement.ResolveUnreachable): New public method.
10675         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10676         (Block.Resolve): Resolve unreachable statements.
10677
10678 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10679
10680         * expression.cs: We need to fix the case where we do
10681         not have a temp variable here.
10682
10683         * assign.cs: Only expression compound assignments need
10684         temporary variables.
10685
10686 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10687
10688         * flowanalysis.cs: Reduce memory allocation in a few ways:
10689           - A block with no variables should not allocate a bit
10690             vector for itself.
10691           - A method with no out parameters does not need any tracking
10692             for assignment of the parameters, so we need not allocate
10693             any data for it.
10694           - The arrays:
10695                 public readonly Type[] VariableTypes;
10696                 public readonly string[] VariableNames;
10697             Are redundant. The data is already stored in the variable
10698             map, so we need not allocate another array for it.
10699           - We need to add alot of checks for if (params | locals) == null
10700             due to the first two changes.
10701
10702 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10703
10704         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10705         implement IMemoryLocation, we store a copy on a local variable and
10706         take the address of it.  Patch from Benjamin Jemlich
10707
10708         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10709         to use a special "type_name_expression" rule which reduces the
10710         number of "QualifiedIdentifier" classes created, and instead
10711         directly creates MemberAccess expressions.
10712
10713 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10714
10715         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10716         that fixes #52853.  Null literal assignment to ValueType
10717
10718         * class.cs (MethodData.Emit): Instead of checking the name of the
10719         method to determine if its a destructor, create a new derived
10720         class from Method called Destructor, and test for that.  
10721
10722         * cs-parser.jay: Create a Destructor object instead of a Method.  
10723
10724         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10725
10726         Fixes: 52933
10727
10728 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (Binary.ResolveOperator): Perform an implicit
10731         conversion from MethodGroups to their delegate types on the
10732         Addition operation.
10733
10734         * delegate.cs: Introduce a new class DelegateCreation that is the
10735         base class for `NewDelegate' and `ImplicitDelegateCreation',
10736         factor some code in here.
10737
10738         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10739         conversion from MethodGroups to compatible delegate types. 
10740
10741         * ecore.cs (Expression.Resolve): Do not flag error 654
10742         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10743         we allow conversions from MethodGroups to delegate types now.
10744
10745         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10746         assignments in v2 either.
10747
10748 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10751         static read-only fields in ctors.
10752
10753         Applied patch from Benjamin Jemlich 
10754
10755         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10756
10757 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10760         here to return true, as they can be used like this:
10761
10762                 (XXX) int.MEMBER ()
10763
10764         Fixed 49836 and all the other dups
10765
10766 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10767
10768         * driver.cs: Implement /win32res and /win32icon.
10769
10770 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10771
10772         * cs-parser.jay: Add a rule to improve error handling for the
10773         common mistake of placing modifiers after the type.
10774
10775 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10776
10777         * cs-parser.jay (interface_event_declaration): Catch
10778         initialization of events on interfaces, and report cs0068
10779
10780         * cs-parser.jay (interface_event_declaration): Catch
10781         initialization of events. 
10782
10783         * ecore.cs: Better report missing constructors.
10784
10785         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10786         the error reporting done in the wrong place.  Fix.
10787
10788         * expression.cs (Binary.ResolveOperator): Catch the 
10789         operator + (E x, E y) error earlier, and later allow for implicit
10790         conversions in operator +/- (E e, U x) from U to the underlying
10791         type of E.
10792
10793         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10794         52596, if the container class is abstract, the default constructor
10795         is protected otherwise its public (before, we were always public).
10796
10797         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10798         fixed statement.
10799
10800         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10801         Jemlich that fixes bug #52597, MCS was generating invalid code for
10802         idisposable structs.   Thanks to Ben for following up with this
10803         bug as well.
10804
10805 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10806
10807         * driver.cs: Allow assemblies without code to be generated, fixes
10808         52230.
10809
10810 2004-01-07  Nick Drochak <ndrochak@gol.com>
10811
10812         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10813
10814 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10815
10816         * cs-parser.jay: Add rules to improve error reporting if fields or
10817         methods are declared at the namespace level (error 116)
10818
10819         * Add rules to catch event add/remove
10820
10821 2004-01-04  David Sheldon <dave-mono@earth.li>
10822
10823   * expression.cs: Added matching ")" to error message for 
10824   CS0077
10825
10826 2004-01-03 Todd Berman <tberman@gentoo.org>
10827
10828         * ecore.cs, attribute.cs:
10829         Applying fix from #52429.
10830
10831 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10832
10833         * ecore.cs, expression.cs, statement.cs:
10834         Total rewrite of how we handle branching. We
10835         now handle complex boolean expressions with fewer
10836         jumps. As well if (x == 0) no longer emits a ceq.
10837
10838         if (x is Foo) is much faster now, because we generate
10839         better code.
10840
10841         Overall, we get a pretty big improvement on our benchmark
10842         tests. The code we generate is smaller and more readable.
10843
10844         I did a full two-stage bootstrap. The patch was reviewed
10845         by Martin and Miguel.
10846
10847 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10848
10849         * cs-parser.jay: Make primary_expression not take a QI.
10850         we dont need this because the member_access rule covers
10851         us here. So we replace the rule with just IDENTIFIER.
10852
10853         This has two good effects. First, we remove a s/r conflict.
10854         Second, we allocate many fewer QualifiedIdentifier objects.
10855
10856 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10857
10858         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10859         set the correct information via SRE. This prevents
10860         hanging on the MS runtime. Fixes #29374.
10861
10862 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10863
10864         * convert.cs: correctly handle conversions to value types
10865         from Enum and ValueType as unboxing conversions.
10866
10867         Fixes bug #52569. Patch by Benjamin Jemlich.
10868
10869 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10870
10871         * expression.cs (BetterConversion): Prefer int -> uint
10872         over int -> ulong (csc's behaviour). This fixed bug #52046.
10873
10874 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10875
10876         * decl.cs (MemberCache.FindMembers): now returns a
10877         MemberInfo [].
10878
10879         * typemanager.cs: In general, go with with ^^.
10880         (CopyNewMethods): take an IList.
10881         (RealMemberLookup): Only allocate an arraylist
10882         if we copy from two sets of methods.
10883
10884         This change basically does two things:
10885         1) Fewer array lists allocated due to CopyNewMethods.
10886         2) the explicit cast in MemberList costed ALOT.
10887
10888 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10889
10890         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10891         a hashtable to avoid needless string allocations when an identifier is
10892         used more than once (the common case).
10893
10894 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10895
10896         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10897         is broken, it will not return anything. So, we
10898         have to use the information we have in mcs to
10899         do the task.
10900
10901         * typemanager.cs: Add a cache for GetInterfaces,
10902         since this will now be used more often (due to ^^)
10903
10904         (GetExplicitInterfaces) New method that gets the
10905         declared, not effective, interfaces on a type
10906         builder (eg, if you have interface IFoo, interface
10907         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10908         { IBar }.
10909
10910         This patch makes MCS able to bootstrap itself on
10911         Windows again.
10912
10913 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10914
10915         * expression.cs: Remove the Nop's that Miguel put
10916         in by mistake.
10917
10918 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10919
10920         * report.cs, codegen.cs: Give the real stack trace to
10921         the error when an exception is thrown.
10922
10923 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10924
10925         * decl.cs: only allocate hashtables for ifaces if 
10926         it is an iface!
10927
10928 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10929
10930         * expression.cs: fix the error from cs0121-2.cs
10931         (a parent interface has two child interfaces that
10932         have a function with the same name and 0 params
10933         and the function is called through the parent).
10934
10935 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10936
10937         * class.cs, rootcontext.cs, typmanager.cs: do not
10938         leak pointers.
10939
10940 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10941
10942         * codegen.cs: remove stack for the ec flow branching.
10943         It is already a linked list, so no need.
10944
10945 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10946
10947         * Makefile: Allow custom profiler here.
10948
10949 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10950
10951         * typemanager.cs (LookupType):
10952           - Use a static char [], because split takes
10953             a param array for args, so it was allocating
10954             every time.
10955           - Do not store true in a hashtable, it boxes.
10956
10957 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10958
10959         * flowanalysis.cs: bytify common enums.
10960
10961 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10962
10963         * modifiers.cs: Add a new set of flags for the
10964         flags allowed on explicit interface impls.
10965         * cs-parser.jay: catch the use of modifiers in
10966         interfaces correctly.
10967         * class.cs: catch private void IFoo.Blah ().
10968
10969         All related to bug #50572.
10970
10971 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10972
10973         * decl.cs: Rewrite the consistant accessability checking.
10974         Accessability is not linear, it must be implemented in
10975         a tableish way. Fixes #49704.
10976
10977 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10978
10979         * expression.cs: Handle negation in a checked context.
10980         We must use subtraction from zero. Fixes #38674.
10981
10982 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10983
10984         * class.cs: Ignore static void main in DLLs.
10985         * rootcontext.cs: Handle the target type here,
10986         since we are have to access it from class.cs
10987         * driver.cs: account for the above.
10988
10989 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10990
10991         * report.cs: Give line numbers and files if available.
10992
10993 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10994
10995         * driver.cs: Implement /addmodule.
10996
10997         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10998         ModuleBuilders.
10999
11000 2003-12-20  Martin Baulig  <martin@ximian.com>
11001
11002         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11003         (FieldBase.IsAssigned): Removed this field.
11004         (FieldBase.SetAssigned): New public method.
11005         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11006
11007 2003-12-20  Martin Baulig  <martin@ximian.com>
11008
11009         * expression.cs (LocalVariableReference.DoResolve): Don't set
11010         `vi.Used' if we're called from DoResolveLValue().
11011
11012         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11013         returns the usage vector it just merged into the current one -
11014         pass this one to UsageWarning().
11015         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11016         of the `EmitContext', don't call this recursively on our children.
11017
11018 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11019
11020         * driver.cs: Implement /target:module.
11021
11022 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11023
11024         * support.cs (CharArrayHashtable): New helper class.
11025
11026         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11027         char arrays, not strings, so we can avoid creating a string in
11028         consume_identifier if the identifier is a keyword.
11029
11030 2003-12-16  Martin Baulig  <martin@ximian.com>
11031
11032         * statement.cs (LocalInfo.Assigned): Removed this property.
11033         (LocalInfo.Flags): Removed `Assigned'.
11034         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11035         and uses flow analysis.
11036         (Block.UsageWarning): Made this method private.
11037         (Block.Resolve): Call UsageWarning() if appropriate.
11038
11039         * expression.cs (LocalVariableReference.DoResolve): Always set
11040         LocalInfo.Used here.
11041
11042 2003-12-13  Martin Baulig  <martin@ximian.com>
11043
11044         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11045         any value here; we're now using flow analysis to figure out
11046         whether a statement/block returns a value.
11047
11048 2003-12-13  Martin Baulig  <martin@ximian.com>
11049
11050         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11051         working again.
11052         (FlowBranching.MergeFinally): Don't call
11053         `branching.CheckOutParameters()' here, this is called in
11054         MergeTopBlock().
11055         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11056         when adding the `finally' vector.       
11057
11058 2003-12-13  Martin Baulig  <martin@ximian.com>
11059
11060         * flowanalysis.cs
11061         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11062         actually work and also fix #48962.
11063
11064 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11065
11066         * decl.cs: Do not check System.Object for nested types,
11067         since we know it does not have any. Big bang for buck:
11068
11069         BEFORE:
11070            Run 1:   8.35 seconds
11071            Run 2:   8.32 seconds
11072            corlib:  17.99 seconds
11073         AFTER:
11074            Run 1:   8.17 seconds
11075            Run 2:   8.17 seconds
11076            corlib:  17.39 seconds
11077
11078 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11079
11080         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11081         time we are returning 0 members, so we save alot here.
11082
11083 2003-12-11  Martin Baulig  <martin@ximian.com>
11084
11085         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11086         `MergeChild()', also just take the `FlowBranching' as argument;
11087         call Merge() on it and return the result.
11088         (FlowBranching.Merge): We don't need to do anything if we just
11089         have one sibling.
11090
11091 2003-12-11  Martin Baulig  <martin@ximian.com>
11092
11093         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11094         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11095         Maurer for this idea.
11096
11097 2003-12-11  Martin Baulig  <martin@ximian.com>
11098
11099         * flowanalysis.cs (MergeResult): This class is now gone; we now
11100         use the `UsageVector' for this.  The reason for this is that if a
11101         branching just has one sibling, we don't need to "merge" them at
11102         all - that's the next step to do.
11103         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11104         `MergeResult'.
11105
11106 2003-12-11  Martin Baulig  <martin@ximian.com>
11107
11108         Reworked flow analyis and made it more precise and bug-free.  The
11109         most important change is that we're now using a special `Reachability'
11110         class instead of having "magic" meanings of `FlowReturns'.  I'll
11111         do some more cleanups and optimizations and also add some more
11112         documentation this week.
11113
11114         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11115         largely reworked this class.
11116         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11117         the new `Reachability' class instead of having "magic" values here.
11118         (FlowBranching): We're now using an instance of `Reachability'
11119         instead of having separate `Returns', `Breaks' etc. fields.
11120
11121         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11122         based on flow analysis; ignore the return value of block.Emit ().
11123
11124 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11125
11126         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11127         if they are private.
11128
11129 2003-12-09  Martin Baulig  <martin@ximian.com>
11130
11131         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11132         call them directly on the UsageVector.
11133
11134 2003-12-09  Martin Baulig  <martin@ximian.com>
11135
11136         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11137         Changed return type from `FlowReturns' to `Reachability'.
11138
11139 2003-12-09  Martin Baulig  <martin@ximian.com>
11140
11141         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11142         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11143         `Reachable' fields with a single `Reachability' one.
11144
11145 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11146
11147         * class.cs (FindMembers): Remove foreach's.
11148
11149         Bootstrap times:
11150
11151         BEFORE
11152                 Run 1:   8.74 seconds
11153                 Run 2:   8.71 seconds
11154
11155         AFTER
11156                 Run 1:   8.64 seconds
11157                 Run 2:   8.58 seconds
11158
11159
11160 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11161
11162         * cs-parser.jay:
11163         * gen-treedump.cs:
11164         * statement.cs:
11165         This patch does a few things:
11166                 1. EmptyStatement is now a singleton, so it is never reallocated.
11167                 2. All blah is EmptyStatement constructs have been changed to
11168                    blah == EmptyStatement.Value, which is much faster and valid
11169                    now that EmptyStatement is a singleton.
11170                 3. When resolving a block, rather than allocating a new array for
11171                    the non-empty statements, empty statements are replaced with
11172                    EmptyStatement.Value
11173                 4. Some recursive functions have been made non-recursive.
11174         Mainly the performance impact is from (3), however (1) and (2) are needed for
11175         this to work. (4) does not make a big difference in normal situations, however
11176         it makes the profile look saner.
11177
11178         Bootstrap times:
11179
11180         BEFORE
11181         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11182         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11183         Total memory allocated: 56397 KB
11184
11185         AFTER
11186         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11187         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11188         Total memory allocated: 55666 KB
11189
11190 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11191
11192         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11193         than the hashtable in a hashtable version
11194
11195         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11196         we always end up concating a string. This results in a huge perf
11197         loss, because many strings have to be tracked by the GC. In this
11198         patch, we first use a hashtable that works with two keys, so that
11199         the strings do not need to be concat'ed.
11200
11201         Bootstrap times:
11202         BEFORE
11203                 Run 1:   8.74 seconds
11204                 Run 2:   8.71 seconds
11205
11206         AFTER
11207                 Run 1:   8.65 seconds
11208                 Run 2:   8.56 seconds
11209
11210 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11211
11212         * Makefile: Add a new target `do-time' that does a quick and simple
11213         profile, leaving easy to parse output.
11214
11215 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11216
11217         * codegen.cs (Init): Create the dynamic assembly with 
11218         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11219
11220 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11221
11222         * support.cs: Make the PtrHashtable use only one
11223         instance of its comparer.
11224
11225 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11226
11227         * typemanager.cs: Fix lookup of GetNamespaces.
11228
11229 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11230
11231         * expression.cs: Removed redundant line.
11232
11233         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11234         ArrayLists, use for loops with bounds.  
11235
11236         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11237         arraylist.
11238
11239         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11240         arraylists, use for loop with bounds.
11241
11242         The above three changes give us a 0.071 second performance
11243         improvement out of 3.294 seconds down to 3.223.  On my machine
11244         the above changes reduced the memory usage by 1,387 KB during
11245         compiler bootstrap.
11246
11247         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11248         QualifiedIdentifiers.  Before we created a new string through
11249         concatenation, and mostly later on, the result would be
11250         manipulated by DecomposeQI through string manipulation.
11251
11252         This reduced the compiler memory usage for bootstrapping from
11253         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11254         compile times in 0.05 seconds.
11255
11256 2003-11-28  Dick Porter  <dick@ximian.com>
11257
11258         * support.cs: Do string compares with the Invariant culture.
11259
11260         * rootcontext.cs: 
11261         * gen-treedump.cs: 
11262         * expression.cs: 
11263         * driver.cs: 
11264         * decl.cs: 
11265         * codegen.cs: 
11266         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11267         the comparison is done with the Invariant culture.
11268
11269 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11270
11271         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11272         GetEnumerator method.
11273
11274         (ProbeCollectionType): Iterate starting at the most specific type
11275         upwards looking for a GetEnumerator
11276
11277         * expression.cs: Shift count can be up to 31 for int/uint and 63
11278         for long/ulong.
11279
11280 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11281
11282         * statement.cs (Block.LookupLabel): Also look for the label on the
11283         children blocks.  Use a hash table to keep track of visited
11284         nodes. 
11285
11286         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11287         we actually did transform the other operand, otherwise fall back
11288         to the common codepath that casts to long.
11289
11290         * cs-tokenizer.cs: Use the same code pattern as the int case.
11291         Maybe I should do the parsing myself, and avoid depending on the
11292         Parse routines to get this done.
11293
11294 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11297         which fixes bug 51347.  This time test it.
11298
11299         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11300         attributes for example can not tell the difference between these.
11301         The difference was only a syntax feature of the language. 
11302
11303         * attribute.cs: Apply attributes to delegates.
11304
11305         * delegate.cs: Call the apply attributes method.
11306
11307 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11308
11309         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11310         comparing 0 vs Byte.MinValue, not the value
11311
11312         (ImplicitConversionRequired): When reporting a conversion error,
11313         use error 31 to print out the constant error instead of the
11314         simpler 29.
11315
11316         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11317         which fixes bug 51347.
11318
11319 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11320
11321         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11322         which fixes the -warnaserror command line option.
11323
11324 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11325
11326         * cfold.cs (DoNumericPromotions): During constant folding of
11327         additions on UIntConstant, special case intconstants with
11328         IntConstants like we do on the expression binary operator. 
11329
11330 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * convert.cs (ImplicitReferenceConversion): We were missing a case
11333         (System.Enum are not value types or class types, so we need to
11334         classify them separatedly).
11335
11336         * driver.cs: We do not support error 2007.
11337
11338 2003-11-12 Jackson Harper <jackson@ximian.com>
11339
11340         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11341         system directory. Also use the full file name so users can
11342         libraries names mscorlib-o-tron.dll in a non system dir.
11343
11344 2003-11-10  Martin Baulig  <martin@ximian.com>
11345
11346         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11347         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11348         calling `ResolveType()' on them, directly assign their `Type'.
11349
11350 2003-11-08  Martin Baulig  <martin@ximian.com>
11351
11352         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11353         return value and the `out parent' parameter.
11354         (TypeContainer.DefineType): Moved the CS0644 check into
11355         GetClassBases().  Don't pass the interface types to the
11356         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11357         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11358
11359         * ecore.cs (TypeExpr.IsAttribute): New property.
11360         (TypeExpr.GetInterfaces): New method.
11361
11362         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11363         TypeExpr instead of a Type.
11364         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11365         (Interface.DefineType): Don't pass the interface types to the
11366         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11367         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11368
11369         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11370         instead of a `Type[]'.
11371         (TypeManager.RegisterBuilder): Likewise.
11372         (TypeManager.AddUserInterface): Likewise.
11373         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11374         `Type[]' and also return a `TypeExpr[]'.
11375         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11376
11377 2003-11-08  Martin Baulig  <martin@ximian.com>
11378
11379         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11380         Expression.     
11381
11382 2003-11-08  Martin Baulig  <martin@ximian.com>
11383
11384         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11385         TypeManager.ResolveExpressionTypes().
11386
11387         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11388         instead of an Expression.
11389         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11390         (TypeExpression): New public class; formerly known as `TypeExpr'.
11391
11392         * expression.cs (ComposedCast): Derive from TypeExpr.
11393
11394         * typemanager.cs (TypeManager.system_*_expr): These are now
11395         TypExpr's instead of Expression's.
11396         (TypeManager.ResolveExpressionTypes): New public static function;
11397         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11398         of them.        
11399
11400 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11401
11402         * expression.cs (New.DoResolve): Do not dereference value that
11403         might be a null return.
11404
11405         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11406         sure that the constant value has the right type.  Fixes an
11407         unreported bug, similar to 50425.
11408
11409         * const.cs (Const.LookupConstantValue): Call
11410         ImplicitStandardConversionExists before doing a conversion to
11411         avoid havng the TypeManager.ChangeType do conversions.
11412
11413         Reduced the number of casts used
11414
11415         (Const.ChangeType): New routine to enable reuse of the constant
11416         type changing code from statement.
11417
11418         * typemanager.cs (ChangeType): Move common initialization to
11419         static global variables.
11420
11421         Fixes #50425.
11422
11423         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11424         every value type to go through, even if it was void.  Fix that. 
11425
11426         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11427         character of the define, and the is_identifier_part_character for
11428         the rest of the string.
11429
11430 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11431
11432         * expression.cs (UnaryMutator.EmitCode): When I updated
11433         LocalVariableReference.DoResolve, I overdid it, and dropped an
11434         optimization done on local variable references.
11435
11436 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * ecore.cs: Convert the return from Ldlen into an int.
11439
11440 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11441
11442         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11443         the accessibility, this is a special case for toplevel non-public
11444         classes (internal for instance).
11445
11446 2003-10-20  Nick Drochak <ndrochak@gol.com>
11447
11448         * ecore.cs: Fix typo and build.  Needed another right paren.
11449
11450 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11451
11452         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11453         `internal' case regular and protected, but not allowing protected
11454         to be evaluated later.  Bug 49840
11455
11456 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11457
11458         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11459         to kb.Nlast, and not the kb.nFirst to isolate the switch
11460         statement.
11461
11462         Extract the underlying type, so enumerations of long/ulong are
11463         treated like long/ulong.
11464
11465 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11466
11467         * expression.cs (New): Overload the meaning of RequestedType to
11468         track the possible creation of the NewDelegate type, since
11469         DoResolve is invoked more than once for new constructors on field
11470         initialization.
11471
11472         See bugs: #48800 and #37014
11473
11474         * cs-parser.jay (declare_local_constants): Take an arraylist
11475         instead of a single constant.
11476
11477         (local_constant_declaration): It should take a
11478         constant_declarators, not a constant_declarator.  Fixes 49487
11479
11480         * convert.cs: Fix error report.
11481
11482 2003-10-13 Jackson Harper <jackson@ximian.com>
11483
11484         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11485         bug #49611
11486
11487 2003-10-09  Martin Baulig  <martin@ximian.com>
11488
11489         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11490         to the .ctor.
11491         (MethodCore.DoDefineParameters): Removed the TypeContainer
11492         argument; use the DeclSpace which was passed to the .ctor instead.
11493         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11494         TypeContainer; we only need a DeclSpace here.
11495
11496 2003-10-09  Martin Baulig  <martin@ximian.com>
11497
11498         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11499         to the .ctor.
11500         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11501         EmitContext's .ctor.    
11502
11503 2003-10-09  Martin Baulig  <martin@ximian.com>
11504
11505         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11506         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11507         AsAccessible(), moved them as well.
11508
11509         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11510
11511 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11512
11513         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11514
11515 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11516
11517         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11518         generation for >=, as spotted by Paolo, bug 48679.  
11519         Patch from David Waite.
11520
11521         * cs-tokenizer.cs: Add handling for #pragma.
11522
11523         * cs-parser.jay: Allow for both yield and yield return in the
11524         syntax.  The anti-cobolization of C# fight will go on!
11525
11526         * class.cs (TypeBuilder.DefineType): Catch error condition here
11527         (Parent.DefineType erroring out and returning null).
11528
11529         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11530         coping with enumerations variables, we were mistakenly processing
11531         them as a regular value type instead of built-in types.  Fixes the
11532         bug #48063
11533
11534         * typemanager.cs (IsBuiltinOrEnum): New method.
11535
11536 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11537
11538         * cs-parser.jay: Upgrade: yield now needs the return clause.
11539
11540 2003-09-19  Martin Baulig  <martin@ximian.com>
11541
11542         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11543         `MemberCache parent' argument.  Normally, an interface doesn't
11544         have a parent type except System.Object, but we use this in gmcs
11545         for generic type parameters.
11546
11547 2003-09-18  Martin Baulig  <martin@ximian.com>
11548
11549         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11550         on `type.IsInterface'; don't check whether the type has a parent
11551         to determine whether it's an interface.
11552
11553 2003-09-15  Martin Baulig  <martin@ximian.com>
11554
11555         * class.cs (TypeContainer.DefineType): Added an error flag to
11556         avoid reporting duplicate CS0146's ("class definition is
11557         circular.").
11558
11559         * driver.cs (Driver.MainDriver): Abort if
11560         RootContext.ResolveTree() reported any errors.
11561
11562 2003-09-07  Martin Baulig  <martin@ximian.com>
11563
11564         * report.cs (Error, Warning): Added overloaded versions which take
11565         a `params object[] args' and call String.Format().
11566
11567 2003-09-07  Martin Baulig  <martin@ximian.com>
11568
11569         * decl.cs (DeclSpace..ctor): Don't call
11570         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11571         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11572         (DeclSpace.RecordDecl): New method.
11573
11574         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11575
11576 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11577
11578         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11579         value attributes to be applied to ParameterBuilders.
11580
11581         * class.cs (MethodCore.LabelParameters): Make static and more
11582         generic so that it can be used from other places - like interface
11583         methods, for instance.
11584
11585         * interface.cs (Interface.Emit): Call LabelParameters before
11586         emitting attributes on the InterfaceMethod.
11587
11588 2003-08-26  Martin Baulig  <martin@ximian.com>
11589
11590         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11591         resolving aliases; fixes #47927.
11592
11593 2003-08-26  Martin Baulig  <martin@ximian.com>
11594
11595         * statement.cs (Using.DoResolve): This is internally emitting a
11596         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11597         do not always return.  Fixes #47681.
11598
11599 2003-08-26  Martin Baulig  <martin@ximian.com>
11600
11601         * decl.cs (MemberCore): Moved WarningNotHiding(),
11602         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11603         into MemberBase.
11604         (AdditionResult): Make this nested in DeclSpace.
11605         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11606         argument; call NamespaceEntry.Define() unless we're nested in a
11607         class or struct.
11608
11609         * namespace.cs (Namespace.DefineName): New public function.  This
11610         is called from DeclSpace's .ctor to add 
11611         (Namespace.Lookup): Include DeclSpaces in the lookup.
11612
11613         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11614
11615         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11616
11617 2003-08-25  Martin Baulig  <martin@ximian.com>
11618
11619         * convert.cs (Convert.ExplicitReferenceConversion): When
11620         converting from an interface type to a class, unbox if the target
11621         type is a struct type.  Fixes #47822.
11622
11623 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11624
11625         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11626         #47854.
11627
11628 2003-08-22  Martin Baulig  <martin@ximian.com>
11629
11630         * class.cs (TypeManager.DefineType): When defining a nested type,
11631         call DefineType() on our parent; fixes #47801.
11632
11633 2003-08-22  Martin Baulig  <martin@ximian.com>
11634
11635         * class.cs (MethodData.Define): While checking if a method is an
11636         interface implementation, improve the test a bit more to fix #47654.
11637
11638 2003-08-22  Martin Baulig  <martin@ximian.com>
11639
11640         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11641         correctly; fixes #47722.
11642
11643 2003-08-22  Martin Baulig  <martin@ximian.com>
11644
11645         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11646         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11647
11648         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11649
11650 2003-08-22  Martin Baulig  <martin@ximian.com>
11651
11652         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11653         can only be assigned in static constructors.  Fixes #47161.
11654
11655 2003-08-22  Martin Baulig  <martin@ximian.com>
11656
11657         Rewrote and improved the flow analysis code.
11658
11659         * flowbranching.cs (FlowBranching): Make this class abstract.
11660         (FlowBranching.CreateBranching): New static function to create a
11661         new flow branching.
11662         (FlowBranchingBlock, FlowBranchingException): New classes.
11663         (FlowBranching.UsageVector.Type): New public readonly field.
11664         (FlowBranching.UsageVector.Breaks): Removed the setter.
11665         (FlowBranching.UsageVector.Returns): Removed the setter.
11666         (FlowBranching.UsageVector): Added Break(), Return(),
11667         NeverReachable() and Throw() methods to modify the reachability.
11668         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11669         done by FlowBranching.Merge().
11670         (FlowBranching.UsageVector.MergeChild): New method; merges the
11671         merge result into the current vector.
11672         (FlowBranching.Merge): New abstract method to merge a branching.
11673
11674 2003-08-12  Martin Baulig  <martin@ximian.com>
11675
11676         * expression.cs (Indirection.CacheTemporaries): Create the
11677         LocalTemporary with the pointer type, not its element type.
11678
11679 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11682         token was a keyword or not.
11683
11684         Add `error' options where an IDENTIFIER was expected;  Provide
11685         CheckToken and CheckIdentifierToken convenience error reporting
11686         functions. 
11687
11688         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11689
11690         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11691         NameSpaceEntry NameSpaceEntry.
11692
11693         (LookupInterfaceOrClass): Avoid creating a full qualified name
11694         from namespace and name: avoid doing lookups when we know the
11695         namespace is non-existant.   Use new Tree.LookupByNamespace which
11696         looks up DeclSpaces based on their namespace, name pair.
11697
11698         * driver.cs: Provide a new `parser verbose' to display the
11699         exception thrown during parsing.  This is turned off by default
11700         now, so the output of a failure from mcs is more graceful.
11701
11702         * namespace.cs: Track all the namespaces defined in a hashtable
11703         for quick lookup.
11704
11705         (IsNamespace): New method
11706
11707 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11710         we know that we need to concatenate (full typename can never be
11711         null). 
11712
11713         * class.cs: ditto.
11714
11715         * statement.cs: Use a bitfield;  Do not initialize to null things
11716         which are done by the constructor by default.
11717
11718         * cs-parser.jay: bug fix, parameter was 4, not 3.
11719
11720         * expression.cs: Just use the property;
11721
11722         * statement.cs: No need for GetVariableInfo method.
11723
11724 2003-08-08  Martin Baulig  <martin@ximian.com>
11725
11726         * flowanalysis.cs (FlowReturns): This is now nested in the
11727         `FlowBranching' class.
11728         (MyBitVector): Moved this here from statement.cs.
11729         (FlowBranching.SiblingType): New enum type.
11730         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11731
11732 2003-08-07  Martin Baulig  <martin@ximian.com>
11733
11734         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11735         `FlowBranching' class and called `BranchingType'.
11736
11737 2003-08-07  Martin Baulig  <martin@ximian.com>
11738
11739         * flowanalysis.cs: Moved all the control flow analysis code into
11740         its own file.
11741
11742 2003-08-07  Martin Baulig  <martin@ximian.com>
11743
11744         * assign.cs (Assign.DoResolve): `target' must either be an
11745         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11746         #37319.
11747
11748 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * expression.cs (BinaryMethod): This kind of expression is created by the
11751         Binary class if it determines that the operator has to be handled
11752         by a method.
11753
11754         (BinaryDelegate): This kind of expression is created if we are
11755         dealing with a + or - operator on delegates.
11756
11757         (Binary): remove method, argumetns, and DelegateOperator: when
11758         dealing with methods, 
11759
11760         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11761
11762         * statement.cs (Block): use bitfields for the three extra booleans
11763         we had in use.   Remove unused topblock parameter.
11764
11765         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11766
11767         * assign.cs: Drop extra unneeded tests.
11768
11769 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11770
11771         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11772
11773         * statement.cs (Foreach): Use VariableStorage instead of
11774         LocalBuilders.   
11775
11776         * codegen.cs (VariableStorage): New class used by clients that
11777         require a variable stored: locals or fields for variables that
11778         need to live across yield.
11779
11780         Maybe provide a convenience api for EmitThis+EmitLoad?
11781
11782         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11783         these bad boys.
11784
11785 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11786
11787         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11788         RemapParameterLValue): New methods that are used to turn a
11789         precomputed FieldInfo into an expression like this:
11790
11791                 instance.FieldInfo
11792
11793         The idea is to use this instead of making LocalVariableReference
11794         have more than one meaning.
11795
11796         * cs-parser.jay: Add error production to BASE.
11797
11798         * ecore.cs: Deal with TypeManager.GetField returning null, which
11799         is now a valid return value.
11800
11801         (FieldExprNoAddress): New expression for Fields whose address can
11802         not be taken.
11803
11804         * expression.cs (LocalVariableReference): During the resolve
11805         phases, create new expressions if we are in a remapping context.
11806         Remove code that dealt with remapping here.
11807
11808         (ParameterReference): same.
11809
11810         (ProxyInstance): New expression, like the `This' expression, but
11811         it is born fully resolved.  We know what we are doing, so remove
11812         the errors that are targeted to user-provided uses of `this'.
11813
11814         * statement.cs (Foreach): our variable is now stored as an
11815         Expression;  During resolution, follow the protocol, dont just
11816         assume it will return this.
11817
11818 2003-08-06  Martin Baulig  <martin@ximian.com>
11819
11820         * support.cs (SeekableStreamReader.cs): New public class.
11821
11822         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11823         SeekableStreamReader instead of the normal StreamReader.
11824
11825 2003-08-04  Martin Baulig  <martin@ximian.com>
11826
11827         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11828         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11829         deambiguate casts and delegate invocations.
11830         (parenthesized_expression): Use the new tokens to ensure this is
11831         not a cast of method invocation.
11832
11833         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11834         when reading a `)' and Deambiguate_CloseParens () was previously
11835         called.
11836
11837         * expression.cs (ParenthesizedExpression): New class.  This is
11838         just used for the CS0075 test.
11839         (Binary.DoResolve): Check for CS0075.   
11840
11841 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11842
11843         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11844         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11845         reference comparison.
11846
11847         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11848         examine the ReturnType for equality - this is necessary in the
11849         cases of implicit and explicit operators whose signature also
11850         includes the return type.
11851
11852 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11853
11854         * namespace.cs: Cache the result of the namespace computation,
11855         instead of computing it every time.
11856
11857 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11858
11859         * decl.cs: Use a global arraylist that we reuse over invocations
11860         to avoid excesive memory consumption.  Reduces memory usage on an
11861         mcs compile by one meg (45 average).
11862
11863         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11864         private, work around that.
11865
11866 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11867
11868         * literal.cs (IntLiteral): Define Zero and One static literals. 
11869
11870         * cs-parser.jay (integer_literal): use static literals to reduce
11871         memory usage for the most used literals (0, 1 and -1).  211kb
11872         reduced in memory usage.
11873
11874         Replace all calls to `new ArrayList' with `new
11875         ArrayList(4)' which is a good average number for most allocations,
11876         and also requires only 16 bytes of memory for its buffer by
11877         default. 
11878
11879         This reduced MCS memory usage in seven megabytes for the RSS after
11880         bootstrapping.
11881
11882 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11883
11884         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11885         handle params methods the correct way by forming only one
11886         applicable set with params and normal methods in them. Earlier we
11887         were looking at params methods only if we found no normal methods
11888         which was not the correct thing to do.
11889
11890         (Invocation.BetterFunction): Take separate arguments indicating
11891         when candidate and the best method are params methods in their
11892         expanded form.
11893
11894         This fixes bugs #43367 and #46199.
11895
11896         * attribute.cs: Documentation updates.
11897
11898         (CheckAttribute): Rename to CheckAttributeTarget.
11899         (GetValidPlaces): Rename to GetValidTargets.
11900
11901         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11902         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11903
11904         Fixes bug #44468.
11905
11906 2003-07-28  Martin Baulig  <martin@ximian.com>
11907
11908         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11909         name when looking up the base class of a nested class.  Fixes #46977.
11910
11911 2003-07-26  Martin Baulig  <martin@ximian.com>
11912
11913         * expression.cs (Indexers.Indexer): New nested struct; contains
11914         getter, setter and the indexer's type.
11915         (Indexers.Properties): This is now an ArrayList of
11916         Indexers.Indexer's.
11917         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11918         indexer doesn't have any getters.
11919
11920         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11921         for embedded property and indexer assignments.
11922
11923 2003-07-26  Martin Baulig  <martin@ximian.com>
11924
11925         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11926         preprocessor directive is not the first non-whitespace character
11927         on a line.
11928
11929 2003-07-26  Martin Baulig  <martin@ximian.com>
11930
11931         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11932         namespace parsing, follow the spec more closely.
11933
11934         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11935         NamespaceEntry.Lookup().
11936
11937 2003-07-25  Martin Baulig  <martin@ximian.com>
11938
11939         * MethodCore.cs (OverridesSomething): New public field; it's set
11940         from TypeContainer.DefineMembers if this method overrides
11941         something (which doesn't need to be a method).  Fix #39462.
11942
11943 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11944
11945         * typemanager.cs (GetMembers): Ensure that the list of members is
11946         reversed. This keeps things in sync.
11947
11948         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11949         find an AttributeUsage attribute.
11950
11951         * expression.cs (Invocation.OverloadResolve): Perform the check
11952         which disallows Invoke to be directly called on a Delegate.
11953
11954         (Error_InvokeOnDelegate): Report error cs1533.
11955
11956 2003-07-25  Martin Baulig  <martin@ximian.com>
11957
11958         * expression.cs (Indexers.GetIndexersForType): Only look in the
11959         interface hierarchy if the requested type is already an
11960         interface.  Fixes #46788 while keeping #46502 fixed.
11961
11962 2003-07-25  Martin Baulig  <martin@ximian.com>
11963
11964         * class.cs (TypeContainer.DefineMembers): Check whether all
11965         readonly fields have been assigned and report warning CS0649 if
11966         not.
11967
11968         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11969         a valuetype.
11970
11971 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11972
11973         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11974         returned from GetMethods to make things consistent with the
11975         assumptions MCS makes about ordering of methods.
11976
11977         This should comprehensively fix bug #45127 and it does :-)
11978
11979         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11980         ordering is actually reverse.
11981
11982         * Clean up some debug messages I left lying around.
11983
11984         * interface.cs (Populate*): Get rid of code which emits attributes
11985         since the stage in which we emit attributes is the 'Emit' stage,
11986         not the define stage.
11987
11988         (Emit): Move attribute emission for interface members here.
11989
11990 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11991
11992         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11993         closely: we eliminate methods in base types when we have an
11994         applicable method in a top-level type.
11995
11996         Please see section 14.5.5.1 for an exact description of what goes
11997         on. 
11998
11999         This fixes bug #45127 and a host of other related to corlib compilation.
12000
12001         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12002         array is the method corresponding to the top-level type (this is
12003         because of the changes made to icall.c) so we change this
12004         accordingly.
12005
12006         (MethodGroupExpr.Name): This too.
12007
12008         * typemanager.cs (GetElementType): New method which does the right
12009         thing when compiling corlib. 
12010
12011         * everywhere: Make use of the above in the relevant places.
12012
12013 2003-07-22  Martin Baulig  <martin@ximian.com>
12014
12015         * cs-parser.jay (invocation_expression): Moved
12016         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12017         `cast_expression', but create a InvocationOrCast which later
12018         resolves to either an Invocation or a Cast.
12019
12020         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12021         method; call this before EmitStatement() to make sure that this
12022         expression can be used as a statement.
12023
12024         * expression.cs (InvocationOrCast): New class; resolves to either
12025         an Invocation or a Cast.
12026
12027         * statement.cs (StatementExpression): Call ResolveStatement() on
12028         the ExpressionStatement before emitting it.
12029
12030 2003-07-21  Martin Baulig  <martin@ximian.com>
12031
12032         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12033         `ref' and `out' attributes match; fixes #46220.
12034         (MemberAccess.ResolveMemberAccess): You can't reference a type
12035         through an expression; fixes #33180.
12036         (Indexers.GetIndexersForType): Don't return the indexers from
12037         interfaces the class implements; fixes #46502.
12038
12039 2003-07-21  Martin Baulig  <martin@ximian.com>
12040
12041         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12042         CS0661 checks; fixes bug #30442.
12043
12044 2003-07-21  Martin Baulig  <martin@ximian.com>
12045
12046         * decl.cs (AdditionResult): Added `Error'.
12047
12048         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12049
12050         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12051         makes cs0031.cs actually work.
12052
12053 2003-07-20  Martin Baulig  <martin@ximian.com>
12054
12055         * namespace.cs: Fixed that bug which caused a crash when compiling
12056         the debugger's GUI.
12057
12058 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12059
12060         * typemanager.cs (LookupTypeReflection): Never expose types which
12061         are NotPublic, NestedPrivate, NestedAssembly, or
12062         NestedFamANDAssem.  We used to return these, and later do a check
12063         that would report a meaningful error, but the problem is that we
12064         would not get the real match, if there was a name override.
12065
12066 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12067
12068         * namespace.cs (Namespace, Name): Do not compute the namespace
12069         name dynamically, compute it in the constructor.  This reduced
12070         memory usage by 1697 KB.
12071
12072         * driver.cs: Use --pause to pause at the end.
12073
12074 2003-07-17  Peter Williams  <peter@newton.cx>
12075
12076         * Makefile: Change the name of the test target so that it doesn't
12077         conflict with the recursive test target.
12078
12079 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12080
12081         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12082         AddressOf): Do not use EmitThis, that was wrong, use the actual
12083         this pointer.
12084
12085 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12086
12087         * class.cs (MethodData.Define): While checking if a method is an
12088         interface implementation, improve the test: If we are not public
12089         (use new test here: use the computed MethodAttributes directly,
12090         instead of the parsed modifier flags) check if the `implementing'
12091         method comes from an interface or not.
12092
12093         * pending.cs (VerifyPendingMethods): Slightly better error
12094         message.
12095
12096         * makefile: add test target that does the mcs bootstrap.
12097
12098 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12099
12100         * interface.cs (Define): Do nothing here since there are no
12101         members to populate etc. Move the attribute emission out of here
12102         since this was just totally the wrong place to put it. Attribute
12103         application happens during the 'Emit' phase, not in the 'Define'
12104         phase.
12105
12106         (Emit): Add this method and move the attribute emission here
12107
12108         * rootcontext.cs (EmitCode): Call the Emit method on interface
12109         types too.
12110
12111 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12112
12113         * expression.cs (OverloadResolve): Report error only if Location
12114         is not 'Null' which means that there was a probe going on.
12115
12116 2003-07-14  Martin Baulig  <martin@ximian.com>
12117
12118         * expression.cs (ConditionalLogicalOperator): New public class to
12119         implement user defined conditional logical operators.
12120         This is section 14.11.2 in the spec and bug #40505.
12121
12122 2003-07-14  Martin Baulig  <martin@ximian.com>
12123
12124         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12125
12126 2003-07-14  Martin Baulig  <martin@ximian.com>
12127
12128         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12129
12130         * ecore.cs (IVariable.VerifyFixed): New interface method.
12131
12132         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12133         operator, check whether the variable is actually fixed.  Fixes bug
12134         #36055.  Set a variable definitely assigned when taking its
12135         address as required by the spec.
12136
12137         * statement.cs (LocalInfo.IsFixed): New field.
12138         (LocalInfo.MakePinned): Set `IsFixed' to true.
12139
12140 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12141
12142         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12143         for .ctors, ensure that we only ask for members declared in the
12144         attribute type (BindingFlags.DeclaredOnly).
12145
12146         Fixes bug #43632.
12147
12148         * expression.cs (Error_WrongNumArguments): Report error 1501
12149         correctly the way CSC does.
12150
12151 2003-07-13  Martin Baulig  <martin@ximian.com>
12152
12153         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12154         lookup on the fully qualified name, to make things like "X.X" work
12155         where "X.X" is a fully qualified type name, but we also have a
12156         namespace "X" in the using list.  Fixes #41975.
12157
12158 2003-07-13  Martin Baulig  <martin@ximian.com>
12159
12160         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12161         function. If we're a CompoundAssign, we need to create an embedded
12162         CompoundAssign, not an embedded Assign.
12163         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12164         Fixes #45854.
12165
12166 2003-07-13  Martin Baulig  <martin@ximian.com>
12167
12168         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12169         work to fix bug #46088.
12170
12171 2003-07-13  Ravi Pratap <ravi@ximian.com>
12172
12173         * class.cs (Operator.Emit): Do not emit attributes here - it is
12174         taken care of by the Method class that we delegate too. This takes
12175         care of bug #45876.
12176
12177 2003-07-10  Martin Baulig  <martin@ximian.com>
12178
12179         * expression.cs (TypeOfVoid): New class.
12180         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12181
12182 2003-07-10  Martin Baulig  <martin@ximian.com>
12183
12184         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12185         bug #35957.
12186
12187 2003-07-10  Martin Baulig  <martin@ximian.com>
12188
12189         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12190         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12191
12192         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12193
12194         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12195
12196 2003-07-10  Martin Baulig  <martin@ximian.com>
12197
12198         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12199         of decimal.  Fixes #42850.
12200
12201         NOTE: I also fixed the created byte blob, but this doesn't work on
12202         the MS runtime and csc never produces any byte blobs for decimal
12203         arrays.
12204
12205 2003-07-10  Martin Baulig  <martin@ximian.com>
12206
12207         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12208         structs; fixes #32068.
12209         (Block.AddChildVariableNames): Fixed #44302.
12210
12211 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12212
12213         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12214
12215 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * attribute.cs: And this test is onger needed.
12218
12219 2003-07-08  Martin Baulig  <martin@ximian.com>
12220
12221         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12222         inaccessible types.  Fixes #36313.
12223
12224         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12225
12226         * namespace.cs (NamespaceEntry): Create implicit entries for all
12227         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12228         implicit entries for N1.N2 and N1.
12229
12230 2003-07-08  Martin Baulig  <martin@ximian.com>
12231
12232         Rewrote the handling of namespaces to fix a lot of the issues
12233         wrt. `using' aliases etc.
12234
12235         * namespace.cs (Namespace): Splitted this class into a
12236         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12237
12238         * typemanager.cs (TypeManager.IsNamespace): Removed.
12239         (TypeManager.ComputeNamespaces): Only compute namespaces from
12240         loaded assemblies here, not the namespaces from the assembly we're
12241         currently compiling.
12242
12243 2003-07-08  Martin Baulig  <martin@ximian.com>
12244
12245         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12246
12247 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12248
12249         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12250         already fixed it.  
12251
12252         I thought about the memory savings here, but LookupTypeReflection
12253         is used under already very constrained scenarios.  Compiling
12254         corlib or mcs only exposes one hit, so it would not really reduce
12255         any memory consumption.
12256
12257 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12258
12259         * typemanager.cs: fixes bug #45889 by only adding public types from
12260         other assemblies to the list of known types.
12261
12262 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12263
12264         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12265         on the type we resolved.
12266
12267 2003-07-05  Martin Baulig  <martin@ximian.com>
12268
12269         * pending.cs (PendingImplementation.ParentImplements): Don't
12270         create the proxy if the parent is abstract.
12271
12272         * class.cs (TypeContainer.DefineIndexers): Process explicit
12273         interface implementations first.  Fixes #37714.
12274
12275 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12276
12277         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12278         defined recursively;  but since we modify the input parameters
12279         (left is set to `this' temporarily), we reset this value if the
12280         left_is_explicit is false, which gives the original semantics to
12281         the code.  
12282
12283         * literal.cs (NullPointer): new class used to represent a null
12284         literal in a pointer context.
12285
12286         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12287         type is a pointer, use a NullPointer object instead of a
12288         NullLiteral.   Closes 43687
12289
12290         (ExplicitConversion): Convert pointer values using
12291         the conv opcode to the proper type.
12292
12293         * ecore.cs (New): change ValueTypeVariable property into a method,
12294         that returns whether the valuetype is suitable for being used.
12295
12296         * expression.cs (Binary.DoNumericPromotions): Only return if we
12297         the int constant was a valid uint, and we can return both left and
12298         right as uints.  If not, we continue processing, to trigger the
12299         type conversion.  This fixes 39018.
12300
12301         * statement.cs (Block.EmitMeta): During constant resolution, set
12302         the CurrentBlock property on the emitcontext, so that we resolve
12303         constants propertly.
12304
12305 2003-07-02  Martin Baulig  <martin@ximian.com>
12306
12307         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12308         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12309
12310         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12311         than emitting it here.
12312
12313         * statement.cs: Fixed some more flow analysis bugs.
12314
12315 2003-07-02  Martin Baulig  <martin@ximian.com>
12316
12317         * class.cs (MethodData.Define): When implementing interface
12318         methods, set Final unless we're Virtual.
12319
12320         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12321         check work for interface methods.
12322
12323 2003-07-01  Martin Baulig  <martin@ximian.com>
12324
12325         * ecore.cs (EmitContext.This): Replaced this property with a
12326         GetThis() method which takes a Location argument.  This ensures
12327         that we get the correct error location for a CS0188.
12328
12329 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12330
12331         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12332         ImplicitStandardConversion.
12333
12334         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12335
12336 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12337
12338         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12339         optimization.
12340
12341 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12342
12343         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12344         constructors.
12345
12346         (MethodData.Define): Turn off initlocals for unsafe methods.
12347
12348 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12349
12350         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12351         complete;  Fixes #37521.
12352
12353         * delegate.cs: Use Modifiers.TypeAttr to compute the
12354         TypeAttributes, instead of rolling our own.  This makes the flags
12355         correct for the delegates.
12356
12357 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12358
12359         * class.cs (Constructor.Define): Set the private flag for static
12360         constructors as well.
12361
12362         * cs-parser.jay (statement_expression): Set the return value to
12363         null, to avoid a crash when we catch an error.
12364
12365 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12366
12367         * cs-parser.jay: Applied patch from Jackson that adds support for
12368         extern and unsafe modifiers to destructor declarations.
12369
12370         * expression.cs: Report error 21 if the user is trying to index a
12371         System.Array.
12372
12373         * driver.cs: Add an error message, suggested by the bug report.
12374
12375         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12376         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12377
12378 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12379
12380         * namespace.cs: Add some information to reduce FAQs.
12381
12382 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12383
12384         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12385         underlying enumeration types.  Fixes #43915.
12386
12387         * expression.cs: Treat ushort/short as legal values to be used in
12388         bitwise operations.
12389
12390 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12391
12392         * delegate.cs: transfer custom attributes for paramenters from
12393         the delegate declaration to Invoke and BeginInvoke.
12394
12395 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12396
12397         * attribute.cs: handle custom marshalers and emit marshal info
12398         for fields, too.
12399
12400 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12401
12402         * makefile.gnu: Added anonymous.cs to the compiler sources.
12403
12404 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12405
12406         * iterators.cs: Change the name of the proxy class to include two
12407         underscores.
12408
12409         * cs-parser.jay: Update grammar to include anonymous methods.
12410
12411         * anonymous.cs: new file.
12412
12413 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12414
12415         * class.cs (Field.Define): Add missing test for pointers and
12416         safety. 
12417
12418 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12419
12420         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12421         we use the stobj opcode.
12422
12423         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12424         since it wasn't the correct fix. 
12425
12426         It still is puzzling that we are required to use stobj for IntPtr
12427         which seems to be a ValueType.
12428
12429 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12430
12431         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12432         during regular simple name resolution.   Now, the trick is that
12433         instead of returning for processing the simplename, we do a
12434         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12435         contextual lookup type).   If a match is found, return that, if
12436         not, return for further composition.
12437
12438         This fixes long-standing 30485.
12439
12440         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12441         using the address to initialize an object, do an Stobj instead of
12442         using the regular Stelem.
12443
12444         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12445         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12446         Because if we are a BaseIndexerAccess that value will be true.
12447         Fixes 43643.
12448
12449         * statement.cs (GotoCase.Resolve): Return after reporting an
12450         error, do not attempt to continue. 
12451
12452         * expression.cs (PointerArithmetic.Emit): If our operand is a
12453         long, convert our constants to match the operand before
12454         multiplying.  Convert to I type before adding.   Fixes 43670.
12455
12456 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12457
12458         * enum.cs (ImplicitConversionExists) : Rename to
12459         ImplicitEnumConversionExists to remove ambiguity. 
12460
12461         * ecore.cs (NullCast): New type of cast expression class which
12462         basically is very similar to EmptyCast with the difference being
12463         it still is a constant since it is used only to cast a null to
12464         something else
12465         (eg. (string) null)
12466
12467         * convert.cs (ImplicitReferenceConversion): When casting a null
12468         literal, we return a NullCast.
12469
12470         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12471         should be around anymore.
12472
12473         The renaming (reported was slightly wrong). Corrections:
12474
12475         ConvertImplicitStandard -> ImplicitConversionStandard
12476         ConvertExplicitStandard -> ExplicitConversionStandard
12477
12478         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12479         before passing them in !
12480
12481         * convert.cs (ImplicitConversionStandard): When comparing for
12482         equal expr and target types, ensure that expr is not a
12483         NullLiteral.
12484
12485         In general, we must not be checking (expr_type ==
12486         target_type) in the top level conversion methods
12487         (ImplicitConversion, ExplicitConversion etc). This checking is
12488         done in the methods that they delegate to.
12489
12490 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12491
12492         * convert.cs: Move Error_CannotConvertType,
12493         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12494         ImplicitNumericConversion, ImplicitConversionExists,
12495         ImplicitUserConversionExists, StandardConversionExists,
12496         FindMostEncompassedType, FindMostSpecificSource,
12497         FindMostSpecificTarget, ImplicitUserConversion,
12498         ExplicitUserConversion, GetConversionOperators,
12499         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12500         TryImplicitIntConversion, Error_CannotConvertImplicit,
12501         ConvertImplicitRequired, ConvertNumericExplicit,
12502         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12503         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12504         its own file.
12505
12506         Perform the following renames:
12507
12508         StandardConversionExists -> ImplicitStandardConversionExists
12509         ConvertImplicit -> ImplicitConversion
12510         ConvertImplicitStandard -> ImplicitStandardConversion
12511         TryImplicitIntConversion -> ImplicitIntConversion
12512         ConvertImplicitRequired -> ImplicitConversionRequired
12513         ConvertNumericExplicit -> ExplicitNumericConversion
12514         ConvertReferenceExplicit -> ExplicitReferenceConversion
12515         ConvertExplicit -> ExplicitConversion
12516         ConvertExplicitStandard -> ExplicitStandardConversion
12517
12518 2003-05-19  Martin Baulig  <martin@ximian.com>
12519
12520         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12521         (TypeInfo): Added support for structs having structs as fields.
12522
12523         * ecore.cs (FieldExpr): Implement IVariable.
12524         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12525         VariableInfo for the field.
12526
12527 2003-05-18  Martin Baulig  <martin@ximian.com>
12528
12529         * expression.cs (This.DoResolve): Report a CS0027 if we're
12530         emitting a field initializer.
12531
12532 2003-05-18  Martin Baulig  <martin@ximian.com>
12533
12534         * expression.cs (This.ResolveBase): New public function.
12535         (This.DoResolve): Check for CS0188.
12536
12537         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12538         This.Resolve().
12539
12540         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12541         `instance_expression' to null if we don't have any non-static
12542         methods.
12543
12544 2003-05-18  Martin Baulig  <martin@ximian.com>
12545
12546         Reworked the way how local variables and parameters are handled by
12547         the flow analysis code.
12548
12549         * statement.cs (TypeInfo, VariableMap): New public classes.
12550         (VariableInfo): New public class.  This is now responsible for
12551         checking whether a variable has been assigned.  It is used for
12552         parameters and local variables.
12553         (Block.EmitMeta): Take the InternalParameters as argument; compute
12554         the layout of the flow vectors here.
12555         (Block.LocalMap, Block.ParameterMap): New public properties.
12556         (FlowBranching): The .ctor doesn't get the InternalParameters
12557         anymore since Block.EmitMeta() now computes the layout of the flow
12558         vector.
12559         (MyStructInfo): This class is now known as `StructInfo' and nested
12560         in `TypeInfo'; we don't access this directly anymore.
12561
12562         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12563         property and removed IsAssigned(), IsFieldAssigned(),
12564         SetAssigned() and SetFieldAssigned(); we now call them on the
12565         VariableInfo so we don't need to duplicate this code everywhere.
12566
12567         * expression.cs (ParameterReference): Added `Block block' argument
12568         to the .ctor.
12569         (LocalVariableReference, ParameterReference, This): The new
12570         VariableInfo class is now responsible for all the definite
12571         assignment stuff.
12572
12573         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12574         IsParameterAssigned, SetParameterAssigned): Removed.
12575
12576 2003-05-18  Martin Baulig  <martin@ximian.com>
12577
12578         * typemanager.cs (InitCoreTypes): Try calling
12579         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12580         the 3-args-version.  Corlib now also needs our `void_type'.
12581         (GetMethod): Added overloaded version which takes an optional
12582         `bool report_errors' to allow lookups of optional methods.
12583
12584 2003-05-12  Martin Baulig  <martin@ximian.com>
12585
12586         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12587         only used for locals and not for parameters.
12588
12589 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12590
12591         * support.cs (InternalParameters.ParameterType): Return the
12592         ExternalType of the parameter.
12593
12594         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12595         they were unused.
12596
12597 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12598
12599         * class.cs (MethodData.Define): Do not set the `newslot' on
12600         interface members, if they are also flagged as "override".
12601
12602         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12603         better code for ++i and i++.  This only works for static fields
12604         and local variables.
12605
12606         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12607         want to pull the DeclSpace out of the builder_to_declspace instead
12608         of the TypeBuilder (like in TypeContainer.FindMembers).
12609
12610         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12611         instead of LookupTypeContainer.  Fixes the crash on .NET for
12612         looking up interface members.
12613
12614         * const.cs: Create our own emit context during the Definition
12615         stage, so that constants are evaluated in the proper context, when
12616         a recursive definition happens.
12617
12618 2003-05-11  Martin Baulig  <martin@ximian.com>
12619
12620         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12621         new block for a switch section.
12622         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12623         the adding/lookup in the switch block.  Fixes #39828.
12624
12625 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12626
12627         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12628         functionality: I needed to convert the data after I had performed
12629         the add/sub operation into the operands type size.
12630
12631         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12632         pass the type for the box operation, otherwise the resulting
12633         object would have been of type object.
12634
12635         (BoxedCast): Add constructor to specify the type to box as.
12636
12637 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * iterators.cs: I was reusing the `count' variable inadvertently,
12640         take steps to not allow this to happen.
12641
12642 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12643
12644         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12645         by creating an array at the point where the params starts and
12646         putting all those arguments there, then adjusting the size of the
12647         array.
12648
12649 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12650
12651         * expression.cs (New.AddressOf): Implement interface
12652         IMemoryLocation.  This is used when the `new' operator is used in
12653         the context of an invocation to a method on a value type.
12654
12655         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12656         example. 
12657
12658         * namespace.cs: Also check the using aliases here.
12659
12660         * driver.cs: Move the test for using validity after the types have
12661         been entered, so we do a single pass that also includes the using
12662         aliases. 
12663
12664         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12665         in the regular case.   CreateSiblingForFinally is doing extra
12666         error checking.
12667
12668         * attribute.cs (GetAttributeArgumentExpression): Store the result
12669         on an out value, and use the return value to indicate failure
12670         instead of using null (which is a valid return for Constant.GetValue).
12671
12672         * statement.cs: Perform the analysis flow for the increment
12673         portion after the statement, because this will be the real flow of
12674         execution.  Fixes #42385
12675
12676         * codegen.cs (EmitContext.EmitArgument,
12677         EmitContext.EmitStoreArgument): New helper functions when the
12678         RemapToProxy flag is set.
12679
12680         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12681         function.
12682
12683         Add support for remapping parameters. 
12684
12685         * iterators.cs: Propagate parameter values;  Store parameter
12686         values in the proxy classes.
12687
12688 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12689
12690         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12691         need a proxy reference;  I do not know what I was thinking
12692
12693         * cs-parser.jay (constructor_initializer): catch another error,
12694         and display nice message.
12695
12696         (field_declaration): catch void field declaration
12697         to flag a better error. 
12698
12699         * class.cs (MemberBase.CheckBase): Report an error instead of a
12700         warning if a new protected member is declared in a struct. 
12701         (Field.Define): catch the error of readonly/volatile.
12702
12703         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12704
12705         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12706         volatile variable is taken
12707
12708 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * statement.cs (Fixed.Resolve): Report an error if we are not in
12711         an unsafe context.
12712
12713 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * typemanager.cs: reuse the code that handles type clashes for
12716         delegates and enumerations.
12717
12718         * class.cs (Report28): Always report.
12719
12720         * expression.cs (EncodeAsAttribute): Allow nulls here.
12721
12722 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12723
12724         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12725         the functionality for testing whether an expression is valid for
12726         an attribute here.  Also handle the case of arrays of elements
12727         being stored. 
12728
12729         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12730         encoding a linear array into an array of objects that are suitable
12731         to be passed to an CustomAttributeBuilder.
12732
12733         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12734
12735         * ecore.cs: (FieldExpr): Handle field remapping here.
12736
12737         * iteratators.cs: Pass the instance variable (if the method is an
12738         instance method) to the constructors, so we can access the field
12739         variables on the class.
12740
12741         TODO: Test this with structs.  I think the THIS variable on
12742         structs might have to be a pointer, and not a refenrece
12743
12744 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12745
12746         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12747         local variables to fields in a proxy class.
12748
12749         * iterators.cs (PopulateProxy): Rename our internal fields to
12750         <XXX>.  
12751         Create a <THIS> field if we are an instance method, so we can
12752         reference our parent container variables.
12753         (MapVariable): Called back from the EmitContext code to enter a
12754         new variable to field mapping into the proxy class (we just create
12755         a FieldBuilder).
12756
12757         * expression.cs
12758         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12759         for using the remapped locals to fields.
12760
12761         I placed the code here, because that gives the same semantics to
12762         local variables, and only changes the Emit code.
12763
12764         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12765         statements inside iterators.
12766         (VariableInfo): Add a FieldBuilder for the cases when we are
12767         remapping local variables to fields in a proxy class
12768
12769         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12770         current_block != null.
12771
12772         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12773         not cope with strings, as it has been moved to the
12774         TableSwitchEmit.  Fixed bug in switch generation.
12775
12776         * expression.cs (New.DoResolve): Provide more context for the user
12777         when reporting an error.
12778
12779         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12780         pointers. 
12781
12782         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12783         check the permissions for it.  Note than in a type-resolution
12784         context the check was already present in DeclSpace.ResolveType,
12785         but was missing from the MemberAccess.
12786
12787         (ArrayCreation.CheckIndices): warn if the user has
12788         more nested levels of expressions, but there are no more
12789         dimensions specified.  Avoids crash on bug 41906.
12790
12791 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * statement.cs (Block): replace Implicit bool, for a generic
12794         flags.   
12795         New flag: `Unchecked'.  This is used during the EmitMeta phase
12796         (which is out-of-line with the regular Resolve/Emit process for a
12797         statement, as this is done ahead of time, but still gets a chance
12798         to call constant resolve).
12799
12800         (Block.Flags): new enum for adding a new flag.
12801
12802         (Block.EmitMeta): track the state of unchecked.
12803
12804         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12805         to enable constant resolution to work there as well.
12806
12807 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12808
12809         * typemanager.cs (ienumerable_type): Also look up
12810         System.Collections.IEnumerable. 
12811
12812 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12813
12814         TODO: Test more than one conditional per method.
12815
12816         * class.cs (Indexer.Define): Report the location where the user is
12817         referencing the unsupported feature.
12818
12819         (MethodData): Overload the use of `conditionals' to
12820         minimize the creation of needless ArrayLists.   This saves roughly
12821         212kb on my machine.
12822
12823         (Method): Implement the new IIteratorContainer interface.
12824         (Method.SetYields): Implement the method by setting the ModFlags
12825         to contain METHOD_YIELDS.
12826
12827         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12828         which just got set to null.
12829
12830         * iterators.cs: New file.
12831
12832         (Yield, YieldBreak): New statements.
12833
12834         * statement.cs (Return.Resolve): Flag an error if we are used in
12835         an iterator method.
12836
12837         * codegen.cs (InIterator): New flag set if the code is being
12838         compiled in an iterator method.
12839
12840         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12841         internal modifier, and we just use it to avoid adding extra
12842         fields, as this is seldom used.  
12843
12844         * cs-parser.jay: Add yield_statement (yield and yield break).
12845
12846         * driver.cs: New flag -v2 to turn on version 2 features. 
12847
12848         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12849         hashtable when v2 is enabled.
12850
12851 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12854         there is already a namespace defined with this name.
12855
12856         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12857         people upgraded their corlibs.
12858
12859         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12860         always use fully qualified types, no need to use the compiler
12861         front end.
12862
12863         (TypeManager.IsNamespace): Use binarysearch.
12864
12865         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12866         AddDelegate): I did not quite use the new IsValid API properly: I
12867         have to pass the short-name and the fullname.  I was passing only
12868         the basename instead of the fullname sometimes. 
12869
12870         (TypeContainer.DefineType): call NamespaceClash.
12871
12872         * interface.cs (Interface.DefineType): use NamespaceClash before
12873         defining the type.
12874
12875         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12876         defining the type.
12877
12878         * enum.cs: (Enum.DefineType): use NamespaceClash before
12879         defining the type.
12880
12881         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12882         speed increase.  First, use the negative_hits cache when we get a
12883         negative.  Second, add the type with its full original name
12884         instead of the new . and + encoded name (reflection uses + to
12885         separate type from a nested type).  Use LookupTypeReflection
12886         directly which bypasses the type->name hashtable (that we already
12887         know does not contain the type.
12888
12889         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12890         location/container type. 
12891
12892         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12893
12894 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12895
12896         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12897
12898         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12899         method is being referenced in the method group from a static
12900         context, and report error 120 if so.
12901
12902         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12903         Error118. 
12904
12905         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12906         is created, we create the A namespace).
12907
12908         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12909         Fixes #41591
12910
12911 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12912
12913         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12914         invocation to ModuleBuilder.GetType with the same values will
12915         return a new type instance, so we need to cache its return
12916         values. 
12917
12918         * expression.cs (Binary.ResolveOperator): Only allow the compare
12919         operators on enums if they are of the same type.
12920
12921         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12922         types of ValueType on their own case.  Before we were giving them
12923         the same treatment as objects.
12924
12925         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12926         fullname.  Short name is used to compare against container name.
12927         Fullname is used to check against defined namespace names.
12928
12929         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12930         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12931
12932         (Method.CheckBase): Call parent.
12933         (MemberBase.CheckBase): Check for protected members on sealed
12934         classes.
12935         (PropertyBase.CheckBase): Call parent.
12936         (Field.Define): Call parent.
12937
12938         * report.cs: Negative error codes are now mapped to 8000 - code,
12939         so that the display is render more nicely.
12940
12941         * typemanager.cs: Do not use try/catch, instead report a regular
12942         error. 
12943
12944         (GetPointerType, GetReferenceType): These methods provide
12945         mechanisms to obtain the T* and T& from a T.  We had the code
12946         previously scattered around the code base, and it also used
12947         TypeManager.LookupType that would go through plenty of caches.
12948         This one goes directly to the type source.
12949
12950         In some places we did the Type.GetType followed by
12951         ModuleBuilder.GetType, but not in others, so this unifies the
12952         processing as well.
12953
12954         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12955         statements now that we have namespace information.
12956
12957         * typemanager.cs (IsNamespace): New method, returns whether the
12958         string presented is a namespace or not.
12959
12960         (ComputeNamespaces): New public entry point, computes the list of
12961         available namespaces, using the GetNamespaces API call in Mono, or
12962         the slower version in MS.NET.   
12963
12964         Now before we start the semantic analysis phase, we have a
12965         complete list of namespaces including everything that the user has
12966         provided.
12967
12968         Deleted old code to cache namespaces in .nsc files.
12969
12970 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12971
12972         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12973         class/struct location definition Location for the implicit
12974         constructor location.
12975
12976         (Operator.Define): Use the location of the operator for the
12977         implicit Method definition.
12978
12979         (Constructor.Emit): use the constructor location for the implicit
12980         base initializer constructor.
12981
12982         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12983         and the Expression class now contains two new methods:
12984
12985         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12986         isolate type lookup from the rest of the resolution process.
12987
12988         Since we use Expressions to hold type definitions due to the way
12989         we parse the input we have historically overloaded Resolve to
12990         perform the Type lookups if a special flag is passed.  Now this is
12991         eliminated and two methods take their place. 
12992
12993         The differences in the two methods between xStep and xTerminal is
12994         that xStep is involved in our current lookup system that uses
12995         SimpleNames to compose a name, while xTerminal is used just to
12996         catch the case where the simplename lookup failed.
12997
12998 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12999
13000         * expression.cs (ResolveMemberAccess): Remove redundant code.
13001         TypeExpr expressions are always born fully resolved.
13002
13003         * interface.cs (PopulateMethod): Do not lookup the types twice.
13004         We were doing it once during SemanticAnalysis and once during
13005         PopulateMethod.
13006
13007         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13008         in local variable type definitions, were being returned as a
13009         SimpleName (we decomposed everything into a string), that is
13010         because primary_expression was being used instead of a type in the
13011         grammar (reduce/reduce conflicts).
13012
13013         The part that was wrong is that we converted the expression into a
13014         string (an oversimplification in one hand, compounded with primary
13015         expressions doing string concatenation).
13016
13017         So things like:
13018
13019         A.B.C [] x;
13020
13021         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13022         using clauses from working on this particular context.  And a type
13023         was being matched directly against "A.B.C[]".
13024
13025         We now use the correct approach, and allow for ComposedCast to be
13026         part of the unary expression.  So the "A.B.C []" become a composed
13027         cast of "A.B.C" (as a nested group of MemberAccess with a
13028         SimpleName at the end) plus the rank composition "[]". 
13029
13030         Also fixes 35567
13031
13032 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13033
13034         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13035         for the access level checking.
13036
13037         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13038         `TypeContainer container', because I kept getting confused when I
13039         was debugging this code.
13040
13041         * expression.cs (Indexers): Instead of tracking getters/setters,
13042         we now track them in parallel.  We create one arraylist less, but
13043         most importantly it is possible now for the LValue code to find a
13044         matching get for a set.
13045
13046         (IndexerAccess.DoResolveLValue): Update the code.
13047         GetIndexersForType has been modified already to extract all the
13048         indexers from a type.  The code assumed it did not.
13049
13050         Also make the code set the correct return type for the indexer.
13051         This was fixed a long time ago for properties, but was missing for
13052         indexers.  It used to be void_type.
13053
13054         (Binary.Emit): Test first for doubles instead of
13055         floats, as they are more common.
13056
13057         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13058         when dealing with floats and the <=, >= operators.  This fixes bug
13059         #39314 
13060
13061         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13062         to load the array value by emitting a load on the foreach variable
13063         type.  This was incorrect.  
13064
13065         We now emit the code to load an element using the the array
13066         variable type, and then we emit the conversion operator.
13067
13068         Fixed #40176
13069
13070 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13071
13072         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13073
13074 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13075
13076         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13077         test for protection before we test for signatures. 
13078
13079         (MethodSignature.ToString): implement.
13080
13081         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13082         to the case where we reduced into a LongConstant.
13083
13084         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13085         depend on whether the information is acurrate, because the
13086         Microsoft runtime will always claim that the array type is public,
13087         regardless of the real state.
13088
13089         If the type is a pointer, another problem happens: the type is
13090         reported as non-public in Microsoft.  
13091
13092         In both cases we have to call CheckAccessLevel recursively with
13093         the underlying type as the argument to be tested.
13094
13095 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13096
13097         * assign.cs (Assign.Emit): If we are dealing with a compound
13098         assignment expression, we should use the code path that stores the
13099         intermediate result in a temporary value.  This fixes #40903.
13100
13101         *expression.cs (Indirection.ToString): Provide ToString method for
13102         debugging. 
13103
13104 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13105
13106         * class.cs: Null out fields holding references to Block objects so
13107         they can be garbage collected.
13108
13109         * expression.cs (OverloadResolve): Remove unused local.
13110
13111 2003-04-07  Martin Baulig  <martin@ximian.com>
13112
13113         * codegen.cs (EmitContext.CurrentFile): New public field.
13114         (EmitContext.Mark): Use the CurrentFile to check whether the
13115         location is in the correct file.
13116         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13117
13118 2003-04-07  Martin Baulig  <martin@ximian.com>
13119
13120         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13121
13122         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13123         location.  [FIXME: The location argument which gets passed to this
13124         method is sometimes wrong!]
13125
13126 2003-04-07  Nick Drochak <ndrochak@gol.com>
13127
13128         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13129
13130 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13131
13132         * expression.cs (Indirection.EmitAssign): We were using the
13133         temporary, but returning immediately instead of continuing the
13134         EmitAssing flow.
13135
13136 2003-04-06  Martin Baulig  <martin@ximian.com>
13137
13138         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13139         if it's a nested child, but also deriving from the outer class.
13140         See test 190.cs.
13141
13142         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13143         nested child, but also deriving from the outer class.  See
13144         test-190.cs.
13145         (FilterWithClosure): We may access private members of the outer
13146         class if we're a nested child and deriving from the outer class.
13147         (RealMemberLookup): Only set `closure_private_ok' if the
13148         `original_bf' contained BindingFlags.NonPublic.
13149
13150 2003-04-05  Martin Baulig  <martin@ximian.com>
13151
13152         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13153
13154 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13155
13156         * class.cs (Event.Define): Do not allow abstract events to have
13157         initializers. 
13158
13159 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13162         block in event declarations.
13163
13164         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13165         value type, get its address.
13166
13167         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13168         leaving a class on the stack instead of a boolean value (int
13169         0/1).  Change the code so we compare against null, and then the
13170         result against zero.
13171
13172         * class.cs (TypeContainer.GetClassBases): We were checking for the
13173         parent class being sealed too late.
13174
13175         * expression.cs (Binary.Emit): For <= and >= when dealing with
13176         floating point values, use cgt.un and clt.un instead of cgt and
13177         clt alone.
13178
13179 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13180
13181         * statement.cs: Apply the same optimization as MS: skip the 
13182         GetEnumerator returning an IEnumerator, and use the one returning a 
13183         CharEnumerator instead. This allows us to avoid the try-finally block 
13184         and the boxing.
13185
13186 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13187
13188         * cs-parser.jay: Attributes cannot be applied to
13189                          namespaces. Fixes #40473
13190
13191 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13192
13193         * class.cs:
13194         (Add*): check if the name is valid using the full name for constants,
13195         fields, properties and events.
13196
13197 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13198
13199         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13200         char constants to be part of the enumeration.
13201
13202         * expression.cs (Conditional.DoResolve): Add support for operator
13203         true. Implements the missing functionality from 14.12
13204
13205         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13206         operator true/false as required by the spec.
13207
13208         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13209         implicit conversion to boolean.
13210
13211         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13212         also one where the type implements `operator true'. 
13213
13214         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13215         get an expression that will invoke operator true based on an
13216         expression.  
13217
13218         (GetConversionOperators): Removed the hack that called op_True
13219         here.  
13220
13221         (Expression.ResolveBoolean): Move this from Statement.
13222
13223 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13224
13225         * ecore.cs (FieldExpr): do not allow initialization of initonly
13226         fields on derived classes
13227
13228 2003-03-13  Martin Baulig  <martin@ximian.com>
13229
13230         * statement.cs (Block.Emit): Call ig.BeginScope() and
13231         ig.EndScope() when compiling with debugging info; call
13232         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13233
13234 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13235
13236         * expression.cs (Indexers): Do not construct immediately, allow
13237         for new members to be appended as we go.  Fixes 38143
13238
13239 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13240
13241         * expression.cs: save/restore context when resolving an unchecked
13242         expression.
13243
13244 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13245
13246         * cfold.cs: Catch division by zero in modulus operator during
13247         constant folding.
13248
13249 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * interface.cs (Interface.DefineMembers): Avoid defining members
13252         twice. 
13253
13254 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13255
13256         * driver.cs: handle the +/- options for -noconfig
13257
13258         * statement.cs (Unckeched.Resolve): Also track the state of
13259         unchecked in the Resolve phase.
13260
13261 2003-02-27  Martin Baulig  <martin@ximian.com>
13262
13263         * ecore.cs (Expression.MemberLookup): Don't create a
13264         MethodGroupExpr for something which is not a method.  Fixes #38291.
13265
13266 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13267
13268         * class.cs (MemberBase.CheckParameters): Also check that the type
13269         is unmanaged if it is a pointer.
13270
13271         * expression.cs (SizeOf.Resolve): Add location information.
13272
13273         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13274         a managed type is declared.
13275
13276         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13277         parameter modifiers as well.  Fixes bug 38606
13278
13279         * class.cs: Very sad.  Am backing out the speed up changes
13280         introduced by the ArrayList -> Array in the TypeContainer, as they
13281         were not actually that much faster, and introduced a bug (no error
13282         reports on duplicated methods).
13283
13284         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13285         source first, this will guarantee that we have a valid expression
13286         before calling in lower levels functions that will require a
13287         resolved object.  Then use this original_source in the
13288         target.ResolveLValue instead of the original source that was
13289         passed to us.
13290
13291         Another change.  Use target.Resolve instead of LValueResolve.
13292         Although we are resolving for LValues, we will let the Assign code
13293         take care of that (it will be called again from Resolve).  This
13294         basically allows code like this:
13295
13296         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13297         class Y { void A (X x) { x [0] += o; }
13298
13299         The problem was that the indexer was trying to resolve for
13300         set_Item (idx, object o) and never finding one.  The real set_Item
13301         was set_Item (idx, X).  By delaying the process we get the right
13302         semantics. 
13303
13304         Fixes bug 36505
13305
13306 2003-02-23  Martin Baulig  <martin@ximian.com>
13307
13308         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13309         while calling DoEmit ().
13310
13311         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13312         source files; if you use the #line directive inside a method, the
13313         compiler stops emitting line numbers for the debugger until it
13314         reaches the end of the method or another #line directive which
13315         restores the original file.
13316
13317 2003-02-23  Martin Baulig  <martin@ximian.com>
13318
13319         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13320
13321 2003-02-23  Martin Baulig  <martin@ximian.com>
13322
13323         * statement.cs (Block.AddChildVariableNames): We need to call this
13324         recursively, not just for our immediate children.
13325
13326 2003-02-23  Martin Baulig  <martin@ximian.com>
13327
13328         * class.cs (Event.Define): Always make the field private, like csc does.
13329
13330         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13331         actually work, fixes bug #37521.
13332
13333 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13334
13335         * delegate.cs: When creating the various temporary "Parameters"
13336         classes, make sure that we call the ComputeAndDefineParameterTypes
13337         on those new parameters (just like we do with the formal ones), to
13338         allow them to be resolved in the context of the DeclSpace.
13339
13340         This fixes the bug that Dick observed in Bugzilla #38530.
13341
13342 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13343
13344         * expression.cs (ResolveMemberAccess): When resolving a constant,
13345         do not attempt to pull a constant if the value was not able to
13346         generate a valid constant.
13347
13348         * const.cs (LookupConstantValue): Do not report more errors than required.
13349
13350 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13351
13352         * expression.cs: fixes bug #38328.
13353
13354 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13355
13356         * class.cs: Changed all the various members that can be part of a
13357         class from being an ArrayList to be an Array of the right type.
13358         During the DefineType type_list, interface_list, delegate_list and
13359         enum_list are turned into types, interfaces, delegates and enums
13360         arrays.  
13361
13362         And during the member population, indexer_list, event_list,
13363         constant_list, field_list, instance_constructor_list, method_list,
13364         operator_list and property_list are turned into their real arrays.
13365
13366         Although we could probably perform this operation earlier, for
13367         good error reporting we need to keep the lists and remove the
13368         lists for longer than required.
13369
13370         This optimization was triggered by Paolo profiling the compiler
13371         speed on the output of `gen-sample-program.pl' perl script. 
13372
13373         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13374         not crash in methods like MemberLookupFailed that use this field.  
13375
13376         This problem arises when the compiler fails to resolve a type
13377         during interface type definition for example.
13378
13379 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13382         inherit from System.Object, so we have to stop at null, not only
13383         when reaching System.Object.
13384
13385 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13386
13387         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13388         DeclaredOnly because the parent indexer might have had a different
13389         name, but did not loop until the top of the hierarchy was reached.
13390
13391         The problem this one fixes is 35492: when a class implemented an
13392         indexer from an interface, we were getting the interface method
13393         (which was abstract) and we were flagging an error (can not invoke
13394         abstract method).
13395
13396         This also keeps bug 33089 functioning, and test-148 functioning.
13397
13398         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13399         out if a method is special is to see if it is declared in a
13400         property or event, or whether it is one of the predefined operator
13401         names.   This should fix correctly #36804.
13402
13403 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13404
13405         The goal here is to remove the dependency on EmptyCast.Peel ().
13406         Killing it completely.
13407
13408         The problem is that currently in a number of places where
13409         constants are expected, we have to "probe" for an EmptyCast, and
13410         Peel, which is not the correct thing to do, as this will be
13411         repetitive and will likely lead to errors. 
13412
13413         The idea is to remove any EmptyCasts that are used in casts that
13414         can be reduced to constants, so we only have to cope with
13415         constants. 
13416
13417         This bug hunt was triggered by Bug 37363 and the desire to remove
13418         the duplicate pattern where we were "peeling" emptycasts to check
13419         whether they were constants.  Now constants will always be
13420         constants.
13421
13422         * ecore.cs: Use an enumconstant here instead of wrapping with
13423         EmptyCast.  
13424
13425         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13426         throwing me off.  By handling this we can get rid of a few hacks.
13427
13428         * statement.cs (Switch): Removed Peel() code.
13429
13430 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * class.cs: Location information for error 508
13433
13434         * expression.cs (New.DoResolve): Add a guard against double
13435         resolution of an expression.  
13436
13437         The New DoResolve might be called twice when initializing field
13438         expressions (see EmitFieldInitializers, the call to
13439         GetInitializerExpression will perform a resolve on the expression,
13440         and later the assign will trigger another resolution
13441
13442         This leads to bugs (#37014)
13443
13444         * delegate.cs: The signature for EndInvoke should contain any ref
13445         or out parameters as well.  We were not doing this in the past. 
13446
13447         * class.cs (Field.Define): Do not overwrite the type definition
13448         inside the `volatile' group.  Turns out that volatile enumerations
13449         were changing the type here to perform a validity test, which
13450         broke conversions. 
13451
13452 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13453
13454         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13455         and structs, we do not want to load the instance variable
13456
13457         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13458         enum_type has to be handled like an object reference (implicit
13459         conversions exists from this to object), but the regular IsClass
13460         and IsValueType tests will never return true for this one.
13461
13462         Also we use TypeManager.IsValueType instead of type.IsValueType,
13463         just for consistency with the rest of the code (this is only
13464         needed if we ever use the construct exposed by test-180.cs inside
13465         corlib, which we dont today).
13466
13467 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13468
13469         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13470         just InternalCall.
13471
13472 2003-02-09  Martin Baulig  <martin@ximian.com>
13473
13474         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13475         (Namespace.DefineNamespaces): New static public method; this is
13476         called when we're compiling with debugging to add all namespaces
13477         to the symbol file.
13478
13479         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13480         pass it to the Namespace's .ctor.
13481
13482         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13483         and MethodBase arguments; pass the namespace ID to the symwriter;
13484         pass the MethodBase instead of the token to the symwriter.
13485         (SymbolWriter.DefineNamespace): New method to add a namespace to
13486         the symbol file.
13487
13488 2003-02-09  Martin Baulig  <martin@ximian.com>
13489
13490         * symbolwriter.cs: New file.  This is a wrapper around
13491         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13492         methods here in near future.
13493
13494 2003-02-09  Martin Baulig  <martin@ximian.com>
13495
13496         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13497         ILGenerator.MarkSequencePoint() which are actually used by the
13498         symbol writer.
13499
13500 2003-02-09  Martin Baulig  <martin@ximian.com>
13501
13502         * location.cs (SourceFile): New public sealed class.  This
13503         contains the name and an index which is used in the location's token.
13504         (Location): Reserve an appropriate number of bits in the token for
13505         the source file instead of walking over that list, this gives us a
13506         really huge performance improvement when compiling with debugging.
13507
13508         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13509         `SourceFile' argument instead of a string.
13510         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13511         but don't parse/tokenize here, we need to generate the list of all
13512         source files before we do that.
13513         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13514         the files.
13515
13516         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13517         instead of a string.
13518
13519         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13520         of a string.
13521
13522 2003-02-09  Martin Baulig  <martin@ximian.com>
13523
13524         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13525         filename on `#line default'.
13526
13527 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13528
13529         * statement.cs: don't clear the pinned var when the fixed statement
13530         returns from the method (fixes bug#37752).
13531
13532 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13533
13534         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13535         to IsValueType.
13536
13537 2003-02-07  Martin Baulig  <martin@ximian.com>
13538
13539         * driver.cs: Removed the `--debug-args' command line argument.
13540
13541         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13542         automatically by the AsssemblyBuilder.
13543         (CodeGen.InitializeSymbolWriter): We don't need to call any
13544         initialization function on the symbol writer anymore.  This method
13545         doesn't take any arguments.
13546
13547 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13548
13549         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13550         from referenced assemblies as well.
13551
13552 2003-02-02  Martin Baulig  <martin@ximian.com>
13553
13554         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13555
13556 2003-02-02  Martin Baulig  <martin@ximian.com>
13557
13558         * class.cs (Constructor.Emit): Open the symbol writer before
13559         emitting the constructor initializer.
13560         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13561         single-stepping through constructor initializers.
13562
13563 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13564
13565         * class.cs: Handle error 549: do not allow virtual methods in
13566         sealed classes. 
13567
13568 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13569
13570         * decl.cs: Check access levels when resolving types
13571
13572 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13573
13574         * statement.cs: Add parameters and locals set in catch blocks that might 
13575         return to set vector
13576
13577 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13578
13579         * class.cs (Operator): Set the SpecialName flags for operators.
13580
13581         * expression.cs (Invocation.DoResolve): Only block calls to
13582         accessors and operators on SpecialName methods.
13583
13584         (Cast.TryReduce): Handle conversions from char constants.
13585
13586
13587 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13588
13589         * statement.cs: small memory and time optimization in FlowBranching.
13590
13591 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13592
13593         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13594         problem that the last fix but in the other sid (Set).
13595
13596         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13597         access when there is no indexer in the hierarchy.
13598
13599 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13600
13601         * class.cs: Combine some if statements.
13602
13603 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13604
13605         * driver.cs: fixed bug #37187.
13606
13607 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13608
13609         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13610         any indexer, it's needed to build a list with all the indexers in the
13611         hierarchy (AllGetters), else we have problems. Fixes #35653.
13612
13613 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13614
13615         * class.cs (MethodData.Define): It is wrong for an interface
13616         implementation to be static in both cases: explicit and implicit.
13617         We were only handling this in one case.
13618
13619         Improve the if situation there to not have negations.
13620
13621         * class.cs (Field.Define): Turns out that we do not need to check
13622         the unsafe bit on field definition, only on usage.  Remove the test.
13623
13624 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13625
13626         * driver.cs: use assembly.Location instead of Codebase (the latest
13627         patch made mcs fail when using MS assemblies).
13628
13629 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13630
13631         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13632         get the path to *corlib.dll.
13633
13634 2003-01-21  Nick Drochak <ndrochak@gol.com>
13635
13636         * cs-tokenizer.cs:
13637         * pending.cs:
13638         * typemanager.cs: Remove compiler warnings
13639
13640 2003-01-20  Duncan Mak  <duncan@ximian.com>
13641
13642         * AssemblyInfo.cs: Bump the version number to 0.19.
13643
13644 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13645
13646         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13647
13648 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13649
13650         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13651
13652 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13653
13654         * cs-parser.jay: Small fix: we were not comparing the constructor
13655         name correctly.   Thanks to Zoltan for the initial pointer.
13656
13657 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13658
13659         * cs-tokenizer.cs: Set file name when specified with #line
13660
13661 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * cs-parser.jay: Only perform the constructor checks here if we
13664         are named like the class;  This will help provider a better
13665         error.  The constructor path is taken when a type definition is
13666         not found, but most likely the user forgot to add the type, so
13667         report that rather than the constructor error.
13668
13669 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13670
13671         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13672         allocations.
13673
13674 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13675
13676         * cs-parser.jay: Add cleanup call.
13677
13678 2003-01-13  Duncan Mak  <duncan@ximian.com>
13679
13680         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13681         consistent with other methods.
13682
13683 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13684
13685         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13686
13687 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13688
13689         * attribute.cs: only set GuidAttr to true when we have a
13690         GuidAttribute.
13691
13692 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13693
13694         * ecore.cs:
13695         * expression.cs:
13696         * typemanager.cs: fixes to allow mcs compile corlib with the new
13697         Type.IsSubclassOf fix.
13698
13699 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13700
13701         * expression.cs (LocalVariableReference.DoResolve): Classify a
13702         constant as a value, not as a variable.   Also, set the type for
13703         the variable.
13704
13705         * cs-parser.jay (fixed_statement): take a type instead of a
13706         pointer_type, so we can produce a better error message later.
13707
13708         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13709         as an error.  
13710
13711         (For.DoEmit): Make inifinite loops have a
13712         non-conditional branch back.
13713
13714         (Fixed.DoEmit): First populate the pinned variables, then emit the
13715         statement, then clear the variables.  Before I was emitting the
13716         code once for each fixed piece.
13717
13718
13719 2003-01-08  Martin Baulig  <martin@ximian.com>
13720
13721         * statement.cs (FlowBranching.MergeChild): A break in a
13722         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13723
13724 2003-01-08  Martin Baulig  <martin@ximian.com>
13725
13726         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13727         lives in the same number space than `param_map'.  Fixes #36154.
13728
13729 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13730
13731         * cs-parser.jay (constructor_declaration): Set the
13732         Constructor.ModFlags before probing for it.  This makes the
13733         compiler report 514, 515 and 132 (the code was there, but got
13734         broken). 
13735
13736         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13737         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13738         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13739
13740 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13741
13742         * enum.cs: create the enum static fields using the enum type.
13743
13744 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13745
13746         * class.cs: don't try to create the ParamBuilder for the return
13747         type if it's not needed (and handle it breaking for the ms runtime
13748         anyway).
13749
13750 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13751
13752         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13753
13754 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13755
13756         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13757         the command.   This showed up while compiling the JANET source
13758         code, which used \r as its only newline separator.
13759
13760 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13761
13762         * class.cs (Method.Define): If we are an operator (because it
13763         reuses our code), then set the SpecialName and HideBySig.  #36128
13764
13765 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13766
13767         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13768         exception, report error 120 `object reference required'.
13769
13770         * driver.cs: Add --pause option, used during to measure the size
13771         of the process as it goes with --timestamp.
13772
13773         * expression.cs (Invocation.DoResolve): Do not allow methods with
13774         SpecialName to be invoked.
13775
13776 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13779         number before adding it.
13780
13781 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13782
13783         * ecore.cs (StandardImplicitConversion): When in an unsafe
13784         context, we allow conversion between void * to any other pointer
13785         type. This fixes bug #35973.
13786
13787 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13788
13789         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13790         is not thrown when extensionless outputs are used 
13791
13792 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13793
13794         * rootcontext.cs: fixed compilation of corlib.
13795
13796 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * attribute.cs (Attributes.Contains): Add new method.
13799
13800         * class.cs (MethodCore.LabelParameters): if the parameter is an
13801         `out' parameter, check that no attribute `[In]' has been passed.
13802
13803         * enum.cs: Handle the `value__' name in an enumeration.
13804
13805 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13806
13807         * decl.cs: Added special case to allow overrides on "protected
13808         internal" methods
13809
13810 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13811
13812         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13813         since it makes much more sense.
13814
13815         (Attributes.ctor): Don't require a Location parameter.
13816
13817         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13818
13819         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13820         since we already have that information per attribute.
13821
13822         * everywhere : make appropriate changes.
13823
13824         * class.cs (LabelParameters): Write the code which actually
13825         applies attributes to the return type. We can't do this on the MS
13826         .NET runtime so we flag a warning in the case an exception is
13827         thrown.
13828
13829 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13830
13831         * const.cs: Handle implicit null conversions here too.
13832
13833 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13834
13835         * class.cs (MethodCore.LabelParameters): Remove the extra
13836         Type [] parameter since it is completely unnecessary. Instead
13837         pass in the method's attributes so that we can extract
13838         the "return" attribute.
13839
13840 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13843         of ignoring it and letting the compile continue.
13844
13845         * typemanager.cs (ChangeType): use an extra argument to return an
13846         error condition instead of throwing an exception.
13847
13848 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13849
13850         * expression.cs (Unary.TryReduce): mimic the code for the regular
13851         code path.  Perform an implicit cast in the cases where we can
13852         implicitly convert to one of the integral types, and then reduce
13853         based on that constant.   This fixes bug #35483.
13854
13855 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13856
13857         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13858
13859 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13860
13861         * namespace.cs: fixed bug #35489.
13862
13863 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * class.cs: Remove some dead code.
13866
13867         * cs-parser.jay: Estimate the number of methods needed
13868         (RootContext.MethodCount);
13869
13870         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13871         numbers instead of StringBuilders.
13872
13873         * support.cs (PtrHashtable): Add constructor with initial size;
13874         We can now reduce reallocations of the method table.
13875
13876 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13877
13878         * attribute.cs (ApplyAttributes): Keep track of the emitted
13879         attributes on a per-target basis. This fixes bug #35413.
13880
13881 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13882
13883         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13884         default to the Windows 1252 encoding.
13885
13886         (UnixParseOption): Support version, thanks to Alp for the missing
13887         pointer. 
13888
13889         * AssemblyInfo.cs: Add nice assembly information.
13890
13891         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13892         (bug 35169).
13893
13894         * cs-parser.jay: Allow a trailing comma before the close bracked
13895         in the attribute_section production.
13896
13897         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13898         address of the instance was being taken, I will take this out,
13899         because we take the address of the object immediately here.
13900
13901 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13902
13903         * typemanager.cs (AreMultipleAllowed): Take care of the most
13904         obvious case where attribute type is not in the current assembly -
13905         stupid me ;-)
13906
13907 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13910         definitions, instead of doing that afterwards.  
13911
13912         Also we use a nice little hack, depending on the constructor, we
13913         know if we are a "composed" name or a simple name.  Hence, we
13914         avoid the IndexOf test, and we avoid 
13915
13916         * codegen.cs: Add code to assist in a bug reporter to track down
13917         the source of a compiler crash. 
13918
13919 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13920
13921         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13922         types have been emitted for a given element and flag an error
13923         if something which does not have AllowMultiple set is used more
13924         than once.
13925
13926         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13927         attribute types and their corresponding AllowMultiple properties
13928
13929         (AreMultipleAllowed): Check the property for a given type.
13930
13931         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13932         property in the case we have a TypeContainer.
13933
13934         (Attributes.AddAttribute): Detect duplicates and just skip on
13935         adding them. This trivial fix catches a pretty gross error in our
13936         attribute emission - global attributes were being emitted twice!
13937
13938         Bugzilla bug #33187 is now fixed.
13939
13940 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13941
13942         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13943         instead of pp_and).
13944
13945         * expression.cs (Binary.ResolveOperator): I can only use the
13946         Concat (string, string, string) and Concat (string, string,
13947         string, string) if the child is actually a concatenation of
13948         strings. 
13949
13950 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13951
13952         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13953         context where we need a 2-character lookahead.
13954
13955         * pending.cs (PendingImplementation): Rework so we can keep track
13956         of interface types all the time, and flag those which were
13957         implemented by parents as optional.
13958
13959 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13960
13961         * expression.cs (Binary.ResolveOperator): Use
13962         String.Concat(string,string,string) or
13963         String.Concat(string,string,string,string) when possible. 
13964
13965         * typemanager: More helper methods.
13966
13967
13968 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13969
13970         * pending.cs: remove the bogus return from GetMissingInterfaces()
13971         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13972
13973 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13974
13975         * namespace.cs: avoid duplicated 'using xxx' being added to
13976         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13977         when we get more than one 'using' statement for the same namespace.
13978         Report a CS0105 warning for it.
13979
13980 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13983         of calling getChar/putback, uses internal knowledge of it.    
13984
13985         (xtoken): Reorder tokenizer so most common patterns are checked
13986         first.  This reduces the compilation time in another 5% (from 8.11s
13987         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13988
13989         The parsing time is 22% of the compilation in mcs, and from that
13990         64% is spent on the tokenization process.  
13991
13992         I tried using a binary search for keywords, but this is slower
13993         than the hashtable.  Another option would be to do a couple of
13994         things:
13995
13996                 * Not use a StringBuilder, instead use an array of chars,
13997                   with a set value.  Notice that this way we could catch
13998                   the 645 error without having to do it *afterwards*.
13999
14000                 * We could write a hand-parser to avoid the hashtable
14001                   compares altogether.
14002
14003         The identifier consumption process takes 37% of the tokenization
14004         time.  Another 15% is spent on is_number.  56% of the time spent
14005         on is_number is spent on Int64.Parse:
14006
14007                 * We could probably choose based on the string length to
14008                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14009                   computations. 
14010
14011         Another 3% is spend on wrapping `xtoken' in the `token' function.
14012
14013         Handle 0xa0 as whitespace (#34752)
14014
14015 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14016
14017         * typemanager.cs (IsCLRType): New routine to tell whether a type
14018         is one of the builtin types.  
14019
14020         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14021         typecode in more places instead of doing pointer comparissions.
14022         We could leverage some knowledge about the way the typecodes are
14023         laid out.
14024
14025         New code to cache namespaces in assemblies, it is currently not
14026         invoked, to be used soon.
14027
14028         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14029
14030         * expression.cs (Binary.ResolveOperator): specially handle
14031         strings, and do not perform user-defined operator overloading for
14032         built-in types.
14033
14034 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14037         internalcall as it is a pretty simple operation;  Avoid whenever
14038         possible to call Char.IsLetter.
14039
14040         (consume_identifier): Cut by half the number of
14041         hashtable calls by merging the is_keyword and GetKeyword behavior.
14042
14043         Do not short-circuit, because if we do, we
14044         report errors (ie, #if false && true would produce an invalid
14045         directive error);
14046
14047
14048 2002-11-24  Martin Baulig  <martin@ximian.com>
14049
14050         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14051         check constant ranges and report a CS0221.  Fixes #33186.
14052
14053 2002-11-24  Martin Baulig  <martin@ximian.com>
14054
14055         * cs-parser.jay: Make this work for uninitialized variable
14056         declarations in the `for' initializer.  Fixes #32416.
14057
14058 2002-11-24  Martin Baulig  <martin@ximian.com>
14059
14060         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14061         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14062
14063 2002-11-24  Martin Baulig  <martin@ximian.com>
14064
14065         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14066         argument; if true, we also check for user-defined conversions.
14067         This is only needed if both arguments are of a user-defined type.
14068         Fixes #30443, added test-175.cs.
14069         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14070
14071         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14072
14073 2002-11-24  Martin Baulig  <martin@ximian.com>
14074
14075         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14076         function to get the store opcode.
14077         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14078         only emit the Ldelema if the store opcode is Stobj.  You must run
14079         both test-34 and test-167 to test this.  Fixes #34529.
14080
14081 2002-11-23  Martin Baulig  <martin@ximian.com>
14082
14083         * ecore.cs (Expression.MemberLookup): Added additional
14084         `qualifier_type' argument which is used when we're being called
14085         from MemberAccess.DoResolve() and null if we're called from a
14086         SimpleName lookup.
14087         (Expression.MemberLookupFailed): New method to report errors; this
14088         does the CS1540 check and reports the correct error message.
14089
14090         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14091         argument for the CS1540 check and redone the way how we're dealing
14092         with private members.  See the comment in the source code for details.
14093         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14094         `closure_start_type' to `closure_qualifier_type' and check whether
14095         it's not null.  It was not this filter being broken, it was just
14096         being called with the wrong arguments.
14097
14098         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14099         and pass it the correct `qualifier_type'; this also does the error
14100         handling for us.
14101
14102 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14103
14104         * expression.cs (Invocation.EmitParams): If the we are dealing
14105         with a non-built-in value type, load its address as well.
14106
14107         (ArrayCreation): Use a a pretty constant instead
14108         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14109         static initializers.  
14110
14111         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14112         because they are not really value types, just glorified integers. 
14113
14114         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14115
14116         * ecore.cs: Remove redundant code for enumerations, make them use
14117         the same code path as everything else, fixes the casting issue
14118         with enumerations in Windows.Forms.
14119
14120         * attribute.cs: Do only cast to string if it is a string, the
14121         validation happens later.
14122
14123         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14124         people upgrade their corlibs.
14125
14126         * ecore.cs: Oops, enumerations were not following the entire code path
14127
14128 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14129
14130         * typemanager.cs (FilterWithClosure): Commented out the test for
14131         1540 in typemanager.cs, as it has problems when accessing
14132         protected methods from a parent class (see test-174.cs). 
14133
14134         * attribute.cs (Attribute.ValidateGuid): new method.
14135         (Attribute.Resolve): Use above.
14136
14137 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14140
14141         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14142         handling for enumerations, as we only needed the TypeContainer
14143         functionality to begin with (this is required for the fix below to
14144         work for enums that reference constants in a container class for
14145         example). 
14146
14147         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14148
14149         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14150         a valid TypeBuilder to perform lookups on.o
14151
14152         * class.cs (InheritableMemberSignatureCompare): Use true in the
14153         call to GetGetMethod and GetSetMethod, because we are comparing
14154         the signature, and we need to get the methods *even* if they are
14155         private. 
14156
14157         (PropertyBase.CheckBase): ditto.
14158
14159         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14160         GotoCase.Resolve): Use Peel on EmpytCasts.
14161
14162         * ecore.cs (EmptyCast): drop child, add Peel method.
14163
14164 2002-11-17  Martin Baulig  <martin@ximian.com>
14165
14166         * ecore.cs (EmptyCast.Child): New public property.
14167
14168         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14169         label resolved to an EmptyCast.  Fixes #34162.
14170         (GotoCase.Resolve): Likewise.
14171         (Block.EmitMeta): Likewise.
14172
14173 2002-11-17  Martin Baulig  <martin@ximian.com>
14174
14175         * expression.cs (Invocation.BetterConversion): Prefer int over
14176         uint; short over ushort; long over ulong for integer literals.
14177         Use ImplicitConversionExists instead of StandardConversionExists
14178         since we also need to check for user-defined implicit conversions.
14179         Fixes #34165.  Added test-173.cs.
14180
14181 2002-11-16  Martin Baulig  <martin@ximian.com>
14182
14183         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14184         with the `true' and `false' literals.  Fixes #33151.
14185
14186 2002-11-16  Martin Baulig  <martin@ximian.com>
14187
14188         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14189         October 22nd; don't do the cs1540 check for static members.
14190
14191         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14192         now using our own filter here and doing the cs1540 check again.
14193
14194 2002-11-16  Martin Baulig  <martin@ximian.com>
14195
14196         * support.cs (InternalParameters): Don't crash if we don't have
14197         any fixed parameters.  Fixes #33532.
14198
14199 2002-11-16  Martin Baulig  <martin@ximian.com>
14200
14201         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14202         when looking up static methods to make this work on Windows.
14203         Fixes #33773.
14204
14205 2002-11-16  Martin Baulig  <martin@ximian.com>
14206
14207         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14208         a setter rather than using PropertyInfo.CanWrite.
14209
14210 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14211
14212         * class.cs: Allow acces to block member by subclasses. Fixes build
14213         breaker.
14214
14215 2002-11-14  Martin Baulig  <martin@ximian.com>
14216
14217         * class.cs (Constructor.Emit): Added the extern/block check.
14218         Fixes bug #33678.
14219
14220 2002-11-14  Martin Baulig  <martin@ximian.com>
14221
14222         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14223         iteration while looking for indexers, this is needed because the
14224         indexer may have a different name in our base classes.  Fixed the
14225         error reporting (no indexers at all, not get accessor, no
14226         overloaded match).  Fixes bug #33089.
14227         (IndexerAccess.DoResolveLValue): Likewise.
14228
14229 2002-11-14  Martin Baulig  <martin@ximian.com>
14230
14231         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14232         indexers.  Fixes the first part of bug #33089.
14233         (MethodSignature.InheritableMemberSignatureCompare): Added support
14234         for properties.
14235
14236 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14237
14238         * attribute.cs (Attribute.Resolve): Catch the
14239         NullReferenceException and report it since it isn't supposed to
14240         happen. 
14241
14242 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14243
14244         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14245         LogicalOr and LogicalAnd that can benefit from recursively
14246         handling EmitBranchable.  The code now should be nice for Paolo.
14247
14248 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14251         the Type lookups, as we perform quite a number of lookups on
14252         non-Types.  This can be removed once we can deterministically tell
14253         whether we have a type or a namespace in advance.
14254
14255         But this might require special hacks from our corlib.
14256
14257         * TODO: updated.
14258
14259         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14260         and double which avoids a conversion from an integer to a double.
14261
14262         * expression.cs: tiny optimization, avoid calling IsConstant,
14263         because it effectively performs the lookup twice.
14264
14265 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14266
14267         But a bogus return here to keep the semantics of the old code
14268         until the Mono runtime is fixed.
14269
14270         * pending.cs (GetMissingInterfaces): New method used to remove all
14271         the interfaces that are already implemented by our parent
14272         classes from the list of pending methods. 
14273
14274         * interface.cs: Add checks for calls after ResolveTypeExpr.
14275
14276 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14277
14278         * class.cs (Class.Emit): Report warning 67: event not used if the
14279         warning level is beyond 3.
14280
14281         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14282         being a NullLiteral.
14283
14284         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14285         specifiers. 
14286
14287         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14288         path that might fail if a type can not be resolved.
14289
14290         * expression.cs (Binary.Emit): Emit unsigned versions of the
14291         operators. 
14292
14293         * driver.cs: use error 5.
14294
14295 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14296
14297         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14298
14299 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * cs-parser.jay (switch_section): A beautiful patch from Martin
14302         Baulig that fixed 33094.
14303
14304 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14307         Check whether the base is abstract and report an error if so.
14308
14309         * expression.cs (IndexerAccess.DoResolveLValue,
14310         IndexerAccess.DoResolve): ditto. 
14311
14312         (Invocation.DoResolve): ditto.
14313
14314         (Invocation.FullMethodDesc): Improve the report string.
14315
14316         * statement.cs (Block): Eliminate IsVariableDefined as it is
14317         basically just a wrapper for GetVariableInfo.
14318
14319         * ecore.cs (SimpleName): Use new 
14320
14321         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14322         type, as we return the actual parameter ref/unref state on a
14323         different call.
14324
14325 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * support.cs: Return proper flags REF/OUT fixing the previous
14328         commit.  
14329
14330         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14331         not used to mean `ref' but `ref or out' in ParameterReference
14332
14333         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14334         full type signature instead of calling TypeManger.CSharpName
14335         ourselves. 
14336
14337         * support.cs (InternalParameters.ParameterDesc): Do not compare
14338         directly to the modflags, because REF/OUT will actually be bitsets
14339         if set. 
14340
14341         * delegate.cs (VerifyMethod): Check also the modifiers.
14342
14343         * cs-tokenizer.cs: Fix bug where floating point values with an
14344         exponent where a sign was missing was ignored.
14345
14346         * driver.cs: Allow multiple assemblies to be specified in a single
14347         /r: argument
14348
14349 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14352         because identifiers after a parenthesis would end up in this kind
14353         of production, and we needed to desamiguate it for having casts
14354         like:
14355
14356                 (UserDefinedType *) xxx
14357
14358 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14361         we should set on the Bindingflags.NonPublic, but not turn on
14362         private_ok.  private_ok controls whether a Private member is
14363         returned (this is chekced on the filter routine), while the
14364         BindingFlags.NonPublic just controls whether private/protected
14365         will be allowed.   This fixes the problem part of the problem of
14366         private properties being allowed to be used in derived classes.
14367
14368         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14369         so we can call the children DoResolveLValue method (this will
14370         properly signal errors on lvalue assignments to base properties)
14371
14372         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14373         getter are null, and we have a property info, we know that this
14374         happened because the lookup failed, so we report an error 122 for
14375         protection level violation.
14376
14377         We also silently return if setter and getter are null in the
14378         resolve functions, this condition only happens if we have flagged
14379         the error before.  This is the other half of the problem. 
14380
14381         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14382         not have accessibility information, that is why we were returning
14383         true in the filter function in typemanager.cs.
14384
14385         To properly report 122 (property is inaccessible because of its
14386         protection level) correctly, we report this error in ResolveAccess
14387         by failing if both the setter and the getter are lacking (ie, the
14388         lookup failed). 
14389
14390         DoResolve and DoLResolve have been modified to check for both
14391         setter/getter being null and returning silently, the reason being
14392         that I did not want to put the knowledge about this error in upper
14393         layers, like:
14394
14395         int old = Report.Errors;
14396         x = new PropertyExpr (...);
14397         if (old != Report.Errors)
14398                 return null;
14399         else
14400                 return x;
14401
14402         So the property expr is returned, but it is invalid, so the error
14403         will be flagged during the resolve process. 
14404
14405         * class.cs: Remove InheritablePropertySignatureCompare from the
14406         class, as we no longer depend on the property signature to compute
14407         whether it is possible to implement a method or not.
14408
14409         The reason is that calling PropertyInfo.GetGetMethod will return
14410         null (in .NET, in Mono it works, and we should change this), in
14411         cases where the Get Method does not exist in that particular
14412         class.
14413
14414         So this code:
14415
14416         class X { public virtual int A { get { return 1; } } }
14417         class Y : X { }
14418         class Z : Y { public override int A { get { return 2; } } }
14419
14420         Would fail in Z because the parent (Y) would not have the property
14421         defined.  So we avoid this completely now (because the alternative
14422         fix was ugly and slow), and we now depend exclusively on the
14423         method names.
14424
14425         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14426         reference method, instead of using the property.
14427
14428         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14429         routines are gone now.
14430
14431         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14432         names, they were incorrectly named.
14433
14434         * cs-tokenizer.cs: Return are more gentle token on failure. 
14435
14436         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14437         had an out-of-sync index variable, which caused it to remove from
14438         the list of pending methods the wrong method sometimes.
14439
14440 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14443         CanWrite, because those refer to this particular instance of the
14444         property, and do not take into account the fact that we can
14445         override single members of a property.
14446
14447         Constructor requires an EmitContext.  The resolution process does
14448         not happen here, but we need to compute the accessors before,
14449         because the resolution does not always happen for properties.
14450
14451         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14452         subclass, before we did not update this flag, but we did update
14453         bindingflags. 
14454
14455         (GetAccessors): Drop this routine, as it did not work in the
14456         presence of partially overwritten set/get methods. 
14457
14458         Notice that this broke the cs1540 detection, but that will require
14459         more thinking. 
14460
14461 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14462
14463         * class.cs:
14464         * codegen.cs:
14465         * driver.cs: issue a warning instead of an error if we don't support
14466         debugging for the platform. Also ignore a couple of errors that may
14467         arise when trying to write the symbols. Undo my previous patch.
14468
14469 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14470
14471         * driver.cs: ignore /debug switch except for Unix platforms.
14472
14473 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14474
14475         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14476
14477 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14478
14479         * driver.cs: Do not make mcs-debug conditional, so we do not break
14480         builds that use it.
14481
14482         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14483         review this patch.  But basically after all the children variables
14484         have been merged, the value of "Breaks" was not being set to
14485         new_breaks for Switch blocks.  I think that it should be set after
14486         it has executed.  Currently I set this to the value of new_breaks,
14487         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14488         conservative, but I do not understand this code very well.
14489
14490         I did not break anything in the build, so that is good ;-)
14491
14492         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14493
14494 2002-10-20  Mark Crichton  <crichton@gimp.org>
14495
14496         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14497
14498 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14499
14500         * cfold.cs: Fixed compile blocker.
14501
14502 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * driver.cs: I was chekcing the key, not the file.
14505
14506 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14507
14508         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14509         message that we were generating - we just need to silently return
14510         a null.
14511
14512 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14513
14514         * class.cs (Event.Define): Change my previous commit, as this
14515         breaks the debugger.  This is a temporary hack, as it seems like
14516         the compiler is generating events incorrectly to begin with.
14517
14518         * expression.cs (Binary.ResolveOperator): Added support for 
14519         "U operator - (E x, E y)"
14520
14521         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14522         y)".
14523
14524         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14525         init-only variables, but this path did not take into account that
14526         there might be also instance readonly variables.  Correct this
14527         problem. 
14528
14529         This fixes bug 32253
14530
14531         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14532         delegates as well.
14533
14534         * driver.cs: Change the extension for modules to `netmodule'
14535
14536         * cs-parser.jay: Improved slightly the location tracking for
14537         the debugger symbols.
14538
14539         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14540         modifiers that were specified instead of the hardcoded value
14541         (FamAndAssem).  This was basically ignoring the static modifier,
14542         and others.  Fixes 32429.
14543
14544         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14545         fixed a bug in the process (32476)
14546
14547         * expression.cs (ArrayAccess.EmitAssign): Patch from
14548         hwang_rob@yahoo.ca that fixes bug 31834.3
14549
14550 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14551
14552         * driver.cs: Make the module extension .netmodule.
14553
14554 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14555
14556         * driver.cs: Report an error if the resource file is not found
14557         instead of crashing.
14558
14559         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14560         false, like Emit does.
14561
14562 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14563
14564         * typemanager.cs: Remove unused private member.  Also reported mcs
14565         bug to report this as a warning like csc.
14566
14567 2002-10-15  Martin Baulig  <martin@gnome.org>
14568
14569         * statement.cs (Statement.Emit): Made this a virtual method; emits
14570         the line number info and calls DoEmit().
14571         (Statement.DoEmit): New protected abstract method, formerly knows
14572         as Statement.Emit().
14573
14574         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14575
14576 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14579         have fixed a remaining problem: not every AddXXXX was adding a
14580         fully qualified name.  
14581
14582         Now everyone registers a fully qualified name in the DeclSpace as
14583         being defined instead of the partial name.  
14584
14585         Downsides: we are slower than we need to be due to the excess
14586         copies and the names being registered this way.  
14587
14588         The reason for this is that we currently depend (on the corlib
14589         bootstrap for instance) that types are fully qualified, because
14590         we dump all the types in the namespace, and we should really have
14591         types inserted into the proper namespace, so we can only store the
14592         basenames in the defined_names array.
14593
14594 2002-10-10  Martin Baulig  <martin@gnome.org>
14595
14596         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14597         from bug #31834, see the bug report for a testcase which is
14598         miscompiled.
14599
14600 2002-10-10  Martin Baulig  <martin@gnome.org>
14601
14602         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14603         flow analysis code for this.
14604
14605         * statement.cs (Do, While, For): Tell the flow analysis code about
14606         infinite loops.
14607         (FlowBranching.UsageVector): Added support for infinite loops.
14608         (Block.Resolve): Moved the dead code elimination here and use flow
14609         analysis to do it.
14610
14611 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14612
14613         * class.cs (Field.Define): Catch cycles on struct type
14614         definitions. 
14615
14616         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14617         fields if the fields are static.  We only need to check instance
14618         fields. 
14619
14620         * expression.cs (As.DoResolve): Test for reference type.
14621
14622         * statement.cs (Using.ResolveExpression): Use
14623         ConvertImplicitRequired, not ConvertImplicit which reports an
14624         error on failture
14625         (Using.ResolveLocalVariableDecls): ditto.
14626
14627         * expression.cs (Binary.ResolveOperator): Report errors in a few
14628         places where we had to.
14629
14630         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14631
14632 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * expression.cs: Use StoreFromPtr instead of extracting the type
14635         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14636
14637         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14638         an enumeration value to a System.Enum, but System.Enum is not a
14639         value type, but an class type, so we need to box.
14640
14641         (Expression.ConvertExplicit): One codepath could return
14642         errors but not flag them.  Fix this.  Fixes #31853
14643
14644         * parameter.cs (Resolve): Do not allow void as a parameter type.
14645
14646 2002-10-06  Martin Baulig  <martin@gnome.org>
14647
14648         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14649         if it's a class type and not a struct.  Fixes #31815.
14650
14651 2002-10-06  Martin Baulig  <martin@gnome.org>
14652
14653         * statement.cs: Reworked the flow analysis code a bit to make it
14654         usable for dead code elimination.
14655
14656 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14657
14658         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14659
14660 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14663         to fix the test 165, will investigate deeper.
14664
14665 2002-10-04  Martin Baulig  <martin@gnome.org>
14666
14667         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14668         finally blocks actually work.
14669         (Try.Resolve): We don't need to create a sibling for `finally' if
14670         there is no finally block.
14671
14672 2002-10-04  Martin Baulig  <martin@gnome.org>
14673
14674         * class.cs (Constructor.Define): The default accessibility for a
14675         non-default constructor is private, not public.
14676
14677 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14678
14679         * class.cs (Constructor): Make AllowedModifiers public, add
14680         EXTERN.
14681
14682         * cs-parser.jay: Perform the modifiers test here, as the
14683         constructor for the Constructor class usually receives a zero
14684         because of the way we create it (first we create, later we
14685         customize, and we were never checking the modifiers).
14686
14687         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14688         is a version of LookupTypeReflection that includes the type-name
14689         cache.  This can be used as a fast path for functions that know
14690         the fully qualified name and are only calling into *.GetType() to
14691         obtain a composed type.
14692
14693         This is also used by TypeManager.LookupType during its type
14694         composition.
14695
14696         (LookupType): We now also track the real type name, as sometimes
14697         we can get a quey for the real type name from things like
14698         ComposedCast.  This fixes bug 31422.
14699
14700         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14701         complete type fullname, it does not have to go through the type
14702         resolution system to obtain the composed version of the type (for
14703         obtaining arrays or pointers).
14704
14705         (Conditional.Emit): Use the EmitBoolExpression to
14706         generate nicer code, as requested by Paolo.
14707
14708         (ArrayCreation.CheckIndices): Use the patch from
14709         hwang_rob@yahoo.ca to validate the array initializers. 
14710
14711 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14712
14713         * class.cs (ConstructorInitializer.Emit): simplify code by using
14714         Invocation.EmitCall, and at the same time, fix the bugs in calling
14715         parent constructors that took variable arguments. 
14716
14717         * ecore.cs (Expression.ConvertNumericExplicit,
14718         Expression.ImplicitNumericConversion): Remove the code that
14719         manually wrapped decimal (InternalTypeConstructor call is now gone
14720         as well).
14721
14722         * expression.cs (Cast.TryReduce): Also handle decimal types when
14723         trying to perform a constant fold on the type.
14724
14725         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14726
14727         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14728         that only turned off an error report, and did nothing else. 
14729
14730 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * driver.cs: Handle and ignore /fullpaths
14733
14734 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14735
14736         * expression.cs (Binary.ResolveOperator): Catch the case where
14737         DoNumericPromotions returns true, 
14738
14739         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14740
14741 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14744         report error 70.
14745
14746 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14747
14748         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14749         conversion exists, but it is also required that the conversion be
14750         performed.  This manifested in "(Type64Enum) 2".  
14751
14752         * class.cs (TypeManager.AddMethod): The fix is not to change
14753         AddEnum, because that one was using a fully qualified name (every
14754         DeclSpace derivative does), but to change the AddMethod routine
14755         that was using an un-namespaced name.  This now correctly reports
14756         the duplicated name.
14757
14758         Revert patch until I can properly fix it.  The issue
14759         is that we have a shared Type space across all namespaces
14760         currently, which is wrong.
14761
14762         Options include making the Namespace a DeclSpace, and merge
14763         current_namespace/current_container in the parser.
14764
14765 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14766
14767         * cs-parser.jay: Improve error reporting when we get a different
14768         kind of expression in local_variable_type and
14769         local_variable_pointer_type. 
14770
14771         Propagate this to avoid missleading errors being reported.
14772
14773         * ecore.cs (ImplicitReferenceConversion): treat
14774         TypeManager.value_type as a target just like object_type.   As
14775         code like this:
14776
14777         ValueType v = 1;
14778
14779         Is valid, and needs to result in the int 1 being boxed before it
14780         is assigned to the value type v.
14781
14782         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14783         to validate the enumeration name.
14784
14785         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14786         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14787         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14788
14789         * ecore.cs (TryImplicitIntConversion): When doing an
14790         implicit-enumeration-conversion, check if the type is 64-bits and
14791         perform a conversion before passing to EnumConstant.
14792
14793 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14794
14795         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14796         report ambiguous type references.  Unlike the MS version, we
14797         report what the ambiguity is.   Innovation at work ;-)
14798
14799         (DeclSpace.FindType): Require a location argument to
14800         display when we display an ambiguous error.
14801
14802         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14803
14804         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14805
14806         * expression.cs (EmitDynamicInitializers): Apply patch from
14807         hwang_rob@yahoo.ca that fixes the order in which we emit our
14808         initializers. 
14809
14810 2002-09-21  Martin Baulig  <martin@gnome.org>
14811
14812         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14813         delegate takes no arguments.
14814
14815 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14818         from integers.
14819
14820         * expression.cs: Extract the underlying type.
14821
14822         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14823
14824         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14825
14826 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14827
14828         * class.cs (TypeContainer.DefineType): We can not use the nice
14829         PackingSize with the size set to 1 DefineType method, because it
14830         will not allow us to define the interfaces that the struct
14831         implements.
14832
14833         This completes the fixing of bug 27287
14834
14835         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14836         means also structs.  This fixes part of the problem. 
14837         (Expresion.ImplicitReferenceConversionExists): ditto.
14838
14839         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14840         error if there were no errors reported during the type lookup
14841         process, to avoid duplicates or redundant errors.  Without this
14842         you would get an ambiguous errors plus a type not found.  We have
14843         beaten the user enough with the first error.  
14844
14845         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14846         reference. 
14847
14848         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14849         during the resolution process, stop the lookup, this avoids
14850         repeated error reports (same error twice).
14851
14852         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14853
14854         * typemanager.cs (LookupType): Redo the type lookup code to match
14855         the needs of System.Reflection.  
14856
14857         The issue is that System.Reflection requires references to nested
14858         types to begin with a "+" sign instead of a dot.  So toplevel
14859         types look like: "NameSpace.TopLevelClass", and nested ones look
14860         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14861         levels. 
14862
14863 2002-09-19  Martin Baulig  <martin@gnome.org>
14864
14865         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14866         says that a method always returns or always throws an exception,
14867         don't report the CS0161.
14868
14869         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14870         set `Returns = new_returns'.
14871
14872 2002-09-19  Martin Baulig  <martin@gnome.org>
14873
14874         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14875         to an enum constant, check for a CS0176.
14876
14877 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14878
14879         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14880         for operators that must be in pairs and report errors.
14881
14882         * ecore.cs (SimpleName.DoResolveType): During the initial type
14883         resolution process, when we define types recursively, we must
14884         check first for types in our current scope before we perform
14885         lookups in the enclosing scopes.
14886
14887         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14888
14889         (Invocation.VerifyArgumentsCompat): Call
14890         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14891         I thought we were supposed to always call this, but there are a
14892         few places in the code where we dont do it.
14893
14894 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14895
14896         * driver.cs: Add support in -linkres and -resource to specify the
14897         name of the identifier.
14898
14899 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * ecore.cs (StandardConversionExists): Sync with the conversion
14902         code: allow anything-* to void* conversions.
14903
14904         (FindMostSpecificSource): Use an Expression argument
14905         instead of a Type, because we might be handed over a Literal which
14906         gets a few more implicit conversions that plain types do not.  So
14907         this information was being lost.
14908
14909         Also, we drop the temporary type-holder expression when not
14910         required.
14911
14912 2002-09-17  Martin Baulig  <martin@gnome.org>
14913
14914         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14915         this is an explicit interface implementation.
14916
14917 2002-09-17  Martin Baulig  <martin@gnome.org>
14918
14919         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14920         different `IndexerName' attributes.
14921
14922         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14923         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14924         virtual CommonResolve().
14925
14926 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14927
14928         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14929         and convert that to the UnderlyingType.
14930
14931         * statement.cs (Foreach.Resolve): Indexers are just like variables
14932         or PropertyAccesses.
14933
14934         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14935         inside quoted strings, we were not doing this before.
14936
14937 2002-09-16  Martin Baulig  <martin@gnome.org>
14938
14939         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14940         resolve it.  This is needed for the definite assignment check of the
14941         instance expression, fixes bug #29846.
14942         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14943
14944 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14945
14946         * parameter.cs: Fix compile error.  Cannot reference static member
14947         from an instance object.  Is this an mcs bug?
14948
14949 2002-09-14  Martin Baulig  <martin@gnome.org>
14950
14951         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14952         multiple times.  Fixes bug #30295, added test-166.cs.
14953
14954 2002-09-14  Martin Baulig  <martin@gnome.org>
14955
14956         * statement.cs (Block.Emit): Don't emit unreachable code.
14957         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14958         `break' statements.
14959         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14960
14961 2002-09-14  Martin Baulig  <martin@gnome.org>
14962
14963         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14964         is set.
14965
14966 2002-09-14  Martin Baulig  <martin@gnome.org>
14967
14968         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14969         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14970         be false on the ms runtime.
14971
14972 2002-09-13  Martin Baulig  <martin@gnome.org>
14973
14974         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14975         the CS0038 error message.
14976
14977 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14980         constant inside, return it.
14981
14982 2002-09-12  Martin Baulig  <martin@gnome.org>
14983
14984         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14985         implicit conversion can be done between enum types.
14986
14987         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14988         check whether an implicit conversion to the current enum's UnderlyingType
14989         exists and report an error if not.
14990
14991         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14992         without debugging support.
14993
14994         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14995         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14996
14997 2002-09-12  Martin Baulig  <martin@gnome.org>
14998
14999         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15000
15001         * ecore.cs (IMemberExpr.DeclaringType): New property.
15002         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15003         nonstatic member of an outer type (CS0038).
15004
15005 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * driver.cs: Activate the using-error detector at warning level
15008         4 (at least for MS-compatible APIs).
15009
15010         * namespace.cs (VerifyUsing): Small buglett fix.
15011
15012         * pending.cs (PendingImplementation): pass the container pointer. 
15013
15014         * interface.cs (GetMethods): Allow for recursive definition.  Long
15015         term, I would like to move every type to support recursive
15016         definitions, not the current ordering mechanism that we have right
15017         now.
15018
15019         The situation is this: Attributes are handled before interfaces,
15020         so we can apply attributes to interfaces.  But some attributes
15021         implement interfaces, we will now handle the simple cases
15022         (recursive definitions will just get an error).  
15023
15024         * parameter.cs: Only invalidate types at the end if we fail to
15025         lookup all types.  
15026
15027 2002-09-09  Martin Baulig  <martin@gnome.org>
15028
15029         * ecore.cs (PropertyExpr.Emit): Also check for
15030         TypeManager.system_int_array_get_length so this'll also work when
15031         compiling corlib.  Fixes #30003.
15032
15033 2002-09-09  Martin Baulig  <martin@gnome.org>
15034
15035         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15036         and throw an exception if we can't get the type's size.  Fixed #30040,
15037         added test-165.cs.
15038
15039 2002-09-09  Martin Baulig  <martin@gnome.org>
15040
15041         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15042
15043         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15044         context.  Fixes bug #30027.
15045
15046         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15047         virtual functions.  Fixes bug #30043, added test-164.cs.
15048
15049 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15050
15051         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15052
15053 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15054
15055         * driver.cs: Use an object to get the windows codepage since it's not a
15056         static property.
15057
15058 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * statement.cs (For.Emit): for infinite loops (test == null)
15061         return whether there is a break inside, not always "true".
15062
15063         * namespace.cs (UsingEntry): New struct to hold the name of the
15064         using definition, the location where it is defined, and whether it
15065         has been used in a successful type lookup.
15066
15067         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15068         strings.
15069
15070         * decl.cs: ditto.
15071
15072 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15073
15074         * attribute.cs : Fix incorrect code which relied on catching
15075         a NullReferenceException to detect a null being passed in
15076         where an object was expected.
15077
15078 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * statement.cs (Try): flag the catch variable as assigned
15081
15082         * expression.cs (Cast): Simplified by using ResolveType instead of
15083         manually resolving.
15084
15085         * statement.cs (Catch): Fix bug by using ResolveType.
15086
15087 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15088
15089         * expression.cs (BetterConversion): Special case for when we have
15090         a NullLiteral as the argument and we have to choose between string
15091         and object types - we choose string the way csc does.
15092
15093         * attribute.cs (Attribute.Resolve): Catch the
15094         NullReferenceException and report error #182 since the Mono
15095         runtime no more has the bug and having this exception raised means
15096         we tried to select a constructor which takes an object and is
15097         passed a null.
15098
15099 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15100
15101         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15102         message (1502, 1503) when we can't locate a method after overload
15103         resolution. This is much more informative and closes the bug
15104         Miguel reported.
15105
15106         * interface.cs (PopulateMethod): Return if there are no argument
15107         types. Fixes a NullReferenceException bug.
15108
15109         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15110         expressions too. Previously we were checking only in one place for
15111         positional arguments leaving out named arguments.
15112
15113         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15114         type to the enum type is not allowed. Remove code corresponding to
15115         that.
15116
15117         (ConvertNumericExplicit): Allow explicit conversions from
15118         the underlying type to enum type. This precisely follows the spec
15119         and closes a bug filed by Gonzalo.
15120
15121 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15122
15123         * compiler.csproj:
15124         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15125
15126 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15127
15128         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15129         it was important that we stored the right value after the
15130         reduction in `converted'.
15131
15132 2002-09-04  Martin Baulig  <martin@gnome.org>
15133
15134         * location.cs (Location.SymbolDocument): Use full pathnames for the
15135         source files.
15136
15137 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15140         of the expression resolve mechanism, because that will catch the
15141         SimpleName error failures.
15142
15143         (Conditional): If we can not resolve the
15144         expression, return, do not crash.
15145
15146 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15147
15148         * cs-tokenizer.cs:
15149         (location): display token name instead of its number.
15150
15151 2002-08-28  Martin Baulig  <martin@gnome.org>
15152
15153         * expression.cs (Binary.ResolveOperator): Don't silently return
15154         but return an error if an operator cannot be applied between two
15155         enum types.
15156
15157 2002-08-28  Martin Baulig  <martin@gnome.org>
15158
15159         * class.cs (Constructor.Define): Set the permission attributes
15160         correctly instead of making all constructors public.
15161
15162 2002-08-28  Martin Baulig  <martin@gnome.org>
15163
15164         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15165         for private members before reporting a CS0103; if we find anything,
15166         it's a CS0122.
15167
15168 2002-08-28  Martin Baulig  <martin@gnome.org>
15169
15170         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15171         to check whether `closure_start_type == closure_invocation_type',
15172         we also need to check whether `m.DeclaringType == closure_invocation_type'
15173         before bypassing the permission checks.  We might be accessing
15174         protected/private members from the base class.
15175         (TypeManager.RealMemberLookup): Only set private_ok if private
15176         members were requested via BindingFlags.NonPublic.
15177
15178         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15179
15180         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15181         MethodGroupExpr.IsExplicitImpl if appropriate.
15182         (Invocation.DoResolve): Don't report the CS0120 for explicit
15183         interface implementations.
15184
15185 2002-08-27  Martin Baulig  <martin@gnome.org>
15186
15187         * expression.cs (Invocation.DoResolve): If this is a static
15188         method and we don't have an InstanceExpression, we must report
15189         a CS0120.
15190
15191 2002-08-25  Martin Baulig  <martin@gnome.org>
15192
15193         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15194         `==' between a valuetype and an object.
15195
15196 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15197
15198         * ecore.cs (TypeExpr): Provide a ToString method.
15199
15200 2002-08-24  Martin Baulig  <martin@gnome.org>
15201
15202         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15203         now called proggie.dbg and it's a binary file.
15204
15205 2002-08-23  Martin Baulig  <martin@gnome.org>
15206
15207         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15208
15209 2002-08-23  Martin Baulig  <martin@gnome.org>
15210
15211         * struct.cs (MyStructInfo.ctor): Make this work with empty
15212         structs; it's not allowed to use foreach() on null.
15213
15214 2002-08-23  Martin Baulig  <martin@gnome.org>
15215
15216         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15217         writer the full pathname of the generated assembly.
15218
15219 2002-08-23  Martin Baulig  <martin@gnome.org>
15220
15221         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15222         A `finally' block never returns or breaks; improved handling of
15223         unreachable code.
15224
15225 2002-08-23  Martin Baulig  <martin@gnome.org>
15226
15227         * statement.cs (Throw.Resolve): Allow `throw null'.
15228
15229 2002-08-23  Martin Baulig  <martin@gnome.org>
15230
15231         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15232         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15233         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15234         MemberLookup would return a wrong event if this is an explicit
15235         interface implementation and the class has an event with the same
15236         name.
15237
15238 2002-08-23  Martin Baulig  <martin@gnome.org>
15239
15240         * statement.cs (Block.AddChildVariableNames): New public method.
15241         (Block.AddChildVariableName): Likewise.
15242         (Block.IsVariableNameUsedInChildBlock): Likewise.
15243         (Block.AddVariable): Check whether a variable name has already
15244         been used in a child block.
15245
15246         * cs-parser.jay (declare_local_variables): Mark all variable names
15247         from the current block as being used in a child block in the
15248         implicit block.
15249
15250 2002-08-23  Martin Baulig  <martin@gnome.org>
15251
15252         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15253         find the symbol writer.
15254
15255         * driver.cs: csc also allows the arguments to /define being
15256         separated by commas, not only by semicolons.
15257
15258 2002-08-23  Martin Baulig  <martin@gnome.org>
15259
15260         * interface.cs (Interface.GetMembers): Added static check for events.
15261
15262 2002-08-15  Martin Baulig  <martin@gnome.org>
15263
15264         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15265         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15266
15267         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15268         why the MethodData.EmitDestructor() change was necessary.
15269
15270 2002-08-20  Martin Baulig  <martin@gnome.org>
15271
15272         * class.cs (TypeContainer.FindMembers): Added static check for events.
15273
15274         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15275
15276         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15277         use Type.GetEvents(), not Type.FindMembers().
15278
15279 2002-08-20  Martin Baulig  <martin@gnome.org>
15280
15281         * decl.cs (MemberCache): Added a special method cache which will
15282         be used for method-only searched.  This ensures that a method
15283         search will return a MethodInfo with the correct ReflectedType for
15284         inherited methods.      
15285
15286 2002-08-20  Martin Baulig  <martin@gnome.org>
15287
15288         * decl.cs (DeclSpace.FindMembers): Made this public.
15289
15290 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15291
15292         * delegate.cs: fixed build on windows.
15293         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15294
15295 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15296
15297         * ecore.cs (StandardConversionExists): Return a false
15298         if we are trying to convert the void type to anything else
15299         since that is not allowed.
15300
15301         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15302         we flag error 70 in the event an event is trying to be accessed
15303         directly from outside the declaring type.
15304
15305 2002-08-20  Martin Baulig  <martin@gnome.org>
15306
15307         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15308         MemberCache from typemanager.cs to decl.cs.
15309
15310 2002-08-19  Martin Baulig  <martin@gnome.org>
15311
15312         * class.cs (TypeContainer): Implement IMemberContainer.
15313         (TypeContainer.DefineMembers): Create the MemberCache.
15314         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15315         return public members if BindingFlags.Public was given, check
15316         whether members are static.
15317
15318 2002-08-16  Martin Baulig  <martin@gnome.org>
15319
15320         * decl.cs (DeclSpace.Define): Splitted this in Define and
15321         DefineMembers.  DefineMembers is called first and initializes the
15322         MemberCache.
15323
15324         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15325         DefineMembers() on all our DeclSpaces.
15326
15327         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15328         but call DefineMembers() on all nested interfaces.  We call their
15329         Define() in our new Define() function.
15330
15331         * interface.cs (Interface): Implement IMemberContainer.
15332         (Interface.Define): Moved all code except the attribute stuf to
15333         DefineMembers().
15334         (Interface.DefineMembers): Initialize the member cache.
15335
15336         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15337         need this anymore since we can use MemberCache.FindMembers directly.
15338
15339 2002-08-19  Martin Baulig  <martin@gnome.org>
15340
15341         * typemanager.cs (MemberCache): When creating the cache for an
15342         interface type, add all inherited members.
15343         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15344         to `out bool used_cache' and documented it.
15345         (TypeManager.MemberLookup): If we already used the cache in the first
15346         iteration, we don't need to do the interfaces check.
15347
15348 2002-08-19  Martin Baulig  <martin@gnome.org>
15349
15350         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15351         here from IMemberFinder and don't implement this interface anymore.
15352         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15353
15354         * typemanager.cs (IMemberFinder): This interface is now only used by
15355         classes which actually support the member cache.
15356         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15357         since we only put DeclSpaces into this Hashtable.
15358         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15359         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15360
15361 2002-08-16  Martin Baulig  <martin@gnome.org>
15362
15363         * typemanager.cs (ICachingMemberFinder): Removed.
15364         (IMemberFinder.MemberCache): New property.
15365         (TypeManager.FindMembers): Merged this with RealFindMembers().
15366         This function will never be called from TypeManager.MemberLookup()
15367         so we can't use the cache here, just the IMemberFinder.
15368         (TypeManager.MemberLookup_FindMembers): Check whether the
15369         IMemberFinder has a MemberCache and call the cache's FindMembers
15370         function.
15371         (MemberCache): Rewrote larger parts of this yet another time and
15372         cleaned it up a bit.
15373
15374 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * driver.cs (LoadArgs): Support quoting.
15377
15378         (Usage): Show the CSC-like command line arguments.
15379
15380         Improved a few error messages.
15381
15382 2002-08-15  Martin Baulig  <martin@gnome.org>
15383
15384         * typemanager.cs (IMemberContainer.Type): New property.
15385         (IMemberContainer.IsInterface): New property.
15386
15387         The following changes are conditional to BROKEN_RUNTIME, which is
15388         defined at the top of the file.
15389
15390         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15391         class'es members, but add all members from TypeHandle.ObjectType
15392         if we're an interface.
15393         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15394         is the current type.
15395         (MemberCache.CacheEntry.Container): Removed this field.
15396         (TypeHandle.GetMembers): Include inherited members.
15397
15398 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15399
15400         * typemanager.cs: fixed compilation and added a comment on a field that
15401         is never used.
15402
15403 2002-08-15  Martin Baulig  <martin@gnome.org>
15404
15405         * class.cs (ConstructorInitializer.Resolve): In the
15406         Expression.MemberLookup call, use the queried_type as
15407         invocation_type.
15408
15409         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15410         declared' attribute, it's always true.
15411         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15412         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15413         temporary wrapper for FindMembers which tells MemberLookup whether
15414         members from the base classes are included in the return value.
15415         This will go away soon.
15416         (TypeManager.MemberLookup): Use this temporary hack here; once the
15417         new MemberCache is completed, we don't need to do the DeclaredOnly
15418         looping here anymore since the MemberCache will take care of this.
15419         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15420         (MemberCache): When creating the MemberCache for a class, get
15421         members from the current class and all its base classes.
15422         (MemberCache.CacheEntry.Container): New field.  This is a
15423         temporary hack until the Mono runtime is fixed to distinguish
15424         between ReflectedType and DeclaringType.  It allows us to use MCS
15425         with both the MS runtime and the unfixed Mono runtime without
15426         problems and without accecting performance.
15427         (MemberCache.SearchMembers): The DeclaredOnly looping from
15428         TypeManager.MemberLookup is now done here.      
15429
15430 2002-08-14  Martin Baulig  <martin@gnome.org>
15431
15432         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15433         Type.GetFields on dynamic types but get the fields from the
15434         corresponding TypeContainer.
15435         (MyStructInfo.GetStructInfo): Added check for enum types.
15436
15437         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15438         (MemberList.SyncRoot): Implemented.
15439         (TypeManager.FilterWithClosure): No need to check permissions if
15440         closure_start_type == closure_invocation_type, don't crash if
15441         closure_invocation_type is null.
15442
15443 2002-08-13  Martin Baulig  <martin@gnome.org>
15444
15445         Rewrote TypeContainer.FindMembers to use a member cache.  This
15446         gives us a speed increase of about 35% for the self-hosting MCS
15447         build and of about 15-20% for the class libs (both on GNU/Linux).
15448
15449         * report.cs (Timer): New class to get enhanced profiling.  This
15450         whole class is "TIMER" conditional since it remarkably slows down
15451         compilation speed.
15452
15453         * class.cs (MemberList): New class.  This is an IList wrapper
15454         which we're now using instead of passing MemberInfo[]'s around to
15455         avoid copying this array unnecessarily.
15456         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15457         (ICachingMemberFinder, IMemberContainer): New interface.
15458         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15459         has already been checked, otherwise use it for the name comparision.
15460         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15461         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15462         if possible.  Returns a MemberList, not a MemberInfo [].
15463         (TypeHandle): New class, implements IMemberContainer.  We create
15464         one instance of this class per type, it contains a MemberCache
15465         which is used to do the member lookups.
15466         (MemberCache): New class.  Each instance of this class contains
15467         all members of a type and a name-based hash table.
15468         (MemberCache.FindMembers): This is our new member lookup
15469         function.  First, it looks up all members of the requested name in
15470         the hash table.  Then, it walks this list and sorts out all
15471         applicable members and returns them.
15472
15473 2002-08-13  Martin Baulig  <martin@gnome.org>
15474
15475         In addition to a nice code cleanup, this gives us a performance
15476         increase of about 1.4% on GNU/Linux - not much, but it's already
15477         half a second for the self-hosting MCS compilation.
15478
15479         * typemanager.cs (IMemberFinder): New interface.  It is used by
15480         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15481         Enum, Delegate or Interface.
15482         (TypeManager.finder_to_member_finder): New PtrHashtable.
15483         (TypeManager.finder_to_container): Removed.
15484         (TypeManager.finder_to_delegate): Removed.
15485         (TypeManager.finder_to_interface): Removed.
15486         (TypeManager.finder_to_enum): Removed.
15487
15488         * interface.cs (Interface): Implement IMemberFinder.
15489
15490         * delegate.cs (Delegate): Implement IMemberFinder.
15491
15492         * enum.cs (Enum): Implement IMemberFinder.
15493
15494         * class.cs (TypeContainer): Implement IMemberFinder.
15495
15496 2002-08-12  Martin Baulig  <martin@gnome.org>
15497
15498         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15499
15500 2002-08-12  Martin Baulig  <martin@gnome.org>
15501
15502         * ecore.cs (ITypeExpression): New interface for expressions which
15503         resolve to a type.
15504         (TypeExpression): Renamed to TypeLookupExpression.
15505         (Expression.DoResolve): If we're doing a types-only lookup, the
15506         expression must implement the ITypeExpression interface and we
15507         call DoResolveType() on it.
15508         (SimpleName): Implement the new ITypeExpression interface.
15509         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15510         hack, the situation that we're only looking up types can't happen
15511         anymore when this method is called.  Moved the type lookup code to
15512         DoResolveType() and call it.
15513         (SimpleName.DoResolveType): This ITypeExpression interface method
15514         is now doing the types-only lookup.
15515         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15516         (ResolveFlags): Added MaskExprClass.
15517
15518         * expression.cs (MemberAccess): Implement the ITypeExpression
15519         interface.
15520         (MemberAccess.DoResolve): Added support for a types-only lookup
15521         when we're called via ITypeExpression.DoResolveType().
15522         (ComposedCast): Implement the ITypeExpression interface.
15523
15524         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15525         Expression.Resolve() with ResolveFlags.Type instead.
15526
15527 2002-08-12  Martin Baulig  <martin@gnome.org>
15528
15529         * interface.cs (Interface.Define): Apply attributes.
15530
15531         * attribute.cs (Attribute.ApplyAttributes): Added support for
15532         interface attributes.
15533
15534 2002-08-11  Martin Baulig  <martin@gnome.org>
15535
15536         * statement.cs (Block.Emit): Only check the "this" variable if we
15537         do not always throw an exception.
15538
15539         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15540         whether the property has a set accessor.
15541
15542 2002-08-11  Martin Baulig  <martin@gnome.org>
15543
15544         Added control flow analysis support for structs.
15545
15546         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15547         with control flow analysis turned off.
15548         (IVariable): New interface.
15549         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15550         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15551         (FieldExpr.DoResolve): Resolve the instance expression with flow
15552         analysis turned off and do the definite assignment check after the
15553         resolving when we know what the expression will resolve to.
15554
15555         * expression.cs (LocalVariableReference, ParameterReference):
15556         Implement the new IVariable interface, only call the flow analysis
15557         code if ec.DoFlowAnalysis is true.
15558         (This): Added constructor which takes a Block argument.  Implement
15559         the new IVariable interface.
15560         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15561         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15562         This does the definite assignment checks for struct members.
15563
15564         * class.cs (Constructor.Emit): If this is a non-static `struct'
15565         constructor which doesn't have any initializer, call
15566         Block.AddThisVariable() to tell the flow analysis code that all
15567         struct elements must be initialized before control returns from
15568         the constructor.
15569
15570         * statement.cs (MyStructInfo): New public class.
15571         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15572         argument to this indexer.  If non-zero, check an individual struct
15573         member, not the whole struct.
15574         (FlowBranching.CheckOutParameters): Check struct members.
15575         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15576         overloaded versions of these methods which take an additional
15577         `int field_idx' argument to check struct members.
15578         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15579         overloaded versions of these methods which take an additional
15580         `string field_name' argument to check struct member.s
15581         (VariableInfo): Implement the IVariable interface.
15582         (VariableInfo.StructInfo): New public property.  Returns the
15583         MyStructInfo instance of the variable if it's a struct or null.
15584         (Block.AddThisVariable): New public method.  This is called from
15585         Constructor.Emit() for non-static `struct' constructor which do
15586         not have any initializer.  It creates a special variable for the
15587         "this" instance variable which will be checked by the flow
15588         analysis code to ensure that all of the struct's fields are
15589         initialized before control returns from the constructor.
15590         (UsageVector): Added support for struct members.  If a
15591         variable/parameter is a struct with N members, we reserve a slot
15592         in the usage vector for each member.  A struct is considered fully
15593         initialized if either the struct itself (slot 0) or all its
15594         members are initialized.
15595
15596 2002-08-08  Martin Baulig  <martin@gnome.org>
15597
15598         * driver.cs (Driver.MainDriver): Only report an error CS5001
15599         if there were no compilation errors.
15600
15601         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15602         `UnsafeContext' property to determine whether the parent is in
15603         unsafe context rather than checking the parent's ModFlags:
15604         classes nested in an unsafe class are unsafe as well.
15605
15606 2002-08-08  Martin Baulig  <martin@gnome.org>
15607
15608         * statement.cs (UsageVector.MergeChildren): Distinguish between
15609         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15610         we return.  Added test17() and test18() to test-154.cs.
15611
15612 2002-08-08  Martin Baulig  <martin@gnome.org>
15613
15614         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15615         Family access, make sure the invoking type isn't a subclass of the
15616         queried type (that'd be a CS1540).
15617
15618         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15619         this method which takes an additional `Type invocation_type'.
15620
15621         * expression.cs (BaseAccess.DoResolve): Use the base type as
15622         invocation and query type.
15623         (MemberAccess.DoResolve): If the lookup failed and we're about to
15624         report a CS0122, try a lookup with the ec.ContainerType - if this
15625         succeeds, we must report a CS1540.
15626
15627 2002-08-08  Martin Baulig  <martin@gnome.org>
15628
15629         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15630         (MethodGroupExpr): Implement the IMemberExpr interface.
15631
15632         * expression (MemberAccess.ResolveMemberAccess): No need to have
15633         any special code for MethodGroupExprs anymore, they're now
15634         IMemberExprs.   
15635
15636 2002-08-08  Martin Baulig  <martin@gnome.org>
15637
15638         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15639         Family, FamANDAssem and FamORAssem permissions.
15640         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15641
15642 2002-08-08  Martin Baulig  <martin@gnome.org>
15643
15644         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15645         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15646         or loop block.
15647
15648 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15649
15650         * driver.cs: implemented /resource option to embed managed resources.
15651
15652 2002-08-07  Martin Baulig  <martin@gnome.org>
15653
15654         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15655         (FieldBase.HasFieldInitializer): New public property.
15656         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15657         returns the field initializer and makes sure it is only resolved once.
15658         (TypeContainer.EmitFieldInitializers): Call
15659         FieldBase.GetInitializerExpression to get the initializer, this ensures
15660         that it isn't resolved multiple times.
15661
15662         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15663         the resolving process (SimpleName/MemberLookup) that we're currently
15664         emitting a field initializer (which must not access any instance members,
15665         this is an error CS0236).
15666
15667         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15668         argument, if the `IsFieldInitializer' flag is set, we must report and
15669         error CS0236 and not an error CS0120.   
15670
15671 2002-08-07  Martin Baulig  <martin@gnome.org>
15672
15673         * ecore.cs (IMemberExpr): New public interface.
15674         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15675         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15676         if the expression is an IMemberExpr.
15677
15678         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15679         to be null, implicitly default to `this' if we're non-static in
15680         this case.  Simplified the code a lot by using the new IMemberExpr
15681         interface.  Also fixed bug #28176 here.
15682
15683 2002-08-06  Martin Baulig  <martin@gnome.org>
15684
15685         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15686         ParameterReferences during semantic analysis so that we can do a
15687         type-only search when resolving Cast, TypeOf and SizeOf.
15688         (block): Pass the `current_local_parameters' to the Block's
15689         constructor.
15690
15691         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15692         argument to the constructor.
15693         (ConstructorInitializer.Resolve): Create a temporary implicit
15694         block with the parameters.
15695
15696         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15697         references here if we aren't doing a type-only search.
15698
15699         * statement.cs (Block): Added constructor which takes a
15700         `Parameters parameters' argument.
15701         (Block.Parameters): New public property.
15702
15703         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15704         to `Parameters' and made it public readonly.
15705
15706 2002-08-06  Martin Baulig  <martin@gnome.org>
15707
15708         * ecore.cs (Expression.Warning): Made this public as well.
15709
15710         * report.cs (Report.Debug): Print the contents of collections.
15711
15712 2002-08-06  Martin Baulig  <martin@gnome.org>
15713
15714         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15715         used to tell Resolve() which kinds of expressions it may return.
15716         (Expression.Resolve): Added overloaded version of this method which
15717         takes a `ResolveFlags flags' argument.  This can be used to tell
15718         Resolve() which kinds of expressions it may return.  Reports a
15719         CS0118 on error.
15720         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15721         ResolveFlags.SimpleName.
15722         (Expression.Error118): Added overloaded version of this method which
15723         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15724         which kinds of expressions are allowed.
15725
15726         * expression.cs (Argument.ResolveMethodGroup): New public method.
15727         Resolves an argument, but allows a MethodGroup to be returned.
15728         This is used when invoking a delegate.
15729
15730         * TODO: Updated a bit.
15731
15732 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15733
15734         Fixed compilation with csc.
15735
15736         * ecore.cs: Expression.Error made public. Is this correct? Should
15737         Warning be made public too?
15738
15739         * expression.cs: use ea.Location instead of ea.loc.
15740         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15741
15742 2002-08-06  Martin Baulig  <martin@gnome.org>
15743
15744         * ecore.cs (Expression.loc): Moved the location here instead of
15745         duplicating it in all derived classes.
15746         (Expression.Location): New public property.
15747         (Expression.Error, Expression.Warning): Made them non-static and
15748         removed the location argument.
15749         (Expression.Warning): Added overloaded version which takes an
15750         `int level' argument.
15751         (Expression.Error118): Make this non-static and removed the
15752         expression and location arguments.
15753         (TypeExpr): Added location argument to the constructor.
15754
15755         * expression.cs (StaticCallExpr): Added location argument to
15756         the constructor.
15757         (Indirection, PointerArithmetic): Likewise.
15758         (CheckedExpr, UnCheckedExpr): Likewise.
15759         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15760         (StringPtr): Likewise.
15761
15762
15763 2002-08-05  Martin Baulig  <martin@gnome.org>
15764
15765         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15766
15767         * assign.cs (Assign.DoResolve): Check whether the source
15768         expression is a value or variable.
15769
15770         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15771         while resolving the corresponding blocks.
15772
15773         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15774         an error, don't silently return null.
15775
15776         * statement.cs (Block.AddVariable): Do the error reporting here
15777         and distinguish between CS0128 and CS0136.
15778         (Block.DoResolve): Report all unused labels (warning CS0164).
15779         (LabeledStatement): Pass the location to the constructor.
15780         (LabeledStatement.HasBeenReferenced): New property.
15781         (LabeledStatement.Resolve): Set it to true here.
15782
15783         * statement.cs (Return.Emit): Return success even after reporting
15784         a type mismatch error (CS0126 or CS0127), this is what csc does and
15785         it avoids confusing the users with any consecutive errors.
15786
15787 2002-08-05  Martin Baulig  <martin@gnome.org>
15788
15789         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15790
15791         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15792
15793         * expression.cs (MemberAccess.DoResolve): Silently return if an
15794         error has already been reported.
15795
15796         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15797         error has already been reported.
15798
15799 2002-08-05  Martin Baulig  <martin@gnome.org>
15800
15801         * statement.cs (UsageVector): Only initialize the `parameters'
15802         vector if we actually have any "out" parameters.
15803
15804 2002-08-05  Martin Baulig  <martin@gnome.org>
15805
15806         * expression.cs (Binary.ResolveOperator): When combining delegates,
15807         they must have the same type.
15808
15809 2002-08-05  Martin Baulig  <martin@gnome.org>
15810
15811         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15812         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15813         work with the ms runtime and we also don't need it: if we're a
15814         PropertyBuilder and not in the `indexer_arguments' hash, then we
15815         are a property and not an indexer.
15816
15817         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15818         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15819         since the latter one doesn't work with the ms runtime.
15820
15821 2002-08-03  Martin Baulig  <martin@gnome.org>
15822
15823         Fixed bugs #27998 and #22735.
15824
15825         * class.cs (Method.IsOperator): New public field.
15826         (Method.CheckBase): Report CS0111 if there's already a method
15827         with the same parameters in the current class.  Report CS0508 when
15828         attempting to change the return type of an inherited method.
15829         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15830         and it's not marked abstract or extern.
15831         (PropertyBase): New abstract base class for Property and Indexer.
15832         (PropertyBase.CheckBase): Moved here from Property and made it work
15833         for indexers.
15834         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15835         the same so we can reuse it there.
15836         (Property, Indexer): Derive from PropertyBase.
15837         (MethodSignature.inheritable_property_signature_filter): New delegate
15838         to find properties and indexers.
15839
15840         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15841         argument and improved error reporting.
15842
15843         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15844         EmptyReadOnlyParameters and made it a property.
15845
15846         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15847         version of this method which takes a `PropertyInfo indexer'.
15848         (TypeManager.RegisterIndexer): New method.
15849
15850         * class.cs: Added myself as author of this file :-)
15851
15852 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15853
15854         * class.cs: fixed compilation on windoze.
15855
15856 2002-08-03  Martin Baulig  <martin@gnome.org>
15857
15858         * interface.cs (Interface.GetInterfaceBases): Check whether all
15859         base interfaces are at least as accessible than the current one.
15860
15861         * class.cs (TypeContainer.GetClassBases): Check whether base types
15862         are at least as accessible than the current type.
15863         (TypeContainer.AsAccessible): Implemented and made non-static.
15864         (MemberBase.CheckParameters): Report errors if the accessibility
15865         checks fail.
15866
15867         * delegate.cs (Delegate.Delegate): The default visibility is
15868         internal for top-level types and private for nested types.
15869         (Delegate.Define): Report errors if the accessibility checks fail.
15870
15871         * enum.cs (Enum.Enum): The default visibility is internal for
15872         top-level types and private for nested types.
15873         (Enum.DefineType): Compute the correct visibility.
15874
15875         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15876         function which takes a `bool is_toplevel' instead of a TypeContainer.
15877
15878         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15879         builtin type.
15880
15881 2002-08-02  Martin Baulig  <martin@gnome.org>
15882
15883         * expression.cs (LocalVariableReferenc): Added constructor which
15884         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15885         (LocalVariableReference.IsReadOnly): New property.
15886         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15887         variable is readonly, use our own readonly flag to do this; you can
15888         use the new constructor to get a writable reference to a read-only
15889         variable.
15890
15891         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15892         reference to the local variable.
15893
15894 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * rootcontext.cs (ResolveCore): Also include System.Exception
15897
15898         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15899         we reach an EmptyStatement.
15900
15901         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15902         is also fine.
15903
15904         * expression.cs (Binary.ResolveOperator): Check error result in
15905         two places.
15906
15907         use brtrue/brfalse directly and avoid compares to null.
15908
15909 2002-08-02  Martin Baulig  <martin@gnome.org>
15910
15911         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15912         Fixes bug #28407, added test-155.cs.
15913
15914 2002-08-01  Martin Baulig  <martin@gnome.org>
15915
15916         * class.cs (Event.EmitDefaultMethod): Make this work with static
15917         events.  Fixes #28311, added verify-3.cs.
15918
15919 2002-08-01  Martin Baulig  <martin@gnome.org>
15920
15921         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15922         `is_disposable' fields.
15923         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15924         `hm.is_disposable' if we're using the collection pattern.
15925         (Foreach.EmitCollectionForeach): Use the correct type for the
15926         enumerator's local variable, only emit the try/finally block if
15927         necessary (fixes #27713).
15928
15929 2002-08-01  Martin Baulig  <martin@gnome.org>
15930
15931         * ecore.cs (Expression.report118): Renamed to Error118 and made
15932         it public static.
15933
15934         * statement.cs (Throw.Resolve): Check whether the expression is of
15935         the correct type (CS0118) and whether the type derives from
15936         System.Exception (CS0155).
15937         (Catch.Resolve): New method.  Do the type lookup here and check
15938         whether it derives from System.Exception (CS0155).
15939         (Catch.CatchType, Catch.IsGeneral): New public properties.
15940
15941         * typemanager.cs (TypeManager.exception_type): Added.
15942
15943 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * driver.cs: Updated About function.
15946
15947 2002-07-31  Martin Baulig  <martin@gnome.org>
15948
15949         Implemented Control Flow Analysis.
15950
15951         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15952         (EmitContext.CurrentBranching): Added.
15953         (EmitContext.StartFlowBranching): Added.
15954         (EmitContext.EndFlowBranching): Added.
15955         (EmitContext.KillFlowBranching): Added.
15956         (EmitContext.IsVariableAssigned): Added.
15957         (EmitContext.SetVariableAssigned): Added.
15958         (EmitContext.IsParameterAssigned): Added.
15959         (EmitContext.SetParameterAssigned): Added.
15960         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15961         Added control flow analysis stuff here.
15962
15963         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15964         resolve the expression as lvalue.
15965         (LocalVariableReference.DoResolve): Check whether the variable has
15966         already been assigned.
15967         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15968         the parameter as assigned here.
15969         (ParameterReference.DoResolve): Check whether the parameter has already
15970         been assigned.
15971         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15972         expression as lvalue.
15973
15974         * statement.cs (FlowBranching): New class for the flow analysis code.
15975         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15976         (LabeledStatement.IsDefined): New public property.
15977         (LabeledStatement.AddUsageVector): New public method to tell flow
15978         analyis that the label may be reached via a forward jump.
15979         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15980         flow analysis.
15981         (VariableInfo.Number): New public field.  This is used by flow analysis
15982         to number all locals of a block.
15983         (Block.CountVariables): New public property.  This is the number of
15984         local variables in this block (including the locals from all parent
15985         blocks).
15986         (Block.EmitMeta): Number all the variables.
15987
15988         * statement.cs: Added flow analysis support to all classes.
15989
15990 2002-07-31  Martin Baulig  <martin@gnome.org>
15991
15992         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15993         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15994         then use this argument.
15995
15996         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15997
15998         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15999         use this to specify /define options.
16000
16001 2002-07-29  Martin Baulig  <martin@gnome.org>
16002
16003         * statement.cs (Fixed): Moved all code that does variable lookups
16004         and resolvings from Emit to Resolve.
16005
16006         * statement.cs (For): Moved all code that does variable lookups
16007         and resolvings from Emit to Resolve.
16008
16009         * statement.cs (Using): Moved all code that does variable lookups
16010         and resolvings from Emit to Resolve.
16011
16012 2002-07-29  Martin Baulig  <martin@gnome.org>
16013
16014         * attribute.cs (Attribute.Resolve): Explicitly catch a
16015         System.NullReferenceException when creating the
16016         CustromAttributeBuilder and report a different warning message.
16017
16018 2002-07-29  Martin Baulig  <martin@gnome.org>
16019
16020         * support.cs (ParameterData.ParameterName): Added method to
16021         get the name of a parameter.
16022
16023         * typemanager.cs (TypeManager.IsValueType): New public method.
16024
16025 2002-07-29  Martin Baulig  <martin@gnome.org>
16026
16027         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16028         is a flag which specifies that it's either ref or out.
16029         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16030         the out parameter to `out Parameter.Modifier mod', also set the
16031         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16032
16033         * support.cs (InternalParameters.ParameterModifier): Distinguish
16034         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16035         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16036
16037         * expression.cs (Argument.GetParameterModifier): Distinguish
16038         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16039         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16040
16041 2002-07-29  Martin Baulig  <martin@gnome.org>
16042
16043         * expression.cs (ParameterReference.ParameterReference): Added
16044         `Location loc' argument to the constructor.
16045
16046         * cs-parser.jay: Pass location to ParameterReference.
16047
16048 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * statement.cs (Try): Initialize the location.
16051
16052         * cs-parser.jay: pass location to Try.
16053
16054         * expression.cs (Unary.Reduce): Change the prototype to return
16055         whether a constant fold could be performed or not.  The result is
16056         returned in an out parameters.  In the case of Indirection and
16057         AddressOf, we want to perform the full tests.
16058
16059 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16060
16061         * statement.cs (Statement.Emit): Flag dead code.
16062
16063 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16064
16065         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16066
16067 2002-07-27  Martin Baulig  <martin@gnome.org>
16068
16069         * class.cs (MethodData.Define): Put back call to
16070         TypeManager.AddMethod(), accidentally commented this out.
16071
16072         * report.cs (Debug): New public method to print debugging information,
16073         this is `[Conditional ("DEBUG")]'.
16074
16075 2002-07-26  Martin Baulig  <martin@gnome.org>
16076
16077         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16078         (switch_statement): Push the current_block to the switch_stack and
16079         pop it again when we're done with the switch.
16080         (switch_section): The new block is a child of the current_block.
16081         Fixes bug #24007, added test-152.cs.
16082
16083 2002-07-27  Martin Baulig  <martin@gnome.org>
16084
16085         * expression.cs (Invocation.EmitArguments): When calling a varargs
16086         function with only its fixed arguments, we need to pass an empty
16087         array.
16088
16089 2002-07-27  Martin Baulig  <martin@gnome.org>
16090
16091         Mono 0.13 has been released.
16092
16093 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * driver.cs: Rename --resource to --linkres, because that is what
16096         we do currently, we dont support --resource yet.
16097
16098         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16099
16100 2002-07-25  Martin Baulig  <martin@gnome.org>
16101
16102         * class.cs (MethodData): New public class.  This is a `method builder'
16103         class for a method or one accessor of a Property/Indexer/Event.
16104         (MethodData.GetMethodFlags): Moved here from MemberBase.
16105         (MethodData.ApplyAttributes): Likewise.
16106         (MethodData.ApplyObsoleteAttribute): Likewise.
16107         (MethodData.ApplyConditionalAttribute): Likewise.
16108         (MethodData.ApplyDllImportAttribute): Likewise.
16109         (MethodData.CheckAbstractAndExternal): Likewise.
16110         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16111         (MethodData.Emit): Formerly known as Method.Emit().
16112         (MemberBase): Moved everything which was specific to a single
16113         accessor/method to MethodData.
16114         (Method): Create a new MethodData and call Define() and Emit() on it.
16115         (Property, Indexer, Event): Create a new MethodData objects for each
16116         accessor and call Define() and Emit() on them.
16117
16118 2002-07-25  Martin Baulig  <martin@gnome.org>
16119
16120         Made MethodCore derive from MemberBase to reuse the code from there.
16121         MemberBase now also checks for attributes.
16122
16123         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16124         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16125         as virtual.
16126         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16127         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16128         (MemberBase.ApplyAttributes): New virtual method; applies the
16129         attributes to a method or accessor.
16130         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16131         (MemberBase.ApplyConditionalAttribute): Likewise.
16132         (MemberBase.ApplyDllImportAttribute): Likewise.
16133         (MemberBase.CheckAbstractAndExternal): Likewise.
16134         (MethodCore.ParameterTypes): This is now a property instead of a
16135         method, it's initialized from DoDefineParameters().
16136         (MethodCore.ParameterInfo): Removed the set accessor.
16137         (MethodCore.DoDefineParameters): New protected virtual method to
16138         initialize ParameterTypes and ParameterInfo.
16139         (Method.GetReturnType): We can now simply return the MemberType.
16140         (Method.GetMethodFlags): Override the MemberBase version and add
16141         the conditional flags.
16142         (Method.CheckBase): Moved some code from Define() here, call
16143         DoDefineParameters() here.
16144         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16145         here to avoid some larger code duplication.
16146         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16147         ensure that abstract and external accessors don't declare a body.
16148
16149         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16150         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16151         lookup in the attribute's parent classes, so we need to abort as soon
16152         as we found the first match.
16153         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16154         the attribute has no arguments.
16155
16156         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16157         of a Method.
16158
16159 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16160
16161         * cs-parser.jay: reverted previous patch.
16162
16163 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16164
16165         * cs-parser.jay: fixed bug #22119.
16166
16167 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16168
16169         * attribute.cs: fixed compilation. The error was:
16170         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16171         be assigned to before control leaves the current method."
16172         [FIXME:  Filed as bug #28186: MCS must report this error.]
16173
16174 2002-07-25  Martin Baulig  <martin@gnome.org>
16175
16176         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16177         method to pull the condition name ouf of a Conditional attribute.
16178         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16179         the obsolete message and error flag out of an Obsolete attribute.
16180
16181         * class.cs (Method.GetMethodFlags): New public method to get the
16182         TypeManager.MethodFlags for this method.
16183         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16184         private methods.
16185         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16186         if we're overriding a virtual function, set the new private variable
16187         `parent_method'; call the new TypeManager.AddMethod().
16188
16189         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16190         the MethodBuilder and the Method in a PtrHashtable.
16191         (TypeManager.builder_to_method): Added for this purpose.
16192         (TypeManager.MethodFlags): Added IsObsoleteError.
16193         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16194         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16195         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16196         the message from the attribute.
16197
16198 2002-07-24  Martin Baulig  <martin@gnome.org>
16199
16200         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16201         preprocessor directives, ensure that the argument to #define/#undef is
16202         exactly one identifier and that it's actually an identifier.
16203
16204         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16205         did not work ....
16206
16207 2002-07-24  Martin Baulig  <martin@gnome.org>
16208
16209         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16210         initialize it to TypeManager.object_type in the constructor.
16211         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16212         of the `hm.get_current' method if we're using the collection pattern.
16213         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16214         for the explicit conversion to make it work when we're using the collection
16215         pattern and the `Current' property has a different return type than `object'.
16216         Fixes #27713.
16217
16218 2002-07-24  Martin Baulig  <martin@gnome.org>
16219
16220         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16221         does not match, but don't report any errors.  This method is called in
16222         order for all methods in a MethodGroupExpr until a matching method is
16223         found, so we don't want to bail out if the first method doesn't match.
16224         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16225         matches, report the 123.  Fixes #28070.
16226
16227 2002-07-24  Martin Baulig  <martin@gnome.org>
16228
16229         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16230         TypeManager.TypeToCoreType() to the top of the method so the
16231         following equality checks will work.  Fixes #28107.
16232
16233 2002-07-24  Martin Baulig  <martin@gnome.org>
16234
16235         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16236         operand is of type uint, and the other operand is of type sbyte,
16237         short or int, the operands are converted to type long." -
16238         Actually do what this comment already told us.  Fixes bug #28106,
16239         added test-150.cs.
16240
16241 2002-07-24  Martin Baulig  <martin@gnome.org>
16242
16243         * class.cs (MethodBase): New abstract class.  This is now a base
16244         class for Property, Indexer and Event to avoid some code duplication
16245         in their Define() and DefineMethods() methods.
16246         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16247         generic methods for Define() and DefineMethods().
16248         (FieldBase): Derive from MemberBase, not MemberCore.
16249         (Property): Derive from MemberBase, not MemberCore.
16250         (Property.DefineMethod): Moved all the code from this method to the
16251         new MethodBase.DefineAccessor(), just call it with appropriate
16252         argumetnts.
16253         (Property.Define): Call the new Property.DoDefine(), this does some
16254         sanity checks and we don't need to duplicate the code everywhere.
16255         (Event): Derive from MemberBase, not MemberCore.
16256         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16257         accessors, this will also make them work with interface events.
16258         (Indexer): Derive from MemberBase, not MemberCore.
16259         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16260         (Indexer.Define): Use the new MethodBase functions.
16261
16262         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16263         argument to the constructor.
16264         (Interface.FindMembers): Added support for interface events.
16265         (Interface.PopluateEvent): Implemented.
16266
16267         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16268
16269 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16270
16271         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16272         but this is required to check for a method name being the same as
16273         the containing class.  
16274
16275         Handle this now.
16276
16277 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16278
16279         * interface.cs: initialize variable.
16280
16281 2002-07-23  Martin Baulig  <martin@gnome.org>
16282
16283         Implemented the IndexerName attribute in interfaces.
16284
16285         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16286         name if this is an explicit interface implementation.
16287         (Indexer.InterfaceIndexerName): New public variable.  If we're
16288         implementing an interface indexer, this is the IndexerName in that
16289         interface.  Otherwise, it's the IndexerName.
16290         (Indexer.DefineMethod): If we're implementing interface indexer,
16291         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16292         and Pending.ImplementIndexer methods.
16293         (Indexer.Define): Also define the PropertyBuilder if we're
16294         implementing an interface indexer and this is neither an explicit
16295         interface implementation nor do the IndexerName match the one in
16296         the interface.
16297
16298         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16299         If a method is defined here, then we always need to create a proxy
16300         for it.  This is used when implementing interface indexers.
16301         (Pending.IsInterfaceIndexer): New public method.
16302         (Pending.ImplementIndexer): New public method.
16303         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16304         This is used when implementing interface indexers to define a proxy
16305         if necessary.
16306         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16307         define a proxy if necessary.
16308
16309         * interface.cs (Interface.IndexerName): New public variable.
16310         (Interface.PopulateIndexer): Set the IndexerName.
16311         (Interface.DefineIndexers): New private method.  Populate all the
16312         indexers and make sure their IndexerNames match.
16313
16314         * typemanager.cs (IndexerPropertyName): Added support for interface
16315         indexers.
16316
16317 2002-07-22  Martin Baulig  <martin@gnome.org>
16318
16319         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16320         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16321         ret if HasReturnLabel.
16322         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16323         variables.
16324
16325         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16326         and set the ec.LoopBeginTryCatchLevel.
16327         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16328         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16329         the current ec.TryCatchLevel, the branch goes out of an exception
16330         block.  In this case, we need to use Leave and not Br.
16331
16332 2002-07-22  Martin Baulig  <martin@gnome.org>
16333
16334         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16335         block unless the block does not always return or it is contained in
16336         another try { ... } catch { ... } block.  Fixes bug #26506.
16337         Added verify-1.cs to the test suite.
16338
16339 2002-07-22  Martin Baulig  <martin@gnome.org>
16340
16341         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16342         then we do not always return.  Fixes bug #24985.
16343
16344 2002-07-22  Martin Baulig  <martin@gnome.org>
16345
16346         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16347         lookup on a per-class level; ie. walk up the class hierarchy until we
16348         found at least one applicable method, then choose the best among them.
16349         Fixes bug #24463 and test-29.cs.
16350
16351 2002-07-22  Martin Baulig  <martin@gnome.org>
16352
16353         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16354         return types of the methods.  The return type is not part of the
16355         signature and we must not check it to make the `new' modifier work.
16356         Fixes bug #27999, also added test-147.cs.
16357         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16358
16359         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16360         on the method's return type.
16361
16362 2002-07-21  Martin Baulig  <martin@gnome.org>
16363
16364         * assign.cs: Make this work if the rightmost source is a constant and
16365         we need to do an implicit type conversion.  Also adding a few more tests
16366         to test-38.cs which should have caught this.
16367
16368         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16369         target in the makefile for this.  The makefile.gnu is primarily intended
16370         for end-users who don't want to debug the compiler.
16371
16372 2002-07-21  Martin Baulig  <martin@gnome.org>
16373
16374         * assign.cs: Improved the Assign class so it can now handle embedded
16375         assignments (X = Y = Z = something).  As a side-effect this'll now also
16376         consume less local variables.  test-38.cs now passes with MCS, added
16377         a few new test cases to that test.
16378
16379 2002-07-20  Martin Baulig  <martin@gnome.org>
16380
16381         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16382         instructions.  Fixes bug #27977, also added test-146.cs.
16383
16384 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16385
16386         * cs-tokenizer.cs: fixed getHex ().
16387
16388 2002-07-19  Martin Baulig  <martin@gnome.org>
16389
16390         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16391         not Type.GetType() to lookup the array type.  This is needed when
16392         we're constructing an array of a user-defined type.
16393         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16394         single-dimensional arrays, but also for single-dimensial arrays of
16395         type decimal.
16396
16397 2002-07-19  Martin Baulig  <martin@gnome.org>
16398
16399         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16400         this function is called, it's not allowed to share LocalBuilders
16401         among ILGenerators.
16402
16403 2002-07-19  Martin Baulig  <martin@gnome.org>
16404
16405         * expression.cs (Argument.Resolve): Report an error 118 when trying
16406         to pass a type as argument.
16407
16408 2002-07-18  Martin Baulig  <martin@gnome.org>
16409
16410         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16411         Conv_R_Un for the signed `long' type.
16412
16413 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16416         `expr' for the temporary result, as that will fail if we do
16417         multiple resolves on the same expression.
16418
16419 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16420
16421         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16422         ec.TypeContainer for looking up aliases. 
16423
16424         * class.cs (TypeContainer): Remove LookupAlias from here.
16425
16426         * decl.cs (DeclSpace); Move here.
16427
16428 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * class.cs (FindMembers): Only call filter if the constructor
16431         bulider is not null.
16432
16433         Also handle delegates in `NestedTypes' now.  Now we will perform
16434         type lookups using the standard resolution process.  This also
16435         fixes a bug.
16436
16437         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16438         This uses Expressions (the limited kind that can be parsed by the
16439         tree) instead of strings.
16440
16441         * expression.cs (ComposedCast.ToString): Implement, used to flag
16442         errors since now we have to render expressions.
16443
16444         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16445         FormArrayType. 
16446
16447         * ecore.cs (SimpleName.ToString): ditto.
16448
16449         * cs-parser.jay: Instead of using strings to assemble types, use
16450         Expressions to assemble the type (using SimpleName, ComposedCast,
16451         MemberAccess).  This should fix the type lookups in declarations,
16452         because we were using a different code path for this.
16453
16454         * statement.cs (Block.Resolve): Continue processing statements
16455         even when there is an error.
16456
16457 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16458
16459         * class.cs (Event.Define): Also remove the `remove' method from
16460         the list of pending items.
16461
16462         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16463         generate more compact code. 
16464
16465 2002-07-17  Martin Baulig  <martin@gnome.org>
16466
16467         * const.cs (Const.LookupConstantValue): Add support for constant
16468         `unchecked' and `checked' expressions.
16469         Also adding test case test-140.cs for this.
16470
16471 2002-07-17  Martin Baulig  <martin@gnome.org>
16472
16473         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16474         check whether mi.ReturnType implements the IEnumerator interface; the
16475         `==' and the IsAssignableFrom() will fail in this situation.
16476
16477 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16478
16479         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16480         here too.
16481
16482 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16483
16484         * expression.cs: fixed bug #27811.
16485
16486 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16489         Molaro: when we are a ref, the value already contains a pointer
16490         value, do not take the address of it.
16491
16492 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16493         * removed mb-parser.jay and mb-tokenizer.cs
16494
16495 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16496
16497         * expression.cs: check against the building corlib void type.
16498
16499 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16500
16501         * ecore.cs: fix for valuetype static readonly fields: when 
16502         initializing them, we need their address, not the address of a copy.
16503
16504 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16505
16506         * typemanager.cs: register also enum_type in corlib.
16507
16508 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16509
16510         * class.cs: allow calling this (but not base) initializers in structs.
16511
16512 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16513
16514         * ecore.cs: make sure we compare against the building base types
16515         in GetTypeSize ().
16516
16517 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16518
16519         * typemanager.cs: fix TypeToCoreType() to handle void and object
16520         (corlib gets no more typerefs after this change).
16521
16522 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * expression.cs (ArrayCreation.EmitArrayArguments): use
16525         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16526
16527         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16528         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16529         array indexes, the runtime actually forbids them.
16530
16531         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16532         for array arguments here.
16533
16534         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16535         instead of the default for ValueTypes.
16536
16537         (New.DoEmit): Use IsValueType instead of
16538         IsSubclassOf (value_type)
16539         (New.DoResolve): ditto.
16540         (Invocation.EmitCall): ditto.
16541
16542         * assign.cs (Assign): ditto.
16543
16544         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16545         Statements *are* currently doing part of their resolution during
16546         Emit.  
16547
16548         Expressions do always resolve during resolve, but statements are
16549         only required to propagate resolution to their children.
16550
16551 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16554
16555         (LoadAssembly): Do not add the dll if it is already specified
16556
16557         (MainDriver): Add the System directory to the link path at the end,
16558         after all the other -L arguments. 
16559
16560         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16561         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16562         ldelem.u1) and using the opposite for sbytes.
16563
16564         This fixes Digger, and we can finally run it.
16565
16566         * driver.cs (UnixParseOption): Move the option parsing here.  
16567         (CSCParseOption): Implement CSC-like parsing of options.
16568
16569         We now support both modes of operation, the old Unix way, and the
16570         new CSC-like way.  This should help those who wanted to make cross
16571         platform makefiles.
16572
16573         The only thing broken is that /r:, /reference: and /lib: are not
16574         implemented, because I want to make those have the same semantics
16575         as the CSC compiler has, and kill once and for all the confussion
16576         around this.   Will be doing this tomorrow.
16577
16578         * statement.cs (Unsafe.Resolve): The state is checked during
16579         resolve, not emit, so we have to set the flags for IsUnsfe here.
16580
16581 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16584         not catch the Error_ObjectRefRequired in SimpleName (as it is
16585         possible to have a class/instance variable name that later gets
16586         deambiguated), we have to check this here.      
16587
16588 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16589
16590         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16591         make static and put into Expression.
16592
16593         (Event.Define): Register the private field of the event with the 
16594         TypeManager so that GetFieldFromEvent can get at it.
16595
16596         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16597         keep track of the private field associated with an event which
16598         has no accessors.
16599
16600         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16601         private field.
16602
16603         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16604
16605 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * expression.cs (Binary.EmitBranchable): this routine emits the
16608         Binary expression in a branchable context.  This basically means:
16609         we need to branch somewhere, not just get the value on the stack.
16610
16611         This works together with Statement.EmitBoolExpression.
16612
16613         * statement.cs (Statement.EmitBoolExpression): Use
16614         EmitBranchable. 
16615
16616 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16617
16618         * statement.cs (For): Reduce the number of jumps in loops.
16619
16620         (For): Implement loop inversion for the For statement.
16621
16622         (Break): We can be breaking out of a Try/Catch controlled section
16623         (foreach might have an implicit try/catch clause), so we need to
16624         use Leave instead of Br.
16625
16626         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16627         now).  If the instace expression supports IMemoryLocation, we use
16628         the AddressOf method from the IMemoryLocation to extract the
16629         address instead of emitting the instance.
16630
16631         This showed up with `This', as we were emitting the instance
16632         always (Emit) instead of the Address of This.  Particularly
16633         interesting when This is a value type, as we dont want the Emit
16634         effect (which was to load the object).
16635
16636 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16639
16640         * statement.cs (Checked): Set the CheckedState during the resolve
16641         process too, as the ConvCast operations track the checked state on
16642         the resolve process, and not emit.
16643
16644         * cs-parser.jay (namespace_member_declaration): Flag that we have
16645         found a declaration when we do.  This is used to flag error 1529
16646
16647         * driver.cs: Report ok when we display the help only.
16648
16649 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16650
16651         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16652
16653 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16654
16655         * cs-tokenizer.cs (define): We also have to track locally the
16656         defines.  AllDefines is just used for the Conditional Attribute,
16657         but we also need the local defines for the current source code. 
16658
16659 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * statement.cs (While, For, Do): These loops can exit through a
16662         Break statement, use this information to tell whether the
16663         statement is the last piece of code.
16664
16665         (Break): Flag that we break.
16666
16667         * codegen.cs (EmitContexts): New `Breaks' state variable.
16668
16669 2002-07-03  Martin Baulig  <martin@gnome.org>
16670
16671         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16672         modifiers in method declarations in structs.  Otherwise, you won't
16673         be able to override things like Object.Equals().
16674
16675 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16676
16677         * class.cs (Method, Property, Indexer): Do not allow the public
16678         modifier to be used in explicit interface implementations.
16679
16680         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16681         override modifiers in method declarations in structs
16682
16683 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16684
16685         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16686         integer or real overflow, report an error
16687
16688 2002-07-02  Martin Baulig  <martin@gnome.org>
16689
16690         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16691         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16692         to tell the runtime about our newly created System.Object and
16693         System.ValueType types.
16694
16695 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16698         struct instead of Ldarg/Starg.
16699
16700 2002-07-02  Martin Baulig  <martin@gnome.org>
16701
16702         * expression.cs (Indirection.Indirection): Call
16703         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16704
16705 2002-07-02  Martin Baulig  <martin@gnome.org>
16706
16707         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16708         ValueType, call TypeManager.TypeToCoreType() on it.
16709         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16710         the OpCodes.Newarr argument.
16711
16712 2002-07-02  Martin Baulig  <martin@gnome.org>
16713
16714         * expression.cs (Invocation.EmitCall): When compiling corlib,
16715         replace all calls to the system's System.Array type to calls to
16716         the newly created one.
16717
16718         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16719         System.Array methods.
16720         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16721         from the system's System.Array type which must be replaced.
16722
16723 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16724
16725         * typemanager.cs: load unverifiable_code_ctor so we can build
16726         corlib using the correct type. Avoid using GetTypeCode() with
16727         TypeBuilders.
16728         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16729         TypeManager.object_type to allow building corlib.
16730
16731 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16732
16733         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16734
16735 2002-07-01  Martin Baulig  <martin@gnome.org>
16736
16737         * class.cs: Make the last change actually work, we need to check
16738         whether `ifaces != null' to avoid a crash.
16739
16740 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16741
16742         * class.cs: when we build structs without fields that implement
16743         interfaces, we need to add the interfaces separately, since there is
16744         no API to both set the size and add the interfaces at type creation
16745         time.
16746
16747 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16748
16749         * expression.cs: the dimension arguments to the array constructors
16750         need to be converted if they are a long.
16751
16752 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16753
16754         * class.cs: don't emit ldarg.0 if there is no parent constructor
16755         (fixes showstopper for corlib).
16756
16757 2002-06-29  Martin Baulig  <martin@gnome.org>
16758
16759         MCS now compiles corlib on GNU/Linux :-)
16760
16761         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16762         ie. check for MethodImplOptions.InternalCall.
16763
16764         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16765         and TypeManager.attribute_type are null, so we must explicitly check
16766         whether parent is not null to find out whether it's an attribute type.
16767         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16768         and SetBuilder, not only if the property is neither abstract nor external.
16769         This is necessary to set the MethodImplOptions on the accessor methods.
16770         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16771         SetBuilder, see Property.Emit().
16772
16773         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16774         populate "System.Object", "System.ValueType" and "System.Attribute" since
16775         they've already been populated from BootCorlib_PopulateCoreTypes().
16776
16777 2002-06-29  Martin Baulig  <martin@gnome.org>
16778
16779         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16780         is the NullLiteral, we also need to make sure that target_type is not
16781         an enum type.   
16782
16783 2002-06-29  Martin Baulig  <martin@gnome.org>
16784
16785         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16786         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16787         before calling BootstrapCorlib_ResolveDelegate ().
16788
16789 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16790
16791         * statement.cs: fixed build-breaker. All tests passed ok.
16792
16793 2002-06-27  Martin Baulig  <martin@gnome.org>
16794
16795         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16796         for System.Decimal when compiling corlib.
16797
16798 2002-06-27  Martin Baulig  <martin@gnome.org>
16799
16800         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16801         switch blocks which contain nothing but a default clause.
16802
16803 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16804
16805        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16806
16807 2002-06-27  Martin Baulig  <martin@gnome.org>
16808
16809         * ecore.cs (PropertyExpr.PropertyExpr): Call
16810         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16811
16812         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16813         is already a TypeBuilder.
16814
16815 2002-06-27  Martin Baulig  <martin@gnome.org>
16816
16817         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16818         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16819         the "from an array-type to System.Array" case.  This makes it work
16820         when compiling corlib.
16821
16822 2002-06-27  Martin Baulig  <martin@gnome.org>
16823
16824         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16825         non-static PropertyExpr, set its InstanceExpression.  This makes
16826         the `ICollection.Count' property work in System/Array.cs.
16827
16828 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16829
16830         * driver.cs: Made error handling more consistent.  Errors now
16831         tracked by Report class, so many methods which used to return int
16832         now return void.  Main() now prints success/failure and 
16833         errors/warnings message.
16834
16835         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16836         the magic number return values (123 and 124).  Now, if the
16837         expected error occurs, the compiler exits with success (exit value
16838         0).  If the compilation completes without seeing that particular
16839         error, the compiler exits with failure (exit value 1).  The
16840         makefile in mcs/errors has been changed to handle the new behaviour.
16841
16842         * report.cs: Made 'expected error' number a property and renamed
16843         it from 'Probe' to 'ExpectedError'.
16844
16845         * genericparser.cs: Removed error handling support, since it is
16846         now all done by Report class.
16847
16848         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16849         class, so parse() no longer returns an int.
16850
16851         * namespace.cs: Use Report.Error instead of GenericParser.error
16852
16853 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16854
16855         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16856         TypeContainer.AddOperator): At the front of the list put the
16857         explicit implementations, so they get resolved/defined first. 
16858
16859 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16860
16861         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16862         interface type is implemented by this TypeContainer.  Used during
16863         explicit interface implementation.
16864
16865         (Property.Define, Indexer.Define, Method.Define): Validate that
16866         the given interface in the explicit implementation is one of the
16867         base classes for the containing type.
16868
16869         Also if we are explicitly implementing an interface, but there is
16870         no match in the pending implementation table, report an error.
16871
16872         (Property.Define): Only define the property if we are
16873         not explicitly implementing a property from an interface.  Use the
16874         correct name also for those properties (the same CSC uses,
16875         although that is really not needed).
16876
16877         (Property.Emit): Do not emit attributes for explicitly implemented
16878         properties, as there is no TypeBuilder.
16879
16880         (Indexer.Emit): ditto.
16881
16882         Hiding then means that we do not really *implement* a pending
16883         implementation, which makes code fail.
16884
16885 2002-06-22  Martin Baulig  <martin@gnome.org>
16886
16887         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16888         the return value of Object.GetType().  [FIXME: we need to do this whenever
16889         we get a type back from the reflection library].
16890
16891 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16892
16893         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16894
16895 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16896
16897         * attribute.cs: Return null if we can not look up the type.
16898
16899         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16900         the interface types found.
16901
16902         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16903         interface types found.
16904
16905         * typemanager.cs (GetInterfaces): Make this routine returns alll
16906         the interfaces and work around the lame differences between
16907         System.Type and System.Reflection.Emit.TypeBuilder in the results
16908         result for GetInterfaces.
16909
16910         (ExpandInterfaces): Given an array of interface types, expand and
16911         eliminate repeated ocurrences of an interface.  This expands in
16912         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16913         be IA, IB, IC.
16914
16915 2002-06-21  Martin Baulig  <martin@gnome.org>
16916
16917         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16918         on System.Enum.
16919
16920 2002-06-21  Martin Baulig  <martin@gnome.org>
16921
16922         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16923         and called with one of the core types, return the corresponding typebuilder for
16924         that type.
16925
16926         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16927         element type.
16928
16929 2002-06-21  Martin Baulig  <martin@gnome.org>
16930
16931         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16932         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16933         (Expression.ConvertReferenceExplicit): Likewise.
16934
16935         * expression.cs (ElementAccess.DoResolve): Likewise.
16936         (ElementAccess.DoResolveLValue): Likewise.
16937
16938 2002-06-10  Martin Baulig  <martin@gnome.org>
16939
16940         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16941         add the "value" parameter to the parameter list.
16942
16943         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16944         to our caller.
16945
16946 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16947
16948         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16949         the argument to an int, uint, long or ulong, per the spec.  Also
16950         catch negative constants in array creation.
16951
16952 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16953
16954         * class.cs: do not allow the same interface to appear twice in
16955         the definition list.
16956
16957 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16958
16959         * ecore.cs: don't use ldlen with System.Array.
16960
16961 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16962
16963         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16964
16965 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16966
16967         * modifiers.cs: produce correct field attributes for protected
16968         internal. Easy fix so miguel can work on ther harder stuff:-)
16969
16970 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * pending.cs: New file.  Move the code from class.cs here.
16973         Support clearning the pending flag for all methods (when not doing
16974         explicit interface implementation).
16975
16976 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16977
16978         * rootcontext.cs: added a couple more types needed to bootstrap.
16979
16980 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16981
16982         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16983         constructor in the type, instead of any constructor in the type
16984         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16985         a bug in the Mono runtime when applying the params attribute). 
16986
16987 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16988         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16989
16990 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16991
16992         * expression.cs (Unary.ResolveOperator): Use TypeManager
16993         to resolve the type.
16994
16995 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16996
16997         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16998         attached.
16999
17000         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17001         with each member too.
17002
17003         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17004         field builders too - this takes care of the enum member case.
17005
17006 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17007
17008         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17009         address-of operator on both value types and pointers.
17010
17011 2002-06-10  Martin Baulig  <martin@gnome.org>
17012
17013         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17014         PropertyBuilder to the `property_builders' list.
17015
17016         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17017         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17018         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17019         find any indexers which are inherited from an interface.
17020
17021 2002-06-09  Martin Baulig  <martin@gnome.org>
17022
17023         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17024         the same type as the constant if necessary.  There's also a test-130.cs
17025         for this.
17026
17027         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17028
17029         * typemanager.cs (TypeManager.ChangeType): Previously known as
17030         Enum.ChangeEnumType().
17031
17032 2002-06-09  Martin Baulig  <martin@gnome.org>
17033
17034         * expression.cs (Cast.TryReduce): Added support for consts.
17035
17036 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17037
17038         * class.cs (Accessor): Hold attributes information so we can pass
17039         it along.
17040
17041         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17042         Modify to pass in attributes attached to the methods.
17043
17044         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17045
17046         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17047         to handle the Accessor kind :-)
17048
17049         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17050
17051 2002-06-08  Martin Baulig  <martin@gnome.org>
17052
17053         * expression.cs (Unary.TryReduceNegative): Added support for
17054         ULongConstants.
17055
17056 2002-06-08  Martin Baulig  <martin@gnome.org>
17057
17058         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17059         name can't be found in the `defined_names' - the caller will do a
17060         MemberLookup in this case and thus find methods in System.Enum
17061         such as Enum.IsDefined().
17062
17063 2002-06-08  Martin Baulig  <martin@gnome.org>
17064
17065         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17066         Convert.ChangeType() which works with TypeBuilder created types.
17067         (Enum.LookupEnumValue, Enum.Define): Use it here.
17068
17069         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17070         `TypeBuilder.BaseType != null' check.
17071         (TypeContainer.FindMembers): Only lookup parent members if we
17072         actually have a parent.
17073         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17074         (ConstructorInitializer.Resolve): Likewise.
17075
17076         * interface.cs (Interface.FindMembers): Added
17077         `TypeBuilder.BaseType != null' check.
17078
17079         * rootcontext.cs (RootContext.ResolveCore): Added
17080         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17081         classes_second_stage.
17082
17083         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17084         debug_type and trace_type when compiling with --nostdlib.       
17085
17086 2002-06-07  Martin Baulig  <martin@gnome.org>
17087
17088         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17089         (AddField): Set it to true when adding a non-static field.
17090         (DefineType): Use `have_nonstatic_fields' to find out whether we
17091         have non-static fields, not `Fields != null'.
17092
17093 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17096         dereferencing a null on the static-field code path)
17097
17098 2002-05-30  Martin Baulig  <martin@gnome.org>
17099
17100         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17101         to take command line arguments.  Use reflection to call the new
17102         custom `Initialize' function on the symbol writer and pass it the
17103         command line arguments.
17104
17105         * driver.cs (--debug-args): New command line argument to pass command
17106         line arguments to the symbol writer.
17107
17108 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17109
17110         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17111         the target type for indexers and properties.  Thanks to Joe for
17112         catching this.
17113
17114 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17115
17116         * typemanager.cs (MethodFlags): returns the method flags
17117         (Obsolete/ShouldIgnore) that control warning emission and whether
17118         the invocation should be made, or ignored. 
17119
17120         * expression.cs (Invocation.Emit): Remove previous hack, we should
17121         not do this on matching a base type, we should do this based on an attribute
17122
17123         Only emit calls to System.Diagnostics.Debug and
17124         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17125         on the command line.
17126
17127         * rootcontext.cs: Global settings for tracing and debugging.
17128
17129         * cs-tokenizer.cs (define): New utility function to track
17130         defines.   Set the global settings for TRACE and DEBUG if found.
17131
17132 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17133
17134         * interface.cs (Populate*): Pass in the TypeContainer as well as
17135         the DeclSpace as parameters so that we can create EmitContexts and
17136         then use that to apply attributes etc.
17137
17138         (PopulateMethod, PopulateEvent, PopulateProperty)
17139         (PopulateIndexer): Apply attributes everywhere.
17140
17141         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17142         etc.
17143
17144         (ApplyAttributes): Update accordingly.
17145
17146         We now apply interface attributes for all members too.
17147
17148 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * class.cs (Indexer.Define); Correctly check if we are explicit
17151         implementation (instead of checking the Name for a ".", we
17152         directly look up if the InterfaceType was specified).
17153
17154         Delay the creation of the PropertyBuilder.
17155
17156         Only create the PropertyBuilder if we are not an explicit
17157         interface implementation.   This means that explicit interface
17158         implementation members do not participate in regular function
17159         lookups, and hence fixes another major ambiguity problem in
17160         overload resolution (that was the visible effect).
17161
17162         (DefineMethod): Return whether we are doing an interface
17163         implementation. 
17164
17165         * typemanager.cs: Temporary hack until we get attributes in
17166         interfaces (Ravi is working on that) and we get IndexerName
17167         support in interfaces.
17168
17169         * interface.cs: Register the indexers as properties.
17170
17171         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17172         warning, I have verified that this is a bug in the .NET runtime
17173         (JavaScript suffers of the same problem).
17174
17175         * typemanager.cs (MemberLookup): When looking up members for
17176         interfaces, the parent of an interface is the implicit
17177         System.Object (so we succeed in searches of Object methods in an
17178         interface method invocation.  Example:  IEnumerable x;  x.ToString
17179         ()) 
17180
17181 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * class.cs (Event): Events should also register if they do
17184         implement the methods that an interface requires.
17185
17186         * typemanager.cs (MemberLookup); use the new GetInterfaces
17187         method. 
17188
17189         (GetInterfaces): The code used to lookup interfaces for a type is
17190         used in more than one place, factor it here. 
17191
17192         * driver.cs: Track the errors at the bottom of the file, we kept
17193         on going.
17194
17195         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17196         instance if the method we are calling is static!
17197
17198 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17199
17200         * attribute.cs (ApplyAttributes): Make this function filter out
17201         the IndexerName attribute (as that attribute in reality is never
17202         applied) and return the string constant for the IndexerName
17203         attribute. 
17204
17205         * class.cs (TypeContainer.Emit): Validate that all the indexers
17206         have the same IndexerName attribute, and if so, set the
17207         DefaultName attribute on the class. 
17208
17209         * typemanager.cs: The return value might contain other stuff (not
17210         only methods).  For instance, consider a method with an "Item"
17211         property and an Item method.
17212
17213         * class.cs: If there is a problem with the parameter types,
17214         return. 
17215
17216 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17217
17218         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17219         looks at user defined conversion after making a call to 
17220         StandardConversionExists - we need this for overload resolution.
17221
17222         * expression.cs : Update accordingly the various method calls.
17223
17224         This fixes 2 bugs filed against implicit user defined conversions 
17225
17226 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17227
17228         * statement.cs: Track the result of the assignment.
17229
17230 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * expression.cs (MemberAccess): Improved error reporting for
17233         inaccessible members.
17234
17235 2002-05-22  Martin Baulig  <martin@gnome.org>
17236
17237         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17238         itself with debugging support.
17239
17240 2002-05-22  Martin Baulig  <martin@gnome.org>
17241
17242         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17243         Removed, this isn't needed anymore.
17244
17245 2002-05-20  Martin Baulig  <martin@gnome.org>
17246
17247         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17248         be underlying type for an enum.
17249
17250 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17251
17252         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17253         that splits out the loading of just the core types.
17254
17255         * rootcontext.cs (ResolveCore): Split the struct resolution in
17256         two, so we can load the enumeration underlying types before any
17257         enums are used.
17258
17259         * expression.cs (Is): Bandaid until we fix properly Switch (see
17260         bug #24985 for details).
17261
17262         * typemanager.cs (ImplementsInterface): The hashtable will contain
17263         a null if there are no interfaces implemented.
17264
17265 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17266
17267         * cs-parser.jay (indexer_declarator): It is fine to have array
17268         parameters
17269
17270 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * typemanager.cs: (RegisterBuilder): New function used to register
17273         TypeBuilders that implement interfaces.  Since
17274         TypeBuilder.GetInterfaces (as usual) does not work with lame
17275         Reflection.Emit. 
17276         (AddUserType): register interfaces.
17277
17278         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17279         dealing with TypeBuilder.  Also, arrays are showing up as
17280         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17281         methods can not be invoked on them!
17282
17283         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17284         (ImplicitReferenceConversionExists): Split out from
17285         StandardConversionExists. 
17286
17287         * expression.cs (As): We were only implementing one of the three
17288         cases for the as operator.  We now implement them all.
17289         (Is): Implement the various other cases for Is as well.
17290
17291         * typemanager.cs (CACHE): New define used to control if we want or
17292         not the FindMembers cache.  Seems to have a negative impact on
17293         performance currently
17294
17295         (MemberLookup): Nested types have full acess to
17296         enclosing type members
17297
17298         Remove code that coped with instance/static returns for events, we
17299         now catch this in RealFindMembers.
17300
17301         (RealFindMembers): only perform static lookup if the instance
17302         lookup did not return a type or an event.  
17303
17304 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17305
17306         * assign.cs (CompoundAssign): We pass more semantic information
17307         now to Compound Assignments than we did before: now we have all
17308         the information at hand, and now we resolve the target *before* we
17309         do the expression expansion, which allows the "CacheValue" method
17310         to have the effect we intended (before, a [x] += 1 would generate
17311         two differen ArrayAccess expressions from the ElementAccess,
17312         during the resolution process).
17313
17314         (CompoundAssign.DoResolve): Resolve target and original_source here.
17315
17316 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17317
17318         * expression.cs (ArrayAccess): dropped debugging information. 
17319
17320         * typemanager.cs: Small bug fix: I was always returning i_members,
17321         instead of one of i_members or s_members (depending on which had
17322         the content).
17323
17324         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17325         method is invoked before any code generation takes place, and it
17326         is a mechanism to inform that the expression will be invoked more
17327         than once, and that the method should use temporary values to
17328         avoid having side effects
17329
17330         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17331
17332         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17333         implementation.
17334
17335         * expression.cs (Indirection, ArrayAccess): Add support for
17336         CacheTemporaries in these two bad boys. 
17337
17338         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17339         ldobj or ldind_ref.  
17340         (StoreFromPtr): Handle stobj as well.
17341
17342         * expression.cs (UnaryMutator): Share more code.
17343
17344         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17345         down: I was not tracking the Filter function as well, which
17346         was affecting the results of the cache.
17347
17348 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * attribute.cs: Remove the hack to handle the CharSet property on
17351         StructLayouts. 
17352
17353 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17354
17355         * attribute.cs (DoResolve): More uglyness, we now only try to
17356         resolve the attribute partially, to extract the CharSet
17357         information (only if we are a StructLayout attribute).  Otherwise 
17358
17359         (GetExtraTypeInfo): Add some code to conditionally kill in the
17360         future this.   I am more and more convinced that the .NET
17361         framework has special code to handle the attribute setting on
17362         certain elements.
17363
17364         * expression.cs (IsParamsMethodApplicable): Revert my previous
17365         foreach change here, it was wrong.
17366
17367 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17370         (pp_expr): do not abort on unknown input, just return.
17371         (eval): abort if there are pending chars.
17372
17373         * attribute.cs (Attribute.Resolve): Positional parameters are
17374         optional.  Deal with that case.
17375
17376         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17377         the Ansi/Unicode/Auto information for the type.
17378
17379         (TypeContainer.DefineType): instantiate the EmitContext here, as
17380         we will be using it during the type definition (to resolve
17381         attributes) and during the emit phase.
17382
17383         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17384         to pull type information out of the attributes
17385
17386         (Attribute.Resolve): track the constructor builder, and allow for
17387         multiple invocations (structs and classes will use this).
17388
17389         * ecore.cs (MemberLookupFinal): new version with all the
17390         parameters customizable.
17391
17392         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17393         constructors.  Return if the result value is null (as the error
17394         would have been flagged already by MemberLookupFinal)
17395
17396         Do not allow instances of abstract classes or interfaces to be
17397         created.
17398
17399         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17400         We have to compare the assembly property here when dealing with
17401         FamANDAssem and Assembly access modifiers, because we might be
17402         creating an assembly from *modules* (that means that we are not
17403         getting TypeBuilders for types defined in other modules that are
17404         part of this assembly).
17405
17406         (Method.Emit): If the method is marked abstract and has a body,
17407         emit an error. 
17408
17409         (TypeContainer.DefineMembers): If both the defined member and the
17410         parent name match are methods, then do not emit any warnings: let
17411         the Method.Define routine take care of flagging warnings.  But if
17412         there is a mismatch (method overrides something else, or method is
17413         overriwritten by something, then emit warning).
17414
17415         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17416         set to null, this means `do not check for the return type on the
17417         signature'. 
17418
17419         (Method.Define): set the return type for the method signature to
17420         null, so that we get methods with the same name and parameters and
17421         different return types.  This is used to flag warning 114 (you are
17422         hiding a method, and you probably want to use the new/override
17423         keywords instead).
17424
17425         * typemanager.cs (MemberLookup): Implemented proper access
17426         control, closing a long standing set of bug reports.  The problem
17427         was that the Framework only has two bits: Public and NonPublic,
17428         and NonPublic includes private and protected methods, but we need
17429         to enforce the FamANDAssem, FamOrAssem and Family. 
17430
17431 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17432
17433         * statement.cs (GotoCase): Return true: Ammounts to giving up
17434         knowledge on whether we return or not, and letting the other case
17435         be responsible for it.
17436
17437 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17438
17439         * driver.cs: Do not load directories for each file processed, only
17440         do it if there is a pattern.
17441
17442         * ecore.cs: Report readonly assigns here as well, as we might have
17443         been resolved only by MemberAccess.
17444
17445         (SimpleName.SimpleNameResolve): Also be useful for LValue
17446         resolution.   We need this to propagate assign to local readonly variables
17447
17448         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17449         do not want to reuse potential criteria memory.
17450
17451         * class.cs (MyEventBuilder): Set reflected_type;
17452
17453         * ecore.cs (Constantify): Added support for constifying bools.
17454
17455         (RootContext.LookupType): Added a cache for values looked up in
17456         the declaration space.
17457
17458         * typemanager.cs (FindMembers): Now is a front-end to
17459         RealFindMembers, and provides a two-level hashtable-based cache to
17460         the request.  
17461
17462         15% performance improvement: from 22.5 to 19.2 seconds.
17463
17464         * expression.cs (IsParamsMethodApplicable): use foreach.
17465         (Invocation.DoResolve): ditto.
17466         (New.DoResolve): ditto.
17467         (ArrayCreation.DoResolve): ditto.
17468
17469         * ecore.cs (FindMostEncompassingType): use foreach.
17470
17471         * delegate.cs (NewDelegate.DoResolve): Use foreach
17472
17473         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17474         (RemoveMethods): use foreach.
17475
17476         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17477         nested foreach statements instead of for, and also break out of
17478         the inner loop once a match is found.
17479
17480         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17481
17482 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17483
17484         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17485         we actually unwrap the expression to allow for extra information
17486         to be extracted. 
17487
17488         * expression.cs: Use Shr_Un on unsigned operations. 
17489
17490 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17491
17492         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17493         applicable operators was not being considered correctly. This closes
17494         the bug Miguel reported.
17495
17496 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17497
17498         * attribute.cs: check that the type derives from System.Attribute
17499         and report the correct error in that case (moved the duplicate code to
17500         its own method, too).
17501
17502 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17503
17504         * attribute.cs: lookup attribute type name as the spec says: first the
17505         bare attribute name and then name + "Attribute" (nant compiles with
17506         mcs after this fix).
17507
17508 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17509
17510         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17511         Because of the way we parse things, we should try to see if a
17512         UIntConstant can fit in an integer.
17513
17514 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17515
17516         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17517         when we are in an explicit context.
17518
17519         (ConvertReferenceExplicit): When converting from Iface type S to Class
17520         T make sure the rules are implemented as an OR.
17521
17522         * parameter.cs (ParameterType): Make it a property for now although the
17523         purpose really isn't anything immediate.
17524
17525         * expression.cs (Is*Applicable): Do better checking on the parameter type
17526         of a ref/out parameter. The ones from the system assemblies are already 
17527         marked with the correct type so we don't need to do any correction.
17528
17529         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17530         the object type is standard too so include that.
17531
17532 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * ecore.cs (StandardConversionExists): Augment with missing code:
17535         deal with IntConstant, LongConstants and Enumerations.
17536
17537         * assign.cs: Report the error, instead of failing silently
17538
17539         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17540         typecontainer that they are declared, because the
17541         typecontainer/namespace will have the list of using clauses that
17542         need to be applied.
17543
17544         Assembly Attributes were escaping the normal registration
17545         mechanism. 
17546
17547         (EmitCode): Apply attributes within an EmitContext that represents
17548         the container they were declared on.
17549
17550         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17551
17552 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17553
17554         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17555         Revamp completely - make much cleaner as we now operate only
17556         on a set of Types.
17557
17558         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17559         to implement the logic detailed in the spec more correctly.
17560
17561         (UserDefinedConversion): Update accordingly.
17562
17563 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17564
17565         * statement.cs: Return flow analysis information up.
17566
17567         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17568         and the default.
17569
17570         (token): Do not consume an extra character before calling
17571         decimal_digits.
17572
17573 2002-05-06  Piers Haken <piersh@friskit.com>
17574
17575         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17576
17577 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17578
17579         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17580         EmitContext during the instance constructor initializer
17581         resolution, to stop access to instance variables.
17582
17583         This is mandated by the spec, last paragraph of the `constructor
17584         initializers' section. 
17585
17586 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17587
17588         * cs-parser.jay, class.cs (Accessor): new class used to represent
17589         an accessor (get or set).  In the past we used `null' to represent
17590         a missing accessor.  But this is ambiguous because there was no
17591         way to tell in abstract indexers/properties if one of them was
17592         specified.
17593
17594         Now there is a way of addressing that.
17595
17596         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17597         instead of FindMembers.
17598
17599         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17600         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17601
17602         * attribute.cs: Treat indexers and properties as the same in terms
17603         of applying attributes
17604
17605         * ecore.cs (FindMostEncompassedType): Use statically initialized
17606         EmptyExpressions()s like we do elsewhere to avoid creating useless
17607         objects (and we take this out of the tight loop).
17608
17609         (GetConversionOperators): Move the code to extract the actual
17610         operators to a separate routine to clean things up.
17611
17612 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17615         events are always registered FieldBuilders.
17616
17617         * class.cs (FieldBase): New class shared by Fields 
17618
17619         * delegate.cs: If we are a toplevel delegate, use our full name.
17620         If we are a nested delegate, then only use our tail name.
17621
17622 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17623
17624         * expression.cs (IsApplicable): Ensure that we add the "&" to
17625         ref/out types before comparing it with the type of the argument.
17626
17627         (IsParamsMethodApplicable): Ditto.
17628
17629         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17630         silly me ;-)
17631
17632         * delegate.cs : Handle the case when we have more than one applicable
17633         method. Flag an error only when we finish checking all.
17634
17635 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17636
17637         * expression.cs: Add support for boolean static initializers.
17638
17639 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17642
17643         * parameter.cs (ComputeParameterTypes,
17644         ComputeAndDefineParameterTypes): Better error handling: now we
17645         clear the `types' cache if we fail during any of the type lookups.
17646         We also return the status code correctly to our caller
17647
17648         * delegate.cs: If we fail to define a delegate, abort the extra
17649         steps. 
17650
17651         * expression.cs (Binary.ResolveOperator): for
17652         operator==(object,object) and operator !=(object, object) we also
17653         have to verify that there is an implicit conversion from one to
17654         the other.
17655
17656         (ArrayAccess.DoResolve): Array Access can operate on
17657         non-variables. 
17658
17659 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17660
17661         * assign.cs (CompoundAssign): A new class used as a "flag" that
17662         the assignment actually is happening as part of a compound
17663         assignment operator.
17664
17665         During compound assignment, a few new rules exist to enable things
17666         like:
17667
17668         byte b |= 1 + 2
17669
17670         From the spec:
17671
17672         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17673         to the type of x) if y is implicitly convertible to the type of x,
17674         and the operator is a builtin operator and the return type of the
17675         operator is explicitly convertible to the type of x. 
17676
17677         * rootcontext.cs: Reset warning level to 2.  4 catches various
17678         "interesting" features in mcs, we must clean this up at some
17679         point, but currently am trying to kill other bugs ;-)
17680
17681         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17682         in container classes as well.  
17683
17684         * expression.cs (Binary.ResolveOperator): Handle string case
17685         before anything else (as operator overloading does emit an error
17686         before doing anything else).
17687
17688         This code could go away when we move to a table driven model, but
17689         i could not come up with a good plan last night.
17690
17691 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17692
17693         * typemanager.cs (CSharpName): reimplementation using regex.
17694         * class.cs: added null check for fields in Emit
17695         * rootcontext.cs: set warninglevel to 4
17696
17697 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * typemanager.cs (CSharpName): reimplemented with Lupus
17700         suggestion.
17701
17702 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * statement.cs (If): correclty implement Resolve, because we were
17705         not catching sem errors in there.  The same process is needed
17706         everywhere else. 
17707         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17708
17709
17710         (Statement.Warning_DeadCodeFound): Factorize code.
17711         (While): Report dead code here too.
17712
17713         (Statement): Added Resolve virtual method to allow
17714         for resolution split from the emit code.
17715
17716 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17717
17718         * statement.cs (EmitBoolExpression): No longer try to resolve the
17719         expression here.    
17720         (MakeBoolean): New utility function that resolve, implicitly
17721         converts to boolean and tags the expression. 
17722
17723
17724         (If, Do): Implement dead code elimination.
17725         (While): Implement loop inversion
17726
17727         (Do, While, For, If): Resolve the expression prior to calling our
17728         code generation.
17729
17730 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17731
17732         * class.cs:
17733           - added method Report28 (warning: program has more than one entry point)
17734           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17735           - modified method Method.Define, the part at the end of the method
17736
17737         * rootcontext.cs: added static public Location EntryPointLocation;
17738           
17739         * ../errors/cs0028.cs : Add test case for the above warning.              
17740
17741         * typemanager.cs:
17742           - modified method CSharpName to allow arrays of primitive type to
17743             be printed nicely (e.g. instead of System.Int32[][] it now prints
17744             int[][])
17745           - added method CSharpSignature: returns the signature of a method
17746             in string format to be used in reporting errors, warnings, etc.
17747
17748         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17749         with String.Empty.
17750
17751 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17752
17753         * delegate.cs (Define): Fix extremely silly bug where I was
17754         setting the type of the 'object' parameter of the BeginInvoke
17755         method to System.IAsyncResult instead of System.Object ;-)
17756
17757 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17758
17759         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17760         here. 
17761
17762         (Constructor.Emit): return if we fail to initialize the
17763         constructor.  Another door closed!  
17764
17765         * expression.cs (New.DoResolve): Improve error message (from -6 to
17766         1501).  Use DeclaredOnly lookup to find the exact constructor.
17767
17768         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17769         loop.  This is useful.
17770
17771         * cs-parser.jay: Adjust the default parameters so that destructors
17772         have the proper signature.
17773
17774 2002-04-26  Martin Baulig  <martin@gnome.org>
17775
17776         * driver.cs (LoadAssembly): If `assembly' contains any characters
17777         which are only valid in path names and not in assembly names
17778         (currently slash, backslash and point), use Assembly.LoadFrom ()
17779         instead of Assembly.Load () on the `assembly' (before iteration
17780         over the link_paths).
17781
17782 2002-04-26  Martin Baulig  <martin@gnome.org>
17783
17784         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17785
17786 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17787
17788         * class.cs (Property): use the new typemanager.MemberLookup
17789
17790         (TypeContainer.MemberLookup): Implement using the
17791         TypeManager.MemberLookup now. 
17792
17793         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17794         and return MemberInfos, so that these can be used without an
17795         EmitContext (what we had before).
17796
17797 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17798
17799         * expression.cs: Fix the case where the argument to params if the
17800         type of the params.  I omitted handling this before.   Fixed
17801
17802 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * driver.cs: Call BootCorlib_PopulateCoreType
17805
17806         * class.cs (Property.CheckBase): Check for properties only, not
17807         for all members. 
17808
17809         * interface.cs: Temporary hack: try/catch around the
17810         CustomAttributeBuilder, because I am getting an exception that I
17811         do not understand.
17812
17813         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17814         types whose definitions are required to be there (attributes are
17815         defined before standard types).
17816
17817         Compute definitions as we boot the various types, as they are used
17818         immediately (value_type class will need object_type, but if we do
17819         not initialize object_type, we will pass a null, which will let
17820         the runtime pick the System.Object from the existing corlib, which
17821         is not what we want).
17822
17823 2002-04-22  Patrik Torstensson <totte@labs2.com>
17824
17825         * cs-tokenizer.cs: fixed a number of trim() issues.
17826
17827 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17828
17829         * expression.cs (Argument.Type): Ensure that we return the correct
17830         type when we have out or ref parameters [in which case we 
17831         append a "&"].
17832
17833 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17834
17835         * class.cs (Property, Indexer): Allow extern modifier in there. 
17836
17837         * typemanager.cs (InitBaseTypes): Initializes object_type and
17838         value_type, since those will be used early on during the bootstrap
17839         process to compile corlib.
17840
17841         (InitCoreTypes): Move code from here to InitBaseTypes.
17842
17843 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17844
17845         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17846         single-dimension arrays as using the ldlen opcode.  
17847
17848         Daniel Lewis discovered this optimization.  
17849
17850         * typemanager.cs: Add signature for System.Array::get_Length
17851
17852 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17853
17854         * statement.cs: report the error when the foreach does not apply to an
17855         array nor a collection.
17856
17857 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17858
17859         * expression.cs: Add implicit conversions to the operator ~.
17860
17861         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17862
17863         * typemanager.cs: Locate the decimal constructor.
17864
17865 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17866
17867         * attribute.cs: use the new property of TypeOf.
17868         * expression.cs: added 'get' property around typearg.
17869
17870         These changes fix a build breaker reported by NickD. Is this the
17871         correct way to fix?  If not, please, revert my changes and make it
17872         work :-).
17873
17874 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * attribute.cs: Add support for typeof in attribute invocations.
17877         I am not sure that this is right though.
17878
17879 2002-04-14  Duncan Mak  <duncan@ximian.com>
17880
17881         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17882         Binary.Operator.Division case.
17883
17884 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17885
17886         * class.cs (DefineType): Ensure that we do a proper check on
17887         attribute types and also register it with the TypeManager.
17888
17889         (TypeContainer.Targets): The default for attribute types is
17890         AttributeTargets.All.
17891
17892         * attribute.cs (ApplyAttributes): Registering the attribute type
17893         is done elsewhere, not when we discover we have a Usage attribute.
17894
17895 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17896
17897         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17898         and get rid of is_delegate parameter.
17899
17900         * everywhere : update.
17901
17902 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17903
17904         * cs-parser.jay (compilation_unit): Revamp completely to use
17905         some new ideas that I got from Rhys' grammar to solve the problems
17906         with assembly level attributes.
17907
17908         (outer_declaration): New grammar production.
17909
17910         (attribute_sections): Add.
17911
17912         (opt_attributes): Base on attribute_sections
17913
17914         (namespace_declaration): Allow opt_attributes to tackle the case
17915         when we have assembly level attributes - we are clever in this
17916         regard now ;-)
17917
17918         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17919         attributes in the non-global context.
17920
17921         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17922         instead of SetGlobalAttributes.
17923
17924         * class.cs, rootcontext.cs : Ensure we define and generate 
17925         attribute types before anything else.
17926
17927         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17928         and flag the new error -20 for the case when the attribute type
17929         does not have valid targets specified. csc does not catch this.
17930
17931         * ../errors/errors.txt : update for error # -20
17932
17933 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17934
17935         * support.cs (InternalParameters.ParameterModifier): Do some null
17936         checking and return sane values.
17937
17938         * class.cs (Method.Define): If we are a PInvoke method, ensure
17939         that we are static and extern. Report error # 601
17940
17941         * ../errors/cs0601.cs : Add test case for the above error.
17942
17943 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17944
17945         * rootcontext.cs (attribute_types): We need to keep type of
17946         all attribute types separately and emit code for them first.
17947
17948         (RegisterAttribute) : Implement.
17949
17950         * class.cs (DefineType): Check if the current Type is a custom
17951         attribute type and register it accordingly.
17952
17953         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17954         adding the first attribute twice and rename to
17955
17956         (SetGlobalAttributes): this.
17957
17958         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17959         lookups.
17960
17961         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17962         if we are processing global arguments. Hmm, I am unsure of this.
17963
17964 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17965
17966         * expression.cs: added static array of strings to avoid calling
17967         Enum.ToString () for Operator in Binary. Significant recover of
17968         performance.
17969
17970 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17971
17972         * class.cs (FindMembers): Allow the Builders of the various
17973         members to be null.  If they are skip them.  This only happens
17974         during the PInvoke declaration.
17975
17976 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17979         failure, so we do not keep going afterwards.
17980
17981         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17982         wanted to pass `false' as the `is_delegate' argument.  If this is
17983         the case, why not use delegate_type == null to mean `is_delegate =
17984         false' and anything else as is_delegate = true.
17985
17986 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17987
17988         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17989         code for the section, not the beginning of the tests.
17990
17991 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17992
17993         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17994
17995         * expression.cs (Binary): same.  Warn about errors where we have
17996         Enum/Enum in operator + as well.
17997
17998 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17999
18000         * statement.cs:
18001                 - added support for switch(bool)
18002                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18003                 - add TableSwitchEmit() to handle table-based switch statements
18004
18005 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18006
18007         * expression.cs (Invocation.OverloadResolve): Factor out code which
18008         does parameter compatibility checking with arguments so that we can 
18009         re-use the code even from Delegate.VerifyApplicability
18010
18011         (VerifyArgumentsCompat): Move above code here.
18012
18013         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18014         and instead make a call to the above method.
18015
18016 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18017
18018         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18019         We use it to keep track of classes which are attribute types.
18020
18021 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * delegate.cs (Delegate.Define): Correctly define the types in the
18024         presence of fixed and array parameters.
18025
18026         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18027         doing FindMembers.
18028
18029         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18030         include NonPublic after the first iteration.
18031
18032         * class.cs (Indexer.CheckBase): Only check if both parents are
18033         non-null. 
18034
18035         * cs-parser.jay (accessor_body): If empty, set to null.
18036
18037         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18038         same code path here to resolve constants names that we did have in
18039         MemberAccess.DoResolve.  There is too much code duplicated here.
18040
18041 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18042
18043         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18044
18045         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18046         to MakeUnionSet.
18047
18048         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18049         tokens, numbers and strings.
18050
18051         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18052         parenthesis.
18053
18054         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18055         asyncronous parameters and the regular parameters.  
18056
18057         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18058         specify the target directory.
18059
18060         * expression.cs: (This.DoResolve): Simplify
18061         (As.Emit): Optimize, do not generate IsInst if the expression is
18062         always of the given type.
18063
18064         (Is.DoResolve): Bug fix, we were reporting both always/never for
18065         the is expression.
18066
18067         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18068         creating too many unnecessary arrays.
18069
18070 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18073         fields instead of rolling our own initializer.   Takes care of all
18074         implicit conversions, and drops unnecessary static checks/argument.
18075
18076 2002-03-31  Dick Porter  <dick@ximian.com>
18077
18078         * driver.cs: use the GetDirectories() return values properly, and
18079         use "/" as path separator.
18080
18081 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18082
18083         * expression.cs (Unary): Optimize - - expr into expr.
18084         (Binary): Optimize a + (-b) into a -b.
18085
18086         * codegen.cs (CodeGen): Made all methods static.
18087
18088 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * rootcontext.cs: 
18091
18092         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18093         TypeBuilder property.
18094
18095         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18096         instead. 
18097
18098         * tree.cs: Removed the various RecordXXXX, and replaced with a
18099         single RecordDecl.  Removed all the accessor methods, and just
18100         left a single access point Type 
18101
18102         * enum.cs: Rename DefineEnum to DefineType.
18103
18104         * decl.cs: New abstract method `DefineType' used to unify the
18105         Defines for Enumerations, Interfaces, TypeContainers and
18106         Delegates.
18107
18108         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18109         LookupBaseClasses method that used to live in class.cs and
18110         interface.cs here, and renamed to FindType.
18111
18112         * delegate.cs: Implement DefineType.  Take advantage of the
18113         refactored pattern for locating the parent builder without taking
18114         the parent_builder argument (which we know does not work if we are
18115         nested, and triggering a toplevel definition).
18116
18117 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18118
18119         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18120         accessibility of a member has changed during override and report
18121         an error if so.
18122
18123         * class.cs (Method.Define, Property.Define): Only complain on
18124         overrides if the method is private, any other accessibility is
18125         fine (and since we just checked the permission is the same, we are
18126         good to go).
18127
18128         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18129         and elif are processed always.  The other pre-processing
18130         directives are only processed if we are "taking" the path
18131
18132 2002-03-29  Martin Baulig  <martin@gnome.org>
18133
18134         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18135         current location is not Null.
18136
18137         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18138         a separate method so we can profile it.
18139
18140         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18141         `span.Seconds' are just seconds, but no minutes or hours.
18142         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18143
18144 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18147         Remove the gratuitous set of Final:
18148
18149                                 // If an interface implementation, then we can set Final.
18150                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18151                                     implementing.DeclaringType.IsInterface)
18152                                         flags |= MethodAttributes.Final;
18153
18154         I do not know what I was smoking when I used that.
18155
18156
18157         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18158         step into fixing the name resolution issues for delegates and
18159         unifying the toplevel name resolution.
18160
18161 2002-03-28  Martin Baulig  <martin@gnome.org>
18162
18163         * class.cs (Method.Emit): If we have a symbol writer, call its
18164         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18165         tell it about the current method.
18166
18167         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18168         writer that we're going to emit the first byte of IL code for a new
18169         statement (a new source line).
18170         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18171         EmitContext.Mark() before emitting any code.
18172
18173         * location.cs (SymbolDocument): Return null when we're Null.
18174
18175         * statement.cs (Statement): Moved the `Location loc' variable here.
18176         (Statement.EmitBoolExpression): If we have a symbol writer, call
18177         ec.Mark() before emitting any code to tell it that we're at the
18178         beginning of a new statement.
18179         (StatementExpression): Added `Location' argument to the constructor.
18180         (Block): Added public readonly variable `StartLocation' and public
18181         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18182         (Block): Added constructor which takes a start and end location.
18183         (Block.SetEndLocation): New method. This sets the end location.
18184         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18185         local variables we create.
18186         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18187         each statement and do also mark the begin and end of the block.
18188
18189         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18190         tell it the current lexer.Location, use Location.Null for the end of the
18191         block.
18192         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18193         current block, set its end location using SetEndLocation().
18194         (statement_expression): StatementExpression constructor now takes the
18195         lexer.Location as additional argument.
18196         (for_statement, declare_local_variables): Likewise.
18197         (declare_local_variables): When creating a new implicit block, use the
18198         new Block constructor and pass it the lexer.Location.
18199
18200 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18201
18202         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18203         members also on the parent interfaces recursively.
18204
18205 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18206
18207         * report.cs: Use new formats, since Gonzalo finished the missing
18208         bits. 
18209
18210         * expression.cs (Binary.ResolveOperator): added missing operator|
18211         operator& and operator^ for bool/bool.
18212
18213         * cs-parser.jay: CheckDef now takes a Location argument that is
18214         used to report errors more precisly (instead of reporting the end
18215         of a definition, we try to track something which is a lot closer
18216         to the source of the problem).
18217
18218         * cs-tokenizer.cs: Track global token use, so we can properly flag
18219         the use of #define/#undef after the first token has been seen.
18220
18221         Also, rename the reportXXXX to Error_DescriptiveName
18222
18223         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18224         TypeContainer, so that Enum and Interface can use this too.
18225
18226         * class.cs (TypeContainer.LookupInterfaceOrClass,
18227         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18228         `builder' argument.  Typically this was used to pass the parent
18229         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18230         the definition).  
18231
18232         The problem is that a nested class could trigger the definition of
18233         a toplevel class, and the builder would be obviously wrong in that
18234         case. 
18235
18236         So we drop this argument, and we compute dynamically the
18237         TypeBuilder/ModuleBuilder (the correct information was available
18238         to us anyways from DeclSpace.Parent)
18239
18240         * interface.cs (Interface.DefineInterface): Drop builder
18241         parameter cleanup like class.cs
18242
18243         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18244         like class.cs
18245
18246         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18247         values. 
18248
18249         (Try.Emit): Propagate the returns value from the statement.
18250
18251         (Return.Emit): Even if we are leavning 
18252
18253         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18254
18255         * modifiers.cs: Fix the computation of MethodAttributes flags.
18256
18257 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18258
18259         * driver.cs: allow compilation of files that start with '/'.
18260         Add a default case when checking the argument of --target.
18261
18262 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * interface.cs: Implement the same search algorithm for types in
18265         the interface code.
18266
18267         * delegate.cs: Do not allow multiple definition.
18268
18269         * Recovered ChangeLog that got accidentally amputated
18270
18271         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18272
18273         * rootcontext.cs: Load manually enum to allow core classes to
18274         contain enumerations.
18275
18276         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18277         Update to new static methods in TypeManager.
18278
18279         * typemanager.cs (GetMethod, GetConstructor): Use our
18280         implementation of FindMembers to find the members, since during
18281         corlib compilation, the types are TypeBuilders and GetMethod and
18282         GetConstructor do not work.
18283
18284         Make all methods in TypeManager static.
18285
18286         (InitCodeHelpers): Split the functionality from
18287         the InitCodeTypes function.
18288
18289         * driver.cs: Call InitCodeHelpers after we have populated the
18290         types. 
18291
18292         * cs-parser.jay (delegate_declaration): we did not used to compute
18293         the delegate name correctly for void delegates.
18294
18295 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18296
18297         * rootcontext.cs (RootContext): Init the interface_resolve_order
18298         and type_container_resolve_order always.
18299
18300         (ResolveCore, BootstrapCorlib_ResolveClass,
18301         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18302         compiler when compiling with --nostdlib
18303
18304         * class.cs (TypeContainer.DefineType): Check that our parent is
18305         not null.  This test is most important when we are bootstraping
18306         the core types.
18307
18308         * codegen.cs: Split out the symbol writing code.
18309
18310 2002-03-25  Martin Baulig  <martin@gnome.org>
18311
18312         * driver.cs (-g): Made -g an alias for --debug.
18313
18314 2002-03-24  Martin Baulig  <martin@gnome.org>
18315
18316         * codegen.cs (SymbolWriter): New public variable. Returns the
18317         current symbol writer.
18318         (CodeGen): Added `bool want_debugging_support' argument to the
18319          constructor. If true, tell the ModuleBuild that we want debugging
18320         support and ask it for the ISymbolWriter.
18321         (Save): If we have a symbol writer, call it's Close() method after
18322         saving the assembly.
18323
18324         * driver.c (--debug): New command line argument to create a
18325         debugger information file.
18326
18327         * location.cs (SymbolDocument): New public property. Returns an
18328         ISymbolDocumentWriter object for the current source file or null
18329         if we don't have a symbol writer.
18330
18331 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18332
18333         * driver.cs (LoadAssembly): Correctly return when all the paths
18334         have been tried and not before.
18335
18336         * statement.cs (Switch.Emit): return the actual coverage for this
18337         statement (returns/not-returns)
18338
18339         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18340         switch of the statement if we are the last switch section.  That
18341         kills two problems: try/catch problems (we used to emit an empty
18342         nop at the end) and switch statements where all branches would
18343         return. 
18344
18345 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18346
18347         * driver.cs: Add default assemblies (the equivalent to the
18348         Microsoft CSC.RSP file)
18349
18350         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18351         also update tokens_seen and set it to false.
18352
18353         * driver.cs: Implement --recurse for Mike.
18354
18355         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18356         correctly splitting out the paths.
18357
18358 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * interface.cs (Interface.PopulateProperty): Instead of using
18361         `parent' as the declaration space for the set parameters, use
18362         `this' 
18363
18364         * support.cs (InternalParameters): InternalParameters constructor
18365         takes a DeclSpace instead of a TypeContainer.
18366
18367         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18368         types are being initialized, load the address of it before calling
18369         the function.  
18370
18371         (New): Provide a mechanism to disable the generation of local
18372         value type temporaries when the caller will be providing us with
18373         an address to store it.
18374
18375         (ArrayCreation.EmitDynamicInitializers): Use it.
18376
18377 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18378
18379         * expression.cs (Invocation.EmitArguments): Only probe for array
18380         property if there is more than one argument.  Sorry about that.
18381
18382         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18383         empty param arrays.
18384
18385         * class.cs (Method.LabelParameters): Fix incorrect code path that
18386         prevented the `ParamArrayAttribute' from being applied to the
18387         params attribute.
18388
18389 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18390
18391         * support.cs (ReflectionParameters): Correctly compute whether the
18392         last argument is a params array.  Fixes the problem with
18393         string.Split ('a')
18394
18395         * typemanager.cs: Make the assemblies array always be non-null
18396         (empty, but non-null)
18397
18398         * tree.cs (RecordDecl): New function that abstracts the recording
18399         of names.  This reports error 101, and provides a pointer to the
18400         previous declaration.  Fixes a crash in the compiler.
18401
18402         * cs-parser.jay (constructor_declaration): Update to new grammar,
18403         and provide a constructor_body that can be empty.
18404
18405 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * driver.cs: Add support for --resources.
18408
18409         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18410         Make all types for the various array helper methods be integer.
18411
18412         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18413         CheckState to ConvCast.
18414
18415         (ConvCast): Now it takes a `checked' state argument, to avoid
18416         depending on the emit context for the conversion, and just using
18417         the resolve time setting.
18418
18419         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18420         instead of Invocation.EmitArguments.  We do not emit the original
18421         arguments, instead we emit those which have been converted to
18422         unsigned int expressions.
18423
18424         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18425
18426         * codegen.cs: ditto.
18427
18428         * expression.cs (LocalVariableReference): Drop the use of the
18429         Store function that depended on the variable index.
18430
18431         * statement.cs (VariableInfo): Drop the `Idx' property from this
18432         class, as this is not taking into account the indexes for
18433         temporaries tat we generate during the execution, getting the
18434         indexes wrong.
18435
18436         * class.cs: First emit class initializers, then call the parent
18437         constructor. 
18438
18439         * expression.cs (Binary): Fix opcode emision.
18440         (UnaryMutator.EmitCode): Support checked code generation
18441
18442         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18443         matches for events for both the Static and Instance scans,
18444         pointing to the same element.   Fix that.
18445
18446 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18447
18448         * rootcontext.cs (ResolveTree): Always set the
18449         interface_resolve_order, because nested interfaces will be calling
18450         into us.
18451
18452         * class.cs (GetInterfaceOrClass): Track the same resolution
18453         process used by TypeManager.LookupType.  This fixes the nested
18454         type lookups in class declarations (separate path from
18455         LookupType). 
18456
18457         (TypeContainer.DefineType): Also define nested interfaces.
18458         (TypeContainer.RegisterOrder): New public function used to
18459         register the order in which child interfaces need to be closed.
18460
18461         Nested interfaces need to be closed after their parents have been
18462         created. 
18463
18464         * interface.cs (InterfaceAttr): Put all the logic for computing
18465         the interface attribute here. 
18466
18467         (DefineInterface): Register our interface order with the
18468         RootContext or with the TypeContainer depending on the case.
18469
18470 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18471
18472         * cs-parser.jay: rework foreach statement to work with the new
18473         changes to the policy on SimpleNames.
18474
18475         * report.cs: support Stacktrace on warnings as well.
18476
18477         * makefile: drop --unsafe and /unsafe from the compile.
18478
18479 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18480
18481         * ecore.cs (StandardConversionExists): Modify to take an Expression
18482         as the first parameter. Ensure we do null -> reference type conversion
18483         checking.
18484
18485         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18486         temporary Expression objects.
18487
18488 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18489
18490         * interface.cs: workaround bug in method overloading resolution
18491         (there is already a bugzilla bug for it).
18492
18493 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18494
18495         We could also solve this problem by having a separate path for
18496         performing type lookups, instead of DoResolve, we could have a
18497         ResolveType entry point, and only participating pieces of the
18498         production (simplename, deref, array) would implement this. 
18499
18500         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18501         signal SimpleName to only resolve type names and not attempt to
18502         resolve anything else.
18503
18504         * expression.cs (Cast): Set the flag.
18505
18506         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18507
18508         * class.cs: Only report 108 if there is no `new' modifier.
18509
18510         * cs-parser.jay: rework foreach statement to work with the new
18511         changes to the policy on SimpleNames.
18512
18513         * report.cs: support Stacktrace on warnings as well.
18514
18515         * makefile: drop --unsafe and /unsafe from the compile.
18516
18517 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18520         lookups here, instead of doing that at parse time.  This means
18521         that our grammar will not introduce `LocalVariableReferences' as
18522         expressions at this point.  That solves the problem of code like
18523         this:
18524
18525         class X {
18526            static void Main ()
18527            { int X = 1;
18528             { X x = null }}}
18529
18530         This is only half the fix.  The full fix requires parameters to
18531         also be handled in this way.
18532
18533         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18534         makes the use more obvious of the DeclSpace.  The
18535         ec.TypeContainer.TypeBuilder is now only used to pull the
18536         TypeBuilder for it.
18537
18538         My theory is that I can get rid of the TypeBuilder completely from
18539         the EmitContext, and have typecasts where it is used (from
18540         DeclSpace to where it matters).  
18541
18542         The only pending problem is that the code that implements Aliases
18543         is on TypeContainer, and probably should go in DeclSpace.
18544
18545         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18546         lookups here, instead of doing that at parse time.  This means
18547         that our grammar will not introduce `LocalVariableReferences' as
18548         expressions at this point.  That solves the problem of code like
18549         this:
18550
18551         class X {
18552            static void Main ()
18553            { int X = 1;
18554             { X x = null }}}
18555
18556         This is only half the fix.  The full fix requires parameters to
18557         also be handled in this way.
18558
18559         * class.cs (Property.DefineMethod): When implementing an interface
18560         method, set newslot, when implementing an abstract method, do not
18561         set the flag (before we tried never setting it, or always setting
18562         it, which is the difference).
18563         (Indexer.DefineMethod): same.
18564         (Method.DefineMethod): same.
18565
18566         * ecore.cs: Only set the status used flag if we get back a Field.
18567
18568         * attribute.cs: Temporary hack, so Paolo can keep working.
18569
18570 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18571
18572         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18573         the unmanaged type in the case we have a MarshalAs attribute.
18574
18575         (Resolve): Handle the case when we are parsing the special MarshalAs
18576         attribute [we need to store the unmanaged type to use later]
18577
18578         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18579         MarshalAs Attribute.
18580
18581         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18582         on parameters and accordingly set the marshalling info.
18583
18584 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18585
18586         * class.cs: Optimizing slightly by removing redundant code after
18587         we switched to the `NoTypes' return value.
18588         (Property.DefineMethod): use NoTypes here too.
18589
18590         This fixes the bug I introduced in my last batch of changes.
18591
18592 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18593
18594         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18595
18596         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18597         Enums since those are types too. 
18598
18599         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18600
18601         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18602         thanks to a call during the lookup process.
18603
18604 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18605
18606         * statement.cs (Foreach): Lots of work to accomodate a particular
18607         kind of foreach statement that I had not kept in mind.  It is
18608         possible to have foreachs on classes that provide a GetEnumerator
18609         method that return objects that implement the "pattern" for using
18610         a foreach, there is no need to support GetEnumerator
18611         specifically. 
18612
18613         This is needed to compile nant.
18614
18615         * decl.cs: Only report 114 if the member is not `Finalize' and if
18616         the warning level is at least 2.
18617
18618         * class.cs: Moved the compare function from Method to
18619         MethodSignature. 
18620
18621         (MethodSignature.InheritableMemberSignatureCompare): Add new
18622         filter function that is used to extract inheritable methods from a
18623         class. 
18624
18625         (Method.Define): Use the new `inheritable_method_signature_filter'
18626         delegate
18627
18628         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18629         command. 
18630
18631 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18634
18635         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18636
18637         * expression.cs: Pass location information to
18638         ConvertImplicitStandard. 
18639
18640         * class.cs: Added debugging code to track return values from
18641         interfaces. 
18642
18643 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * expression.cs (Is.DoResolve): If either side of the `is' is an
18646         interface, do not flag the warning.
18647
18648         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18649         for interfaces
18650
18651         * report.cs: Allow for --fatal to be used with --probe.
18652
18653         * typemanager.cs (NoTypes): Move the definition for the empty Type
18654         array here. 
18655
18656         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18657         properties. 
18658         (TypeContainer.DefineProxy): New function used to proxy to parent
18659         implementations when implementing interfaces.
18660         (TypeContainer.ParentImplements): used to lookup if our parent
18661         implements a public function that is required by an interface.
18662         (TypeContainer.VerifyPendingMethods): Hook this up.
18663
18664         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18665         `modules' and `assemblies' arraylists into arrays.  We only grow
18666         these are the very early start up of the program, so this improves
18667         the speedof LookupType (nicely measured).
18668
18669         * expression.cs (MakeByteBlob): Replaced unsafe code with
18670         BitConverter, as suggested by Paolo.
18671
18672         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18673         folding of string concatenation, but if either side is a string,
18674         and the other is not, then return null, and let the runtime use
18675         the concatenation on the string plus the object (using
18676         `Object.ToString'). 
18677
18678 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18679
18680         Constant Folding has been implemented now.
18681
18682         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18683         the error instead on types that are not supported in one's
18684         complement. 
18685
18686         * constant.cs (Constant and all children): New set of functions to
18687         perform implict and explicit conversions.
18688
18689         * ecore.cs (EnumConstant): Implement the new functions to perform
18690         conversion by proxying to the child expression.
18691
18692         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18693         own separate setting that can not be turned off from the command
18694         line using --unchecked or --checked and is only controlled using
18695         the checked/unchecked statements and expressions.  This setting is
18696         used by the constant folder to flag errors.
18697
18698         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18699         ConstantCheckState as well.   
18700
18701         During Resolve, they also have to flag the state, because the
18702         constant folder runs completely in the Resolve phase.
18703
18704         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18705         well.
18706
18707 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * cfold.cs: New file, this file contains the constant folder.
18710
18711         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18712         argument to track whether we are using the resulting address to
18713         load or store a value and provide better error messages. 
18714
18715         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18716         new AddressOf arguments.
18717
18718         * statement.cs (Foreach.EmitCollectionForeach): Update
18719
18720         * expression.cs (Argument.Emit): Call AddressOf with proper
18721         arguments to track usage.
18722
18723         (New.DoEmit): Call AddressOf with new arguments.
18724
18725         (Unary.Emit): Adjust AddressOf call.
18726
18727 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18728
18729         * cs-parser.jay (member_access): Change the case for pre-defined types
18730         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18731         this suggestion.
18732
18733         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18734         a method body.
18735
18736         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18737         essentially like methods and apply attributes like MethodImplOptions to them too.
18738
18739         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18740         not being null.
18741
18742         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18743         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18744         is the DeclSpace.
18745
18746         * Update code everywhere accordingly.
18747
18748         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18749
18750         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18751
18752 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18753
18754         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18755         try performing lookups against those instead of jumping straight into using
18756         the 'using' clauses.
18757
18758         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18759
18760         (LookupType): Perform lookups in implicit parents too.
18761
18762         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18763         sequence as RootContext.LookupType. 
18764
18765         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18766         the various cases of namespace lookups into this method.
18767
18768 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18769
18770         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18771         in positional arguments)
18772
18773         * class.cs (Operator): Update the AllowedModifiers to contain
18774         extern. 
18775
18776         * cs-parser.jay: Update operator declaration to allow for the
18777         operator body to be empty.
18778
18779         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18780         values. 
18781
18782 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18783
18784         * class.cs (Method.Emit): Label parameters.
18785
18786         * driver.cs: Return 1 or 0 as the program exit code.
18787
18788 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18789
18790         * expression.cs: Special case the `null' object when trying to
18791         auto-compute the type, as anything can be explicitly converted to
18792         that. 
18793
18794         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18795         spotting this Paolo.
18796
18797         (Expression.ImplicitNumericConversion): Perform comparissions of
18798         the type using the underlying type in the case of an enumeration
18799         rather than using the enumeration type for the compare.
18800
18801         Cope with the underlying == type case, which is not possible to
18802         catch before. 
18803
18804         (Expression.ConvertNumericExplicit): Perform comparissions of
18805         the type using the underlying type in the case of an enumeration
18806         rather than using the enumeration type for the compare.
18807
18808         * driver.cs: If the user does not supply an extension, assume .exe
18809
18810         * cs-parser.jay (if_statement): Rewrote so that we can track the
18811         location for the if statement.
18812
18813         * expression.cs (Binary.ConstantFold): Only concat strings when
18814         the operation is "+", not everything ;-)
18815
18816         * statement.cs (Statement.EmitBoolExpression): Take a location
18817         argument. 
18818         (If, While, Do): Track location.
18819
18820         * expression.cs (Binary.ResolveOperator): In the object + string
18821         case, I was missing a call to ConvertImplicit
18822
18823 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18824
18825         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18826         Location arguments. Ensure we use RootContext.LookupType to do our work
18827         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18828
18829         * interface.cs (PopulateMethod): Handle the type of the parameter being
18830         null gracefully.
18831
18832         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18833         have a params method with no fixed arguments and a call is made with no
18834         arguments.
18835
18836 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18837
18838         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18839         the verbatim-string-literal
18840
18841         * support.cs (InternalParameters.ParameterModifier): handle null
18842         fixed parameters.
18843         (InternalParameters.ParameterType): ditto.
18844
18845         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18846         duplicating the name of the variable parameter.
18847         (GetParameterByName): Fix bug where we were not looking up array
18848         paramters if they were the only present (thanks Paolo!).
18849         (GetParameterInfo): We only have an empty set of types if both
18850         fixed and array are set to null.
18851         (GetParameterInfo-idx): Handle FixedParameter == null
18852
18853         * cs-parser.jay: Handle the case where there is no catch
18854         statements (missing null test).
18855
18856 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * driver.cs (MainDriver): Be conservative on our command line
18859         handling.
18860
18861         Catch DirectoryNotFoundException when calling GetFiles.
18862
18863         (SplitPathAndPattern): Used to split the input specification into
18864         a path and a pattern that we can feed to Directory.GetFiles.
18865
18866 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * statement.cs (Fixed): Implement the last case of the Fixed
18869         statement (string handling).
18870
18871         * expression.cs (StringPtr): New class used to return a char * to
18872         a string;  Used by the Fixed statement.
18873
18874         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18875
18876         * expression.cs (Binary.ResolveOperator): Remove redundant
18877         MemberLookup pn parent type.
18878         Optimize union call, we do not need a union if the types are the same.
18879         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18880         type.
18881
18882         Specialize the use of MemberLookup everywhere, instead of using
18883         the default settings. 
18884
18885         (StackAlloc): Implement stackalloc keyword.
18886
18887         * cs-parser.jay: Add rule to parse stackalloc.
18888
18889         * driver.cs: Handle /h, /help, /?
18890
18891         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18892         before we supported unsafe code.
18893
18894         * makefile: add --unsafe to the self compilation of mcs.
18895
18896 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18897
18898         * expression.cs (PointerArithmetic): New class that is used to
18899         perform pointer arithmetic.
18900         (Binary.Resolve): Handle pointer arithmetic
18901         Handle pointer comparission.
18902         (ArrayPtr): Utility expression class that is used to take the
18903         address of an array.
18904
18905         (ElementAccess): Implement array access for pointers
18906
18907         * statement.cs (Fixed): Implement fixed statement for arrays, we
18908         are missing one more case before we are done.
18909
18910         * expression.cs (Indirection): Implement EmitAssign and set the
18911         ExprClass to Variable.  This allows pointer dereferences to be
18912         treated as variables, and to have values assigned to them.
18913
18914         * ecore.cs (Expression.StoreFromPtr): New utility function to
18915         store values dereferencing.
18916
18917 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18918
18919         * expression.cs (Binary.ResolveOperator): Ensure that we are
18920         not trying to operate on a void type - this fixes the reported
18921         bug.
18922
18923         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18924         the parent implementation is sealed.
18925
18926         * ../errors/cs0239.cs : Add.
18927
18928         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18929
18930         * typemanager.cs (unverifiable_code_type): Corresponds to 
18931         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18932         which have unsafe code in them.
18933
18934         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18935         unsafe context.
18936
18937 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * cs-tokenizer.cs: Add support for @"litreal strings"
18940
18941         Make tokenizer accept pre-processor directives
18942         on any column (remove the old C-like limitation). 
18943
18944         * rootcontext.cs (EmitCode): Emit any global attributes.
18945         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18946
18947         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18948
18949         * cs-parser.jay: Add support for global attributes.  
18950
18951 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18952
18953         * expression.cs (Indirection): New helper class.  Unary will
18954         create Indirection classes to be able to implement the
18955         IMemoryLocation interface on it.
18956
18957 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18958
18959         * cs-parser.jay (fixed_statement): reference the right statement.
18960
18961         * statement.cs (Fixed.Emit): Finish implementing the fixed
18962         statement for the &x case.
18963
18964 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * class.cs (Property.Define, Method.Define): Remove newslot when
18967         `implementing'.  
18968
18969         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18970         wrong.  NewSlot should only be used if the `new' keyword is present.
18971
18972         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18973         locating our system dir.  Sorry about this.
18974
18975 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * driver.cs (GetSystemDir): Compute correctly the location of our
18978         system assemblies.  I was using the compiler directory instead of
18979         the library directory.
18980
18981 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18982
18983         * expression.cs (BetterFunction): Put back in what Miguel commented out
18984         since it is the correct fix. The problem is elsewhere ;-)
18985
18986         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18987         parameters of the parms method are themselves compatible or not !
18988
18989         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18990         to check that a class implements an interface before saying that an implicit
18991         conversion was allowed. Use ImplementsInterface to do the checking.
18992
18993 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * class.cs (Method.Define): Track whether we are an explicit
18996         implementation or not.  And only call DefineMethodOverride if we
18997         are an explicit implementation.
18998
18999         (Property.DefineMethod): Ditto.
19000
19001 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19002
19003         * expression.cs (BetterFunction): Catch hideous bug which was
19004          preventing us from detecting ambiguous calls due to implicit casts i.e
19005         cs0121.
19006
19007 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19008
19009         * support.cs (Pair): Remove un-needed method.  I figured why I was
19010         getting the error in cs-parser.jay, the variable in a foreach loop
19011         is readonly, and the compiler does not really treat this as a variable.
19012
19013         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19014         instead of EQUALS in grammar.  
19015
19016         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19017
19018         * expression.cs (Unary.DoResolve): Check whether the argument is
19019         managed or not.
19020
19021 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19022
19023         * support.cs: Api for Pair to set a value.  Despite the fact that
19024         the variables are public the MS C# compiler refuses to compile
19025         code that accesses the field if the variable is part of a foreach
19026         statement. 
19027
19028         * statement.cs (Fixed): Begin implementation of the fixed
19029         statement.
19030
19031         (Block.AddVariable): Return the VariableInfo on success and null
19032         on failure instead of true/false. 
19033
19034         * cs-parser.jay (foreach): Catch errors on variables already
19035         defined (we were ignoring this value before) and properly unwind
19036         the block hierarchy
19037
19038         (fixed_statement): grammar for the fixed statement.
19039
19040 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19041
19042         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19043         pointer types to be incretemented.
19044
19045         (SizeOf): Implement.
19046
19047         * cs-parser.jay (pointer_member_access): Implement
19048         expr->IDENTIFIER production.
19049
19050         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19051         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19052         on safe contexts.
19053
19054         (Unary): Implement indirection.
19055
19056         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19057         use in non-unsafe context).
19058
19059         (SimpleName.DoResolve): Check for pointers in field access on safe
19060         contexts. 
19061
19062         (Expression.LoadFromPtr): Factor the load-indirect code in this
19063         function.  This was duplicated in UnboxCast and ParameterReference
19064
19065 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * expression.cs (ComposedCast): report an error if a pointer cast
19068         is used in a safe region.
19069
19070         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19071         pointer type casts in unsafe context.
19072
19073         * codegen.cs (EmitContext): Set up IsUnsafe.
19074
19075         * cs-parser.jay (non_expression_type): Add productions for pointer
19076         casts. 
19077
19078         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19079         code.  We should not use force into static mode if the method is
19080         not virtual.  Fixes bug in MIS
19081
19082         * statement.cs (Do.Emit, While.Emit, For.Emit,
19083         Statement.EmitBoolExpression): Add support to Do and While to
19084         propagate infinite loop as `I do return' semantics.
19085
19086         Improve the For case to also test for boolean constants.
19087
19088         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19089         to the list of attributes we can add.
19090
19091         Remove `EmitContext' argument.
19092
19093         * class.cs (Method.Define): Apply parameter attributes.
19094         (Constructor.Define): Apply parameter attributes.
19095         (MethodCore.LabelParameters): Move here the core of labeling
19096         parameters. 
19097
19098         * support.cs (ReflectionParameters.ParameterModifier,
19099         InternalParameters.ParameterModifier): Use IsByRef on the type and
19100         only return the OUT bit for these parameters instead of in/out/ref
19101         flags.
19102
19103         This is because I miss-understood things.  The ParameterInfo.IsIn
19104         and IsOut represent whether the parameter has the [In] and [Out]
19105         attributes set.  
19106
19107 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * ecore.cs (FieldExpr.Emit): Release temporaries.
19110
19111         * assign.cs (LocalTemporary.Release): new function.
19112
19113         * codegen.cs (EmitContext.GetTemporaryStorage,
19114         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19115         temporary storage.  Now we can "put back" localbuilders when we
19116         are done with them
19117
19118 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19121         need to make a copy of the variable to generate verifiable code.
19122
19123 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * driver.cs: Compute dynamically the system directory.
19126
19127         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19128         Slower, but more generally useful.  Used by the abstract
19129         registering implementation. 
19130
19131         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19132         the rules for the special rule on Type/instances.  First check if
19133         we have the same name, and if so, try that special static path
19134         rather than the instance path.
19135
19136 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19139         for, while and if.
19140
19141         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19142         Enum, ValueType, Delegate or Array for non-corlib compiles.
19143
19144         * cs-tokenizer.cs: Catch long identifiers (645)
19145
19146         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19147         piece of code.
19148
19149         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19150         fix, we were returning too early, so we were not registering
19151         pending methods from abstract classes.
19152
19153         Do not register pending methods if the class is abstract.
19154
19155         * expression.cs (Conditional.DoResolve): Report circular implicit
19156         conversions when we neecd to compute it for conditional
19157         expressions. 
19158
19159         (Is.DoResolve): If the expression is always of the provided type,
19160         flag warning 183.  If the expression can not ever be of the
19161         provided type flag warning 184.
19162
19163         * class.cs: Catch 169 as well.
19164
19165         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19166         read. 
19167
19168 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19169
19170         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19171
19172 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19173
19174         * interface.cs: (PopulateMethod): Check for pointers being defined
19175         only if the unsafe context is active.
19176         (PopulateProperty): ditto.
19177         (PopulateIndexer): ditto.
19178
19179         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19180         specified.  If pointers are present, make sure that they are
19181         present in an unsafe context.
19182         (Constructor, Constructor.Define): ditto.
19183         (Field, Field.Define): ditto.
19184         (Property, Property.Define): ditto.
19185         (Event, Event.Define): ditto.
19186
19187         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19188         hashtable if there are classes or structs defined.
19189
19190         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19191         code, as the constant resolution moved.
19192
19193         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19194         the metadata, so we can flag error 133. 
19195
19196         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19197         pointer is being declared in an unsafe context.
19198
19199 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19200
19201         * modifiers.cs (Modifiers.Check): Require a Location argument.
19202         Report error 227 for Unsafe use.
19203
19204         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19205
19206         * statement.cs (For.Emit): If the test is null, then report that
19207         we do `return', as we wont reach anything afterwards.
19208
19209         (Switch.SwitchGoverningType): Track the expression that matched
19210         the conversion.
19211
19212         * driver.cs: Allow negative numbers as an error code to flag.
19213
19214         * cs-parser.jay: Handle 1551.
19215
19216         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19217
19218 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * cs-parser.jay: Report 1518 (type declaration can only contain
19221         class, struct, interface, enum or delegate)
19222
19223         (switch_label): Report 1523 (keywords `case' or `default' must
19224         preced code)
19225
19226         (opt_switch_sections): Report 1522 (empty switch)
19227
19228         * driver.cs: Report 1515 (response file specified multiple times)
19229         Report 1516 (Source file specified multiple times).
19230
19231         * expression.cs (Argument.Resolve): Signal 1510
19232
19233         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19234         access not allowed in static code)
19235
19236 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19237
19238         * typemanager.cs (IsPointerType): Utility method which we are going
19239         to need a lot.
19240
19241         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19242         the object type, so we take care of that.
19243
19244         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19245
19246         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19247         added to non-params parameters :-)
19248
19249         * typemanager.cs (CSharpName): Include 'void' type too. 
19250
19251         (void_ptr_type): Include in the set of core types.
19252
19253         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19254         duplicating code.
19255
19256         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19257         an unsafe context.
19258
19259         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19260         completely forgotten about it.
19261
19262 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19263
19264         * cs-parser.jay (pointer_type): Add. This begins our implementation
19265         of parsing rules for unsafe code.
19266
19267         (unsafe_statement): Implement.
19268
19269         (embedded_statement): Modify to include the above.
19270
19271         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19272
19273         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19274         if the current context is an unsafe one.
19275
19276         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19277         are handled differently, we need separate rules for them.
19278
19279         (local_variable_declaration): Update to use local_variable_pointer_type
19280         to allow variable declarations of unmanaged pointer types.
19281
19282         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19283         in unsafe contexts.
19284
19285         * ../errors/cs0214.cs : Add.
19286
19287 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19288
19289         * makefile: remove 'response' file when cleaning.
19290
19291 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19292
19293         * cs-parser.jay: Report 1524.
19294
19295 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19296
19297         * typemanager.cs (RegisterMethod): drop checking if we have
19298         registered this from here
19299
19300 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * class.cs (Method.EmitDestructor): Implement calling our base
19303         destructor. 
19304
19305         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19306         value of InFinally.
19307
19308         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19309         this routine and will wrap the call in a try/catch block.  Deal
19310         with the case.
19311
19312 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * ecore.cs (Expression.MemberLookup): instead of taking a
19315         parameter `same_type' that was used to tell whether we could
19316         access private members we compute our containing type from the
19317         EmitContext.
19318
19319         (FieldExpr): Added partial support for volatile fields.  This does
19320         not work for volatile fields exposed from assemblies, as I can not
19321         figure out how to extract the modreq from it.
19322
19323         Updated all the source files to use this.
19324
19325         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19326         because it is referenced by MemberLookup very often. 
19327
19328 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19329
19330         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19331         TypeBuilder.GetCustomAttributes to retrieve what we need.
19332
19333         Get rid of redundant default_member_attr_type as this is the same as
19334         default_member_type which already exists.
19335
19336         * interface.cs, attribute.cs : Update accordingly.
19337
19338 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19339
19340         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19341         work for TYpeBuilders though.  Ravi, can you please fix this?
19342
19343         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19344
19345         * expression.cs (Argument.Emit): Handle the case of ref objects
19346         being passed to ref functions;  
19347
19348         (ParameterReference.EmitLoad): Loads the content of the pointer
19349         without dereferencing.
19350
19351 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19354
19355 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19356
19357         * class.cs (Indexer.DefineMethod): Incorporate the interface
19358         type in the name of the method if we are doing explicit interface
19359         implementation.
19360
19361         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19362
19363         (BetterConversion): Fix extremely trivial bug where we were referring to
19364         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19365         again !
19366
19367         * ../errors/bug16.cs : Add although we have fixed it.
19368
19369 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * expression.cs (BaseIndexer): Begin implementation.
19372
19373         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19374
19375         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19376         production directly to remove a shift/reduce, and implement
19377         explicit interface implementation.
19378
19379         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19380         after a floating point suffix.
19381
19382         * expression.cs (DoNumericPromotions): Improved the conversion for
19383         uint/uint.  If we have a constant, we avoid doing a typecast to a
19384         larger type.
19385
19386         * class.cs (Indexer): Implement explicit interface implementation
19387         for indexers.
19388
19389 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19390
19391         * class.cs: make the default instance constructor public and hidebysig.
19392
19393 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19394
19395         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19396         so we can call it from elsewhere.
19397
19398         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19399         we emit it internally if the class has a defined indexer; otherwise the user
19400         emits it by decorating the class definition with the DefaultMemberAttribute.
19401
19402         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19403         attribute is not used on a type which defines an indexer.
19404
19405         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19406         character when we skip whitespace.
19407
19408         * ../errors/cs0646.cs : Add.
19409
19410 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19411
19412         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19413         again. 
19414
19415         * makefile: Add practical target `mcs3.exe' which builds the third
19416         generation compiler. 
19417
19418         * expression.cs (New): Fix structures constructor calling.
19419
19420         * class.cs (Property, Method, Indexer): Emit Final flag on the
19421         method if we are an interface implementation and we are not
19422         abstract. 
19423
19424         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19425         whether this property is referencing a `base' method.
19426
19427         * expression.cs (Invocation.EmitCall): take an extra argument:
19428         is_base, this is used to determine whether the `call' or
19429         `callvirt' opcode should be used.
19430
19431
19432         * delegate.cs: update EmitCall.
19433
19434         * class.cs (Method.Define): Set NewSlot for the cases where we are
19435         not implementing an interface method.
19436
19437         (Property.Define): ditto.
19438
19439 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19442         'r'.  Allows mcs to parse itself fully.
19443
19444 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19445
19446         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19447         of the number of initializers that require the InitializeArray method.
19448
19449         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19450         update the above field where necessary.
19451
19452         (MakeByteBlob): Update accordingly.
19453
19454         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19455         greater than 2.
19456
19457         (EmitDynamicInitializers): Update in accordance with the new optimization.
19458
19459         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19460         same OpCode applies.
19461
19462         * cs-parser.jay : Fix some glaring errors I introduced.
19463
19464 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19465
19466         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19467         so that we can check for name clashes there too.
19468
19469         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19470         for interface indexers.
19471
19472         * interfaces.cs (Define): Emit the default member attribute.
19473
19474         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19475         variable was being referred to while setting the value ;-)
19476
19477 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19478
19479         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19480         byte-by-byte information when we know the data is zero.
19481
19482         Make the block always a multiple of 4, because
19483         DefineInitializedData has a bug.
19484
19485         * assign.cs: Fix, we should assign from the temporary, not from
19486         the source. 
19487
19488         * expression.cs (MakeByteBlob): Fix my incorrect code.
19489
19490 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19491
19492         * typemanager.cs (EnumToUnderlying): This function is used to get
19493         the underlying type from an enumeration, because it does not
19494         always work. 
19495
19496         * constant.cs: Use the I4_S form for values between -128 and 127.
19497
19498         * statement.cs (Block.LookupLabel): Looks up a label.
19499         (Block): Drop support for labeled blocks.
19500
19501         (LabeledStatement): New kind of statement that represents a label
19502         only.
19503
19504         (Goto): Finally implement this bad boy.
19505
19506         * cs-parser.jay: Update to reflect new mechanism to implement
19507         labels.
19508
19509 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19510
19511         * codegen.cs (EmitContext.This): a codegen property that keeps the
19512         a single instance of this instead of creating many different this
19513         instances. 
19514
19515         * delegate.cs (Delegate.DoResolve): Update to use the property;
19516
19517         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19518
19519         * expression.cs (BaseAccess.DoResolve): Ditto.
19520
19521 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19522
19523         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19524         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19525
19526         (InitCoreTypes): Update accordingly.
19527
19528         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19529         so we can quickly store the state.
19530
19531         (ApplyAttributes): Set the correct implementation flags
19532         for InternalCall methods.
19533
19534 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19535
19536         * expression.cs (EmitCall): if a method is not virtual, then do
19537         not use callvirt on it.
19538
19539         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19540         user defined stuff) requires the use of stobj, which takes an
19541         address on the stack instead of an array and an index.  So emit
19542         the Ldelema operation for it.
19543
19544         (EmitStoreOpcode): Use stobj for valuetypes.
19545
19546         (UnaryMutator.EmitCode): Use the right 1 value depending on
19547         whether we are dealing with int64/uint64, float or doubles.
19548
19549         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19550         constructors that I implemented last night.
19551
19552         (Constructor.IsDefault): Fix to work properly for static
19553         constructors.
19554
19555         * cs-parser.jay (CheckDef): report method signature errors.
19556         Update error number 103 to be 132.
19557
19558         * decl.cs: New AdditionResult enumeration value: MethodExists.
19559         Although we do this check for methods later on in the semantic
19560         analysis, catching repeated default constructors is so easy that
19561         we catch these here. 
19562
19563         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19564         promotions code.
19565
19566         (ParameterReference.EmitAssign, Emit): handle
19567         bools as bytes.
19568
19569         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19570         (ArrayAccess.EmitStoreOpcode): ditto.
19571
19572         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19573
19574         * expression.cs (MakeByteBlob): Complete all the missing types
19575         (uint, short, ushort, byte, sbyte)
19576
19577         * class.cs: Only init instance field initializers on instance
19578         constructors. 
19579
19580         Rename `constructors' to instance_constructors. 
19581
19582         (TypeContainer.AddConstructor): Only add constructors to the list
19583         if it is not static.
19584
19585         Make sure that we handle default_static_constructor independently
19586         everywhere where we handle instance_constructors
19587
19588 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * class.cs: Do not lookup or create a base initializer for a
19591         static constructor.
19592
19593         (ConstructorInitializer.Resolve): use the proper type to lookup
19594         for constructors.
19595
19596         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19597
19598         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19599         in DeclSpace. 
19600
19601         * decl.cs: CloseType is now an virtual method, the default
19602         implementation just closes this type.
19603
19604 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19605
19606         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19607         to PreserveSig by default. Also emit HideBySig on such methods.
19608
19609         Basically, set the defaults to standard values.
19610
19611         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19612         argument, if candidate is better, it can't be worse than the best !
19613
19614         (Invocation): Re-write bits to differentiate between methods being
19615         applicable in their expanded form and their normal form - for params
19616         methods of course.
19617
19618         Get rid of use_standard everywhere as only standard conversions are allowed
19619         in overload resolution. 
19620
19621         More spec conformance.
19622
19623 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * driver.cs: Add --timestamp, to see where the compiler spends
19626         most of its time.
19627
19628         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19629         `this' in static code.
19630
19631         (SimpleName.DoResolve): Implement in terms of a helper function
19632         that allows static-references to be passed upstream to
19633         MemberAccess.
19634
19635         (Expression.ResolveWithSimpleName): Resolve specially simple
19636         names when called by MemberAccess to implement the special
19637         semantics. 
19638
19639         (Expression.ImplicitReferenceConversion): Handle conversions from
19640         Null to reference types before others, as Null's type is
19641         System.Object. 
19642
19643         * expression.cs (Invocation.EmitCall): Handle the special case of
19644         calling methods declared on a reference type from a ValueType
19645         (Base classes System.Object and System.Enum)
19646
19647         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19648         the left hand side is a TypeExpr, not on every enumeration. 
19649
19650         (Binary.Resolve): If types are reference types, then do a cast to
19651         object on operators != and == of both arguments.
19652
19653         * typemanager.cs (FindMembers): Extract instance and static
19654         members if requested.
19655
19656         * interface.cs (PopulateProperty): Use void_type instead of null
19657         as the return type for the setter method.
19658
19659         (PopulateIndexer): ditto.
19660
19661 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19662
19663         * support.cs (ReflectionParameters): Fix minor bug where we
19664         were examining the wrong parameter for the ParamArray attribute.
19665
19666         Cope with requests for the type of the parameter at position
19667         greater than the params parameter's. We now return the element
19668         type of the params array as that makes more sense.
19669
19670         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19671         accordingly as we no longer have to extract the element type
19672         ourselves.
19673
19674         (Invocation.OverloadResolve): Update.
19675
19676 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19677
19678         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19679         against IEnumerator, test whether the return value is a descendant
19680         of the IEnumerator interface.
19681
19682         * class.cs (Indexer.Define): Use an auxiliary method to implement
19683         the other bits of the method definition.  Begin support for
19684         explicit interface implementation.
19685
19686         (Property.DefineMethod): Use TypeManager.void_type instead of null
19687         for an empty return value.
19688
19689 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19690
19691         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19692         dealing with a FieldExpr which is composed of a FieldBuilder, in
19693         the code path we did extract the constant, but we should have
19694         obtained the underlying value to be able to cast it (otherwise we
19695         end up in an infinite loop, this is what Ravi was running into).
19696
19697         (ArrayCreation.UpdateIndices): Arrays might be empty.
19698
19699         (MemberAccess.ResolveMemberAccess): Add support for section
19700         14.5.4.1 that deals with the special case of E.I when E is a type
19701         and something else, that I can be a reference to a static member.
19702
19703         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19704         handle a particular array type to create byte blobs, it is just
19705         something we dont generate byteblobs for.
19706
19707         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19708         arguments. 
19709
19710         * location.cs (Push): remove the key from the hashtable that we
19711         are about to add.   This happens for empty files.
19712
19713         * driver.cs: Dispose files after we have parsed them.
19714
19715         (tokenize): new function that only runs the tokenizer on its
19716         input, for speed testing.
19717
19718 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19719
19720         * class.cs (Event.Define): Define the private field only if there
19721         are no accessors defined.
19722
19723         * expression.cs (ResolveMemberAccess): If there is no associated
19724         field with the event, that means we have an event defined with its
19725         own accessors and we should flag error cs0070 since transforming
19726         ourselves into a field is not valid in that case.
19727
19728         * ecore.cs (SimpleName.DoResolve): Same as above.
19729
19730         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19731         and charset to sane values.
19732
19733 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19734
19735         * assign.cs (DoResolve): Perform check on events only if they 
19736         are being accessed outside the declaring type.
19737
19738         * cs-parser.jay (event_declarations): Update rules to correctly
19739         set the type of the implicit parameter etc.
19740
19741         (add_accessor, remove_accessor): Set current local parameters.
19742
19743         * expression.cs (Binary): For delegate addition and subtraction,
19744         cast the return value from the method into the appropriate delegate
19745         type.
19746
19747 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19748
19749         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19750         of these as the workaround is unnecessary.
19751
19752         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19753         delegate data - none of that is needed at all.
19754
19755         Re-write bits to extract the instance expression and the delegate method
19756         correctly.
19757
19758         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19759         on delegates too.
19760
19761         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19762         of attaching attributes instead of duplicating code everywhere.
19763
19764         * everywhere : Update code to do attribute emission using the above method.
19765
19766 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * expression.cs (IsParamsMethodApplicable): if there are not
19769         parameters, return immediately.
19770
19771         * ecore.cs: The 0 literal can be implicity converted to an enum
19772         type. 
19773
19774         (SimpleName.DoResolve): First lookup the type, then lookup the
19775         members. 
19776
19777         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19778         want to get its address.  If the InstanceExpression is not
19779         addressable, store the result in a temporary variable, then get
19780         the address of it.
19781
19782         * codegen.cs: Only display 219 errors on warning level or above. 
19783
19784         * expression.cs (ArrayAccess): Make it implement the
19785         IMemoryLocation interface.
19786
19787         (Binary.DoResolve): handle the operator == (object a, object b)
19788         and operator != (object a, object b) without incurring into a
19789         BoxedCast (because 5 != o should never be performed).
19790
19791         Handle binary enumerator operators.
19792
19793         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19794         value type, otherwise use Ldelem_ref.
19795
19796         Use precomputed names;
19797
19798         (AddressOf): Implement address of
19799
19800         * cs-parser.jay (labeled_statement): Fix recursive block
19801         addition by reworking the production.
19802
19803         * expression.cs (New.DoEmit): New has a special case:
19804                 
19805                  If we are dealing with a ValueType, we have a few
19806                  situations to deal with:
19807                 
19808                     * The target of New is a ValueType variable, that is
19809                       easy, we just pass this as the variable reference
19810                 
19811                     * The target of New is being passed as an argument,
19812                       to a boxing operation or a function that takes a
19813                       ValueType.
19814                 
19815                       In this case, we need to create a temporary variable
19816                       that is the argument of New.
19817
19818
19819 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19820
19821         * rootcontext.cs (LookupType): Check that current_type is not null before
19822         going about looking at nested types.
19823
19824         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19825         not implement the IAssignMethod interface any more.
19826
19827         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19828         where we tranform them into FieldExprs if they are being resolved from within
19829         the declaring type.
19830
19831         * ecore.cs (SimpleName.DoResolve): Do the same here.
19832
19833         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19834
19835         * ../errors/bug10.cs : Add.
19836
19837         * ../errors/cs0070.cs : Add.
19838
19839         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19840
19841         * assign.cs : Get rid of EventIsLocal everywhere.
19842
19843 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19844
19845         * ecore.cs (ConvertIntLiteral): finished the implementation.
19846
19847         * statement.cs (SwitchLabel): Convert the value we are using as a
19848         key before looking up the table.
19849
19850 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * codegen.cs (EmitTopBlock): Require a Location argument now.
19853
19854         * cs-parser.jay (constructor_declarator): We need to setup
19855         current_local_parameters before we parse the
19856         opt_constructor_initializer, to allow the variables to be bound
19857         to the constructor arguments.
19858
19859         * rootcontext.cs (LookupType): First lookup nested classes in our
19860         class and our parents before we go looking outside our class.
19861
19862         * expression.cs (ConstantFold): Extract/debox the values at the
19863         beginnning. 
19864
19865         * rootcontext.cs (EmitCode): Resolve the constants first before we
19866         resolve the types.  This is not really needed, but it helps debugging.
19867
19868         * statement.cs: report location.
19869
19870         * cs-parser.jay: pass location to throw statement.
19871
19872         * driver.cs: Small bug fix.
19873
19874         * report.cs: Updated format to be 4-zero filled digits.
19875
19876 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19877
19878         * expression.cs (CheckIndices): Fix minor bug where the wrong
19879         variable was being referred to ;-)
19880
19881         (DoEmit): Do not call EmitStaticInitializers when the 
19882         underlying type is System.Object.
19883
19884 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19885
19886         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19887         and do the usual workaround for SRE.
19888
19889         * class.cs (MyEventBuilder.EventType): New member to get at the type
19890         of the event, quickly.
19891
19892         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19893
19894         * assign.cs (Assign.DoResolve): Handle the case when the target
19895         is an EventExpr and perform the necessary checks.
19896
19897         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19898         interface.
19899
19900         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19901
19902         (EventExpr): Set the type in the constructor itself since we 
19903         are meant to be born fully resolved.
19904
19905         (EventExpr.Define): Revert code I wrote earlier.
19906                 
19907         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19908         instance expression is null. The instance expression is a This in that case
19909         or a null, depending on whether it is a static method or not.
19910
19911         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19912         refers to more than one method.
19913
19914         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19915         and accordingly flag errors.
19916
19917 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19918
19919         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19920
19921 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19922
19923         * location.cs (ToString): Provide useful rutine.
19924
19925 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19928         objects, return the actual integral boxed.
19929
19930         * statement.cs (SwitchLabel): define an ILLabel for each
19931         SwitchLabel. 
19932
19933         (Switch.CheckSwitch): If the value is a Literal, extract
19934         the underlying literal.
19935
19936         Also in the unused hashtable we had, add the SwitchLabel so we can
19937         quickly look this value up.
19938
19939         * constant.cs: Implement a bunch of new constants.  Rewrite
19940         Literal based on this.  Made changes everywhere to adapt to this.
19941
19942         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19943         dereferencing array only once, and also copes with enumrations.
19944
19945         bytes are two bytes wide, not one.
19946
19947         (Cast): Perform constant conversions.
19948
19949         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19950         wrappers to the literals here.
19951
19952         * expression.cs (DoNumericPromotions): long literals can converted
19953         to ulong implicity (this is taken care of elsewhere, but I was
19954         missing this spot).
19955
19956         * ecore.cs (Expression.Literalize): Make the return type Literal,
19957         to improve type checking.
19958
19959         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19960
19961 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * literal.cs: Revert code from ravi that checked the bounds.  The
19964         bounds are sane by the definition of the type itself. 
19965
19966         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19967         need to actually look up in our parent hierarchy for interfaces
19968         implemented. 
19969
19970         * const.cs: Use the underlying type for enumerations
19971
19972         * delegate.cs: Compute the basename for the delegate creation,
19973         that should fix the delegate test case, and restore the correct
19974         Type Lookup semantics in rootcontext
19975
19976         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19977         referencing a nested type with the Reflection API is using the "+"
19978         sign. 
19979
19980         * cs-parser.jay: Do not require EOF token at the end.
19981
19982 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19983
19984         * rootcontext.cs (LookupType): Concatenate type names with
19985         a '.' instead of a '+' The test suite passes again.
19986
19987         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19988         field of the enumeration.
19989
19990         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19991         the case when the member is an EventExpr.
19992
19993         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19994         static has an associated instance expression.
19995
19996         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19997
19998         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19999
20000         * class.cs (Event.Define): Register event and perform appropriate checks
20001         for error #111.
20002
20003         We define the Add and Remove methods even if the use provides none because
20004         in that case, we provide default implementations ourselves.
20005
20006         Define a private field of the type of the event. This is done by the CSC compiler
20007         and we should be doing it too ;-)
20008
20009         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20010         More methods we use in code we generate.
20011
20012         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20013         is important.
20014
20015         (InitCoreTypes): Update accordingly for the above.
20016
20017         * class.cs (Event.Emit): Generate code for default accessors that we provide
20018
20019         (EmitDefaultMethod): Do the job in the above.
20020
20021         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20022         appropriate place.
20023
20024 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20027         builders even if we were missing one.
20028
20029         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20030         pass the Basename as our class name instead of the Name.  The
20031         basename will be correctly composed for us.
20032
20033         * parameter.cs (Paramters): Now takes a Location argument.
20034
20035         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20036         make all the code call directly LookupType in RootContext and take
20037         this chance to pass the Location information everywhere.
20038
20039         * Everywhere: pass Location information.
20040
20041 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20042
20043         * class.cs (Constructor.Define): Updated way of detecting the
20044         length of the parameters.
20045
20046         (TypeContainer.DefineType): Use basename as the type name for
20047         nested types.
20048
20049         (TypeContainer.Define): Do not recursively define types here, as
20050         definition is taken care in order by the RootContext.
20051
20052         * tree.cs: Keep track of namespaces in a per-file basis.
20053
20054         * parameter.cs (Parameter.ComputeSignature): Update to use
20055         DeclSpace. 
20056
20057         (Parameters.GetSignature): ditto.
20058
20059         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20060         instead of a TypeContainer.
20061
20062         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20063         resolve names.  Because we need to be resolve in our context, not
20064         our parents.
20065
20066         * driver.cs: Implement response files.
20067
20068         * class.cs (TypeContainer.DefineType): If we are defined, do not
20069         redefine ourselves.
20070
20071         (Event.Emit): Emit the code for add/remove handlers.
20072         (Event.Define): Save the MethodBuilders for add/remove.
20073
20074         * typemanager.cs: Use pair here too.
20075
20076         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20077         DictionaryEntry requires the first argument to be non-null.  
20078
20079         (enum_declaration): Compute full name for registering the
20080         enumeration.
20081
20082         (delegate_declaration): Instead of using
20083         formal_parameter_list, use opt_formal_parameter_list as the list
20084         can be empty.
20085
20086         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20087         (EventParsing): New property that controls whether `add' and
20088         `remove' are returned as tokens or identifiers (for events);
20089
20090 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20091
20092         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20093         use MyEventBuilder only and let it wrap the real builder for us.
20094
20095         (MyEventBuilder): Revamp constructor etc.
20096
20097         Implement all operations that we perform on EventBuilder in precisely the same
20098         way here too.
20099
20100         (FindMembers): Update to use the EventBuilder member.
20101
20102         (Event.Emit): Update accordingly.
20103
20104 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20105
20106         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20107         by calling the appropriate methods.
20108
20109         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20110         useful.
20111
20112         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20113
20114 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20115
20116         * delegate.cs (Delegate.Populate): Check that the return type
20117         and various parameters types are indeed accessible.
20118
20119         * class.cs (Constructor.Define): Same here.
20120
20121         (Field.Define): Ditto.
20122
20123         (Event.Define): Ditto.
20124
20125         (Operator.Define): Check that the underlying Method defined itself
20126         correctly - so it's MethodBuilder should not be null.
20127
20128         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20129         expression happens to be null.
20130
20131         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20132         members but as of now we don't seem to be able to do anything really useful with it.
20133
20134         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20135         not the EventBuilder.
20136
20137 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20138
20139         * cs-tokenizer.cs: Add support for defines.
20140         Add support for #if, #elif, #else, #endif
20141
20142         (eval_var): evaluates a variable.
20143         (eval): stubbed for evaluating functions.
20144
20145         * cs-parser.jay: Pass the defines information
20146
20147         * driver.cs: Add --define command line option.
20148
20149         * decl.cs: Move MemberCore here.
20150
20151         Make it the base class for DeclSpace.  This allows us to catch and
20152         report 108 and 109 for everything now.
20153
20154         * class.cs (TypeContainer.Define): Extract all the members
20155         before populating and emit the warning 108 (new keyword required
20156         to override) instead of having each member implement this.
20157
20158         (MemberCore.Define): New abstract method, we will be using this in
20159         the warning reporting engine in Populate.
20160
20161         (Operator.Define): Adjust to new MemberCore protocol. 
20162
20163         * const.cs (Const): This does not derive from Expression, it is a
20164         temporary object we use to create fields, it is a MemberCore. 
20165
20166         * class.cs (Method.Define): Allow the entry point to be in a
20167         specific class.
20168
20169         * driver.cs: Rewrite the argument handler to clean it up a bit.
20170
20171         * rootcontext.cs: Made it just an auxiliary namespace feature by
20172         making everything static.
20173
20174         * driver.cs: Adapt code to use RootContext type name instead of
20175         instance variable.
20176
20177         * delegate.cs: Remove RootContext argument.
20178
20179         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20180         argument. 
20181
20182         * class.cs (Event.Define): The lookup can fail.
20183
20184         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20185
20186         * expression.cs: Resolve the this instance before invoking the code.
20187
20188 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20189
20190         * cs-parser.jay: Add a production in element_access that allows
20191         the thing to become a "type" reference.  This way we can parse
20192         things like "(string [])" as a type.
20193
20194         Note that this still does not handle the more complex rules of
20195         casts. 
20196
20197
20198         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20199
20200         * ecore.cs: (CopyNewMethods): new utility function used to
20201         assemble the list of methods from running FindMembers.
20202
20203         (MemberLookup): Rework FindMembers so that 
20204
20205 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * class.cs (TypeContainer): Remove Delegates who fail to be
20208         defined.
20209
20210         * delegate.cs (Populate): Verify that we dont get null return
20211         values.   TODO: Check for AsAccessible.
20212
20213         * cs-parser.jay: Use basename to emit error 574 (destructor should
20214         have the same name as container class), not the full name.
20215
20216         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20217         possible representation.  
20218
20219         Also implements integer type suffixes U and L.
20220
20221 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20222
20223         * expression.cs (ArrayCreation.DoResolve): We need to do the
20224         argument resolution *always*.
20225
20226         * decl.cs: Make this hold the namespace.  Hold the root context as
20227         well.
20228         (LookupType): Move here.
20229
20230         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20231
20232         * location.cs (Row, Name): Fixed the code, it was always returning
20233         references to the first file.
20234
20235         * interface.cs: Register properties defined through interfaces.
20236
20237         * driver.cs: Add support for globbing on the command line
20238
20239         * class.cs (Field): Make it derive from MemberCore as well.
20240         (Event): ditto.
20241
20242 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20243
20244         * class.cs (Event::Define): Check that the type of the event is a delegate
20245         type else flag error #66.
20246
20247         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20248         same.
20249
20250         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20251         values of EntryPoint, CharSet etc etc.
20252
20253         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20254
20255         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20256         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20257         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20258         which needs this to do its work.
20259
20260         * ../errors/cs0066.cs : Add.
20261
20262 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20265         helper functions.
20266
20267         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20268         clears out the parameters field.
20269         (MemberSignatureCompare): Cleanup
20270
20271         (MemberCore): New base class used to share code between MethodCore
20272         and Property.
20273
20274         (RegisterRequiredImplementations) BindingFlags.Public requires
20275         either BindingFlags.Instace or Static.  Use instance here.
20276
20277         (Property): Refactored code to cope better with the full spec.
20278
20279         * parameter.cs (GetParameterInfo): Return an empty array instead
20280         of null on error.
20281
20282         * class.cs (Property): Abstract or extern properties have no bodies.
20283
20284         * parameter.cs (GetParameterInfo): return a zero-sized array.
20285
20286         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20287         method modifier validation to the typecontainer so we can reuse
20288         this on properties.
20289
20290         (MethodCore.ParameterTypes): return an empty sized array of types.
20291
20292         (Property.Define): Test property modifier validity.
20293
20294         Add tests for sealed/override too.
20295
20296         (Method.Emit): abstract or extern methods have no bodies.
20297
20298 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20299
20300         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20301         thing.
20302
20303         (Method::Define, ::Emit): Modify accordingly.
20304
20305         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20306
20307         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20308
20309         * makefile: Pass in /unsafe.
20310
20311 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * class.cs (MakeKey): Kill routine.
20314
20315         * class.cs (TypeContainer.Define): Correctly define explicit
20316         method implementations (they require the full interface name plus
20317         the method name).
20318
20319         * typemanager.cs: Deply the PtrHashtable here and stop using the
20320         lame keys.  Things work so much better.
20321
20322         This of course broke everyone who depended on `RegisterMethod' to
20323         do the `test for existance' test.  This has to be done elsewhere.
20324
20325         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20326         the object stupid Equals method (because, that like fails all over
20327         the place).  We still do not use it.
20328
20329         * class.cs (TypeContainer.SetRequiredInterface,
20330         TypeContainer.RequireMethods): Killed these two routines and moved
20331         all the functionality to RegisterRequiredImplementations.
20332
20333         (TypeContainer.RegisterRequiredImplementations): This routine now
20334         registers all the implementations required in an array for the
20335         interfaces and abstract methods.  We use an array of structures
20336         which can be computed ahead of time to reduce memory usage and we
20337         also assume that lookups are cheap as most classes will not
20338         implement too many interfaces.
20339
20340         We also avoid creating too many MethodSignatures.
20341
20342         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20343         clear the "pending" bit if we find that there are problems with
20344         the declaration.
20345
20346         (TypeContainer.VerifyPendingMethods): Update to report errors of
20347         methods that look like implementations but are not.
20348
20349         (TypeContainer.Define): Add support for explicit interface method
20350         implementation. 
20351
20352 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20353
20354         * typemanager.cs: Keep track of the parameters here instead of
20355         being a feature of the TypeContainer.
20356
20357         * class.cs: Drop the registration of parameters here, as
20358         InterfaceMethods are also interface declarations.
20359
20360         * delegate.cs: Register methods with the TypeManager not only with
20361         the TypeContainer.  This code was buggy.
20362
20363         * interface.cs: Full registation here.
20364
20365 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * expression.cs: Remove reducer for binary expressions, it can not
20368         be done this way.
20369
20370         * const.cs: Put here the code that used to go into constant.cs
20371
20372         * constant.cs: Put here the code for constants, this is a new base
20373         class for Literals.
20374
20375         * literal.cs: Make Literal derive from Constant.
20376
20377 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * statement.cs (Return.Emit): Report error 157 if the user
20380         attempts to return from a finally block.
20381
20382         (Return.Emit): Instead of emitting a return, jump to the end of
20383         the function.
20384
20385         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20386         LocalBuilder to store the result of the function.  ReturnLabel is
20387         the target where we jump.
20388
20389
20390 2001-12-09  Radek Doulik  <rodo@ximian.com>
20391
20392         * cs-parser.jay: remember alias in current namespace
20393
20394         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20395         namespaces
20396
20397         * class.cs (LookupAlias): lookup alias in my_namespace
20398
20399         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20400         aliases hashtable
20401         (LookupAlias): lookup alias in this and if needed in parent
20402         namespaces
20403
20404 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20405
20406         * support.cs: 
20407
20408         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20409         making things static.  I need this to avoid passing the
20410         TypeContainer when calling ParameterType.
20411
20412         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20413         that did string manipulation to compute the type and then call
20414         GetType.  Use Parameter.ParameterType instead.
20415
20416         * cs-tokenizer.cs: Consume the suffix for floating values.
20417
20418         * expression.cs (ParameterReference): figure out whether this is a
20419         reference parameter or not.  Kill an extra variable by computing
20420         the arg_idx during emission.
20421
20422         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20423         function that returns whether a parameter is an out/ref value or not.
20424
20425         (Parameter.ParameterType): The type of the parameter (base,
20426         without ref/out applied).
20427
20428         (Parameter.Resolve): Perform resolution here.
20429         (Parameter.ExternalType): The full type (with ref/out applied).
20430
20431         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20432         support for expressions on the using statement.
20433
20434 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * statement.cs (Using.EmitLocalVariableDecls): Split the
20437         localvariable handling of the using statement.
20438
20439         (Block.EmitMeta): Keep track of variable count across blocks.  We
20440         were reusing slots on separate branches of blocks.
20441
20442         (Try.Emit): Emit the general code block, we were not emitting it. 
20443
20444         Check the type of the declaration to be an IDisposable or
20445         something that can be implicity converted to it. 
20446
20447         Emit conversions if required.
20448
20449         * ecore.cs (EmptyExpression): New utility class.
20450         (Expression.ImplicitConversionExists): New utility function.
20451
20452 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20453
20454         * statement.cs (Using): Implement.
20455
20456         * expression.cs (LocalVariableReference): Support read only variables.
20457
20458         * statement.cs: Remove the explicit emit for the Leave opcode.
20459         (VariableInfo): Add a readonly field.
20460
20461 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20462
20463         * ecore.cs (ConvCast): new class used to encapsulate the various
20464         explicit integer conversions that works in both checked and
20465         unchecked contexts.
20466
20467         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20468         properly generate the overflow opcodes.
20469
20470 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20471
20472         * statement.cs: The correct type for the EmptyExpression is the
20473         element_type, not the variable type.  Ravi pointed this out.
20474
20475 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20476
20477         * class.cs (Method::Define): Handle PInvoke methods specially
20478         by using DefinePInvokeMethod instead of the usual one.
20479
20480         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20481         above to do the task of extracting information and defining the method.
20482
20483 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20484
20485         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20486         of the condition for string type.
20487
20488         (Emit): Move that here. 
20489
20490         (ArrayCreation::CheckIndices): Keep string literals in their expression
20491         form.
20492
20493         (EmitDynamicInitializers): Handle strings appropriately.
20494
20495 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * codegen.cs (EmitContext): Replace multiple variables with a
20498         single pointer to the current Switch statement.
20499
20500         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20501         EmitContext.
20502
20503 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20504
20505         * statement.cs 
20506
20507         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20508         default'.
20509
20510         (Foreach.Emit): Foreach on arrays was not setting
20511         up the loop variables (for break/continue).
20512
20513         (GotoCase): Semi-implented.
20514
20515 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20516
20517         * attribute.cs (CheckAttribute): Handle system attributes by using
20518         Attribute.GetAttributes to examine information we need.
20519
20520         (GetValidPlaces): Same here.
20521
20522         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20523
20524         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20525
20526         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20527
20528         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20529
20530         (Method::Emit): Handle the case when we are a PInvoke method.
20531
20532 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * expression.cs: Use ResolveWithSimpleName on compound names.
20535
20536 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20537
20538         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20539         before trying to reduce it.
20540
20541         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20542
20543         * constant.cs (LookupConstantValue): Implement.
20544
20545         (EmitConstant): Use the above in emitting the constant.
20546
20547         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20548         that are user-defined by doing a LookupConstantValue on them.
20549
20550         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20551         too, like above.
20552
20553 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20554
20555         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20556
20557         (BaseAccess.DoResolve): Implement.
20558
20559         (MemberAccess.DoResolve): Split this routine into a
20560         ResolveMemberAccess routine that can be used independently
20561
20562 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20563
20564         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20565         As that share bits of the implementation.  Is returns a boolean,
20566         while As returns the Type that is being probed.
20567
20568 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20569
20570         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20571         instead of a Literal - much easier.
20572
20573         (EnumInTransit): Remove - utterly useless :-)
20574
20575         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20576
20577         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20578
20579         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20580         chain when we have no associated expression.
20581
20582 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20583
20584         * constant.cs (Define): Use Location while reporting the errror.
20585
20586         Also emit a warning when 'new' is used and there is no inherited
20587         member to hide.
20588
20589         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20590         populated.
20591
20592         (LookupEnumValue): Implement to lookup an enum member's value and define it
20593         if necessary.
20594
20595         (Populate): Re-write accordingly to use the above routine.
20596
20597 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20598
20599         * expression.cs (This): Fix prototype for DoResolveLValue to
20600         override the base class DoResolveLValue.
20601
20602         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20603         declarations) 
20604
20605         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20606         (we need to load the address of the field here).  This fixes
20607         test-22. 
20608
20609         (FieldExpr.DoResolveLValue): Call the DoResolve
20610         function to initialize the Instance expression.
20611
20612         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20613         correctly the GetEnumerator operation on a value type.
20614
20615         * cs-parser.jay: Add more simple parsing error catches.
20616
20617         * statement.cs (Switch): Add support for string switches.
20618         Handle null specially.
20619
20620         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20621
20622 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20623
20624         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20625
20626         (declare_local_constant): New helper function.
20627
20628         * statement.cs (AddConstant): Keep a separate record of constants
20629
20630         (IsConstant): Implement to determine if a variable is a constant.
20631
20632         (GetConstantExpression): Implement.
20633
20634         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20635
20636         * statement.cs (IsVariableDefined): Re-write.
20637
20638 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20639
20640         * class.cs (TypeContainer::FindMembers): Look for constants
20641         in the case when we are looking for MemberTypes.Field
20642
20643         * expression.cs (MemberAccess::DoResolve): Check that in the
20644         case we are a FieldExpr and a Literal, we are not being accessed
20645         by an instance reference.
20646
20647         * cs-parser.jay (local_constant_declaration): Implement.
20648
20649         (declaration_statement): Implement for constant declarations.
20650
20651 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20652
20653         * statement.cs (Switch): Catch double defaults.
20654
20655         (Switch): More work on the switch() statement
20656         implementation.  It works for integral values now, need to finish
20657         string support.
20658
20659
20660 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20663         integer literals into other integer literals.  To be used by
20664         switch. 
20665
20666 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20667
20668         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20669         some memory.
20670
20671         (EmitDynamicInitializers): Cope with the above since we extract data
20672         directly from ArrayData now.
20673
20674         (ExpectInitializers): Keep track of whether initializers are mandatory
20675         or not.
20676
20677         (Bounds): Make it a hashtable to prevent the same dimension being 
20678         recorded for every element in that dimension.
20679
20680         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20681         from being found.
20682
20683         Also fix bug which was causing the indices to be emitted in the reverse
20684         order.
20685
20686 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20689         unfinished.  They do not work, because the underlying code is
20690         sloppy.
20691
20692 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20693
20694         * cs-parser.jay: Remove bogus fixme.
20695
20696         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20697         on Switch statement.
20698
20699 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20700
20701         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20702         the same. 
20703
20704         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20705         parameter. Apparently, any expression is allowed. 
20706
20707         (ValidateInitializers): Update accordingly.
20708
20709         (CheckIndices): Fix some tricky bugs thanks to recursion.
20710
20711         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20712         I was being completely brain-dead.
20713
20714         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20715         and re-write acordingly.
20716
20717         (DelegateInvocation): Re-write accordingly.
20718
20719         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20720
20721         (MakeByteBlob): Handle types more correctly.
20722
20723         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20724         initialization from expressions but it is incomplete because I am a complete
20725         Dodo :-|
20726
20727 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20730         on If.  Basically, we have to return `true' (ie, we do return to
20731         our caller) only if both branches of the if return.
20732
20733         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20734         short-circuit operators, handle them as short circuit operators. 
20735
20736         (Cast.DoResolve): Resolve type.
20737         (Cast.Cast): Take an expression as the target type.
20738
20739         * cs-parser.jay (cast_expression): Remove old hack that only
20740         allowed a limited set of types to be handled.  Now we take a
20741         unary_expression and we resolve to a type during semantic
20742         analysis.
20743
20744         Use the grammar productions from Rhys to handle casts (this is
20745         not complete like Rhys syntax yet, we fail to handle that corner
20746         case that C# has regarding (-x), but we will get there.
20747
20748 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20749
20750         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20751         field which is an array type.
20752
20753         * cs-parser.jay (declare_local_variables): Support array initialization too.
20754
20755         * typemanager.cs (MakeKey): Implement.
20756
20757         (everywhere): Use the above appropriately.
20758
20759         * cs-parser.jay (for_statement): Update for array initialization while
20760         declaring variables.
20761
20762         * ecore.cs : The error message was correct, it's the variable's names that
20763         were misleading ;-) Make the code more readable.
20764
20765         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20766         the correct type etc.
20767
20768         (ConvertExplicit): Handle Enum types by examining the underlying type.
20769
20770 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20771
20772         * parameter.cs (GetCallingConvention): Always return
20773         CallingConventions.Standard for now.
20774
20775 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20776
20777         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20778         and `r' after calling DoNumericPromotions.
20779
20780         * ecore.cs: Fix error message (the types were in the wrong order).
20781
20782         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20783         BindingFlags.Instance as well 
20784
20785         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20786         implicit int literal conversion in an empty cast so that we
20787         propagate the right type upstream.
20788
20789         (UnboxCast): new class used to unbox value types.
20790         (Expression.ConvertExplicit): Add explicit type conversions done
20791         by unboxing.
20792
20793         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20794         the target type before applying the implicit LongLiterals to ULong
20795         literal cast.
20796
20797 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * cs-parser.jay (for_statement): Reworked the way For works: now
20800         we declare manually any variables that are introduced in
20801         for_initializer to solve the problem of having out-of-band code
20802         emition (that is what got for broken).
20803
20804         (declaration_statement): Perform the actual variable declaration
20805         that used to be done in local_variable_declaration here.
20806
20807         (local_variable_declaration): Do not declare anything, just pass
20808         the information on a DictionaryEntry
20809
20810 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20811
20812         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20813         re-write of the logic to now make it recursive.
20814
20815         (UpdateIndices): Re-write accordingly.
20816
20817         Store element data in a separate ArrayData list in the above methods.
20818
20819         (MakeByteBlob): Implement to dump the array data into a byte array.
20820
20821 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20822
20823         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20824         into CheckIndices.
20825
20826         * constant.cs (Define): Implement.
20827
20828         (EmitConstant): Re-write fully.
20829
20830         Pass in location info.
20831
20832         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20833         respectively.
20834
20835         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20836         DictionaryEntry since we need location info too.
20837
20838         (constant_declaration): Update accordingly.
20839
20840         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20841         code into another method : UpdateIndices.
20842
20843 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20844
20845         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20846         some type checking etc.
20847
20848 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20849
20850         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20851         bits to provide dimension info if the user skips doing that.
20852
20853         Update second constructor to store the rank correctly.
20854
20855 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20856
20857         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20858         and try to implement.
20859
20860         * ../errors/cs0150.cs : Add.
20861
20862         * ../errors/cs0178.cs : Add.
20863
20864 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20865
20866         * statement.cs: Implement foreach on multi-dimensional arrays. 
20867
20868         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20869         name of the params argument.
20870
20871         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20872         initializing the array.
20873
20874         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20875         we can use this elsewhere.
20876
20877         * statement.cs: Finish implementation of foreach for single
20878         dimension arrays.
20879
20880         * cs-parser.jay: Use an out-of-band stack to pass information
20881         around, I wonder why I need this.
20882
20883         foreach_block: Make the new foreach_block the current_block.
20884
20885         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20886         function used to return a static Parameters structure.  Used for
20887         empty parameters, as those are created very frequently.
20888
20889         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20890
20891 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20892
20893         * interface.cs : Default modifier is private, not public. The
20894         make verify test passes again.
20895
20896 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20897
20898         * support.cs (ReflectionParameters): Fix logic to determine
20899         whether the last parameter is a params one. Test 9 passes again.
20900
20901         * delegate.cs (Populate): Register the builders we define with
20902         RegisterParameterForBuilder. Test 19 passes again.
20903
20904         * cs-parser.jay (property_declaration): Reference $6 instead
20905         of $$ to get at the location.
20906
20907         (indexer_declaration): Similar stuff.
20908
20909         (attribute): Ditto.
20910
20911         * class.cs (Property): Register parameters for the Get and Set methods
20912         if they exist. Test 23 passes again.
20913
20914         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20915         call to EmitArguments as we are sure there aren't any params arguments. 
20916         Test 32 passes again.
20917
20918         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20919         IndexOutOfRangeException. 
20920
20921         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20922         Test 33 now passes again.
20923
20924 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20927         broke a bunch of things.  Will have to come up with a better way
20928         of tracking locations.
20929
20930         * statement.cs: Implemented foreach for single dimension arrays.
20931
20932 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20935         an error.  This removes the lookup from the critical path.
20936
20937         * cs-parser.jay: Removed use of temporary_loc, which is completely
20938         broken. 
20939
20940 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * support.cs (ReflectionParameters.ParameterModifier): Report
20943         whether the argument is a PARAMS argument or not.
20944
20945         * class.cs: Set the attribute `ParamArrayAttribute' on the
20946         parameter argument.
20947
20948         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20949         and cons_param_array_attribute (ConstructorInfo for
20950         ParamArrayAttribute)., 
20951
20952         * codegen.cs: Emit the return using the `Return' statement, that
20953         way we can report the error correctly for missing return values. 
20954
20955         * class.cs (Method.Emit): Clean up.
20956
20957         * expression.cs (Argument.Resolve): Take another argument: the
20958         location where this argument is used.  Notice that this is not
20959         part of the "Argument" class as to reduce the size of the
20960         structure (we know the approximate location anyways).
20961
20962         Test if the argument is a variable-reference, if not, then
20963         complain with a 206.
20964
20965         (Argument.Emit): Emit addresses of variables.
20966
20967         (Argument.FullDesc): Simplify.
20968
20969         (Invocation.DoResolve): Update for Argument.Resolve.
20970
20971         (ElementAccess.DoResolve): ditto.
20972
20973         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20974         method should be virtual, as this method is always virtual.
20975
20976         (NewDelegate.DoResolve): Update for Argument.Resolve.
20977
20978         * class.cs (ConstructorInitializer.DoResolve): ditto.
20979
20980         * attribute.cs (Attribute.Resolve): ditto.
20981
20982 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20983
20984         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20985
20986         * expression.cs (ParameterReference): Drop IStackStorage and implement
20987         IAssignMethod instead. 
20988
20989         (LocalVariableReference): ditto.
20990
20991         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20992         IAssignMethod instead. 
20993
20994 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20995
20996         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20997         enumerations that are used in heavily used structures derive from
20998         byte in a laughable and pathetic attempt to reduce memory usage.
20999         This is the kind of pre-optimzations that you should not do at
21000         home without adult supervision.
21001
21002         * expression.cs (UnaryMutator): New class, used to handle ++ and
21003         -- separatedly from the other unary operators.  Cleans up the
21004         code, and kills the ExpressionStatement dependency in Unary.
21005
21006         (Unary): Removed `method' and `Arguments' from this class, making
21007         it smaller, and moving it all to SimpleCall, so I can reuse this
21008         code in other locations and avoid creating a lot of transient data
21009         strucutres when not required.
21010
21011         * cs-parser.jay: Adjust for new changes.
21012
21013 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * enum.cs (Enum.Populate): If there is a failure during
21016         definition, return
21017
21018         * cs-parser.jay (opt_enum_base): we used to catch type errors
21019         here, but this is really incorrect.  The type error should be
21020         catched during semantic analysis.
21021
21022 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21023
21024         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21025         current_local_parameters as expected since I, in my stupidity, had forgotten
21026         to do this :-)
21027
21028         * attribute.cs (GetValidPlaces): Fix stupid bug.
21029
21030         * class.cs (Method::Emit): Perform check on applicability of attributes.
21031
21032         (Constructor::Emit): Ditto.
21033
21034         (Field::Emit): Ditto.
21035
21036         (Field.Location): Store location information.
21037
21038         (Property, Event, Indexer, Operator): Ditto.
21039
21040         * cs-parser.jay (field_declaration): Pass in location for each field.
21041
21042         * ../errors/cs0592.cs : Add.
21043
21044 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21045
21046         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21047
21048         (InitCoreTypes): Update accordingly.
21049
21050         (RegisterAttrType, LookupAttr): Implement.
21051
21052         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21053         info about the same.
21054
21055         (Resolve): Update to populate the above as necessary.
21056
21057         (Error592): Helper.
21058
21059         (GetValidPlaces): Helper to the above.
21060
21061         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21062
21063         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21064
21065 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21066
21067         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21068
21069         * ../errors/cs0617.cs : Add.
21070
21071 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21072
21073         * enum.cs (Emit): Rename to Populate to be more consistent with what
21074         we expect it to do and when exactly it is called.
21075
21076         * class.cs, rootcontext.cs : Update accordingly.
21077
21078         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21079         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21080
21081         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21082
21083         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21084         of a fieldinfo using the above, when dealing with a FieldBuilder.
21085
21086 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21087
21088         * ../errors/cs0031.cs : Add.
21089
21090         * ../errors/cs1008.cs : Add.
21091
21092         * ../errrors/cs0543.cs : Add.
21093
21094         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21095         enum type.
21096
21097         (FindMembers): Implement.
21098
21099         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21100         enums and delegates too.
21101
21102         (enum_types): Rename to builder_to_enum.
21103
21104         (delegate_types): Rename to builder_to_delegate.
21105
21106         * delegate.cs (FindMembers): Implement.
21107
21108 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21109
21110         * typemanager.cs (IsEnumType): Implement.
21111
21112         * enum.cs (Emit): Re-write parts to account for the underlying type
21113         better and perform checking etc.
21114
21115         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21116         of the underlying type.
21117
21118         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21119         value
21120
21121         * enum.cs (error31): Helper to report error #31.
21122
21123         * cs-parser.jay (enum_declaration): Store location of each member too.
21124
21125         * enum.cs (member_to_location): New hashtable. 
21126
21127         (AddEnumMember): Update location hashtable.
21128
21129         (Emit): Use the location of each member while reporting errors.
21130
21131 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * cs-parser.jay: A for_initializer if is a
21134         local_variable_declaration really ammount to have an implicit
21135         block with the variable declaration and no initializer for for.
21136
21137         * statement.cs (For.Emit): Cope with null initializers.
21138
21139         This fixes the infinite loop on for initializers.
21140
21141 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * enum.cs: More cleanup.
21144
21145         * ecore.cs: Remove dead code.
21146
21147         * class.cs (Property.Emit): More simplification.
21148         (Event.Emit): ditto.
21149
21150         Reworked to have less levels of indentation.
21151
21152 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21153
21154         * class.cs (Property): Emit attributes.
21155
21156         (Field): Ditto.
21157
21158         (Event): Ditto.
21159
21160         (Indexer): Ditto.
21161
21162         (Operator): Ditto.
21163
21164         * enum.cs (Emit): Ditto.
21165
21166         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21167         Enums too.
21168
21169         * class.cs (Field, Event, etc.): Move attribute generation into the
21170         Emit method everywhere.
21171
21172         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21173         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21174         as we had no way of defining nested enums !
21175
21176         * rootcontext.cs : Adjust code accordingly.
21177
21178         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21179
21180 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21181
21182         * expression.cs (EvalConstantExpression): Move into ecore.cs
21183
21184         * enum.cs (Enum): Rename some members and make them public and readonly
21185         according to our convention.
21186
21187         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21188         nothing else.
21189
21190         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21191
21192         (Enum::Emit): Write a simple version for now which doesn't try to compute
21193         expressions. I shall modify this to be more robust in just a while.
21194
21195         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21196
21197         (TypeContainer::CloseType): Create the Enum types too.
21198
21199         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21200
21201         * expression.cs (EvalConstantExpression): Get rid of completely.
21202
21203         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21204         user-defined values and other cases.
21205
21206         (IsValidEnumLiteral): Helper function.
21207
21208         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21209         out there in the case we had a literal FieldExpr.
21210
21211         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21212
21213         (Literalize): Revamp a bit to take two arguments.
21214
21215         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21216
21217 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21218
21219         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21220
21221         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21222
21223         (Resolve): Use the above to ensure we have proper initializers.
21224
21225 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21226
21227         * expression.cs (Expression::EvalConstantExpression): New method to 
21228         evaluate constant expressions.
21229
21230         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21231
21232 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21233
21234         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21235         in an array.
21236
21237         (Binary.ResolveOperator): Handle operator != (object a, object b)
21238         and operator == (object a, object b);
21239
21240         (Binary.DoNumericPromotions): Indicate whether the numeric
21241         promotion was possible.
21242
21243         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21244         Implement.  
21245
21246         Made the ArrayAccess implement interface IAssignMethod instead of
21247         IStackStore as the order in which arguments are passed reflects
21248         this.
21249
21250         * assign.cs: Instead of using expr.ExprClass to select the way of
21251         assinging, probe for the IStackStore/IAssignMethod interfaces.
21252
21253         * typemanager.cs: Load InitializeArray definition.
21254
21255         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21256         static data that can be used to initialize arrays. 
21257
21258 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21259
21260         * expression.cs: Handle operator== and operator!= for booleans.
21261
21262         (Conditioal.Reduce): Implement reducer for the ?: operator.
21263
21264         (Conditional.Resolve): Implement dead code elimination.
21265
21266         (Binary.Resolve): Catch string literals and return a new
21267         concatenated string.
21268
21269         (Unary.Reduce): Implement reduction of unary expressions.
21270
21271         * ecore.cs: Split out the expression core handling here.
21272
21273         (Expression.Reduce): New method used to perform constant folding
21274         and CSE.  This is needed to support constant-expressions. 
21275
21276         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21277         targets, and optimize for !x.
21278
21279 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21280
21281         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21282         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21283         set custom atttributes.
21284
21285         * literal.cs (Literal::GetValue): New abstract method to return the actual
21286         value of the literal, cast as an object.
21287
21288         (*Literal): Implement GetValue method.
21289
21290         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21291         expressions to the arraylist but objects of type Argument.
21292
21293         * class.cs (TypeContainer::Emit): Emit our attributes too.
21294
21295         (Method::Emit, Constructor::Emit): Ditto.
21296
21297         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21298         to be ignoring earlier.
21299
21300 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21301
21302         * attribute.cs (AttributeSection::Define): Implement to do the business
21303         of constructing a CustomAttributeBuilder.
21304
21305         (Attribute): New trivial class. Increases readability of code.  
21306
21307         * cs-parser.jay : Update accordingly.
21308
21309         (positional_argument_list, named_argument_list, named_argument): New rules
21310
21311         (attribute_arguments): Use the above so that we are more correct.
21312
21313 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21314
21315         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21316         to perform all checks for a method with a params parameter.
21317
21318         (Invocation::OverloadResolve): Update to use the above method and therefore
21319         cope correctly with params method invocations.
21320
21321         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21322         params too.
21323
21324         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21325         constructors in our parent too because we can't afford to miss out on 
21326         protected ones ;-)
21327
21328         * attribute.cs (AttributeSection): New name for the class Attribute
21329
21330         Other trivial changes to improve readability.
21331
21332         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21333         use the new class names.
21334
21335 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21336
21337         * class.cs (Method::Define): Complete definition for params types too
21338
21339         (Indexer::Define): Ditto.
21340
21341         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21342         Cope everywhere with a request for info about the array parameter.
21343
21344 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21345
21346         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21347
21348         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21349         local_variable_type to extract the string corresponding to the type.
21350
21351         (local_variable_type): Fixup the action to use the new helper method.
21352
21353         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21354         go.
21355
21356         * expression.cs : Clean out code which uses the above.
21357
21358 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21359
21360         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21361         and bale out if necessary by returning a false.
21362
21363         (RegisterProperty): Ditto.
21364
21365         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21366         and print out appropriate error messages.
21367
21368         * interface.cs (everywhere): Ditto.
21369
21370         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21371         location to constructor.
21372
21373         * class.cs (Property, Event, Indexer): Update accordingly.
21374
21375         * ../errors/cs111.cs : Added.
21376
21377         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21378         of a method, as laid down by the spec.
21379
21380         (Invocation::OverloadResolve): Use the above method.
21381
21382 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21383
21384         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21385         now take a TypeContainer and a Parameters object.
21386
21387         (ParameterData): Modify return type of ParameterModifier method to be 
21388         Parameter.Modifier and not a string.
21389
21390         (ReflectionParameters, InternalParameters): Update accordingly.
21391
21392         * expression.cs (Argument::GetParameterModifier): Same here.
21393
21394         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21395         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21396         symbol in it at all so maybe this is only for now.
21397
21398 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21399
21400         * support.cs (InternalParameters): Constructor now takes an extra argument 
21401         which is the actual Parameters class.
21402
21403         (ParameterDesc): Update to provide info on ref/out modifiers.
21404
21405         * class.cs (everywhere): Update call to InternalParameters to pass in
21406         the second argument too.
21407
21408         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21409         to return the modifier info [ref/out etc]
21410
21411         (InternalParameters, ReflectionParameters): Implement the above.
21412
21413         * expression.cs (Argument::ParameterModifier): Similar function to return
21414         info about the argument's modifiers.
21415
21416         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21417         too.
21418
21419         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21420         a new SetFormalParameters object which we pass to InternalParameters.
21421
21422 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21423
21424         * expression.cs (NewArray): Merge into the ArrayCreation class.
21425
21426 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21427
21428         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21429         NewUserdefinedArray into one as there wasn't much of a use in having
21430         two separate ones.
21431
21432         * expression.cs (Argument): Change field's name to ArgType from Type.
21433
21434         (Type): New readonly property which returns the proper type, taking into 
21435         account ref/out modifiers.
21436
21437         (everywhere): Adjust code accordingly for the above.
21438
21439         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21440         whether we are emitting for a ref or out parameter.
21441
21442         * expression.cs (Argument::Emit): Use the above field to set the state.
21443
21444         (LocalVariableReference::Emit): Update to honour the flag and emit the
21445         right stuff.
21446
21447         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21448
21449         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21450
21451         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21452
21453         (ReflectionParameters, InternalParameters): Implement the above method.
21454
21455         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21456         reporting errors.
21457
21458         (Invocation::FullMethodDesc): Ditto. 
21459
21460 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21461
21462         * cs-parser.jay: Add extra production for the second form of array
21463         creation. 
21464
21465         * expression.cs (ArrayCreation): Update to reflect the above
21466         change. 
21467
21468         * Small changes to prepare for Array initialization.
21469
21470 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21471
21472         * typemanager.cs (ImplementsInterface): interface might be null;
21473         Deal with this problem;
21474
21475         Also, we do store negative hits on the cache (null values), so use
21476         this instead of calling t.GetInterfaces on the type everytime.
21477
21478 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21479
21480         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21481
21482         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21483         split functionality out into different classes.
21484
21485         (New::FormArrayType): Move into NewBuiltinArray.
21486
21487         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21488         quite useless.
21489
21490         (NewBuiltinArray): New class to handle creation of built-in arrays.
21491
21492         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21493         account creation of one-dimensional arrays.
21494
21495         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21496
21497         (NewUserdefinedArray::DoResolve): Implement.
21498
21499         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21500
21501         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21502         we maintain inside the TypeManager. This is necessary to perform lookups on the
21503         module builder.
21504
21505         (LookupType): Update to perform GetType on the module builders too.     
21506
21507         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21508
21509         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21510
21511 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21512
21513         * expression.cs (New::DoResolve): Implement guts of array creation.
21514
21515         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21516
21517 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21518
21519         * expression.cs: Fix bug I introduced lsat night that broke
21520         Delegates. 
21521
21522         (Expression.Resolve): Report a 246 error (can not resolve name)
21523         if we find a SimpleName in the stream.
21524
21525         (Expression.ResolveLValue): Ditto.
21526
21527         (Expression.ResolveWithSimpleName): This function is a variant of
21528         ResolveName, this one allows SimpleNames to be returned without a
21529         warning.  The only consumer of SimpleNames is MemberAccess
21530
21531 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21532
21533         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21534         might arrive here.  I have my doubts that this is correct.
21535
21536         * statement.cs (Lock): Implement lock statement.
21537
21538         * cs-parser.jay: Small fixes to support `lock' and `using'
21539
21540         * cs-tokenizer.cs: Remove extra space
21541
21542         * driver.cs: New flag --checked, allows to turn on integer math
21543         checking. 
21544
21545         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21546         Threading.Monitor.Exit 
21547
21548 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21549
21550         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21551         Expression Class to be IndexerAccess.
21552
21553         Notice that Indexer::DoResolve sets the eclass to Value.
21554
21555 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21556
21557         * class.cs (TypeContainer::Emit): Emit code for indexers.
21558
21559         * assign.cs (IAssignMethod): New interface implemented by Indexers
21560         and Properties for handling assignment.
21561
21562         (Assign::Emit): Simplify and reuse code. 
21563
21564         * expression.cs (IndexerAccess, PropertyExpr): Implement
21565         IAssignMethod, clean up old code. 
21566
21567 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21568
21569         * typemanager.cs (ImplementsInterface): New method to determine if a type
21570         implements a given interface. Provides a nice cache too.
21571
21572         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21573         method.
21574
21575         (ConvertReferenceExplicit): Ditto.
21576
21577         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21578         various methods, with correct names etc.
21579
21580         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21581         Operator.UnaryNegation.
21582
21583         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21584         we have a unary plus or minus operator.
21585
21586         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21587         UnaryMinus.
21588
21589         * everywhere : update accordingly.
21590
21591         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21592         respectively.
21593
21594         * class.cs (Method::Define): For the case where we are implementing a method
21595         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21596         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21597
21598 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21599
21600         * interface.cs (FindMembers): Implement to work around S.R.E
21601         lameness.
21602
21603         * typemanager.cs (IsInterfaceType): Implement.
21604
21605         (FindMembers): Update to handle interface types too.
21606
21607         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21608         use IsAssignableFrom as that is not correct - it doesn't work.
21609
21610         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21611         and accordingly override EmitStatement.
21612
21613         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21614         using the correct logic :-)
21615
21616 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21617
21618         * ../errors/cs-11.cs : Add to demonstrate error -11 
21619
21620 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21621
21622         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21623         then pass this as a hint to ResolveLValue.
21624
21625         * expression.cs (FieldExpr): Add Location information
21626
21627         (FieldExpr::LValueResolve): Report assignment to readonly
21628         variable. 
21629
21630         (Expression::ExprClassFromMemberInfo): Pass location information.
21631
21632         (Expression::ResolveLValue): Add new method that resolves an
21633         LValue. 
21634
21635         (Expression::DoResolveLValue): Default invocation calls
21636         DoResolve. 
21637
21638         (Indexers): New class used to keep track of indexers in a given
21639         Type. 
21640
21641         (IStackStore): Renamed from LValue, as it did not really describe
21642         what this did.  Also ResolveLValue is gone from this interface and
21643         now is part of Expression.
21644
21645         (ElementAccess): Depending on the element access type
21646
21647         * typemanager.cs: Add `indexer_name_type' as a Core type
21648         (System.Runtime.CompilerServices.IndexerNameAttribute)
21649
21650         * statement.cs (Goto): Take a location.
21651
21652 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21653
21654         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21655         if two delegates are compatible.
21656
21657         (NewDelegate::DoResolve): Update to take care of the case when
21658         we instantiate a delegate from another delegate.
21659
21660         * typemanager.cs (FindMembers): Don't even try to look up members
21661         of Delegate types for now.
21662
21663 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21664
21665         * delegate.cs (NewDelegate): New class to take care of delegate
21666         instantiation.
21667
21668         * expression.cs (New): Split the delegate related code out into 
21669         the NewDelegate class.
21670
21671         * delegate.cs (DelegateInvocation): New class to handle delegate 
21672         invocation.
21673
21674         * expression.cs (Invocation): Split out delegate related code into
21675         the DelegateInvocation class.
21676
21677 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21678
21679         * expression.cs (New::DoResolve): Implement delegate creation fully
21680         and according to the spec.
21681
21682         (New::DoEmit): Update to handle delegates differently.
21683
21684         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21685         because of which we were printing out arguments in reverse order !
21686
21687         * delegate.cs (VerifyMethod): Implement to check if the given method
21688         matches the delegate.
21689
21690         (FullDelegateDesc): Implement.
21691
21692         (VerifyApplicability): Implement.
21693
21694         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21695         delegate invocations too.
21696
21697         (Invocation::Emit): Ditto.
21698
21699         * ../errors/cs1593.cs : Added.
21700
21701         * ../errors/cs1594.cs : Added.
21702
21703         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21704
21705 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21706
21707         * typemanager.cs (intptr_type): Core type for System.IntPtr
21708
21709         (InitCoreTypes): Update for the same.
21710
21711         (iasyncresult_type, asynccallback_type): Ditto.
21712
21713         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21714         correct.
21715
21716         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21717         too.
21718
21719         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21720         the builders for the 4 members of a delegate type :-)
21721
21722         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21723         type.
21724
21725         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21726
21727         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21728
21729 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21730
21731         * statement.cs (Break::Emit): Implement.   
21732         (Continue::Emit): Implement.
21733
21734         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21735         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21736         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21737         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21738         end loop
21739
21740         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21741         properties that track the label for the current loop (begin of the
21742         loop and end of the loop).
21743
21744 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21745
21746         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21747         use of emitting anything at all.
21748
21749         * class.cs, rootcontext.cs : Get rid of calls to the same.
21750
21751         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21752
21753         (Populate): Define the constructor correctly and set the implementation
21754         attributes.
21755
21756         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21757         have been defined.
21758
21759         (AddDelegateType): Implement.
21760
21761         (IsDelegateType): Implement helper method.
21762
21763         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21764
21765         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21766         and accordingly handle it.
21767
21768         * delegate.cs (Populate): Take TypeContainer argument.
21769         Implement bits to define the Invoke method. However, I still haven't figured out
21770         how to take care of the native int bit :-(
21771
21772         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21773         Qualify the name of the delegate, not its return type !
21774
21775         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21776         conversion.
21777
21778         (StandardConversionExists): Checking for array types turns out to be recursive.
21779
21780         (ConvertReferenceExplicit): Implement array conversion.
21781
21782         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21783
21784 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21785
21786         * cs-parser.jay (delegate_declaration): Store the fully qualified
21787         name as it is a type declaration.
21788
21789         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21790         readonly.
21791
21792         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21793         as TypeContainer::DefineType.
21794
21795         (Populate): Method in which all the definition of the various methods (Invoke)
21796         etc is done.
21797
21798         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21799         see.
21800
21801         (CloseDelegate): Finally creates the delegate.
21802
21803         * class.cs (TypeContainer::DefineType): Update to define delegates.
21804         (Populate, Emit and CloseType): Do the same thing here too.
21805
21806         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21807         delegates in all these operations.
21808
21809 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * expression.cs: LocalTemporary: a new expression used to
21812         reference a temporary that has been created.
21813
21814         * assign.cs: Handle PropertyAccess back here, so that we can
21815         provide the proper semantic access to properties.
21816
21817         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21818         a few more explicit conversions. 
21819
21820         * modifiers.cs: `NEW' modifier maps to HideBySig.
21821
21822         * expression.cs (PropertyExpr): Make this into an
21823         ExpressionStatement, and support the EmitStatement code path. 
21824
21825         Perform get/set error checking, clean up the interface.
21826
21827         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21828         them into toplevel access objects.
21829
21830 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21831
21832         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21833         SRE.
21834
21835         * typemanager.cs: Keep track here of our PropertyBuilders again to
21836         work around lameness in SRE.
21837
21838 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21839
21840         * expression.cs (LValue::LValueResolve): New method in the
21841         interface, used to perform a second resolution pass for LValues. 
21842
21843         (This::DoResolve): Catch the use of this in static methods.
21844
21845         (This::LValueResolve): Implement.
21846
21847         (This::Store): Remove warning, assigning to `this' in structures
21848         is 
21849
21850         (Invocation::Emit): Deal with invocation of
21851         methods on value types.  We need to pass the address to structure
21852         methods rather than the object itself.  (The equivalent code to
21853         emit "this" for structures leaves the entire structure on the
21854         stack instead of a pointer to it). 
21855
21856         (ParameterReference::DoResolve): Compute the real index for the
21857         argument based on whether the method takes or not a `this' pointer
21858         (ie, the method is static).
21859
21860         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21861         value types returned from functions when we need to invoke a
21862         method on the sturcture.
21863
21864
21865 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21866
21867         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21868         defining the type in the Modulebuilder or Typebuilder. This is to take
21869         care of nested types which need to be defined on the TypeBuilder using
21870         DefineNestedMethod.
21871
21872         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21873         methods in RootContext, only ported to be part of TypeContainer.
21874
21875         (TypeContainer::GetInterfaceOrClass): Ditto.
21876
21877         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21878
21879         * interface.cs (Interface::DefineInterface): New method. Does exactly
21880         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21881         too.
21882
21883         (Interface::GetInterfaces): Move from RootContext here and port.
21884
21885         (Interface::GetInterfaceByName): Same here.
21886
21887         * rootcontext.cs (ResolveTree): Re-write.
21888
21889         (PopulateTypes): Re-write.
21890
21891         * class.cs (TypeContainer::Populate): Populate nested types too.
21892         (TypeContainer::Emit): Emit nested members too.
21893
21894         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21895         instead just use the name argument passed in as it is already fully
21896         qualified.
21897
21898         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21899         to TypeContainer mapping to see if a type is user-defined.
21900
21901         * class.cs (TypeContainer::CloseType): Implement. 
21902
21903         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21904         the default constructor.
21905
21906         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21907         twice.
21908
21909         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21910
21911         * interface.cs (CloseType): Create the type here.
21912
21913         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21914         the hierarchy.
21915
21916         Remove all the methods which are now in TypeContainer.
21917
21918 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21919
21920         * delegate.cs (Define): Re-write bits to define the delegate
21921         correctly.
21922
21923 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21924
21925         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21926
21927         * expression.cs (ImplicitReferenceConversion): handle null as well
21928         as a source to convert to any reference type.
21929
21930         * statement.cs (Return): Perform any implicit conversions to
21931         expected return type.  
21932
21933         Validate use of return statement.  
21934
21935         * codegen.cs (EmitContext): Pass the expected return type here.
21936
21937         * class.cs (Method, Constructor, Property): Pass expected return
21938         type to EmitContext.
21939
21940 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21941
21942         * expression.cs: Make DoResolve take an EmitContext instead of a
21943         TypeContainer.
21944
21945         Replaced `l' and `location' for `loc', for consistency.
21946
21947         (Error, Warning): Remove unneeded Tc argument.
21948
21949         * assign.cs, literal.cs, constant.cs: Update to new calling
21950         convention. 
21951
21952         * codegen.cs: EmitContext now contains a flag indicating whether
21953         code is being generated in a static method or not.
21954
21955         * cs-parser.jay: DecomposeQI, new function that replaces the old
21956         QualifiedIdentifier.  Now we always decompose the assembled
21957         strings from qualified_identifier productions into a group of
21958         memberaccesses.
21959
21960 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21961
21962         * rootcontext.cs: Deal with field-less struct types correctly now
21963         by passing the size option to Define Type.
21964
21965         * class.cs: Removed hack that created one static field. 
21966
21967 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21968
21969         * statement.cs: Moved most of the code generation here. 
21970
21971 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21972
21973         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21974         seem very right.
21975
21976         (ElementAccess): Remove useless bits for now - keep checks as the spec
21977         says.
21978
21979 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21980
21981         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21982         and start performing checks according to the spec.
21983
21984 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21985
21986         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21987         rank_specifiers instead.
21988
21989         (rank_specifiers): Change the order in which the rank specifiers are stored
21990
21991         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21992
21993         * expression.cs (ElementAccess): Implement the LValue interface too.
21994
21995 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21996
21997         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21998         except that user defined conversions are not included.
21999
22000         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22001         perform the conversion of the return type, if necessary.
22002
22003         (New::DoResolve): Check whether we are creating an array or an object
22004         and accordingly do the needful.
22005
22006         (New::Emit): Same here.
22007
22008         (New::DoResolve): Implement guts of array creation.
22009
22010         (New::FormLookupType): Helper function.
22011
22012 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * codegen.cs: Removed most of the code generation here, and move the
22015         corresponding code generation bits to the statement classes. 
22016
22017         Added support for try/catch/finalize and throw.
22018
22019         * cs-parser.jay: Added support for try/catch/finalize.
22020
22021         * class.cs: Catch static methods having the flags override,
22022         virtual or abstract.
22023
22024         * expression.cs (UserCast): This user cast was not really doing
22025         what it was supposed to do.  Which is to be born in fully resolved
22026         state.  Parts of the resolution were being performed at Emit time! 
22027
22028         Fixed this code.
22029
22030 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22031
22032         * expression.cs: Implicity convert the result from UserCast.
22033
22034 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22035
22036         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22037         prevented it from working correctly. 
22038
22039         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22040         merely ConvertImplicit.
22041
22042 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * typemanager.cs: Make the LookupTypeContainer function static,
22045         and not per-instance.  
22046
22047         * class.cs: Make static FindMembers (the one that takes a Type
22048         argument). 
22049
22050         * codegen.cs: Add EmitForeach here.
22051
22052         * cs-parser.jay: Make foreach a toplevel object instead of the
22053         inline expansion, as we need to perform semantic analysis on it. 
22054
22055 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22056
22057         * expression.cs (Expression::ImplicitUserConversion): Rename to
22058         UserDefinedConversion.
22059
22060         (Expression::UserDefinedConversion): Take an extra argument specifying 
22061         whether we look for explicit user conversions too.
22062
22063         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22064
22065         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22066
22067         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22068         with the appropriate arguments.
22069
22070         * cs-parser.jay (cast_expression): Record location too.
22071
22072         * expression.cs (Cast): Record location info.
22073
22074         (Expression::ConvertExplicit): Take location argument.
22075
22076         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22077         to determine if we are doing explicit conversions.
22078
22079         (UserCast::Emit): Update accordingly.
22080
22081         (Expression::ConvertExplicit): Report an error if everything fails.
22082
22083         * ../errors/cs0030.cs : Add.
22084
22085 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22086
22087         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22088         virtual and newslot bits. 
22089
22090         * class.cs (TypeContainer::RegisterRequiredImplementations):
22091         Record methods we need.
22092
22093         (TypeContainer::MakeKey): Helper function to make keys for
22094         MethodBases, since the Methodbase key is useless.
22095
22096         (TypeContainer::Populate): Call RegisterRequiredImplementations
22097         before defining the methods.   
22098
22099         Create a mapping for method_builders_to_methods ahead of time
22100         instead of inside a tight loop.
22101
22102         (::RequireMethods):  Accept an object as the data to set into the
22103         hashtable so we can report interface vs abstract method mismatch.
22104
22105 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22106
22107         * report.cs: Make all of it static.
22108
22109         * rootcontext.cs: Drop object_type and value_type computations, as
22110         we have those in the TypeManager anyways.
22111
22112         Drop report instance variable too, now it is a global.
22113
22114         * driver.cs: Use try/catch on command line handling.
22115
22116         Add --probe option to debug the error reporting system with a test
22117         suite. 
22118
22119         * report.cs: Add support for exiting program when a probe
22120         condition is reached.
22121
22122 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22123
22124         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22125         we do a forcible conversion regardless of type, to check if 
22126         ForceConversion returns a null.
22127
22128         (Binary::error19): Use location to report error.
22129
22130         (Unary::error23): Use location here too.
22131
22132         * ../errors/cs0019.cs : Check in.
22133
22134         * ../errors/cs0023.cs : Check in.
22135
22136         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22137         case of a non-null MethodInfo object with a length of 0 !
22138
22139         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22140         an applicable member - according to the spec :-)
22141         Also fix logic to find members in base types.
22142
22143         (Unary::ResolveOperator): Same here.
22144
22145         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22146         as I was getting thoroughly confused between this and error19 :-)
22147
22148         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22149         (::FindMostEncompassedType): Implement.
22150         (::FindMostEncompassingType): Implement.
22151         (::StandardConversionExists): Implement.
22152
22153         (UserImplicitCast): Re-vamp. We now need info about most specific
22154         source and target types so that we can do the necessary conversions.
22155
22156         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22157         mathematical union with no duplicates.
22158
22159 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22160
22161         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22162         in order from base classes to child classes, so that we can in
22163         child classes look up in our parent for method names and
22164         attributes (required for handling abstract, virtual, new, override
22165         constructs: we need to instrospect our base class, and if we dont
22166         populate the classes in order, the introspection might be
22167         incorrect.  For example, a method could query its parent before
22168         the parent has any methods and would determine that the parent has
22169         no abstract methods (while it could have had them)).
22170
22171         (RootContext::CreateType): Record the order in which we define the
22172         classes.
22173
22174 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * class.cs (TypeContainer::Populate): Also method definitions can
22177         fail now, keep track of this.
22178
22179         (TypeContainer::FindMembers): Implement support for
22180         DeclaredOnly/noDeclaredOnly flag.
22181
22182         (Constructor::Emit) Return the ConstructorBuilder.
22183
22184         (Method::Emit) Return the MethodBuilder. 
22185         Check for abstract or virtual methods to be public.
22186
22187         * rootcontext.cs (RootContext::CreateType): Register all the
22188         abstract methods required for the class to be complete and the
22189         interface methods that must be implemented. 
22190
22191         * cs-parser.jay: Report error 501 (method requires body if it is
22192         not marked abstract or extern).
22193
22194         * expression.cs (TypeOf::Emit): Implement.
22195
22196         * typemanager.cs: runtime_handle_type, new global type.
22197
22198         * class.cs (Property::Emit): Generate code for properties.
22199
22200 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22201
22202         * expression.cs (Unary::ResolveOperator): Find operators on base type
22203         too - we now conform exactly to the spec.
22204
22205         (Binary::ResolveOperator): Same here.
22206
22207         * class.cs (Operator::Define): Fix minor quirk in the tests.
22208
22209         * ../errors/cs0215.cs : Added.
22210
22211         * ../errors/cs0556.cs : Added.
22212
22213         * ../errors/cs0555.cs : Added.
22214
22215 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22216
22217         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22218         single integer which is really efficient
22219
22220 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22221
22222         *  expression.cs (Expression::ImplicitUserConversion): Use location
22223         even in the case when we are examining True operators.
22224  
22225         * class.cs (Operator::Define): Perform extensive checks to conform
22226         with the rules for operator overloading in the spec.
22227
22228         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22229         some of the other conversions mentioned in the spec.
22230
22231         * typemanager.cs (array_type): New static member for the System.Array built-in
22232         type.
22233
22234         (cloneable_interface): For System.ICloneable interface.
22235
22236         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22237         we start resolving the tree and populating types.
22238
22239         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22240  
22241 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22242
22243         * expression.cs (Expression::ExprClassFromMemberInfo,
22244         Expression::Literalize): Create literal expressions from
22245         FieldInfos which are literals.
22246
22247         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22248         type casts, because they were wrong.  The test suite in tests
22249         caught these ones.
22250
22251         (ImplicitNumericConversion): ushort to ulong requires a widening
22252         cast. 
22253
22254         Int32 constant to long requires widening cast as well.
22255
22256         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22257         for integers because the type on the stack is not i4.
22258
22259 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22260
22261         * expression.cs (report118): require location argument. 
22262
22263         * parameter.cs: Do not dereference potential null value.
22264
22265         * class.cs: Catch methods that lack the `new' keyword when
22266         overriding a name.  Report warnings when `new' is used without
22267         anything being there to override.
22268
22269         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22270
22271         * class.cs: Only add constructor to hashtable if it is non-null
22272         (as now constructors can fail on define).
22273
22274         (TypeManager, Class, Struct): Take location arguments.
22275
22276         Catch field instance initialization in structs as errors.
22277
22278         accepting_filter: a new filter for FindMembers that is static so
22279         that we dont create an instance per invocation.
22280
22281         (Constructor::Define): Catch errors where a struct constructor is
22282         parameterless 
22283
22284         * cs-parser.jay: Pass location information for various new
22285         constructs. 
22286
22287         * delegate.cs (Delegate): take a location argument.
22288
22289         * driver.cs: Do not call EmitCode if there were problesm in the
22290         Definition of the types, as many Builders wont be there. 
22291
22292         * decl.cs (Decl::Decl): Require a location argument.
22293
22294         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22295         into integers, and find the most appropiate integer for it.
22296
22297         * literal.cs: Implement ULongLiteral.
22298
22299         * rootcontext.cs: Provide better information about the location of
22300         failure when CreateType fails.
22301
22302 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22303
22304         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22305         as well.
22306
22307         * expression.cs (Binary::CheckShiftArguments): Add missing type
22308         computation.
22309         (Binary::ResolveOperator): Add type to the logical and and logical
22310         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22311         before.
22312
22313         (Binary::DoNumericPromotions): In the case where either argument
22314         is ulong (and most signed types combined with ulong cause an
22315         error) perform implicit integer constant conversions as well.
22316
22317 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22318
22319         * expression.cs (UserImplicitCast): Method should always be
22320         non-null. 
22321         (Invocation::BetterConversion): Simplified test for IntLiteral.
22322
22323         (Expression::ImplicitNumericConversion): Split this routine out.
22324         Put the code that performs implicit constant integer conversions
22325         here. 
22326
22327         (Expression::Resolve): Become a wrapper around DoResolve so we can
22328         check eclass and type being set after resolve.
22329
22330         (Invocation::Badness): Remove this dead function
22331
22332         (Binary::ResolveOperator): Do not compute the expensive argumnets
22333         unless we have a union for it.
22334
22335         (Probe::Emit): Is needs to do an isinst and then
22336         compare against null.
22337
22338         (::CanConvert): Added Location argument.  If the Location argument
22339         is null (Location.Null), then we do not report errors.  This is
22340         used by the `probe' mechanism of the Explicit conversion.  We do
22341         not want to generate an error for something that the user
22342         explicitly requested to be casted.  But the pipeline for an
22343         explicit cast first tests for potential implicit casts.
22344
22345         So for now, if the Location is null, it means `Probe only' to
22346         avoid adding another argument.   Might have to revise this
22347         strategy later.
22348
22349         (ClassCast): New class used to type cast objects into arbitrary
22350         classes (used in Explicit Reference Conversions).
22351
22352         Implement `as' as well.
22353
22354         Reverted all the patches from Ravi below: they were broken:
22355
22356                 * The use of `level' as a mechanism to stop recursive
22357                   invocations is wrong.  That was there just to catch the
22358                   bug with a strack trace but not as a way of addressing
22359                   the problem.
22360
22361                   To fix the problem we have to *understand* what is going
22362                   on and the interactions and come up with a plan, not
22363                   just get things going.
22364
22365                 * The use of the type conversion cache that I proposed
22366                   last night had an open topic: How does this work across
22367                   protection domains.  A user defined conversion might not
22368                   be public in the location where we are applying the
22369                   conversion, a different conversion might be selected
22370                   (ie, private A->B (better) but public B->A (worse),
22371                   inside A, A->B applies, but outside it, B->A will
22372                   apply).
22373
22374                 * On top of that (ie, even if the above is solved),
22375                   conversions in a cache need to be abstract.  Ie, `To
22376                   convert from an Int to a Short use an OpcodeCast', not
22377                   `To convert from an Int to a Short use the OpcodeCast on
22378                   the variable 5' (which is what this patch was doing).
22379
22380 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22381
22382         * expression.cs (Invocation::ConversionExists): Re-write to use
22383         the conversion cache
22384
22385         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22386         cache all conversions done, not just user-defined ones.
22387
22388         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22389         to determine if a conversion exists instead of acutually trying to 
22390         perform the conversion. It's faster too.
22391
22392         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22393         and only then attempt the implicit conversion.
22394
22395 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22396
22397         * expression.cs (ConvertImplicit): Use a cache for conversions
22398         already found. Check level of recursion and bail out if necessary.
22399
22400 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22401
22402         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22403         Export standard methods that we expect for string operations.
22404
22405         * statement.cs (Block::UsageWarning): Track usage of variables and
22406         report the errors for not used variables.
22407
22408         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22409         operator. 
22410
22411 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22412
22413         * codegen.cs: remove unnneded code 
22414
22415         * expression.cs: Removed BuiltinTypeAccess class
22416
22417         Fix the order in which implicit conversions are
22418         done.  
22419
22420         The previous fixed dropped support for boxed conversions (adding a
22421         test to the test suite now)
22422
22423         (UserImplicitCast::CanConvert): Remove test for source being null,
22424         that code is broken.  We should not feed a null to begin with, if
22425         we do, then we should track the bug where the problem originates
22426         and not try to cover it up here.
22427
22428         Return a resolved expression of type UserImplicitCast on success
22429         rather than true/false.  Ravi: this is what I was talking about,
22430         the pattern is to use a static method as a "constructor" for
22431         objects. 
22432
22433         Also, do not create arguments until the very last minute,
22434         otherwise we always create the arguments even for lookups that
22435         will never be performed. 
22436
22437         (UserImplicitCast::Resolve): Eliminate, objects of type
22438         UserImplicitCast are born in a fully resolved state. 
22439
22440         * typemanager.cs (InitCoreTypes): Init also value_type
22441         (System.ValueType). 
22442
22443         * expression.cs (Cast::Resolve): First resolve the child expression.
22444
22445         (LValue): Add new method AddressOf to be used by
22446         the `&' operator.  
22447
22448         Change the argument of Store to take an EmitContext instead of an
22449         ILGenerator, because things like FieldExpr need to be able to call
22450         their children expression to generate the instance code. 
22451
22452         (Expression::Error, Expression::Warning): Sugar functions for
22453         reporting errors.
22454
22455         (Expression::MemberLookup): Accept a TypeContainer instead of a
22456         Report as the first argument.
22457
22458         (Expression::ResolvePrimary): Killed.  I still want to improve
22459         this as currently the code is just not right.
22460
22461         (Expression::ResolveMemberAccess): Simplify, but it is still
22462         wrong. 
22463
22464         (Unary::Resolve): Catch errors in AddressOf operators.
22465
22466         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22467         index to a byte for the short-version, or the compiler will choose
22468         the wrong Emit call, which generates the wrong data.
22469
22470         (ParameterReference::Emit, ::Store): same.
22471
22472         (FieldExpr::AddressOf): Implement.
22473
22474         * typemanager.cs: TypeManager: made public variable instead of
22475         property.
22476
22477         * driver.cs: document --fatal.
22478
22479         * report.cs (ErrorMessage, WarningMessage): new names for the old
22480         Error and Warning classes.
22481
22482         * cs-parser.jay (member_access): Turn built-in access to types
22483         into a normal simplename
22484
22485 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22486
22487         * expression.cs (Invocation::BetterConversion): Fix to cope
22488         with q being null, since this was introducing a bug.
22489
22490         * expression.cs (ConvertImplicit): Do built-in conversions first.
22491
22492 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22493
22494         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22495
22496 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22497
22498         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22499         I had introduced long ago (what's new ?).
22500
22501         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22502         the work of all the checking. 
22503         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22504         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22505
22506         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22507         that is the right way. 
22508
22509         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22510         overloading resolution. Use everywhere instead of cutting and pasting code.
22511
22512         (Binary::ResolveOperator): Use MakeUnionSet.
22513
22514         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22515         we have to convert to bool types. Not complete yet.
22516
22517 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22518
22519         * typemanager.cs (TypeManager::CSharpName): support ushort.
22520
22521         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22522         to provide an expression that performsn an implicit constant int
22523         conversion (section 6.1.6).
22524         (Expression::ConvertImplicitRequired): Reworked to include
22525         implicit constant expression conversions.
22526
22527         (Expression::ConvertNumericExplicit): Finished.
22528
22529         (Invocation::Emit): If InstanceExpression is null, then it means
22530         that we perform a call on this.
22531
22532 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22533
22534         * expression.cs (Unary::Emit): Remove some dead code.
22535         (Probe): Implement Resolve and Emit for `is'.
22536         (Expression::ConvertImplicitRequired): Attempt to do constant
22537         expression conversions here.  Maybe should be moved to
22538         ConvertImplicit, but I am not sure.
22539         (Expression::ImplicitLongConstantConversionPossible,
22540         Expression::ImplicitIntConstantConversionPossible): New functions
22541         that tell whether is it possible to apply an implicit constant
22542         expression conversion.
22543
22544         (ConvertNumericExplicit): Started work on explicit numeric
22545         conversions.
22546
22547         * cs-parser.jay: Update operator constants.
22548
22549         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22550         (Parameters::GetSignature): Hook up VerifyArgs here.
22551         (Parameters::VerifyArgs): Verifies that no two arguments have the
22552         same name. 
22553
22554         * class.cs (Operator): Update the operator names to reflect the
22555         ones that the spec expects (as we are just stringizing the
22556         operator names).
22557
22558         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22559         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22560         previous usage did only work for our methods.
22561         (Expression::ConvertImplicit): Handle decimal implicit numeric
22562         conversions as well.
22563         (Expression::InternalTypeConstructor): Used to invoke constructors
22564         on internal types for default promotions.
22565
22566         (Unary::Emit): Implement special handling for the pre/post
22567         increment/decrement for overloaded operators, as they need to have
22568         the same semantics as the other operators.
22569
22570         (Binary::ResolveOperator): ditto.
22571         (Invocation::ConversionExists): ditto.
22572         (UserImplicitCast::Resolve): ditto.
22573
22574 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22575
22576         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22577         operator, return after emitting body. Regression tests pass again !
22578
22579         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22580         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22581         (Invocation::OverloadResolve): Ditto.
22582         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22583
22584         * everywhere : update calls to the above methods accordingly.
22585
22586 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22587
22588         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22589
22590         * expression.cs (ExpressionStatement): New base class used for
22591         expressions that can appear in statements, so that we can provide
22592         an alternate path to generate expression that do not leave a value
22593         on the stack.
22594
22595         (Expression::Emit, and all the derivatives): We no longer return
22596         whether a value is left on the stack or not.  Every expression
22597         after being emitted leaves a single value on the stack.
22598
22599         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22600         facilties of ExpressionStatement if possible.
22601
22602         * cs-parser.jay: Update statement_expression.
22603
22604 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22605
22606         * driver.cs: Change the wording of message
22607
22608 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22609
22610         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22611         the type of the expression to the return type of the method if
22612         we have an overloaded operator match ! The regression tests pass again !
22613         (Unary::ResolveOperator): Ditto.
22614
22615         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22616         to find "op_Implicit", not "implicit" ;-)
22617         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22618         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22619
22620         * everywhere : Correct calls to the above accordingly.
22621
22622         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22623         (ConvertImplicit): Do user-defined conversion if it exists.
22624
22625 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22626
22627         * assign.cs: track location.
22628         (Resolve): Use implicit conversions on assignment.
22629
22630         * literal.cs: Oops.  Not good, Emit of short access values should
22631         pass (Bytes) or the wrong argument will be selected.
22632
22633         * expression.cs (Unary::Emit): Emit code for -expr.
22634
22635         (Unary::ResolveOperator): Handle `Substract' for non-constants
22636         (substract from zero from the non-constants).
22637         Deal with Doubles as well. 
22638
22639         (Expression::ConvertImplicitRequired): New routine that reports an
22640         error if no implicit conversion exists. 
22641
22642         (Invocation::OverloadResolve): Store the converted implicit
22643         expressions if we make them
22644
22645 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22646
22647         * class.cs (ConstructorInitializer): Take a Location argument.
22648         (ConstructorBaseInitializer): Same here.
22649         (ConstructorThisInitializer): Same here.
22650
22651         * cs-parser.jay : Update all calls accordingly.
22652
22653         * expression.cs (Unary, Binary, New): Take location argument.
22654         Update accordingly everywhere.
22655
22656         * cs-parser.jay : Update all calls to the above to take a location
22657         argument.
22658
22659         * class.cs : Ditto.
22660
22661 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22662
22663         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22664         (Invocation::BetterConversion): Same here
22665         (Invocation::ConversionExists): Ditto.
22666
22667         (Invocation::ConversionExists): Implement.
22668
22669 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22670
22671         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22672         Also take an additional TypeContainer argument.
22673
22674         * All over : Pass in TypeContainer as argument to OverloadResolve.
22675
22676         * typemanager.cs (CSharpName): Update to check for the string type and return
22677         that too.
22678
22679         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22680         a given method.
22681
22682 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22683
22684         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22685         (Invocation::BetterFunction): Implement.
22686         (Invocation::BetterConversion): Implement.
22687         (Invocation::ConversionExists): Skeleton, no implementation yet.
22688
22689         Okay, things work fine !
22690
22691 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22692
22693         * typemanager.cs: declare and load enum_type, delegate_type and
22694         void_type. 
22695
22696         * expression.cs (Expression::Emit): Now emit returns a value that
22697         tells whether a value is left on the stack or not.  This strategy
22698         might be reveted tomorrow with a mechanism that would address
22699         multiple assignments.
22700         (Expression::report118): Utility routine to report mismatches on
22701         the ExprClass.
22702
22703         (Unary::Report23): Report impossible type/operator combination
22704         utility function.
22705
22706         (Unary::IsIncrementableNumber): Whether the type can be
22707         incremented or decremented with add.
22708         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22709         complemented. 
22710         (Unary::ResolveOperator): Implement ++, !, ~,
22711
22712         (Invocation::Emit): Deal with new Emit convetion.
22713
22714         * All Expression derivatives: Updated their Emit method to return
22715         whether they leave values on the stack or not.
22716
22717         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22718         stack for expressions that are statements. 
22719
22720 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22721
22722         * expression.cs (LValue): New interface.  Must be implemented by
22723         LValue objects.
22724         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22725         LValue interface.
22726
22727         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22728         interface for generating code, simplifies the code.
22729
22730 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22731
22732         * expression.cs (everywhere): Comment out return statements in ::Resolve
22733         methods to avoid the warnings.
22734
22735 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22736
22737         * driver.cs (parse): Report error 2001 if we can not open the
22738         source file.
22739
22740         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22741         not resolve it.
22742
22743         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22744         object. 
22745
22746         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22747         otherwise nested blocks end up with the same index.
22748
22749         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22750
22751         * expression.cs:  Instead of having FIXMEs in the Resolve
22752         functions, throw exceptions so it is obvious that we are facing a
22753         bug. 
22754
22755         * cs-parser.jay (invocation_expression): Pass Location information.
22756
22757         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22758         Use a basename for those routines because .NET does not like paths
22759         on them. 
22760
22761         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22762         already defined.
22763
22764 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22765
22766         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22767         are loading the correct data types (throws an exception if not).
22768         (TypeManager::InitCoreTypes): Use CoreLookupType
22769
22770         * expression.cs (Unary::ResolveOperator): return the child
22771         expression for expressions which are just +expr.
22772         (Unary::ResolveOperator): Return negative literals for -LITERAL
22773         expressions (otherwise they are Unary {Literal}).
22774         (Invocation::Badness): Take into account `Implicit constant
22775         expression conversions'.
22776
22777         * literal.cs (LongLiteral): Implement long literal class.
22778         (IntLiteral): export the `Value' of the intliteral. 
22779
22780 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22781
22782         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22783
22784         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22785         instead of 'Operator'
22786
22787         * expression.cs (Binary::ResolveOperator): Update accordingly.
22788         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22789         and 'Minus'
22790
22791         * cs-parser.jay (unary_expression): Update to use the new names.
22792
22793         * gen-treedump.cs (GetUnary): Same here.
22794
22795         * expression.cs (Unary::Resolve): Implement.
22796         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22797         operators are found instead of making noise ;-)
22798         (Unary::ResolveOperator): New method to do precisely the same thing which
22799         Binary::ResolveOperator does for Binary expressions.
22800         (Unary.method, .Arguments): Add.
22801         (Unary::OperName): Implement.   
22802         (Unary::ForceConversion): Copy and Paste !
22803
22804         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22805         a unary operator.
22806
22807         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22808         for the inbuilt operators. Only overloading works for now ;-)
22809
22810 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22813         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22814
22815         * expression.cs (This::Emit): Implement. 
22816         (This::Resolve): Implement.
22817         (TypeOf:Resolve): Implement.
22818         (Expression::ResolveSimpleName): Add an implicit this to instance
22819         field references. 
22820         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22821         Bind instance variable to Field expressions.
22822         (FieldExpr::Instance): New field used to track the expression that
22823         represents the object instance.
22824         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22825         binding 
22826         (FieldExpr::Emit): Implement.
22827
22828         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22829         the last instruction contains a return opcode to avoid generating
22830         the last `ret' instruction (this generates correct code, and it is
22831         nice to pass the peverify output).
22832
22833         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22834         initializer for static and instance variables.
22835         (Constructor::Emit): Allow initializer to be null in the case of
22836         static constructors.  Only emit initializer for instance
22837         constructors. 
22838
22839         (TypeContainer::FindMembers): Return a null array if there are no
22840         matches.
22841
22842         Also fix the code for the MemberTypes.Method branch, as it was not
22843         scanning that for operators (or tried to access null variables before).
22844
22845         * assign.cs (Assign::Emit): Handle instance and static fields. 
22846
22847         * TODO: Updated.
22848
22849         * driver.cs: Stop compilation if there are parse errors.
22850
22851         * cs-parser.jay (constructor_declaration): Provide default base
22852         initializer for non-static constructors.
22853         (constructor_declarator): Do not provide a default base
22854         initializers if none was specified.
22855         Catch the fact that constructors should not have parameters.
22856
22857         * class.cs: Do not emit parent class initializers for static
22858         constructors, that should be flagged as an error.
22859
22860 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22861
22862         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22863         Move back code into TypeContainer::Populate.
22864
22865 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22866
22867         * class.cs (TypeContainer::AddConstructor): Fix the check to
22868         compare against Name, not Basename. 
22869         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22870
22871         * cs-parser.jay : Update accordingly.
22872
22873         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22874         for methods, don't forget to look into the operators too.
22875         (RegisterMethodBuilder): Helper method to take care of this for
22876         methods, constructors and operators.
22877         (Operator::Define): Completely revamp.
22878         (Operator.OperatorMethod, MethodName): New fields.
22879         (TypeContainer::Populate): Move the registering of builders into
22880         RegisterMethodBuilder.
22881         (Operator::Emit): Re-write.
22882
22883         * expression.cs (Binary::Emit): Comment out code path to emit method
22884         invocation stuff for the case when we have a user defined operator. I am
22885         just not able to get it right !
22886
22887 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22888
22889         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22890         argument. 
22891
22892         (Expression::MemberLookup): Provide a version that allows to
22893         specify the MemberTypes and BindingFlags. 
22894
22895         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22896         so it was not fetching variable information from outer blocks.
22897
22898         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22899         Beforefieldinit as it was buggy.
22900
22901         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22902         that Ravi put here.  
22903
22904         * class.cs (Constructor::Emit): Only emit if block is not null.
22905         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22906         deal with this by semantically definining it as if the user had
22907         done it.
22908
22909         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22910         constructors as we now "emit" them at a higher level.
22911
22912         (TypeContainer::DefineDefaultConstructor): Used to define the
22913         default constructors if none was provided.
22914
22915         (ConstructorInitializer): Add methods Resolve and Emit. 
22916
22917         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22918
22919 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22920
22921         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22922         the default constructor builder with our hashtable for methodbuilders
22923         to methodcores.
22924
22925         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22926         and argument_count is 0 in which case we have a match.
22927         (Binary::ResolveOperator): More null checking and miscellaneous coding
22928         style cleanup.
22929
22930 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22931
22932         * rootcontext.cs (IsNameSpace): Compare against null.
22933
22934         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22935
22936         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22937         and Unary::Operator.
22938
22939         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22940         accordingly.
22941
22942         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22943         we have overloaded operators.
22944         (Binary::ResolveOperator): Implement the part which does the operator overload
22945         resolution.
22946
22947         * class.cs (Operator::Emit): Implement.
22948         (TypeContainer::Emit): Emit the operators we have too.
22949
22950         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22951         the case when we have a user-defined operator.
22952
22953 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22956
22957 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22958
22959         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22960         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22961         (Constructor::Emit): Implement.
22962         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22963         if we have no work to do. 
22964         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22965         Emit method.
22966
22967         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22968         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22969
22970         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22971         of parent.parent.
22972
22973 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22974
22975         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22976         in the source.
22977         (Tree::RecordNamespace): Method to do what the name says ;-)
22978         (Tree::Namespaces): Property to get at the namespaces hashtable.
22979
22980         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22981         keep track.
22982
22983         * rootcontext.cs (IsNamespace): Fixed it :-)
22984
22985 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22986
22987         * class.cs (TypeContainer::FindMembers): Add support for
22988         constructors. 
22989         (MethodCore): New class that encapsulates both the shared aspects
22990         of a Constructor and a Method.  
22991         (Method, Constructor): Factored pieces into MethodCore.
22992
22993         * driver.cs: Added --fatal which makes errors throw exceptions.
22994         Load System assembly as well as part of the standard library.
22995
22996         * report.cs: Allow throwing exceptions on errors for debugging.
22997
22998         * modifiers.cs: Do not use `parent', instead use the real type
22999         container to evaluate permission settings.
23000
23001         * class.cs: Put Ravi's patch back in.  He is right, and we will
23002         have to cope with the
23003
23004 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23005
23006         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23007         FamORAssem, not FamANDAssem.
23008
23009 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * driver.cs: Added --parse option that only parses its input files
23012         and terminates.
23013
23014         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23015         incorrect.  IsTopLevel is not used to tell whether an object is
23016         root_types or not (that can be achieved by testing this ==
23017         root_types).  But to see if this is a top-level *class* (not
23018         necessarly our "toplevel" container). 
23019
23020 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23021
23022         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23023         parent instead of a direct call to GetType.
23024
23025 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23026
23027         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23028         Modifiers.TypeAttr. This should just be a call to that method.
23029
23030         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23031         object so that we can determine if we are top-level or not.
23032
23033         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23034         TypeContainer too.
23035
23036         * enum.cs (Enum::Define): Ditto.
23037
23038         * modifiers.cs (FieldAttr): Re-write.
23039
23040         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23041         (TypeContainer::HaveStaticConstructor): New property to provide access
23042         to precisely that info.
23043
23044         * modifiers.cs (MethodAttr): Re-write.
23045         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23046
23047         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23048         of top-level types as claimed.
23049
23050 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23051
23052         * expression.cs (MemberLookup): Fruitless attempt to lookup
23053         constructors.  Maybe I need to emit default constructors?  That
23054         might be it (currently .NET emits this for me automatically).
23055         (Invocation::OverloadResolve): Cope with Arguments == null.
23056         (Invocation::EmitArguments): new function, shared by the new
23057         constructor and us.
23058         (Invocation::Emit): Handle static and instance methods.  Emit
23059         proper call instruction for virtual or non-virtual invocations.
23060         (New::Emit): Implement.
23061         (New::Resolve): Implement.
23062         (MemberAccess:Resolve): Implement.
23063         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23064         to track instances.
23065         (FieldExpr::Resolve): Set type.
23066
23067         * support.cs: Handle empty arguments.
23068                 
23069         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23070         SimpleLookup): Auxiliary routines to help parse a qualifier
23071         identifier.  
23072
23073         Update qualifier_identifier rule.
23074
23075         * codegen.cs: Removed debugging messages.
23076
23077         * class.cs: Make this a global thing, this acts just as a "key" to
23078         objects that we might have around.
23079
23080         (Populate): Only initialize method_builders_to_methods once.
23081
23082         * expression.cs (PropertyExpr): Initialize type from the
23083         PropertyType. 
23084
23085         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23086         Resolve pattern.  Attempt to implicitly convert value to boolean.
23087         Emit code.
23088
23089         * expression.cs: Set the type for the int32/int32 argument case.
23090         (Binary::ResolveOperator): Set the return type to boolean for
23091         comparission operators
23092
23093         * typemanager.cs: Remove debugging print code.
23094
23095         (Invocation::Resolve): resolve type.
23096
23097         * class.cs: Allocate a MemberInfo of the correct size, as the code
23098         elsewhere depends on the test to reflect the correct contents.
23099
23100         (Method::) Keep track of parameters, due to System.Reflection holes
23101
23102         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23103         mapping here.
23104
23105         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23106         of the exact size and return that.
23107
23108         (Class::LookupMethodByBuilder): New function that maps
23109         MethodBuilders to its methods.  Required to locate the information
23110         on methods because System.Reflection bit us again.
23111
23112         * support.cs: New file, contains an interface ParameterData and
23113         two implementations: ReflectionParameters and InternalParameters
23114         used to access Parameter information.  We will need to grow this
23115         as required.
23116
23117         * expression.cs (Invocation::GetParameterData): implement a cache
23118         and a wrapper around the ParameterData creation for methods. 
23119         (Invocation::OverloadResolve): Use new code.
23120
23121 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23122
23123         * class.cs (TypeContainer::EmitField): Remove and move into 
23124         (Field::Define): here and modify accordingly.
23125         (Field.FieldBuilder): New member.
23126         (TypeContainer::Populate): Update accordingly.
23127         (TypeContainer::FindMembers): Implement.
23128
23129 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23130
23131         * statement.cs: (VariableInfo::VariableType): New field to be
23132         initialized with the full type once it is resolved. 
23133
23134 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23135
23136         * parameter.cs (GetParameterInfo): Use a type cache to compute
23137         things only once, and to reuse this information
23138
23139         * expression.cs (LocalVariableReference::Emit): Implement.
23140         (OpcodeCast::Emit): fix.
23141
23142         (ParameterReference::Resolve): Implement.
23143         (ParameterReference::Emit): Implement.
23144
23145         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23146         that are expressions need to stay as Expressions.
23147
23148         * typemanager.cs (CSharpName): Returns the C# name of a type if
23149         possible. 
23150
23151         * expression.cs (Expression::ConvertImplicit): New function that
23152         implements implicit type conversions.
23153
23154         (Expression::ImplicitReferenceConversion): Implements implicit
23155         reference conversions.
23156
23157         (EmptyCast): New type for transparent casts.
23158
23159         (OpcodeCast): New type for casts of types that are performed with
23160         a sequence of bytecodes.
23161
23162         (BoxedCast): New type used for casting value types into reference
23163         types.  Emits a box opcode.
23164
23165         (Binary::DoNumericPromotions): Implements numeric promotions of
23166         and computation of the Binary::Type.
23167
23168         (Binary::EmitBranchable): Optimization.
23169
23170         (Binary::Emit): Implement code emission for expressions.
23171
23172         * typemanager.cs (TypeManager): Added two new core types: sbyte
23173         and byte.
23174
23175 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23176
23177         * class.cs (TypeContainer::FindMembers): Method which does exactly
23178         what Type.FindMembers does, only we don't have to use reflection. No
23179         implementation yet.
23180
23181         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23182         typecontainer objects as we need to get at them.
23183         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23184
23185         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23186         typecontainer object.
23187
23188         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23189         of just a Report object.
23190
23191 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23192
23193         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23194         "remove_"
23195         (TypeContainer::Populate): Now define the delegates of the type too.
23196         (TypeContainer.Delegates): Property to access the list of delegates defined
23197         in the type.
23198
23199         * delegates.cs (Delegate::Define): Implement partially.
23200
23201         * modifiers.cs (TypeAttr): Handle more flags.
23202
23203 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23204
23205         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23206         and not <=
23207         (Operator::Define): Re-write logic to get types by using the LookupType method
23208         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23209         (Indexer::Define): Ditto.
23210         (Event::Define): Ditto.
23211         (Property::Define): Ditto.
23212
23213 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23214
23215         * class.cs (TypeContainer::Populate): Now define operators too. 
23216         (TypeContainer.Operators): New property to access the list of operators
23217         in a type.
23218         (Operator.OperatorMethodBuilder): New member to hold the method builder
23219         for the operator we are defining.
23220         (Operator::Define): Implement.
23221
23222 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23223
23224         * class.cs (Event::Define): Make the prefixes of the accessor methods
23225         addOn_ and removeOn_ 
23226
23227         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23228         of the location being passed in too. Ideally, this should go later since all
23229         error reporting should be done through the Report object.
23230
23231         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23232         (Populate): Iterate thru the indexers we have and define them too.
23233         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23234         for the get and set accessors.
23235         (Indexer::Define): Implement.
23236
23237 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23238
23239         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23240         my previous implementation, did not work.
23241
23242         * typemanager.cs: Add a couple of missing types (the longs).
23243
23244         * literal.cs: Use TypeManager.bool_type instead of getting it.
23245
23246         * expression.cs (EventExpr): New kind of expressions.
23247         (Expressio::ExprClassFromMemberInfo): finish
23248
23249 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23250
23251         * assign.cs: Emit stores to static fields differently.
23252
23253 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23254
23255         * Merge in changes and adjust code to tackle conflicts. Backed out my
23256         code in Assign::Resolve ;-) 
23257
23258 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23259
23260         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23261         instead Report.Error and also pass in the location.
23262         (CSharpParser::Lexer): New readonly property to return the reference
23263         to the Tokenizer object.
23264         (declare_local_variables): Use Report.Error with location instead of plain 
23265         old error.
23266         (CheckDef): Ditto.
23267
23268         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23269         (Operator.CheckBinaryOperator): Ditto.
23270
23271         * cs-parser.jay (operator_declarator): Update accordingly.
23272
23273         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23274         (CheckBinaryOperator): Same here.
23275
23276         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23277         on the name without any prefixes of namespace names etc. This is because we
23278         already might have something already fully qualified like 
23279         'System.Console.WriteLine'
23280
23281         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23282
23283 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23284
23285         * cs-tokenizer.cs (location): Return a string which also contains
23286         the file name.
23287
23288         * expression.cs (ElementAccess): New class for expressions of the
23289         type 'element access.'
23290         (BaseAccess): New class for expressions of the type 'base access.'
23291         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23292         respectively.
23293
23294         * cs-parser.jay (element_access): Implement action.
23295         (base_access): Implement actions.
23296         (checked_expression, unchecked_expression): Implement.
23297
23298         * cs-parser.jay (local_variable_type): Correct and implement.
23299         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23300
23301         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23302
23303         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23304         name and the specifiers.
23305
23306         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23307
23308         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23309         making them all public ;-)
23310
23311         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23312         class anyways.
23313
23314 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23315
23316         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23317         PropertyExprs.
23318         (FieldExpr, PropertyExprs): New resolved expressions.
23319         (SimpleName::MemberStaticCheck): Perform static checks for access
23320         to non-static fields on static methods. Maybe this should be
23321         generalized for MemberAccesses. 
23322         (SimpleName::ResolveSimpleName): More work on simple name
23323         resolution. 
23324
23325         * cs-parser.jay (primary_expression/qualified_identifier): track
23326         the parameter index.
23327
23328         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23329         (EmitContext::EmitBoolExpression): Chain to expression generation
23330         instead of temporary hack.
23331         (::EmitStatementExpression): Put generic expression code generation.
23332
23333         * assign.cs (Assign::Emit): Implement variable assignments to
23334         local variables, parameters and fields.
23335
23336 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23337
23338         * statement.cs (Block::GetVariableInfo): New method, returns the
23339         VariableInfo for a variable name in a block.
23340         (Block::GetVariableType): Implement in terms of GetVariableInfo
23341
23342         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23343         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23344
23345 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23346
23347         * cs-parser.jay (operator_declaration): Continue on my quest : update
23348         to take attributes argument.
23349         (event_declaration): Ditto.
23350         (enum_declaration): Ditto.
23351         (indexer_declaration): Ditto.
23352
23353         * class.cs (Operator::Operator): Update constructor accordingly.
23354         (Event::Event): Ditto.
23355
23356         * delegate.cs (Delegate::Delegate): Same here.
23357
23358         * enum.cs (Enum::Enum): Same here.
23359
23360 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23361
23362         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23363
23364         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23365
23366         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23367         being passed around as an arraylist.
23368         (Attributes::AddAttribute): Method to add attribute sections.
23369
23370         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23371         (struct_declaration): Update accordingly.
23372         (constant_declaration): Update.
23373         (field_declaration): Update.
23374         (method_header): Update.
23375         (fixed_parameter): Update.
23376         (parameter_array): Ditto.
23377         (property_declaration): Ditto.
23378         (destructor_declaration): Ditto.
23379
23380         * class.cs (Struct::Struct): Update constructors accordingly.
23381         (Class::Class): Ditto.
23382         (Field::Field): Ditto.
23383         (Method::Method): Ditto.
23384         (Property::Property): Ditto.
23385         (TypeContainer::OptAttribute): update property's return type.
23386
23387         * interface.cs (Interface.opt_attributes): New member.
23388         (Interface::Interface): Update to take the extra Attributes argument.
23389
23390         * parameter.cs (Parameter::Parameter): Ditto.
23391
23392         * constant.cs (Constant::Constant): Ditto.
23393
23394         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23395         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23396         the attributes as a parameter.
23397         (InterfaceProperty): Update constructor call.
23398         (InterfaceEvent): Ditto.
23399         (InterfaceMethod): Ditto.
23400         (InterfaceIndexer): Ditto.
23401
23402         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23403         pass the attributes too.
23404         (interface_event_declaration): Ditto.
23405         (interface_property_declaration): Ditto.
23406         (interface_method_declaration): Ditto.
23407         (interface_declaration): Ditto.
23408
23409 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23410
23411         * class.cs (Method::Define): Track the "static Main" definition to
23412         create an entry point. 
23413
23414         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23415         EntryPoint if we find it. 
23416
23417         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23418         (EmitContext::ig): Make this variable public.
23419
23420         * driver.cs: Make the default output file be the first file name
23421         with the .exe extension.  
23422
23423         Detect empty compilations
23424
23425         Handle various kinds of output targets.  Handle --target and
23426         rename -t to --dumper.
23427
23428         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23429         methods inherited from Expression return now an Expression.  This
23430         will is used during the tree rewriting as we resolve them during
23431         semantic analysis.
23432
23433         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23434         the spec.  Missing entirely is the information about
23435         accessability of elements of it.
23436
23437         (Expression::ExprClassFromMemberInfo): New constructor for
23438         Expressions that creates a fully initialized Expression based on
23439         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23440         a Type.
23441
23442         (Invocation::Resolve): Begin implementing resolution of invocations.
23443
23444         * literal.cs (StringLiteral):  Implement Emit.
23445
23446 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23447
23448         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23449         member.
23450
23451 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23452
23453         * cs-parser.jay (attribute_arguments): Implement actions.
23454         (attribute): Fix bug in production. Implement action.
23455         (attribute_list): Implement.
23456         (attribute_target): Implement.
23457         (attribute_target_specifier, opt_target_specifier): Implement
23458         (CheckAttributeTarget): New method to check if the attribute target
23459         is valid.
23460         (attribute_section): Implement.
23461         (opt_attributes): Implement.
23462
23463         * attribute.cs : New file to handle attributes.
23464         (Attribute): Class to hold attribute info.
23465
23466         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23467         (attribute_section): Modify production to use 2 different rules to 
23468         achieve the same thing. 1 s/r conflict down !
23469         Clean out commented, useless, non-reducing dimension_separator rules.
23470
23471         * class.cs (TypeContainer.attributes): New member to hold list
23472         of attributes for a type.
23473         (Struct::Struct): Modify to take one more argument, the attribute list.
23474         (Class::Class): Ditto.
23475         (Field::Field): Ditto.
23476         (Method::Method): Ditto.
23477         (Property::Property): Ditto.
23478
23479         * cs-parser.jay (struct_declaration): Update constructor call to
23480         pass in the attributes too.
23481         (class_declaration): Ditto.
23482         (constant_declaration): Ditto.
23483         (field_declaration): Ditto.
23484         (method_header): Ditto.
23485         (fixed_parameter): Ditto.
23486         (parameter_array): Ditto.
23487         (property_declaration): Ditto.
23488
23489         * constant.cs (Constant::Constant): Update constructor similarly.
23490         Use System.Collections.
23491
23492         * parameter.cs (Parameter::Parameter): Update as above.
23493
23494 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23495
23496         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23497         (TypeContainer.delegates): New member to hold list of delegates.
23498
23499         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23500         this time as I seem to be on crack ;-)
23501
23502 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23503
23504         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23505         tell whether an identifier represents a namespace.
23506
23507         * expression.cs (NamespaceExpr): A namespace expression, used only
23508         temporarly during expression resolution.
23509         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23510         utility functions to resolve names on expressions.
23511
23512 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23513
23514         * codegen.cs: Add hook for StatementExpressions. 
23515
23516         * class.cs: Fix inverted test for static flag in methods.
23517
23518 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23519
23520         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23521         to make it coincide with MS' number.
23522         (Operator::CheckBinaryOperator): Ditto.
23523
23524         * ../errors/errors.txt : Remove error numbers added earlier.
23525
23526         * ../errors/cs1019.cs : Test case for error # 1019
23527
23528         * ../errros/cs1020.cs : Test case for error # 1020
23529
23530         * cs-parser.jay : Clean out commented cruft.
23531         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23532         used anywhere - non-reducing rule.
23533         (namespace_declarations): Non-reducing rule - comment out.
23534
23535         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23536         with TypeContainer::AddEnum.
23537
23538         * delegate.cs : New file for delegate handling classes.
23539         (Delegate): Class for declaring delegates.
23540
23541         * makefile : Update.
23542
23543         * cs-parser.jay (delegate_declaration): Implement.
23544
23545 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23546
23547         * class.cs (Event::Define): Implement.
23548         (Event.EventBuilder): New member.
23549
23550         * class.cs (TypeContainer::Populate): Update to define all enums and events
23551         we have.
23552         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23553         readonly fields for all these cases ?
23554
23555 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23556
23557         * class.cs (Property): Revamp to use the convention of making fields readonly.
23558         Accordingly modify code elsewhere.
23559
23560         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23561         the Define method of the Property class.
23562
23563         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23564         trivial bug.
23565         (TypeContainer::Populate): Update to define all the properties we have. Also
23566         define all enumerations.
23567
23568         * enum.cs (Define): Implement.
23569
23570 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23571
23572         * cs-parser.jay (overloadable_operator): The semantic value is an
23573         enum of the Operator class.
23574         (operator_declarator): Implement actions.
23575         (operator_declaration): Implement.
23576
23577         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23578         validity of definitions.
23579         (Operator::CheckBinaryOperator): Static method to check for binary operators
23580         (TypeContainer::AddOperator): New method to add an operator to a type.
23581
23582         * cs-parser.jay (indexer_declaration): Added line to actually call the
23583         AddIndexer method so it gets added ;-)
23584
23585         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23586         already taken care of by the MS compiler ?  
23587
23588 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23589
23590         * class.cs (Operator): New class for operator declarations.
23591         (Operator::OpType): Enum for the various operators.
23592
23593 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23594
23595         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23596         ostensibly handle this in semantic analysis.
23597
23598         * cs-parser.jay (general_catch_clause): Comment out
23599         (specific_catch_clauses, specific_catch_clause): Ditto.
23600         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23601         (catch_args, opt_catch_args): New productions.
23602         (catch_clause): Rewrite to use the new productions above
23603         (catch_clauses): Modify accordingly.
23604         (opt_catch_clauses): New production to use in try_statement
23605         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23606         and re-write the code in the actions to extract the specific and
23607         general catch clauses by being a little smart ;-)
23608
23609         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23610         Hooray, try and catch statements parse fine !
23611
23612 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23613
23614         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23615         string from the hashtable of variables.
23616
23617         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23618         I end up making that mistake ;-)
23619         (catch_clauses): Fixed gross error which made Key and Value of the 
23620         DictionaryEntry the same : $1 !!
23621
23622 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23623
23624         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23625
23626         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23627         when the add and remove accessors are specified. 
23628
23629 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23630
23631         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23632         information about indexer_declarator.
23633         (indexer_declarator): Implement actions.
23634         (parsing_indexer): New local boolean used to keep track of whether
23635         we are parsing indexers or properties. This is necessary because 
23636         implicit_parameters come into picture even for the get accessor in the 
23637         case of an indexer.
23638         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23639
23640         * class.cs (Indexer): New class for indexer declarations.
23641         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23642         (TypeContainer::indexers): New member to hold list of indexers for the
23643         type.
23644
23645 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23646
23647         * cs-parser.jay (add_accessor_declaration): Implement action.
23648         (remove_accessor_declaration): Implement action.
23649         (event_accessors_declaration): Implement
23650         (variable_declarators): swap statements for first rule - trivial.
23651
23652         * class.cs (Event): New class to hold information about event
23653         declarations.
23654         (TypeContainer::AddEvent): New method to add an event to a type
23655         (TypeContainer::events): New member to hold list of events.
23656
23657         * cs-parser.jay (event_declaration): Implement actions.
23658
23659 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23660
23661         * cs-parser.jay (dim_separators): Implement. Make it a string
23662         concatenating all the commas together, just as they appear.
23663         (opt_dim_separators): Modify accordingly
23664         (rank_specifiers): Update accordingly. Basically do the same
23665         thing - instead, collect the brackets here.
23666         (opt_rank_sepcifiers): Modify accordingly.
23667         (array_type): Modify to actually return the complete type string
23668         instead of ignoring the rank_specifiers.
23669         (expression_list): Implement to collect the expressions
23670         (variable_initializer): Implement. We make it a list of expressions
23671         essentially so that we can handle the array_initializer case neatly too.
23672         (variable_initializer_list): Implement.
23673         (array_initializer): Make it a list of variable_initializers
23674         (opt_array_initializer): Modify accordingly.
23675
23676         * expression.cs (New::NType): Add enumeration to help us
23677         keep track of whether we have an object/delegate creation
23678         or an array creation.
23679         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23680         members to hold data about array creation.
23681         (New:New): Modify to update NewType
23682         (New:New): New Overloaded contructor for the array creation
23683         case.
23684
23685         * cs-parser.jay (array_creation_expression): Implement to call
23686         the overloaded New constructor.
23687
23688 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23689
23690         * class.cs (TypeContainer::Constructors): Return member
23691         constructors instead of returning null.
23692
23693 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23694
23695         * typemanager.cs (InitCoreTypes): Initialize the various core
23696         types after we have populated the type manager with the user
23697         defined types (this distinction will be important later while
23698         compiling corlib.dll)
23699
23700         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23701         on Expression Classification.  Now all expressions have a method
23702         `Resolve' and a method `Emit'.
23703
23704         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23705         generation from working.     Also add some temporary debugging
23706         code. 
23707
23708 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23709
23710         * codegen.cs: Lots of code generation pieces.  This is only the
23711         beginning, will continue tomorrow with more touches of polish.  We
23712         handle the fundamentals of if, while, do, for, return.  Others are
23713         trickier and I need to start working on invocations soon.
23714
23715         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23716         s.InitStatement. 
23717
23718         * codegen.cs (EmitContext): New struct, used during code
23719         emission to keep a context.   Most of the code generation will be
23720         here. 
23721
23722         * cs-parser.jay: Add embedded blocks to the list of statements of
23723         this block.  So code generation proceeds in a top down fashion.
23724
23725 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * statement.cs: Add support for multiple child blocks.
23728
23729 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23730
23731         * codegen.cs (EmitCode): New function, will emit the code for a
23732         Block of code given a TypeContainer and its ILGenerator. 
23733
23734         * statement.cs (Block): Standard public readonly optimization.
23735         (Block::Block constructors): Link children. 
23736         (Block::Child): Child Linker.
23737         (Block::EmitVariables): Emits IL variable declarations.
23738
23739         * class.cs: Drop support for MethodGroups here, delay until
23740         Semantic Analysis.
23741         (Method::): Applied the same simplification that I did before, and
23742         move from Properties to public readonly fields.
23743         (Method::ParameterTypes): Returns the parameter types for the
23744         function, and implements a cache that will be useful later when I
23745         do error checking and the semantic analysis on the methods is
23746         performed.
23747         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23748         and made a method, optional argument tells whether this is a class
23749         or a structure to apply the `has-this' bit.
23750         (Method::GetCallingConvention): Implement, returns the calling
23751         convention. 
23752         (Method::Define): Defines the type, a second pass is performed
23753         later to populate the methods.
23754
23755         (Constructor::ParameterTypes): implement a cache similar to the
23756         one on Method::ParameterTypes, useful later when we do semantic
23757         analysis. 
23758
23759         (TypeContainer::EmitMethod):  New method.  Emits methods.
23760
23761         * expression.cs: Removed MethodGroup class from here.
23762
23763         * parameter.cs (Parameters::GetCallingConvention): new method.
23764
23765 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * class.cs (TypeContainer::Populate): Drop RootContext from the
23768         argument. 
23769
23770         (Constructor::CallingConvention): Returns the calling convention.
23771         (Constructor::ParameterTypes): Returns the constructor parameter
23772         types. 
23773
23774         (TypeContainer::AddConstructor): Keep track of default constructor
23775         and the default static constructor.
23776
23777         (Constructor::) Another class that starts using `public readonly'
23778         instead of properties. 
23779
23780         (Constructor::IsDefault): Whether this is a default constructor. 
23781
23782         (Field::) use readonly public fields instead of properties also.
23783
23784         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23785         track of static constructors;  If none is used, turn on
23786         BeforeFieldInit in the TypeAttributes. 
23787
23788         * cs-parser.jay (opt_argument_list): now the return can be null
23789         for the cases where there are no arguments. 
23790
23791         (constructor_declarator): If there is no implicit `base' or
23792         `this', then invoke the default parent constructor. 
23793
23794         * modifiers.cs (MethodAttr): New static function maps a set of
23795         modifiers flags into a MethodAttributes enum
23796         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23797         MethodAttr, TypeAttr to represent the various mappings where the
23798         modifiers are used.
23799         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23800
23801 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23802
23803         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23804         method arguments.
23805
23806         * interface.cs (PopulateIndexer): Implemented the code generator
23807         for interface indexers.
23808
23809 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23810
23811         * interface.cs (InterfaceMemberBase): Now we track the new status
23812         here.  
23813
23814         (PopulateProperty): Implement property population.  Woohoo!  Got
23815         Methods and Properties going today. 
23816
23817         Removed all the properties for interfaces, and replaced them with
23818         `public readonly' fields. 
23819
23820 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23821
23822         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23823         initialize their hashtables/arraylists only when they are needed
23824         instead of doing this always.
23825
23826         * parameter.cs: Handle refs and out parameters.
23827
23828         * cs-parser.jay: Use an ArrayList to construct the arguments
23829         instead of the ParameterCollection, and then cast that to a
23830         Parameter[] array.
23831
23832         * parameter.cs: Drop the use of ParameterCollection and use
23833         instead arrays of Parameters.
23834
23835         (GetParameterInfo): Use the Type, not the Name when resolving
23836         types. 
23837
23838 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23839
23840         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23841         and instead use public readonly fields.
23842
23843         * class.cs: Put back walking code for type containers.
23844
23845 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23846
23847         * class.cs (MakeConstant): Code to define constants.
23848
23849         * rootcontext.cs (LookupType): New function.  Used to locate types 
23850
23851
23852 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23853
23854         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23855         this System.Reflection code is.  Kudos to Microsoft
23856
23857         * typemanager.cs: Implement a type cache and avoid loading all
23858         types at boot time.  Wrap in LookupType the internals.  This made
23859         the compiler so much faster.  Wow.  I rule!
23860
23861         * driver.cs: Make sure we always load mscorlib first (for
23862         debugging purposes, nothing really important).
23863
23864         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23865         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23866
23867         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23868         on namespaces that have been imported using the `using' keyword.
23869
23870         * class.cs (TypeContainer::TypeAttr): Virtualize.
23871         (Class::TypeAttr): Return attributes suitable for this bad boy.
23872         (Struct::TypeAttr): ditto.
23873         Handle nested classes.
23874         (TypeContainer::) Remove all the type visiting code, it is now
23875         replaced with the rootcontext.cs code
23876
23877         * rootcontext.cs (GetClassBases): Added support for structs. 
23878
23879 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23880
23881         * interface.cs, statement.cs, class.cs, parameter.cs,
23882         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23883         Drop use of TypeRefs, and use strings instead.
23884
23885 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23886
23887         * rootcontext.cs: 
23888
23889         * class.cs (Struct::Struct): set the SEALED flags after
23890         checking the modifiers.
23891         (TypeContainer::TypeAttr): new property, returns the
23892         TypeAttributes for a class.  
23893
23894         * cs-parser.jay (type_list): Oops, list production was creating a
23895         new list of base types.
23896
23897         * rootcontext.cs (StdLib): New property.
23898         (GetInterfaceTypeByName): returns an interface by type name, and
23899         encapsulates error handling here.
23900         (GetInterfaces): simplified.
23901         (ResolveTree): Encapsulated all the tree resolution here.
23902         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23903         types. 
23904
23905         * driver.cs: Add support for --nostdlib, to avoid loading the
23906         default assemblies.
23907         (Main): Do not put tree resolution here. 
23908
23909         * rootcontext.cs: Beginning of the class resolution.
23910
23911 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23912
23913         * rootcontext.cs: Provide better error reporting. 
23914
23915         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23916
23917         * rootcontext.cs (CreateInterface): Handle the case where there
23918         are no parent interfaces.
23919
23920         (CloseTypes): Routine to flush types at the end.
23921         (CreateInterface): Track types.
23922         (GetInterfaces): Returns an array of Types from the list of
23923         defined interfaces.
23924
23925         * typemanager.c (AddUserType): Mechanism to track user types (puts
23926         the type on the global type hash, and allows us to close it at the
23927         end). 
23928
23929 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23930
23931         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23932         RecordInterface instead.
23933
23934         * cs-parser.jay: Updated to reflect changes above.
23935
23936         * decl.cs (Definition): Keep track of the TypeBuilder type that
23937         represents this type here.  Not sure we will use it in the long
23938         run, but wont hurt for now.
23939
23940         * driver.cs: Smaller changes to accomodate the new code.
23941
23942         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23943         when done. 
23944
23945         * rootcontext.cs (CreateInterface):  New method, used to create
23946         the System.TypeBuilder type for interfaces.
23947         (ResolveInterfaces): new entry point to resolve the interface
23948         hierarchy. 
23949         (CodeGen): Property, used to keep track of the code generator.
23950
23951 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23952
23953         * cs-parser.jay: Add a second production for delegate_declaration
23954         with `VOID'.
23955
23956         (enum_body): Put an opt_comma here instead of putting it on
23957         enum_body or enum_member_declarations so we can handle trailing
23958         commas on enumeration members.  Gets rid of a shift/reduce.
23959
23960         (type_list): Need a COMMA in the middle.
23961
23962         (indexer_declaration): Tell tokenizer to recognize get/set
23963
23964         * Remove old targets.
23965
23966         * Re-add the parser target.
23967
23968 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23969
23970         * cs-parser.jay: Add precendence rules for a number of operators
23971         ot reduce the number of shift/reduce conflicts in the grammar.
23972
23973 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23974
23975         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23976         and put it here.
23977
23978         Get rid of old crufty code.
23979
23980         * rootcontext.cs: Use this to keep track of the parsed
23981         representation and the defined types available to the program. 
23982
23983         * gen-treedump.cs: adjust for new convention.
23984
23985         * type.cs: Split out the type manager, and the assembly builder
23986         from here. 
23987
23988         * typemanager.cs: the type manager will live here now.
23989
23990         * cil-codegen.cs: And the code generator here. 
23991
23992 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23993
23994         * makefile: Fixed up for easy making.
23995
23996 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23997
23998         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23999         the 
24000
24001         (unary_expression): Expand pre_increment_expression and
24002         post_decrement_expression to reduce a shift/reduce.
24003
24004 2001-07-11  Simon Cozens
24005
24006         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24007
24008         Improve allow_keyword_as_indent name.
24009
24010 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24011
24012         * Adjustments for Beta2. 
24013
24014 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24015
24016         * decl.cs: Added `Define' abstract method.
24017         (InTransit): new property, used to catch recursive definitions. 
24018
24019         * interface.cs: Implement `Define'. 
24020
24021         * modifiers.cs: Map Modifiers.constants to
24022         System.Reflection.TypeAttribute flags.
24023
24024         * class.cs: Keep track of types and user-defined types.
24025         (BuilderInit): New method for creating an assembly
24026         (ResolveType): New function to launch the resolution process, only
24027         used by interfaces for now.
24028
24029         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24030         that are inserted into the name space. 
24031
24032 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24033
24034         * ARGH.  I have screwed up my tree so many times due to the use of
24035         rsync rather than using CVS.  Going to fix this at once. 
24036
24037         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24038         load types.
24039
24040 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24041
24042         * Experiment successful: Use System.Type rather that our own
24043         version of Type.  
24044
24045 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24046
24047         * cs-parser.jay: Removed nsAliases from here.
24048
24049         Use new namespaces, handle `using XXX;' 
24050
24051         * namespace.cs: Reimplemented namespace handling, use a recursive
24052         definition of the class.  Now we can keep track of using clauses
24053         and catch invalid using clauses.
24054
24055 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24056
24057         * gen-treedump.cs: Adapted for all the renaming.
24058
24059         * expression.cs (Expression): this class now has a Type property
24060         which returns an expression Type.
24061
24062         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24063         `Type', as this has a different meaning now in the base
24064
24065 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24066
24067         * interface.cs, class.cs: Removed from all the sources the
24068         references to signature computation, as we can not do method
24069         signature computation during the parsing time, as we are not
24070         trying to solve at that point distinguishing:
24071
24072         class X {
24073                 void a (Blah x) {}
24074                 void a (NS.Blah x) {}
24075         }
24076
24077         Which depending on the context might be valid or not, as we do not
24078         know if Blah is the same thing as NS.Blah at that point.
24079
24080         * Redid everything so the code uses TypeRefs now instead of
24081         Types.  TypeRefs are just temporary type placeholders, that need
24082         to be resolved.  They initially have a pointer to a string and the
24083         current scope in which they are used.  This is used later by the
24084         compiler to resolve the reference to an actual Type. 
24085
24086         * DeclSpace is no longer a CIR.Type, and neither are
24087         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24088         are all DeclSpaces, but no Types. 
24089
24090         * type.cs (TypeRefManager): This implements the TypeRef manager,
24091         which keeps track of all the types that need to be resolved after
24092         the parsing has finished. 
24093
24094 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24095
24096         * ARGH.  We are going to have to store `foreach' as a class rather
24097         than resolving it, as we need to verify error 1579 after name
24098         resolution.   *OR* we could keep a flag that says `This request to
24099         IEnumerator comes from a foreach statement' which we can then use
24100         to generate the error.
24101
24102 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24103
24104         * class.cs (TypeContainer.AddMethod): we now add methods to the
24105         MethodGroup instead of the method hashtable.  
24106
24107         * expression.cs: Add MethodGroup abstraction, which gets us one
24108         step closer to the specification in the way we handle method
24109         declarations.  
24110
24111         * cs-parser.jay (primary_expression): qualified_identifier now
24112         tried to match up an identifier to a local variable reference or
24113         to a parameter reference.
24114
24115         current_local_parameters is now a parser global variable that
24116         points to the current parameters for the block, used during name
24117         lookup.
24118
24119         (property_declaration): Now creates an implicit `value' argument to
24120         the set accessor.
24121
24122 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24123
24124         * parameter.cs: Do not use `param' arguments as part of the
24125         signature, per the spec.
24126
24127 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24128
24129         * decl.cs: Base class for classes, structs and interfaces.  This
24130         is the "Declaration Space" 
24131
24132         * cs-parser.jay: Use CheckDef for checking declaration errors
24133         instead of having one on each function.
24134
24135         * class.cs: Factor out some code for handling error handling in
24136         accordance to the "Declarations" section in the "Basic Concepts"
24137         chapter in the ECMA C# spec.
24138
24139         * interface.cs: Make all interface member classes derive from
24140         InterfaceMemberBase.
24141
24142 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24143
24144         * Many things: all interfaces are parsed and generated in
24145         gen-treedump.  Support for member variables, constructors,
24146         destructors, properties, constants is there.
24147
24148         Beginning of the IL backend, but very little done, just there for
24149         testing purposes. 
24150
24151 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24152
24153         * cs-parser.jay: Fix labeled statement.
24154
24155         * cs-tokenizer.cs (escape): Escape " and ' always.
24156         ref_line, ref_name: keep track of the line/filename as instructed
24157         by #line by the compiler.
24158         Parse #line.
24159
24160 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24161
24162         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24163         to match the values in System.CodeDOM.
24164
24165         Divid renamed to Divide.
24166
24167         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24168         statements. 
24169         (Statements.set): remove.
24170
24171         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24172         statements. 
24173
24174         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24175         falseStatements always have valid values. 
24176
24177         * cs-parser.jay: Use System.CodeDOM now.
24178