New test.
[mono.git] / mcs / mcs / ChangeLog
1 2006-10-04  Martin Baulig  <martin@ximian.com>
2
3         Merged the Anonymous Methods patch.
4
5         * anonymous.cs, iterators.cs: The new anonymous methods code.
6
7         * statement.cs (Variable): New public abstract class.
8         (LocalInfo.Variable): New public property.
9         (LocalInfo.ResolveVariable): New public method.
10         (Block.Flags): Add `IsIterator'.
11         (Block.AddVariable): Improved the CS0136 check.
12         (Block.AnonymousChildren): New public property.
13         (Block.AddAnonymousChild): New public method.
14         (ToplevelBlock): Update to use the new anonymous method framework.
15         (ToplevelBlock.ctor): `container' is now a `Block' and not a
16         `ToplevelBlock'; this is required to correctly implement the
17         CS0136 check.
18         (Fixed, Using): Use `TemporaryVariable' instead of directly
19         creating the `LocalBuilder'.
20
21         * parameter.cs (Parameter.ResolveVariable): New public method.
22         (Parameters.ResolveVariable): Likewise.
23
24         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
25
26         * class.cs (TypeContainer): Replaced the `iterators' list and
27         corresponding methods with a list of `CompilerGeneratedClass'es.
28         (TypeContainer.ResolveMembers): New public method.
29         (Method): `IIteratorContainer' has been replaced by
30         `IAnonymousHost'.
31
32         * expression.cs (VariableReference): New public abstract base
33         class for `LocalVariableReference', `ParameterReference' and
34         `This'.
35
36         * codegen.cs (EmitContext): Removed `capture_context',
37         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
38         (EmitContext.EmitThis): Removed.
39
40         * cs-parser.jay: Replace `iterator_container' with
41         `anonymous_host'.       
42
43 2006-10-04  Martin Baulig  <martin@ximian.com>
44
45         * generic.cs (GenericMethod): Don't make this abstract.
46         (Constraints.Clone): Added dummy implementation.
47
48 2006-10-04  Raja R Harinath  <harinath@gmail.com>
49
50         Fix #79577
51         * namespace.cs (LookForAnyGenericType): Avoid nullref on
52         'declspaces'.  Avoid allocating arrays willy-nilly.
53
54         Fix #79553
55         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
56         cases out of the switch.
57
58 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
59
60         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
61         message when non-generic type is used with the type arguments.
62         * expression.cs: Updated.
63
64 2006-09-28  Raja R Harinath  <rharinath@novell.com>
65
66         Fix #79013
67         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
68         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
69         Change semantics slightly.  Don't insist on having only one
70         temporary EmptyExpression -- just throttle the creation of new ones.
71
72         Fix #79451
73         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
74         non-interfaces too.  If no methods are found, don't try to create
75         a MethodGroupExpr.
76
77 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
78
79         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
80         generic type.
81
82         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
83         us produce better error message.
84
85 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
86
87         * expression.cs (Binary.ResolveOperator): Warn about a side effect
88         of the `|' operator.
89
90         * report.cs: A new warning added.
91
92 2006-09-27  Martin Baulig  <martin@ximian.com>
93
94         * generic.cs (GenericMethod): Don't make this abstract.
95
96 2006-09-27  Martin Baulig  <martin@ximian.com>
97
98         * report.cs
99         (InternalErrorException): Added overloaded ctor taking a params array.
100
101 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
102
103         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
104         Fixed the cases when same error was reported twice.
105
106         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
107         now report symbol information.
108
109 2006-09-25  Martin Baulig  <martin@ximian.com>
110
111         * class.cs: Completely unified with the gmcs version.
112
113 2006-09-25  Martin Baulig  <martin@ximian.com>
114
115         * typemanager.cs (TypeManager.IsNullableType): New public function.
116         (TypeManager.IsNullableTypeOf): Likewise.
117         (TypeManager.IsNullableValueType): Likewise.
118
119         * class.cs (MethodCore): Added the `GenericMethod' argument from
120         gmcs and also unified all classes derived from `MethodCore' with gmcs.
121
122 2006-09-24  Raja R Harinath  <harinath@gmail.com>
123
124         * convert.cs: Unify with gmcs version.
125
126 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
127
128         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
129         verify them as well.
130
131         * report.cs: New warning.
132
133 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
134
135         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
136         for anonymous block with out argument.
137
138 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
139
140         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
141         not used private events only.
142
143 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
144
145         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
146
147         * const.cs (Const.Define): Check for constant type.
148         (Const.IsConstantTypeValid): Looks for valid constant types.
149
150         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
151
152         * ecore.cs (EmptyConstantCast): New common class for all constant based
153         EmptyCast(s).
154
155         * expression.cs (Is.DoResolve): Handle null constant especially.
156         (New.DoResolve): Check for new void().
157         (MemberAccess.DoResolve): Cope with all kind of nulls.
158
159         * literal.cs (NullConstant): Uses EmptyConstantCast.
160         (NullDefault): Based on EmptyConstantCast.
161         (NullLiteral): Uses EmptyConstantCast.
162
163         * statement.cs (Block.ResolveMeta): Check for constant type.
164
165 2006-09-22  Martin Baulig  <martin@ximian.com>
166
167         * delegate.cs, attribute.cs: Merged with the gmcs versions.
168
169 2006-09-22  Raja R Harinath  <rharinath@novell.com>
170
171         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
172         not the null type.
173
174         Fix part of #79451
175         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
176         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
177         code slightly.
178
179 2006-09-22  Martin Baulig  <martin@ximian.com>
180
181         * ecore.cs: Merged with the gmcs version.
182
183         * generic.cs (ConstructedType): New dummy class.
184         (TypeArguments): Don't make this abstract.
185
186         * typemanager.cs
187         (TypeManager.IsGenericTypeDefinition): New method.
188         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
189
190 2006-09-22  Raja R Harinath  <rharinath@novell.com>
191
192         * expression.cs (ComposedCast): Check for arrays of TypedReference
193         before creating the type, not after.
194
195 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
196
197         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
198         after ToType change.
199
200         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
201         when constant must be implicitly convertible.
202
203         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
204
205         * ecore.cs (NullCast): Derives from NullConstant.
206
207         * expression.cs (Is.DoResolve): Removed useless variables.
208         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
209         (New.Constantify): Add enum support.
210         (MemberAccess.DoResolve): Add warning when accessing null constant or
211         variable.
212
213         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
214         property.
215
216         * literal.cs (NullConstant): New abstract class with common
217         functionality for all null specializations.
218         (NullDefault): Represents default(X) when result can be
219         reduced to null.
220         (NullLiteral): Updated.
221
222         * report.cs: Add new warning.
223
224 2006-09-21  Martin Baulig  <martin@ximian.com>
225
226         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
227
228 2006-09-21  Martin Baulig  <martin@ximian.com>
229
230         * generic.cs (GenericConstraints): New dummy class.
231         (Constraints): Likewise.
232         (TypeParameter): Likewise.
233         (TypeParameterName): Likewise.
234         (GenericMethod): Likewise.
235
236         * typemanager.cs (TypeManager.GetGenericArguments): New method.
237
238         * decl.cs: Merged with the gmcs version.
239
240 2006-09-21  Raja R Harinath  <rharinath@novell.com>
241
242         * generic.cs (TypeParameter): Implement IMemberContainer.
243         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
244
245         * rootcontext.cs: Unify with gmcs version.
246
247         * report.cs: Unify with gmcs version.
248         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
249         from gmcs/generics.cs.
250         * generics.cs (TypeParameter): New dummy class.
251
252         * support.cs: Unify with gmcs version.
253
254 2006-09-20  Raja R Harinath  <rharinath@novell.com>
255
256         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
257         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
258
259         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
260         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
261         * mcs.exe.sources: Add generic.cs.
262
263         * codegen.cs: Unify with gmcs version.
264
265         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
266         (EmitContext): Add GenericDeclContainer implementation.
267         * decl.cs (MemberCore, DeclSpace): Likewise.
268         * namespace.cs: Remove #ifdef GMCS_SOURCE.
269
270         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
271         MCS TypeManager has a corresponding dummy method.
272
273 2006-09-19  Martin Baulig  <martin@ximian.com>
274
275         * expression.cs: Completely merged with the gmcs version.
276
277 2006-09-19  Martin Baulig  <martin@ximian.com>
278
279         * expression.cs (Invocation): Merged with the gmcs version.
280         (ArrayAccess.GetStoreOpcode): Likewise.
281
282 2006-09-19  Martin Baulig  <martin@ximian.com>
283
284         * typemanager.cs
285         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
286         (TypeManager.IsGenericMethodDefinition): Likewise.
287
288 2006-09-19  Martin Baulig  <martin@ximian.com>
289
290         * typemanager.cs
291         (TypeManager.IsEqual): Moved the gmcs implementation here.
292         (TypeManager.DropGenericTypeArguments): Likewise.
293         (TypeManager.DropGenericMethodArguments): Likewise.
294         (TypeManager.GetTypeArguments): Moved here from gmcs.
295         (TypeManager.HasGenericArguments): Likewise.
296
297 2006-09-19  Martin Baulig  <martin@ximian.com>
298
299         * expression.cs (Binary): Merged with the gmcs version.
300
301 2006-09-19  Martin Baulig  <martin@ximian.com>
302
303         * expression.cs (Probe, As, Is): Merged with the gmcs version.
304
305 2006-09-19  Martin Baulig  <martin@ximian.com>
306
307         * typemanager.cs: Merged with the gmcs version.
308
309 2006-09-16  Raja R Harinath  <rharinath@novell.com>
310
311         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
312         * driver.cs: Likewise.
313
314 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
315
316         A fix for #79401
317         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
318         only if parent type is class.
319         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
320         update.
321
322 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
323
324         * cs-parser.jay,
325         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
326         keywords are used.
327         * typemanager.cs(CSharpName): Converts NullType to null.
328
329 2006-09-15  Martin Baulig  <martin@ximian.com>
330
331         * typemanager.cs
332         (TypeManager.GetMethodName): Added mcs implementation.
333         (TypeManager.IsEqual): Likewise.
334
335         * ecore.cs
336         (SimpleName.RemoveGenericArity): Added dummy implementation.
337
338         * pending.cs: Merged with the gmcs version.     
339
340 2006-09-15  Martin Baulig  <martin@ximian.com>
341
342         * statement.cs: Merge with the gmcs version.
343
344 2006-09-15  Martin Baulig  <martin@ximian.com>
345
346         * statement.cs (Switch): Merge with the gmcs implementation
347         (without nullables), which is newer.
348
349 2006-09-15  Martin Baulig  <martin@ximian.com>
350
351         * statement.cs (Block.Variables): Make this public.
352         (ToplevelBlock.Parameters): Make this a property.
353         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
354
355 2006-09-15  Martin Baulig  <martin@ximian.com>
356
357         * namespace.cs: Merge with the gmcs version.
358
359 2006-09-15  Martin Baulig  <martin@ximian.com>
360
361         * decl.cs (MemberName): Minor code cleanups.
362
363 2006-09-15  Martin Baulig  <martin@ximian.com>
364
365         * parameter.cs: Merge with the gmcs version.
366
367 2006-09-15  Martin Baulig  <martin@ximian.com>
368
369         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
370         and an error in mcs.
371
372 2006-09-15  Martin Baulig  <martin@ximian.com>
373
374         * flowanalysis.cs: Merged from GMCS; added the generics code into
375         a `GMCS_SOURCE' conditional so we can share this file.
376
377 2006-09-08  Martin Baulig  <martin@ximian.com>
378
379         * typemanager.cs (TypeManager.interlocked_type): New public field.
380         (TypeManager.int_interlocked_compare-exchange): New public field.
381         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
382         enumerator types here and call InitGenericCoreTypes().
383         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
384         after calling InitEnumUnderlyingTypes().
385
386         * rootcontext.cs
387         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
388         `classes_second_stage'. 
389
390 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
391
392         * assign.cs, ecore.cs, expression.cs: Share error message text.
393         * class.cs (FieldMember.Define): Check for varible of static type.
394         * driver.cs (LoadAssembly): Uses error output for errors.
395         * statement.cs: Updated.
396
397 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
398
399         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
400         type instance.
401
402 2006-09-07  Martin Baulig  <martin@ximian.com>
403
404         * driver.cs
405         (MainDriver): Revert r62663 from Marek; see #70506 for details.
406
407 2006-08-29  Miguel de Icaza  <miguel@novell.com>
408
409         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
410         
411 2006-08-17  Miguel de Icaza  <miguel@novell.com>
412
413         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
414         #52019 and #79064, the use of the \uXXXX sequence in source code
415         to represent unicode characters.
416
417 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
418
419         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
420         support.
421         * class.cs, ecore.cs, statement.cs: Merged to one error message.
422
423 2006-08-13  Miguel de Icaza  <miguel@novell.com>
424
425         * assign.cs: Catch attempts to assign to a method groups in += and
426         report as 1656
427
428 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
429
430         A fix for #79056
431         * cs-parser.jay: Don't destroy current array type by typeof of array's.
432
433 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
434
435         * class.cs (Method.Define): Issue a warning when generic method looks like
436         an entry point.
437         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
438         as well.
439
440 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
441  
442         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
443         looking for ctor.
444         * decl.cs (MemberCache.FindMembers): When container is interface we need to
445         search all base interfaces as a member can be ambiguous.
446         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
447         Constructor member type filter. 
448         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
449         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
450         reporting for returned memberinfos.
451         * report.cs: Updated.
452         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
453         version to work on all runtimes.
454         (TypeManager.RealMemberLookup): Removed members filtering.
455
456 2006-08-08  Raja R Harinath  <rharinath@novell.com>
457
458         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
459         (PropertyExpr.EmitAssign): Likewise.
460         * expression.cs (Indirection.EmitAssign): Likewise.
461         (LocalVariableReference.EmitAssign): Likewise.
462         (ParameterReference.EmitAssign): Likewise.
463         (Invocation.EmitArguments): Likewise.
464         (ArrayAccess.EmitAssign): Likewise.
465         (IndexerAccess.EmitAssign): Likewise.
466         (This.EmitAssign): Likewise.
467         (ConditionalLogicalOperator.Emit): Likewise.
468
469         Fix #79026
470         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
471         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
472         leave it in after returning it.
473         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
474
475 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
476
477         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
478         message.
479
480 2006-08-03  Raja R Harinath  <rharinath@novell.com>
481
482         Fix cs0146-3.cs and cs0146-4.cs.
483         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
484         enclosing types don't depend on the current type.
485
486 2006-08-02  Raja R Harinath  <rharinath@novell.com>
487
488         Fix #77963
489         * class.cs (TypeContainer.DoDefineMembers): Use
490         FindBaseMemberWithSameName on Parent, since we're interested in
491         whether we hide inherited members or not.
492         (FindBaseMemberWithSameName): Make slightly more robust.
493
494         Fix the non-generic testcase from #77396
495         * decl.cs (DeclSpace.DeclContainer): Remove override.
496
497         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
498         declspaces for doppelgangers too.
499         (UsingEntry): Implement IResolveContext.
500         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
501         'this' as the resolve context.
502         (LocalAliasEntry): Likewise.
503
504         Implement parts of #77403
505         * roottypes.cs (RootDeclSpace): New.  Used to represent the
506         toplevel declaration space.  Each namespace declaration introduces
507         a "partial" root declaretion space.
508         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
509         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
510         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
511         from 'current_namespace.SlaveDeclSpace'.
512         (namespace_declaration): Likewise.
513         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
514         check.  It can't happen now.
515         * decl.cs (DeclSpace.LookupType): Likewise.
516         * driver.cs (MainDriver): Sanity check.
517
518 2006-08-01  Raja R Harinath  <rharinath@novell.com>
519
520         * decl.cs (DeclSpace.FindNestedType): Remove.
521         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
522         LookupTypeContainer to get the container of the nested type.
523         * class.cs (TypeContainer.FindNestedType): Make non-override.
524
525 2006-07-31  Raja R Harinath  <rharinath@novell.com>
526
527         * decl.cs (DeclSpace.PartialContainer): Move field from ...
528         * class.cs (TypeContainer.PartialContainer): ... here.
529         (TypeContainer.AddBasesForPart): New helper.
530         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
531         instead.
532         * cs-parser.jay (current_class): Convert to DeclSpace.
533         (struct_declaration, interface_declaration, class_declaration):
534         Use AddBasesForPart instead of .Bases directly.
535         * const.cs, iterators.cs: Update to changes.
536
537 2006-07-28  Raja R Harinath  <rharinath@novell.com>
538
539         * class.cs (TypeContainer.AddMemberType): Rename from
540         AddToTypeContainer.
541         (TypeContainer.AddMember): Rename from AddToMemberContainer.
542         (AddTypeContainer): New.  Combine AddClassOrStruct and
543         AddInterface.
544         (AddPartial): Update.  Add 'is_partial' argument.
545         * roottypes.cs: Update to changes.
546         * cs-parser.jay (push_current_class): New helper for handling
547         current_container and current_class.
548         (struct_declaration, interface_declaration, class_declaration):
549         Use it.
550
551 2006-07-26  Raja R Harinath  <rharinath@novell.com>
552
553         * roottypes.cs: Rename from tree.cs.
554
555         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
556         * tree.cs (Tree, ITreeDump): Remove types.
557         * rootcontext.cs (tree, Tree): Remove fields.
558         (root, ToplevelTypes): New.
559         * *.cs: Update to rename.
560
561         * tree.cs (Tree.RecordDecl): Remove.
562         (RootTypes.AddToTypeContainer): Record the toplevel type in its
563         namespace here.
564         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
565
566 2006-07-23  Raja R Harinath  <harinath@gmail.com>
567
568         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
569         DoFlowAnalysis and OmitStructFlowAnalysis here.
570         (ec.With): Rename from WithUnsafe and generalize.
571         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
572         (ec.WithFlowAnalyis): New.
573         * ecore.cs, expression.cs, statement.cs: Update.
574
575 2006-07-22  Raja R Harinath  <harinath@gmail.com>
576
577         * statement.cs (Block.ResolveMeta): Simplify slightly.
578
579         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
580         multiple boolean fields.  Convert InUnsafe, constant_check_state,
581         check_state to flags.
582         (CheckState, ConstantCheckState): Update.
583         (InUnsafe): New read-only property.
584         (FlagsHandle): Rename from CheckStateHandle and convert to handle
585         arbitrary flags.
586         (WithUnsafe): New helper similar to WithCheckState.
587         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
588         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
589
590 2006-07-21  Raja R Harinath  <rharinath@novell.com>
591
592         Make comparisons use the same IL irrespective of whether they're
593         in a 'checked' or 'unchecked' context: one of the issues in #78899
594         * codegen.cs (EmitContext.CheckState): Make read-only property.
595         (EmitContext.ConstantCheckState): Likewise.
596         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
597         helper that implement a save/restore stack for CheckState
598         values.  This is the only way to change check-state.
599         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
600         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
601         (CheckedExpr.EmitBranchable): New forwarding method.
602         (UnCheckedExpr): Likewise.
603         * statement.cs (Block.ResolveMeta): Use WithCheckState.
604         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
605         (Checked.Resolve, checked.DoEmit): Likewise.
606
607 2006-07-20  Miguel de Icaza  <miguel@novell.com>
608
609         * anonymous.cs: Cache the resolved anonymous delegate, and return
610         this so that the ResolveTopBlock is only triggered once, not
611         twice.
612
613         Currently we trigger ResolvetopBlock twice due to a first pass of
614         argument check compatibility, and a second pass that does the
615         actual resolution.   
616         
617 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
618
619         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
620         modifiers.
621         * rootcontext.cs (Reset): Add helper_classes.
622
623 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
624
625         A fix for #78860
626         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
627         correctly.
628
629 2006-07-13  Miguel de Icaza  <miguel@novell.com>
630
631         * statement.cs (Lock): Handle expressions of type
632         TypeManager.null_type specially.  Fixes #78770
633
634 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
635
636         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
637         to an event.
638
639 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
640
641         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
642         for accessors as well.
643         * ecore.cs (EventExpr): Add AccessorTable.
644
645 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
646
647         A fix for #78738
648         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
649         for CS0122 where appropriate.
650         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
651         level attributes.
652         (Filter): Assembly can be null in the case of top level attributes.
653
654 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
655
656         A fix for #78690
657
658         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
659         is done at global level.
660
661 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
662
663         A fix for #77002, Implemented TypeForwarder support.
664
665         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
666         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
667         * typemanager.cs (): Add type_forwarder_attr_type.
668
669 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
670
671         * report.cs: Add CS0469 warning.
672
673 2006-06-21  Martin Baulig  <martin@ximian.com>
674
675         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
676         the `try'-block, so we also report CS0016 etc. there.
677
678 2006-06-21  Martin Baulig  <martin@ximian.com>
679
680         * delegate.cs
681         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
682
683 2006-06-21  Martin Baulig  <martin@ximian.com>
684
685         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
686         also report CS1686 for parameters.
687
688 2006-06-21  Martin Baulig  <martin@ximian.com>
689
690         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
691         instead of an error if the value is not implicitly convertible to
692         the switch types; fixes #77964.
693
694 2006-06-21  Raja R Harinath  <rharinath@novell.com>
695
696         Fix #78673
697         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
698         FieldBuilder is null.
699
700         Fix #78662
701         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
702         'left' and 'right' before error-checking.
703
704 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
705
706         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
707         Fixed bug #78601.
708         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
709         (FieldExpr.DoResolve): likewise.
710         (PropertyExpr.InstanceResolve): likewise.
711         (EventExpr.InstanceResolve): likewise. 
712
713 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
714
715         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
716         attribute applicable tests for attribute argument.
717
718 2006-06-02  Raja R Harinath  <rharinath@novell.com>
719
720         Fix #78079
721         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
722         (Binary.OverloadResolve_PredefinedIntegral): New.
723         (Binary.OverloadResolve_PredefinedFloating): New.
724         (Binary.OverloadResolve_PredefinedString): New.
725         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
726         Follow the standard more closely, and treat numeric promotions in
727         terms of overload resolution.
728         (Binary.CheckShiftArguments): Simplify.
729
730 2006-06-01  Raja R Harinath  <rharinath@novell.com>
731
732         * flowanalysis.cs (MyBitVector): Simplify representation.
733         (MyBitVector.Clone): Avoid allocating BitArray.
734         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
735         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
736         (*): Update.  Change all references to MyBitVector.And and
737         MyBitVector.Or to &= and |=.
738
739 2006-05-29  Raja R Harinath  <rharinath@novell.com>
740
741         Fix cs0231-[34].cs.
742         * cs-parser.jay (formal_parameter_list): Extend the pattern below
743         to param arguments too.
744
745 2006-05-26  Miguel de Icaza  <miguel@novell.com>
746
747         * cs-parser.jay: Catch another parsing form for arglist being
748         followed by other arguments.  Fixes #78313.
749
750 2006-05-24  Raja R Harinath  <rharinath@novell.com>
751
752         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
753         checking of out parameters to ...
754         (FlowBranchingToplevel.Merge): ... here.
755         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
756         set, propagate the origin upward, and only complain if there was
757         no other error.
758         (FlowBranchingException.AddContinueOrigin): Likewise.
759         (FlowBranchingException.AddReturnOrigin): Likewise.
760         (FlowBranchingException.AddGotoOrigin): Likewise.       
761
762 2006-05-23  Raja R Harinath  <rharinath@novell.com>
763
764         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
765         unreachable, skip it.
766         (FlowBranchingException.Merge): Always propagate jumps, even if
767         the finally block renders subsequent code unreachable.
768
769 2006-05-18  Raja R Harinath  <rharinath@novell.com>
770
771         Fix #77601
772         * statement.cs (Goto.Resolve): Move responsibility for resolving
773         'goto' to FlowBranching.AddGotoOrigin.
774         (Goto.SetResolvedTarget): New.  Callback to set the
775         LabeledStatement that's the target of the goto.
776         (Goto.DoEmit): Use Leave instead of Br when crossing an
777         unwind-protect boundary.
778         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
779         LookupLabel and adjust to new semantics.
780         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
781         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
782         Goto.SetResolvedTarget to update target.
783         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
784         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
785         AddBreakOrigin & co.  Delay propagation until ...
786         (FlowBranchingException.Merge): ... this.
787
788         * statement.cs (Block.Resolve): Always depend on flow-branching to
789         determine unreachability.  Kill workaround that originally emitted
790         only one statement after an "unreachable" label (see infloop in
791         test-515.cs).
792
793         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
794         This is still "wrong", but anything better would probably need a
795         multi-pass algorithm.
796         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
797         usage vector.  Force current usage vector to be reachable, to
798         optimistically signify backward jumps.
799         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
800         detected.
801         (FlowBranchingLabeled.Merge): New.  If no backward jump was
802         detected, return the original salted-away usage vector instead,
803         updated with appropriate changes.  Print unreachable warning if
804         necessary.
805         * statement.cs (Block.Resolve): Don't print unreachable warning on
806         a labeled statement.
807
808 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
809
810         * driver.cs: Pass filename without path to AssemblyBuilder's 
811         AddResourceFile. Fixes bug #78407.
812
813 2006-05-17  Raja R Harinath  <rharinath@novell.com>
814
815         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
816         * flowanalysis.cs (FlowBranchingLabeled): ... here.
817         (FlowBranching.MergeChild): Overwrite
818         reachability information from Labeled branchings too.
819
820 2006-05-16  Raja R Harinath  <rharinath@novell.com>
821
822         * statement.cs (Goto.Resolve): Merge jump origins here ...
823         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
824
825         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
826         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
827         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
828         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
829         here, ...
830         * statement.cs (Goto.Resolve): ... not here.
831         (Goto.Emit): Remove CS1632 check.
832
833 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
834
835         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
836         error message.
837
838 2006-05-11  Raja R Harinath  <rharinath@novell.com>
839
840         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
841         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
842         (FlowBranchingException.Label): Likewise.
843
844         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
845         given value.
846         (MyBitVector.Or): Use it to avoid losing information (Count).
847         (FlowBranching.MergeOrigins): Likewise.
848
849         * flowanalysis.cs (UsageVector.IsDirty): Remove.
850         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
851         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
852         (UsageVector.ToString): Simplify.
853         (UsageVector.MergeSiblings): Move here from ...
854         (FlowBranching.Merge): ... here.
855         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
856         not a MyBitVector.
857
858 2006-05-10  Raja R Harinath  <rharinath@novell.com>
859
860         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
861         null bitvector is treated as all-true.
862
863         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
864         (MyBitVector): Rationalize invariants.  'vector != null' implies
865         that we have our own copy of the bitvector.  Otherwise,
866         'InheritsFrom == null' implies all inherited bits are true.
867
868 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
869
870         * statement.cs (LocalInfo): Add IsConstant.
871         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
872         local variable for constants.
873
874 2006-05-09  Raja R Harinath  <rharinath@novell.com>
875
876         * flowanalysis.cs (MyBitVector.Empty): New.
877         (MyBitVector): Don't allow InheritedFrom to be null.
878         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
879         (UsageVector, FlowBranching): Update to changes.
880
881         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
882         recursion.  The 'Parent == null' condition isn't sufficient for
883         anonymous methods.
884         (FlowBranching.AddBreakOrigin): Likewise.
885         (FlowBranching.AddContinueOrigin): Likewise.
886         (FlowBranching.AddReturnOrigin): Likewise.
887         (FlowBranching.StealFinallyClauses): Likewise.
888         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
889         (FlowBranching.CheckOutParameters): Likewise.
890         (FlowBranchingToplevel): Terminate all the above recursions here.
891         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
892         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
893
894         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
895         toplevel block.
896         (FlowBranchingToplevel): New.  Empty for now.
897         (FlowBranching.MergeTopBlock): Update.
898         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
899         branching for the anonymous delegate.
900         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
901
902         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
903         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
904         information at the start of the merge.  Reorganize.
905
906 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
907
908         * class.cs (MethodData.Define): Method cannot implement interface accessor.
909
910 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
911
912         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
913         to newly introduced ctor.
914
915         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
916         message to one place.
917         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
918         global namespace.
919
920 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
921
922         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
923
924         * ecore.cs (Expression.ResolveAsConstant): Updated.
925
926         * statement.cs (ResolveMeta): Updated.
927
928 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
929
930         * cs-parser.jay: __arglist cannot be used in initializer.
931
932 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
933
934         A fix for #77879
935         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
936         private types.
937
938 2006-05-05  Raja R Harinath  <rharinath@novell.com>
939
940         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
941         (LabeledStatement): Add 'name' parameter.
942         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
943         (Block.AddLabel): Update to changes.
944         * cs-parser.jay (labeled_statement): Likewise.
945
946         * flowanalysis.cs (BranchingType.Labeled): New.
947         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
948         (FlowBranchingLabeled): New.  Does nothing for now, but will
949         eventually handle 'goto' flows.
950         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
951         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
952         that's terminated ...
953         (Block.Resolve): ... here.
954
955         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
956         (UsageVector.MergeFinallyOrigins): Likewise.
957         (FlowBranching.InTryOrCatch): Likewise.
958         (FlowBranching.AddFinallyVector): Likewise.
959         (FlowBranchingException): Update to changes.
960
961         Fix #78290
962         * statement.cs (Return.Resolve): Move error checking to ...
963         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
964         (FlowBranchingException): Handle return origins like break and
965         continue origins.
966         (FlowBranching.UsageVector.CheckOutParameters): Remove.
967
968 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
969
970         A fix for #76122
971         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
972         filter.
973
974 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
975
976         A fix for #77543
977         * class.cs (MethodData.Define): Do public accessor check only when method
978         implements an interface.
979
980 2006-05-04  Raja R Harinath  <rharinath@novell.com>
981
982         Remove special handling of 'break'
983         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
984         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
985         (UsageVector.Break): Remove.
986         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
987         reachability.
988         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
989
990         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
991         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
992
993 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
994
995         A fix for #75726
996         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
997         be the interface member.
998
999 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1000
1001         A fix for #60069
1002         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1003         for emitting small (int) values.
1004
1005 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1006
1007         Fix #59427
1008         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1009         control-flow passes through the 'finally' after merging-in all the
1010         control-flows from 'try' and the 'catch' clauses.
1011
1012         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1013         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1014         always true at the only non-recursive entry point.
1015         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1016         FlowBranchingBreakable.
1017         (FlowBranchingLoop): Remove.
1018         * statement.cs (Return.DoResolve): Update to changes.
1019
1020         Fix #76471, #76665
1021         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1022         (FlowBranching.CreateBranching): Handle it: create a
1023         FlowBranchingContinuable.
1024         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1025         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1026         except that it handles the 'continue' command.
1027         (FlowBranching.UsageVector.MergeOrigins): Rename from
1028         MergeBreakOrigins.
1029         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1030         except that it overrides AddContinueOrigin.
1031         (FlowBranchingException): Override AddContinueOrigin, similar to
1032         AddBreakOrigin.
1033         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1034         Create a new branching around the embedded statement.
1035         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1036         control flow after the embedded statement.
1037         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1038
1039         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1040         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1041         FlowBranchingBreakable.
1042         (FlowBranchingSwitch): Remove.
1043
1044         Fix test-503.cs
1045         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1046         error reporting to ...
1047         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1048         Rename from 'AddBreakVector'.  Add new location argument.  Return
1049         a bool indicating whether the 'break' crosses an unwind-protect.
1050         (FlowBranchingException.AddBreakOrigin): Add.
1051         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1052         flowbranching after updating with the effects of the 'finally'
1053         clause.
1054         (FlowBranchingBreakable): New common base class for
1055         FlowBranchingLoop and FlowBranchingSwitch.
1056
1057         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1058         embedded statement.
1059         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1060
1061 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1062
1063         * statement.cs (Do.Resolve): If the loop is infinite, set the
1064         barrier.
1065         (While.Resolve, For.Resolve): Set a barrier after the embedded
1066         statement.  There's no direct control flow that goes from the end
1067         of the embedded statement to the end of the loop.
1068         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1069         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1070         above ensure that the reachability is correctly computed.
1071
1072         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1073         (UsageVector.MergeBreakOrigins): If the current path is
1074         unreachable, treat it as if all parameters/locals are initialized.
1075         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1076         infinite loops before merging-in break origins.
1077
1078         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1079         (Reachability.Reachable): Split part into ...
1080         (Reachability.Unreachable): ... this.  Simplify.
1081         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1082
1083         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1084         (Reachability.SetThrowsSometimes): Likewise.
1085         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1086         TriState.Always, use corresponding property.
1087         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1088         (Block.Resolve): Likewise.  Remove some redundant checks.
1089
1090 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1091
1092         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1093         (Reachability.Meet): Don't bother checking AlwaysThrows --
1094         barrier is always set.
1095         (FlowBranchingBlock.Merge): Likewise.
1096
1097 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1098
1099         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1100         checks for unreachable.
1101
1102 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1103
1104         A fix for #77980
1105         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1106
1107         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1108         whether field is really assigned.
1109
1110 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1111
1112         * flowanalysis.cs (Reachability): Make 4-argument constructor
1113         private.
1114         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1115         (Reachability.Always): Rename from the highly misleading
1116         'Reachability.Never'.
1117         (FlowBranching.Merge): Update to changes.  Mark an impossible
1118         situation with a 'throw'.
1119         (*): Update to changes.
1120
1121 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1122
1123         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1124         Remove 'Undefined'.
1125         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1126         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1127         (*): Update to changes.
1128         * statement.cs: Update to changes.
1129
1130 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1131
1132         A fix for #78049
1133         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1134
1135 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1136
1137         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1138         dummy UsageVector.
1139
1140         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1141         argument to two arguments: an usage-vector and a bool.  Move call
1142         to FlowBranching.Merge () ...
1143         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1144
1145         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1146         handling of loop and switch reachability to ...
1147         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1148
1149 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1150
1151         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1152         handling to FlowBranchingLoop.InLoop.
1153         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1154
1155 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1156
1157         A fix for #78115
1158         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1159         anonymous method is allowed from AnonymousContainer here.
1160
1161         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1162
1163 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1164
1165         Fix #78156
1166         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1167
1168 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1169
1170         A fix for #49011.
1171         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1172         (DoubleConstant.Reduce): Ditto.
1173
1174 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1175
1176         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1177         Remove 'lvalue_right_side' argument.  Move parts to ...
1178         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1179         (LocalVariable.DoResolveLValue): ... these.
1180
1181 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1182
1183         Fix cs1655.cs
1184         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1185         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1186         (LocalVariableReference.DoResolveBase): Use it to implement new
1187         CS1655 check.
1188         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1189         (Argument.Resolve): Simplify.  Move CS1510 check ...
1190         * ecore.cs (Expression.ResolveLValue): ... here.
1191         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1192         (PropertyExpr.DoResolveLValue): Likewise.
1193         (FieldExpr.Report_AssignToReadonly): Likewise.
1194         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1195         LValueMemberAccess or LValueMemberOutAccess on instance depending
1196         on it.
1197         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1198         DoResolve as appropriate.
1199
1200 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1201
1202         Fix #75800
1203         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1204         implicit conversions on 'out' and 'ref' arguments.
1205
1206         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1207         improve clarity.  Remove dead code.
1208
1209         Fix #66031
1210         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1211         (Catch.Resolve): Resolve VarBlock if it exists.
1212
1213 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1214
1215         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1216         twice, this was some residual code, the enumerator was emitted
1217         properly in the two branche of if later.
1218
1219 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1220
1221         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1222         cast is never an lvalue.
1223         (Cast.DoResolve, Cast.ResolveRest): Combine.
1224         (Argument.Emit): Simplify slightly.  Move 'Expr is
1225         IMemoryLocation' check ...
1226         (Argument.Resolve): ... here.
1227         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1228
1229         Simplifications.  Fix cs0191-2.cs
1230         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1231         CS1649 and CS1651 to ...
1232         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1233         the actual selection of the error code and message to a lookup
1234         table.  Add a dummy return value to simplify callsites.
1235         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1236         readonly fields of other instances of the same type.  Move CS0197
1237         warning from ...
1238         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1239         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1240         resolution of an out or ref argument.  The code simplification
1241         above uses this invariant.
1242
1243 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1244
1245         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1246         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1247         CheckMarshallByRefAccess.  Drop parameter.
1248         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1249         warning.
1250         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1251         InstanceExpression.
1252         * report.cs (AllWarnings): Add CS1690.
1253         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1254         for ref access too.
1255         (LocalVariableReference.DoResolveBase): Update.
1256
1257 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1258
1259         * class.cs (MethodOrOperator): Moved common parts from method class.
1260         detect obsolete attributes.
1261         (Method.Define): Simplified as it reuses code from base.
1262         (Constructor.ValidAttributeTargets): Fixed issue found during
1263         refactoring.
1264         (Destructor.ValidAttributeTargets): Fixed issue found during
1265         refactoring.
1266         (Operator): Finished refactoring set off by #78020. Operator class is now
1267         ordinary method class.
1268
1269         * anonymous.cs: Updated.
1270
1271         * decl.cs (DeclSpace): Add IsGeneric
1272
1273 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1274
1275         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1276
1277 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1278
1279         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1280         detect obsolete attributes.
1281         (Method.CreateEmitContext): Moved to MethodOrOperator.
1282
1283 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1284
1285         A fix for #78048.
1286         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1287         customized exception to make crash detection easier.
1288         (MethodOrOperator): Started to work on new base class for methods and
1289         operators.
1290         (Method): Derives from MethodOrOperator.
1291         (Constructor.Emit): Emits its own attributes.
1292         (AbstractPropertyEventMethod.Emit): Ditto.
1293         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1294         patch.
1295         (Operator.Emit): It's temporary more tricky than should be.
1296         
1297         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1298
1299         * report.cs (InternalErrorException): Add ctor with inner exception.
1300
1301 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1302
1303         A fix for #76744.
1304         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1305         only not visible.
1306
1307 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1308
1309         A fix for #77916.
1310         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1311         array.
1312
1313 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1314
1315         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1316         attribute is present and Guid not.
1317         (Interface.ApplyAttributeBuilder): Ditto.
1318
1319         * attribute.cs: Add error message.
1320
1321 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1322
1323         A fix for #78020.
1324
1325         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1326         sources (it's composite) so hold them in extra array as they are used in
1327         Emit phase only. It worked in the previous versions by mistake.
1328         (Attribute.Emit): Emit attribute for more owners when exist.
1329
1330         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1331         it has now different behaviour.
1332
1333 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1334
1335         * constant.cs (Constant.IsDefaultInitializer): New method.
1336
1337         * class.cs: Updated.
1338
1339         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1340         re-initialize default values. It saves KBs almost for every assembly.
1341         Thanks Zoltan for the idea.
1342         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1343         (ArrayCreation.DoResolve): Resolve only once.
1344         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1345         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1346
1347 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1348
1349         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1350         From #77961.
1351
1352 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1353
1354         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1355         in an embedded statement too.
1356
1357 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1358
1359         Fix #77958
1360         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1361
1362 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1363
1364         A fix for #77966.
1365
1366         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1367         was not specified.
1368
1369         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1370
1371 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1372
1373         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1374         phase.
1375
1376         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1377         LocalTemporary change.
1378
1379         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1380         TypeContainer.
1381         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1382         initializers optimization.
1383         (ClassOrStruct.TypeAttr): Moved from modifiers.
1384         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1385         (FieldBase.ResolveInitializer): Resolves initializer.
1386         (FieldBase.HasDefaultInitializer): New property.
1387
1388         * cs-parser.jay: Removed message.
1389
1390         * expression.cs (CompilerGeneratedThis): New specialization.
1391
1392         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1393
1394 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1395
1396         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1397
1398 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1399
1400         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1401         be now EnumConstants only.
1402
1403 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1404
1405         * attribute.cs, driver.cs: Reset more caches.
1406
1407 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1408
1409         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1410
1411 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1412
1413         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1414         for easier reuse. Updated all overrides.
1415         (IntegralConstant): New base class for all integral constants.
1416         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1417         of the constant range, report custom error.
1418         (UIntConstant.Reduce): Fixed uint conversion.
1419
1420         * ecore.cs, literal.cs: Reduce updates.
1421
1422 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1423
1424         A fix for #75813.
1425
1426         * class.cs (Constructor.Define): Removed extra if for default ctors.
1427         A patch from Atsushi Enomoto.
1428
1429 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1432         GetAttributableValue.
1433
1434         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1435         when required.
1436
1437         * convert.cs (ImplicitConversionRequired): Error message moved to
1438         DoubleLiteral.
1439
1440         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1441         automatic implicit conversion of an output value.
1442         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1443
1444         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1445         conversion.
1446         (TypeOf.GetAttributableValue): Add extra handling for object type.
1447
1448         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1449         special error message.
1450
1451 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1452
1453         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1454         InternalCall.
1455         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1456         compatible with MS runtime.
1457
1458 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1459
1460         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1461         attribute arguments here.
1462
1463         * class.cs (Indexer.Define): The check was moved to attribute class.
1464
1465 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1466
1467         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1468         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1469         easier.
1470
1471 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1472
1473         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1474         mcs to keep code differences small.
1475         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1476         * typemanager.cs (parameter_default_value_attribute_type): New.
1477         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1478         CS1908 check.
1479
1480 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1481
1482         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1483
1484 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1485
1486         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1487
1488         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1489         the blocks too.
1490
1491 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1492
1493         * doc-bootstrap.cs : fix build.
1494
1495 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1496
1497         * expression.cs (StringConcat.Append): Issue a warning when empty string
1498         is going to append.
1499
1500 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * assign.cs (CompoundAssign.ResolveSource): Removed.
1503
1504         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1505         clean up.
1506
1507         * class.cs (TypeContainer.FindMethods): Removed.
1508         (TypeContainer.CheckMemberUsage): Made static.
1509
1510         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1511
1512         * constant.cs (CheckRange): Removed unused type argument.
1513         (CheckUnsigned): Removed unused type argument.
1514
1515         * cs-parser.jay: Updated after MemberAccess clean up.
1516         Uses Length for empty string test.
1517
1518         * cs-tokenizer.cs: Uses Length for empty string test.
1519         (IsCastToken): Made static.
1520         (is_hex): Made static.
1521         (real_type_suffix): Made static.
1522
1523         * decl.cs (SetupCache): Made static.
1524         (OnGenerateDocComment): Removed unused ds argument.
1525
1526         * delegate.cs (VerifyDelegate): Removed unused argument.
1527
1528         * doc.cs: Uses Length for empty string test.
1529
1530         * driver.cs: Uses Length for empty string test.
1531
1532         * enum.cs (IsValidEnumType): Made static
1533
1534         * expression.cs (EnumLiftUp): Removed unused argument.
1535         (ResolveMethodGroup): Ditto.
1536         (BetterConversion): Ditto.
1537         (GetVarargsTypes): Ditto.
1538         (UpdateIndices): Ditto.
1539         (ValidateInitializers): Ditto.
1540         (MemberAccess.ctor): Ditto.
1541         (GetIndexersForType): Ditto.
1542
1543         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1544
1545         * iterators.cs: Updated after MemberAccess clean up.
1546
1547         * location.cs: Uses Length for empty string test.
1548
1549         * namespace.cs: Uses Length for empty string test.
1550
1551          * report.cs (CheckWarningCode): Made static.
1552
1553         * statement.cs (LabeledStatement): Removed unused argument.
1554
1555         * typemanager.cs (FilterNone): Removed.
1556
1557 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1558
1559         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1560         obsolete.
1561
1562         * class.cs: Updated.
1563
1564 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1565
1566         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1567
1568 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1569
1570         A fix for #77822.
1571
1572         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1573         reporting, it's more tricky than I thought.
1574
1575 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1576
1577         A fix for #77816.
1578
1579         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1580         host container.
1581         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1582         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1583         Add more error reporting; Fixed issue with params.
1584
1585         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1586
1587         * cs-parser.jay: AnonymousMethod requires host container.
1588
1589         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1590
1591 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1592
1593         * class.cs: Change 'TypeContainer ds' constructor argument to
1594         'DeclSpace parent'.  Some classes were missed below due to
1595         different naming convention.
1596
1597         * class.cs (MemberCore.Parent): Delete.  This makes the
1598         ParentContainer changes below enforceable by the compiler.
1599
1600         Treat pointers to enclosing declaration space as 'DeclSpace', not
1601         'TypeContainer'.
1602         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1603         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1604
1605         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1606         of TypeContainer.
1607         (Block.AddThisVariable): Likewise.
1608         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1609         (AbstractPropertyEventMethod.Emit): Likewise.
1610         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1611         (GetMethod.Define, SetMethod.Define): Likewise.
1612         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1613         (DelegateMethod.EmitMethod): Likewise.
1614
1615         Fix regression test-partial-13.cs.
1616         Rationalize use of PartialContainer.  Ensure that the partial
1617         class semantics can be tied to type-correctness, i.e., any
1618         violation will cause a compile error.
1619         * class.cs, const.cs: Access all fields that belong to class
1620         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1621         Resolve()-like functions still use 'Parent'.
1622
1623         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1624         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1625         (PropertyMethod.CheckModifiers): Remove unused argument.
1626         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1627         DeclSpace.
1628
1629 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1630
1631         Make semantics of PartialContainer simpler.
1632         * decl.cs (DeclSpace.IsPartial): Remove.
1633         * class.cs (TypeContainer.IsPartial): Likewise.
1634         (TypeContainer..ctor): Set PartialContainer to point to self.
1635         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1636         (TypeContainer.FindNestedType): Likewise.
1637         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1638
1639 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1640
1641         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1642
1643 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1644
1645         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1646         classes.
1647
1648 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1649
1650         * class.cs (Operator.Define): An error for base conversion was not
1651         reported correctly.
1652
1653 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1654
1655         * iterator.cs : yield break is allowed in try statement which has
1656           catch clauses. Fixed bug #77767.
1657
1658 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1659
1660         A fix for #77593, #77574.
1661
1662         * class.cs (MethodCore.CheckBase): Another if for operator.
1663
1664 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1665
1666         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1667         were not resolved
1668
1669         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1670         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1671         conversion test.
1672         
1673         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1674         not needed.
1675
1676         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1677         Updated after another emitcontext usage was clean up. It should help us to
1678         synchronize with gmcs easier.
1679
1680 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1681
1682         A fix for #77353.
1683
1684         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1685         (Event.Define): ditto
1686         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1687
1688         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1689         Removed redundant code and set NewSlot for Invoke method too.
1690
1691         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1692         (Parameters.MergeGenerated): New method. Use this method when you merge
1693         compiler generated argument with user arguments.
1694
1695 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1696
1697         * attribute.cs (ResolveAsTypeTerminal): Removed.
1698
1699         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1700         specialization for predefined types; 30% speed up.
1701         Finally placed obsolete check to right place.
1702         (Expression.ResolveType): Removed.
1703
1704         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1705         Updated after ResolveType was removed.
1706
1707         * expression.cs (Cast.ctor): Check void cast.
1708         (Binary.ResolveAsTypeTerminal): Is never type.
1709         (Conditional.ResolveAsTypeTerminal): Is never type.
1710
1711         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1712
1713 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1714
1715         Fix #77679.
1716         * expression.cs (ParameterReference.DoResolveBase): Change return
1717         type to bool.
1718         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1719         Update.
1720
1721         Fix #77628.
1722         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1723
1724         Fix #77642.
1725         * typemanager.cs (GetFullNameSignature): Don't nullref on
1726         protected accessors.
1727
1728 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1729
1730         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1731         these two separated members to simplify the code.
1732         (Attribute.Resolve): Refactored to use new fields and methods.
1733         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1734         implemented obsolete attribute checking.
1735         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1736         implemented obsolete checking again. It look line never ending quest ;-)
1737         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1738
1739         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1740
1741         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1742
1743         *class.cs (Property.Define): Add RegisterProperty call.
1744
1745         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1746         argument groups (only 2).
1747
1748         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1749         encoding expression to arguments.
1750         (Expression.ExprClassToResolveFlags): Just turned to property.
1751
1752         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1753         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1754         optimized as well as implemented support for zero-length attributes.
1755
1756         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1757         Add caching of PropertyInfo's.
1758
1759 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1760
1761         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1762         error multiple times.
1763
1764 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1765
1766         New partial class implementation.
1767         A fix for #77027, #77029, #77403
1768
1769         * attribute.cs (Attributable): Made attributes protected.
1770
1771         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1772         the replacements of ClassPart and PartialContainer.
1773         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1774         (TypeContainer.AddInterface): Ditto.
1775         (TypeContainer.AddPartial): The main method for partial classes. It checks
1776         for errors and merges ModFlags and attributes. At the end class is added to
1777         partial_parts list.
1778         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1779         required here.
1780         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1781         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1782         from the rest of partial classes.
1783         (TypeContainer.GetClassBases): Simplified.
1784         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1785         DefineType.
1786         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1787         (TypeContainer.HasExplicitLayout): Uses Flags now.
1788         (PartialContainer): Removed.
1789         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1790         (StaticClass): Was merged with Class.
1791         (Class.GetClassBases): class and static class bases are verified here.
1792         (Class.TypeAttr): Added static attributes when class is static.
1793         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1794         (MemberBase): In some cases we need to call parent container for partial
1795         class. It should be eliminated but it's not easy now.
1796
1797         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1798
1799         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1800         partial classed to accumulate class comments.
1801         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1802
1803         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1804
1805         * driver.cs (MainDriver): Tree.GetDecl was removed.
1806
1807         * modifiers.cs (Modifiers): Add partial modifier.
1808
1809         * tree.cs (Tree.decl): Removed.
1810         (RootTypes): Started to use this class more often for root types
1811         specializations.
1812
1813 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1814
1815         A fix for #77615
1816
1817         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1818         external interface does not have an attribute.
1819
1820 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1821
1822         Another prerequisites for new partial classs implementation.
1823         
1824         * attribute.cs (Attribute.Equal): Implemented.
1825         (Attribute.Emit): Changed as attributes can be applied more than twice.
1826         (Attributes.Emit): Check for duplicate attributes here.
1827
1828         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1829         as a parameter, clean-up.
1830
1831 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1832
1833         A fix for #77485
1834
1835         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1836         contains obsolete attribute check which can in some cases look for base
1837         type of current class which is not initialized yet.
1838         (TypeContainer.BaseType): Replacement of ptype.
1839
1840         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1841
1842 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1843
1844         First of prerequisites for new partial classs implemention.
1845         
1846         * attribute.cs (Attributable): Extended by ResolveContext;
1847         Attributes finally have correct context for resolving in all cases.
1848         (AttachTo): Attribute owner is assigned here.
1849
1850         * codegen.cs (IResolveContext): Introduce new interface to hold
1851         all information needed in resolving phase.
1852         (EmitContext): Implements IResolveContext; more clean-up needed here.
1853         
1854         * decl.cs (MemberCore): Implemented IResolveContext.
1855
1856         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1857         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1858         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1859         Refactored to use new IResolveContext instead of EmitContext; cleanup
1860
1861 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1862
1863         * codegen.cs (EmitScopeInitFromBlock): check here the
1864         capture_context, there is no need to make two calls to the
1865         EmitContext. 
1866
1867         * anonymous.cs: Add some debugging messages that might help me
1868         track other instances of this problem in the future (the
1869         regression of test 467).
1870
1871         * cs-parser.jay: track the variable block, as we need to initalize
1872         any captured variables declared in this block for the "catch"
1873         portion of the "Try" statement.
1874
1875         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1876         scope initialization for captured variables. 
1877
1878         Also, move the emit for the variables after the block location has
1879         been marked.
1880
1881 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1882
1883         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1884
1885 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1886
1887         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1888         commit yesterday, the initialization for the roots is necessary.
1889         What is not necessary is the scope activation.
1890
1891 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1892
1893         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1894         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1895         CS0206 checks.
1896         (Argument.Resolve): Remove CS0206 checks.
1897
1898 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1899
1900         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1901         scopes for all the roots, the scopes will now be emitted when the
1902         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1903
1904         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1905         code.  This reduces a lot of existing cruft.
1906         
1907         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1908         that the ScopeInfo is generated as we enter the scope, not at the
1909         time of use, which is what we used to do before.
1910
1911         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1912         every time a Block is about to be emitted if we have a
1913         CaptureContext. 
1914
1915 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1916
1917         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1918         (Reset): Update.
1919         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1920
1921         * typemanager.cs (cons_param_array_attribute): Make private.
1922         (Reset): Set it to null.
1923         (InitCoreHelpers): Don't initialize it.
1924         (ConsParamArrayAttribute): New.  Initialize it as needed.
1925         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1926
1927 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1928
1929         * expression.cs: There might be errors reported during the
1930         selection of applicable methods.  If there are errors, do not
1931         continue execution as it will lead the compiler to crash.
1932
1933 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1934
1935         * expression.cs: Member access is not allowed on anonymous
1936         methods.  Fixes #77402.
1937
1938 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1939
1940         Fix #77401
1941         * cs-parser.jay (VariableDeclaration): Don't set
1942         current_array_type to null.
1943         (field_declaration, event_declaration, declaration_statement):
1944         Set it to null here.
1945
1946 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1947
1948         * typemanager.cs (GenericParameterPosition): New.
1949         * doc.cs: Use it.
1950
1951 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1952
1953         * doc.cs : To process "include" elements, first we should create
1954           another list than XmlNodeList, because it could result in node
1955           removal, which could result in that the XmlNodeList gives up
1956           yielding next node.
1957
1958           (Also made code identical to gmcs again.)
1959
1960 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1961
1962         * ecore.cs: Introduce an error report that we were not catching
1963         before, if not silent, we must report the error.  Gonzalo ran into
1964         it.
1965
1966 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1967
1968         A fix for bug: #76957
1969         
1970         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1971         ComputeMethodHost before creating the method, this is a new
1972         requirement. 
1973
1974         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1975         that this method references (RegisterScope).  The actual scope
1976         where the method is hosted is computed with the ComputeMethodHost
1977         before we create the method.
1978
1979         Moved the Deepest routine here.
1980
1981         (AnonymousContainer.ComputeMethodHost): New routine used to
1982         compute the proper ScopeInfo that will host the anonymous method.
1983
1984         (ScopeInfo): Deal with multiple roots.  The problem was that we
1985         did not have a unique root where all ScopeInfos could be hanged
1986         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1987         of roots.  
1988
1989         Remove AdjustMethodScope which is now computed at the end.  Remove
1990         LinkScope which did a partial link, instead link all ScopeInfos
1991         before code generation from the new "LinkScopes" routine. 
1992
1993         Simplify all the Add* routines as they no longer need to maintain
1994         the tree, they just need to record that they are using variables
1995         from a ScopeInfo.
1996
1997         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1998         routines to produce the forest of ScopeInfo trees.
1999
2000         * class.cs (TypeContainer.AppendMethod): This is just like
2001         AddMethod, but ensures that an interface implementation method
2002         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2003         methods, but at the end.
2004
2005         We use this functionality to ensure that the generated MoveNext
2006         method in the iterator class is resolved/emitted before the
2007         enumerator methods created.   
2008
2009         This is required because the MoveNext method computes the right
2010         ScopeInfo for the method.  And the other methods will eventually
2011         need to resolve and fetch information computed from the anonymous
2012         method. 
2013
2014 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2015             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2016
2017         Fix rest of #76995.
2018         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2019         the 'aliases' hash.
2020         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2021         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2022
2023 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix #76656, cs0231-2.cs.
2026         * cs-parser.jay (formal_parameter_list): Make error case catch
2027         more issues.
2028         (parenthesized_expression_0): Add CS1026 check.
2029         (invocation_expression): Remove unused { $$ = lexer.Location }.
2030
2031 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2032
2033         Fix #76824.
2034         * cs-parser.jay (statement_expression): Don't list out the
2035         individual statement-expressions.  Convert syntax error into
2036         CS0201 check.
2037
2038 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2039
2040         Fix #76874.
2041         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2042         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2043         CheckIntermediateModification.
2044         (FieldExpr.DoResolve): Add new two-argument version that
2045         allows us to resolve the InstanceExpression as an lvalue.
2046         The one-argument variant is now just a wrapper.
2047         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2048         Resolve the lhs as an lvalue if the it has a value type.
2049         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2050         from Assign.DoResolve.
2051         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2052         resolved as an lvalue.
2053         (PropertyExpr.DoResolve): Update.
2054         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2055         has a value type.  Move CS1612 check here from
2056         CheckIntermediateModification.
2057         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2058         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2059         'right_side' of a ResolveLValue on an 'out' argument.
2060         (EmptyExpression.LValueMemberAccess): New.  Used as the
2061         'right_side' of a propagated ResolveLValue on a value type.
2062         (LocalVariableReference.DoResolveBase): Recognize
2063         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2064         Add CS1654 check.
2065         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2066         EmptyExpression.Null.
2067
2068 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2069
2070         * typemanager.cs : added IsGenericParameter(). In mcs it always
2071           return false.
2072         * doc.cs : for generic parameters, use GenericParameterPosition,
2073           not FullName.
2074
2075 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2076
2077         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2078
2079 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2080
2081         This fixes the problem where we used ldfld instead of ldflda to
2082         load the "THIS" pointer on captured parameters, when THIS is a
2083         value type.  See bug #77205.
2084         
2085         * iterators.cs (CapturedThisReference.Emit): Pass false to
2086         EmitThis (we do not need the address).
2087
2088         * codegen.cs (EmitThis): it needs to know whether we need the
2089         address of `this' or not.  This is used by value types.  
2090
2091         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2092         every other call passes false.
2093
2094 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2095
2096         Fix #77221.
2097         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2098         GetOverride.
2099         * expression.cs (Invocation.OverloadResolve): Update.
2100         (Invocation.DoResolve): Avoid double resolution of invocation.
2101
2102 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2103
2104         Fix #77180.
2105         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2106         unary negation of floating point types as 0-expr; negation cannot
2107         overflow in floating point types.
2108
2109         Fix #77204.
2110         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2111         on operands of 'void' type.
2112
2113         Fix #77200.
2114         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2115         and ExclusiveOr for boolean constants too.
2116
2117 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2118
2119         Fix #75636.
2120         * expression.cs (Invocation.OverloadResolve): Replace reflected
2121         override methods with their base virtual methods, rather than
2122         skipping over them.
2123         * typemanager.cs (TypeManager.GetOverride): New.
2124
2125 2006-01-05  Jb Evain  <jbevain@gmail.com>
2126
2127         * class.cs (Property.Define, Indexer.Define): do not tag the
2128         properties as SpecialName | RTSpecialName.
2129
2130 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2131
2132         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2133         doing a low-level comparission of parameter types.  It was lacking
2134         a check for __argslist. 
2135
2136 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2137
2138         * expression.cs (ParameterReference.DoResolveBase): Allow
2139         reference parameters if they are local to this block. 
2140
2141         This allows the ref and out parameters of a delegate to be used in
2142         an anonymous method, for example:
2143
2144         delegate void set (out int x);
2145
2146         set s = delegate (out int x){
2147                 x = 0;
2148         };
2149
2150         This is used by functionality introduced late in the C# language.
2151         
2152         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2153         method that take ref and out parameters. 
2154
2155         Fixes #77119 which was a late change in the spec.
2156
2157 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2158
2159         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2160         parent if its the same scope.  Fixes #77060.
2161
2162 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2163
2164         * driver.cs: Report the case of no source files and no -out:
2165         argument provided.
2166
2167 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2168
2169         Fix #77035.
2170         * expression.cs (ComposedCast.GetSignatureForError): Define.
2171
2172 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2173
2174         Fix #76995
2175
2176         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2177         ListDictionary, to contain the ExternAliasEntry entries (in
2178         addition to the NamespaceEntry.aliases hashtable). This field is
2179         shared between the original entry and its doppelganger (bodyless 
2180         copy of it).
2181         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2182         extern_aliases field.
2183         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2184         lookup in extern_aliases.
2185
2186 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2187
2188         Fix #77006.
2189         * class.cs (TypeContainer.Mark_HasEquals): New.
2190         (TypeContainer.Mark_HasGetHashCode): New.
2191         (ClassPart): Override them.
2192         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2193
2194         Fix #77008.
2195         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2196         'parent' argument to the base constructor.
2197
2198         Remove all mention of TypeContainer from decl.cs.
2199         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2200         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2201         (DeclSpace.DeclSpace): Likewise.
2202         (DeclSpace.DefineMembers): Remove unused argument.
2203         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2204         debugging check -- we don't care if the debug code throws an
2205         InvalidCastException instead of an InternalErrorException.
2206         * class.cs (TypeContainer.DefineMembers): Update to changes.
2207         (TypeContainer.DoDefineMembers): Likewise.
2208         (TypeContainer.GetMethods): Likewise.
2209         (PropertyMember.Define): Likewise.
2210         (MemberBase.Parent): New property that forwards to
2211         MemberCore.Parent, but ensures that we get a TypeContainer.
2212         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2213         (RootContext.PopulateTypes): Likewise.  Remove special case code
2214         for !RootContext.StdLib: DefineMembers is idempotent.
2215
2216 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2217
2218         * convert.cs (ExplicitConversionCore): Check the return value from
2219         ExplicitConversionCore which can return null on failure.  Fixes #76914
2220
2221 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2222
2223         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2224
2225 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2226
2227         * doc.cs : The search for referenced namespace was insufficient to
2228           get global one as it used to do. Fixed bug #76965.
2229
2230 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2231
2232         * doc.cs : check name in cref in the last phase that whether it is
2233           namespace or not.
2234
2235 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2236
2237         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2238           Mono.C5.
2239
2240 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2241
2242         * doc.cs : so it turned out that we cannot skip override check for 
2243           interface members. Fixed bug #76954.
2244
2245 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2246
2247         * cs-tokenizer.cs : fixed bug #75984:
2248           - #warning and #error should not be handled when the source line
2249             is disabled.
2250           - #line is not checked strictly when the source line is disabled.
2251           - #define and #undef is on the other hand checked strictly at any
2252             state.
2253
2254 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2255
2256         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2257           CS1027 report.
2258
2259 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2260
2261         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2262
2263         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2264         event initializers.
2265         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2266         (FieldBase.Initializer): Initializer is now optional.
2267         (EventField.Define): Only event field can have initializer.
2268
2269         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2270
2271         * const.cs (Const): Reuse initializer.
2272
2273         * cs-parser.jay: Updated after FieldBase changes.
2274         Added current_array_type to simplify array initializers.
2275
2276         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2277
2278         * expression.cs, iterators.cs: Updated.
2279
2280         * namespace.cs (NamespaceEntry): Made UsingFound private.
2281
2282 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2283
2284         * parameterCollection.cs: Obsolete, removed.
2285         * parser.cs: Obsolete, removed.
2286
2287 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2288
2289         Fix #76849.
2290         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2291
2292         * enum.cs (Enum.Define): Set obsolete context here.
2293
2294 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2295
2296         * doc.cs :
2297           - FindDocumentedMember() now expects 1) paramList as null
2298             when "we don't have to check the number of parameters" and
2299             2) Type.EmptyTypes when "there is no arguments".
2300           - Introduced FoundMember struct to hold the exact type which was
2301             used to find the documented member (the above change broke
2302             test-xml-044; it might be better just to use DeclaringType than
2303             what MS does, like this change does, but it depends on usage.)
2304
2305 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2306
2307         * doc.cs : documented member might be from DeclaringType for nested
2308           types. Fixed bug #76782.
2309
2310 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2311
2312         * anonymous.cs: Have the param code handle leaving copies on the
2313         stack etc. Allows anonymous params to take part in the assignment
2314         code (++, +=, etc). Fixes bug #76550
2315
2316         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2317         it down to the anon code.
2318
2319         * iterators.cs: Use dummy var here
2320
2321         * codegen.cs: Handle new vars
2322
2323 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2324
2325         Fix #76849.
2326         * class.cs (MethodData.Define): Set proper Obsolete context.
2327
2328         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2329         obsolete context.
2330         (FieldExpr.DoResolve): Ditto.
2331
2332 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2333
2334         Fix #76849.
2335         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2336         parent is not obsolete.
2337
2338 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2339
2340         * doc.cs : (FindDocumentedMember) find parameterless members first
2341           and get CS0419 in the early stage. Fixed first case of bug #76727.
2342
2343 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2344
2345         Fix #76859.
2346         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2347         no error was reported.
2348
2349         *expression.cs (Binary.DoResolve): left can be null.
2350
2351 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2352
2353         Fix #76783.
2354         * class.cs (MethodData.Emit): Parameters should be labeled first.
2355
2356 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2357
2358         Fix #76761.
2359         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2360
2361 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2362
2363         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2364
2365         * class.cs (MethodCore): Parameter clean up.
2366         (IMethodData): Added ParameterInfo.
2367         (MethodData): Parameter clean up.
2368         (Indexer.Define): Parameter clean up.
2369
2370         * anonymous.cs,
2371         * codegen.cs,
2372         * cs-parser.jay,
2373         * decl.cs,
2374         * doc.cs,
2375         * ecore.cs,
2376         * flowanalysis.cs,
2377         * iterators.cs,
2378         * pending.cs,
2379         * statement.cs,
2380         * typemanager.cs: Parameter clean up.
2381
2382         * delegate.cs (Define): Get rid of duplicated code.
2383
2384         * expression.cs (ParameterReference): Removed useless parameters
2385         and simplified.
2386         (Invocation): Ditto.
2387
2388         * parameter.cs (ParamsParameter): New class, params specialization.
2389         (ArglistParameter): Attemp to separate arglist.
2390         (Parameter): Refactored to be reusable and faster.
2391         (Parameter.Modifier): Made understandable.
2392         (Parameters): Changed to be used as a class for `this' assembly
2393         parameters. Refactored to use new specialized classes.
2394
2395         * support.cs (ParameterData): Added Types property.
2396         (InternalParameters): Deleted.
2397
2398 2005-08-20  Martin Baulig  <martin@ximian.com>
2399
2400         Merging this patch from GMCS to fix #75867.
2401
2402         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2403         scope if we don't already have it.
2404
2405 2005-11-17  Martin Baulig  <martin@ximian.com>
2406
2407         * anonymous.cs
2408         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2409         inherit the scope from our parent.  Fixes #76653.
2410
2411 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2412
2413         * doc.cs : the previous patch does not actually fix the bug.
2414           PropertyInfo override check is now implemented and really fixed it.
2415         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2416
2417 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2418
2419         * doc.cs : apply "override filter" also to properties.
2420           Fixed bug #76730.
2421
2422 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2423
2424         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2425           no need to check overrides. For classes, omit those results from 
2426           interfaces since they must exist in the class. Fixed bug #76726.
2427
2428 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2429
2430         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2431           with different parameters. Fixed the second problem in #76685.
2432
2433 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2434
2435         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2436           get expected 'protected' access in CheckValidFamilyAccess()).
2437           Fixed bug #76692.
2438
2439 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2440
2441         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2442           Fixed bug #76705.  CS1569 was incorrectly commented out.
2443
2444 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2445
2446         * doc.cs : use Invocation.IsOverride() to do real override check.
2447         * expression.cs : made Invocation.IsOverride() internal.
2448
2449 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2450
2451         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2452           TypeBuilder.FindMembers() and filter overriden base members out.
2453           Fixed bug #76990.
2454
2455 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2456
2457         * doc.cs : ref/out parameters are represented as '@' (instead of
2458           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2459
2460 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2461
2462         * doc.cs : when there was no '.' in cref to methods in doc comment,
2463           then parameters were missing in the output. Fixed bug #76691.
2464
2465 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2466
2467         * driver.cs : don't output docs when there is an error.
2468           Fixed bug #76693.
2469
2470 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2471
2472         * doc.cs :
2473           Now it should detect indexers. Fixed primary concern in bug #76685.
2474           Fixed CS0419 message to not show the identical member signature in
2475           the message.
2476
2477 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2478
2479         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2480           instead of Type.FindMembers() since it does not handle events.
2481           Fixed bug #71604.
2482
2483 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2484
2485         * codegen.cs: Fixed typo (speficied -> specified).
2486
2487 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2488
2489         Fix #76369.
2490         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2491
2492 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2493
2494         * attribute.cs: Changed error message.
2495
2496         * cs-tokenizer.cs: One more check.
2497
2498 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2499
2500         * statement.cs (Block.Resolve): Ignore empty statement.
2501
2502 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2503
2504         * report.cs: Made error/warning methods more strict to avoid
2505         their misuse.
2506
2507         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2508         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2509         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2510         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2511
2512 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2513
2514         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2515         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2516
2517         * class.cs (TypeContainer.IsComImport): New property.
2518         (Constructor.Define): Create proper ctor for ComImport types.
2519
2520         * expression.cs (New.CheckComImport): Fixed.
2521
2522 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2523
2524         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2525         that a parameter has been captured does not mean that we do not
2526         have to do the rest of the processing.  This fixes the second part
2527         of #76592.  If there was another anonymous method capturing
2528         values in the past, the Scope would never be set for the second
2529         method that captured the same parameter.
2530
2531         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2532         properly manipulate the stack.   Second part of fix for #76592.
2533
2534         * expression.cs (New): Add support for invoking "new" on
2535         interfaces that have been flagged with the ComImport attribute and
2536         the CoClass.  Fixes #76637 
2537
2538         * statement.cs (Try.DoEmit): When a variable is captured, do not
2539         try to emit the vi.LocalBuilder variable as it has been captured.
2540         Create a temporary variable and store the results on the
2541         FieldBuilder.  Fixes #76642
2542
2543 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2544
2545         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2546
2547         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2548
2549         * expression.cs (Binary.DoResolve): Added && optimalization.
2550     
2551         * typemanager.cs (AddUserType): Removed useless argument.
2552
2553 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2554
2555         * statement.cs (Block.variables): Uses ListDictionary.
2556
2557 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2558
2559         Fix #75969.
2560         * class.cs (PartialContainer.EmitType): Customized to emit
2561         security attributes.
2562         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2563         for partial classes.
2564
2565 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2566
2567         Fix #76599.
2568         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2569         access has to be fixed.
2570         
2571         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2572
2573 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2574
2575         Fix #76590.
2576         * ecore.cs (NullCast.Reduce): Implemented.
2577
2578         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2579         constant type.
2580         
2581         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2582         properly.
2583         (Foreach.Resolve): Catch null properly.
2584
2585 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2586  
2587         * cs-tokenizer.cs: Warning text fix.
2588
2589         * driver.cs: AllWarningNumbers exposed on public interface.
2590
2591         * report.cs (): Reviewed warning numbers.
2592         (IsValidWarning): Use binary search.
2593
2594 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2595  
2596         * driver.cs: Implemeted resource visibility.
2597         (Resources): New class for code sharing between /res: and
2598         /linkres:
2599  
2600 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2601
2602         Fix #76568.
2603         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2604         folding.
2605         
2606         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2607         contants only.
2608         
2609         * ecore.cs (NullCast): Child is contant only.
2610         
2611         * literal.cs (NullLiteral.Reduce): null can be converted to any
2612         reference type.
2613
2614 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2615
2616         * driver.cs: Use Encoding.Default as default code page instead
2617           of ISO-28591.
2618
2619 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2620
2621         Fix #76085.
2622         * expression.cs (Invocation.Error_InvalidArguments): Handle
2623         __arglist parameters.
2624         (Invocation.VerifyArgumentsCompat): Likewise.
2625         * support.cs (ReflectionParameters.GetSignatureForError): Print
2626         __arglist parameters.
2627         (InternalParamters.GetSignatureForError): Likewise.
2628         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2629
2630 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * attribute.cs (GetPropertyValue): Made public.
2633
2634         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2635         Resolve.
2636         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2637         attribute.
2638         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2639         is not defined.
2640         
2641         * driver.cs: Reflect method name change.
2642         
2643         * statement.cs (Try.Resolve): Warn when try has both general
2644         exception handlers.
2645         
2646         * typemanager.cs: runtime_compatibility_attr_type new predefined
2647         type.
2648
2649 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2650
2651         Fix #76419.
2652         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2653         treat it as an empty parameter list.
2654
2655 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2656
2657         Fix #76271.     
2658         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2659         ResolveAsTypeStep silent.
2660         * statement.cs (Block.AddConstant): Mark block as used.
2661         (Block.ResolveMeta): Avoid piling on error messages
2662         if a constant initializer resolution fails.
2663
2664 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2665
2666         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2667         Remove.
2668         (NamespaceEntry.VerifyAllUsing): New.
2669         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2670         behaviour.  Delegates actual resolution of alias to ...
2671         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2672         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2673         Update.
2674         * driver.cs (Driver.MainDriver): Update.
2675         
2676         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2677         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2678         property.
2679         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2680         Remove.
2681         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2682         RootNamespace.DefineNamespacesForAll.
2683
2684 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2685
2686         * typemanager.cs (assemblies, external_aliases, modules)
2687         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2688         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2689         overhead.  Move resposibility ...
2690         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2691         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2692
2693 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2694
2695         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2696         cached_namespaces.  Improve usage.
2697         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2698         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2699         Move from GlobalRootNamespace and simplify.
2700         (RootNamespace.Global): Make instance variable.
2701         (RootNamespace.RootNamespace): Add "alias name" parameter.
2702         (GlobalRootNamespace): Simplify drastically.
2703         (Namespace.Lookup): Don't use GetNamespace.
2704         * typemanager.cs (GetRootNamespace): Rename from
2705         ComputeNamespaceForAlias.
2706         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2707
2708 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2709
2710         * anonymous.cs (AnonymousContainer): Don't crash when container
2711         doesn't exist.
2712
2713 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2714
2715         * expression.cs (Binary.DoResolve): Warn when comparing same
2716         values.
2717
2718 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2719
2720         Fix #76486.
2721         * expression.cs (Binary.DoResolve): It looks like there are no
2722         convetsion rules in enum context.
2723
2724 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2725
2726         Add support for extern alias qualifiers.
2727         * typemanager.cs: Move some LookupTypeReflection code
2728         to namespace.cs, to have cleaner code. Added some methods
2729         to help us keep track of the extern aliased references.
2730         * driver.cs: Add suport for extern alias assemblies on command
2731         line and check for their warnings/errors. Also keep track of the
2732         extern aliased assemblies.
2733         * namespace.cs: Move the global functionality of Namespace
2734         to GlobalRootNamespace/RootNamespace. Now the global namespace
2735         is GlobalRootNamespace.Globa. Also the code moved from 
2736         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2737         Finally added LocalAliasEntry (AliasEntry before) and
2738         ExternAliasEntry, to handle alias statements.
2739         * cs-parser.jay: Add support in the grammar for extern alias
2740         statement.
2741         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2742         Update callings to Namespace (now in GlobalRootNamespace).
2743
2744 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2745
2746         Fix #76371.
2747         * class.cs (TypeContainer.DefineType): Move updating of
2748         topological sort earlier in the code.
2749         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2750
2751 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2752
2753         Fix #76273.
2754         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2755         
2756         * constant.cs (Constant.TryReduce): Moved from Cast class.
2757         (Reduce): Made little bit more OO and fixed missing conversions.
2758         
2759         * ecore.cs (Reduce): Implemented.
2760         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2761         
2762         * literal.cs (Reduce): Implemented.
2763         
2764         * class.cs: Reverted Miguel's wrong commit.
2765
2766 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2767
2768         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2769
2770 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2771
2772         * cs-parser.jay, expression.cs : CS0214 was missing error location
2773           for constants. Fixed bug #76404.
2774
2775 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2776
2777         Fix #76370.
2778         * convert.cs (ExplicitConversionCore): Fixed object->enum
2779         conversion.
2780
2781 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2782
2783         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2784         InstanceExpression.
2785         (PropertyExpr.EmitCall): Likewise.
2786         * expression.cs (Invocation.EmitArguments): Handle case where
2787         arguments == null.
2788         (Invocation.EmitCall): Avoid allocating temporary variable if
2789         there are no arguments.
2790
2791 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2792
2793         Fix #76323.
2794         * convert.cs (ImplicitConversionStandard): Move conversion of
2795         void* to arbitrary pointer types ...
2796         (ExplicitConversionStandard): .. here.
2797         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2798         error to always print typenames.
2799
2800 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2801
2802         * convert.cs (GetConversionOperator): Rename from
2803         GetConversionOperators.  Move operator selection code from ...
2804         (UserDefinedConversion): ... here.
2805
2806 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2807
2808         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2809         conversion.
2810
2811 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2812
2813         * assign.cs (Assign.DoResolve): Error method changed.
2814
2815         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2816         
2817         * const.cs (ResolveValue): Reset in_transit immediately.
2818         
2819         * constant.cs: Error method changed.
2820         
2821         * convert.cs: Removed useless location parameter.
2822         (ExplicitNumericConversion): Don't do double enum check.
2823         (ExplicitConversionCore): Renamed from ExplicitConversion.
2824         (ExplicitUnsafe): Extracted from ExplicitConversion.
2825         (ExplicitConversion): Uses for error reporting.
2826         
2827         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2828         error messages.
2829         (ResolveBoolean): Uses common error method.
2830         (CastToDecimal): Get rid of ec.
2831         (CastFromDecimal): Optimized.
2832         (ConvCast): Get rid of ec.
2833         
2834         * enum.cs (ResolveValue): Reset in_transit immediately.
2835         (Emit): Return after first error.
2836         
2837         * expression.cs: Convert changes.
2838         
2839         * literal.cs: Error method changed.
2840         
2841         * statement.cs: Error method changed.
2842
2843 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2844
2845         * support.cs (SeekableStreamReader.Position): Don't error out when
2846         the requested position is just beyond the end of the current
2847         buffered data.
2848
2849 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2850
2851         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2852         try to keep in sync with the byte count of the underlying Stream.
2853         However, this limits us to a window size of 2048 characters: i.e.,
2854         the maximum lookahead of our lexer/parser can be 2048 characters.
2855
2856 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2857
2858         Fix #76255.
2859         * driver.cs: Fix compilation files with full root path.
2860
2861 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2862
2863         * report.cs (SymbolRelatedToPreviousError): Format the output so
2864         it does not use an open parenthesis that is never closed. 
2865
2866         * driver.cs: Follow coding guidelines
2867
2868 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2869
2870         Fix #72930.
2871         * const.cs (Const.ResolveValue): Check for assigning non-null
2872         value to reference type.
2873
2874 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2875
2876         * anonymous.cs: Implemented ExprClassName.
2877         
2878         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2879         delegate.
2880         
2881         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2882         check.
2883         
2884         * class.cs (StaticClass.DefineContainerMembers): Report protected
2885         members as error.
2886         
2887         * codegen.cs: if(ed) PRODUCTION.
2888         
2889         * convert.cs (Error_CannotImplicitConversion): Better error
2890         distinction.
2891         
2892         * cs-parser.jay: More error checks.
2893         
2894         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2895         
2896         * driver.cs (CSCParseOption): Enabled wrong option check.
2897         
2898         * ecore.cs (Expression.ExprClassName): Turned to property.
2899         (MemberExpr.CheckIntermediateModification): For checking boxed
2900         value types     modification.
2901         
2902         * statement.cs (Fixed.Resolve): Expression type must be
2903         convertible to fixed type.
2904         (CollectionForeach.GetEnumeratorFilter,TryType):
2905         Small refactoring for easier error checking.
2906
2907 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2908
2909         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2910         attributes.
2911         
2912         * class.cs (GeneratedBaseInitializer): New class for customization
2913         compiler generated initializers.
2914         (MemberBase.DoDefine): Check Obsolete attribute here.
2915         (FieldMember.DoDefine): Ditto.
2916         
2917         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2918         constants.
2919         
2920         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2921         (MemberCore.GetObsoleteAttribute): Removed argument.
2922         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2923         (MemberCore.CheckObsoleteType): New helper.
2924         
2925         * delegate.cs,
2926         * enum.cs,
2927         * statement.cs: Updates after MemberCore changes.
2928         
2929         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2930         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2931         
2932         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2933         obsolete attribute for compiler construct.
2934         (As.DoResolve): Cache result.
2935         
2936         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2937
2938 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2939
2940         Fix #76133.
2941         * expression.cs (This.VerifyFixed): In a value type T, the type of
2942         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2943         value type R, 'this' is treated as a value parameter.
2944
2945 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2946
2947         * statement.cs (Lock): Use the TemporaryVariable class instead of
2948         manually using local variables as those do not work when variables
2949         are captured.
2950
2951         * ecore.cs: Moved the TemporaryVariable class from being a nested
2952         class inside Foreach to be a public class that can be employed in
2953         other places. 
2954
2955 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2956
2957         * cs-parser.jay: interface_accessors replaced by
2958         accessor_declarations.
2959
2960         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2961         location.
2962         
2963         * statement.cs (GotoCase.Resolve): Convert null constant to
2964         null case.
2965         (SwitchLabel.ResolveAndReduce): Ditto.
2966         (SwitchLabel.NullStringCase): Custom null stamp.
2967         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2968         
2969         typemanager.cs (CSharpSignature): Don't skip first argument
2970         for full names.
2971
2972 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2973
2974         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2975
2976         * location.cs (InEmacs): in this mode, do not report column
2977         location as it confuses Emacs.
2978
2979 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2980
2981         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2982         expression.cs, iterators.cs, literal.cs: Store constants and
2983         literals location.
2984         
2985         * class.cs (MemberBase.ShortName): Pass location.
2986         
2987         * cs-parser.jay: Some location fixes.
2988         
2989         * ecore.cs (Expression.Location): Made virtual.
2990
2991 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2992
2993         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2994         if the underlying types are the same, otherwise we need to produce
2995         code that will do the proper cast.
2996
2997         This was exposed by Marek's constant rewrite which produced
2998         invalid code for the call site:
2999
3000         enum X : long { a }
3001         void Method (X v) {}
3002
3003         Method ((X) 5)
3004
3005         This fixes test-49.cs
3006
3007 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3008
3009         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3010           Type/Object should be allowed as well. Fixed bug #75968.
3011
3012 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3013
3014         * expression.cs : (Binary.DoResolve): when one is enum constant and
3015           another is constant 0, then return enum one *as enum type*.
3016           Fixed bug 74846.
3017
3018 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3019
3020         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3021         internal.
3022
3023         Fix #75941.
3024         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3025         flow-branching for LocalVariableReferences in case we were invoked
3026         from a MemberAccess.
3027         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3028         Carved out of ...
3029         (LocalVariableReference.DoResolveBase): ... this.
3030         (MemberAccess.Resolve): Do the check that was disabled during
3031         SimpleNameResolve.
3032
3033 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3034
3035         * class.cs :
3036           (PartialContainer.Create): check abstract/sealed/static strictly
3037           but abstract/sealed can exist only at one side. Fixed bug #75883.
3038
3039 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3040
3041         Fix #75945.
3042         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3043         specified, don't default to UnmanagedType.I4.
3044
3045 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3046
3047         * expression.cs : conditional operator should check possibly
3048           incorrect assign expression. Fixed bug #75946.
3049
3050 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3051
3052         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3053           Reverting the change. gmcs is much complex than mcs on this matter.
3054
3055 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3056
3057         * cs-tokenizer.cs : To read another token ahead of the actual 
3058           consumption, use new SavedToken and cache token instead of moving
3059           back the stream with SeekableStreamReader (it seemed problematic).
3060         * cs-parser.jay,
3061           driver.cs : Thus use StreamReader directly.
3062         * support.cs : Thus removed SeekableStreamReader.
3063
3064 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3065
3066         Fix #75934.
3067         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3068         (ScopeInfo.EmitScopeType): Use it to construct field names from
3069         names of captured locals.
3070
3071         Fix #75929.
3072         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3073         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3074         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3075         (ExplicitConversion): Remove enum cases already handled by
3076         implicit conversion.  Move implicit conversion check to the beginning.
3077         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3078         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3079         Don't treat System.Enum as a struct.
3080
3081 2005-08-30  Jb Evain  <jbevain@gmail.com>
3082
3083         * attribute.cs: handles as expression in parameters.
3084
3085 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3086
3087         Fix #75802.
3088         * class.cs (TypeContainer.VerifyClsName): Don't use a
3089         PartialContainer when verifying CLS compliance.
3090         (AbstractPropertyEventMethod): Set Parent here, ...
3091         (PropertyMethod): ... not here.
3092
3093 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3094
3095         * attribute.cs : escaped attribute name should not be allowed to be
3096           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3097
3098 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3099
3100         Fix #75927.
3101         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3102         when converting a long constant to unsigned long.
3103         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3104         detect where IsApplicable and VerifyArgumentsCompat disagree.
3105
3106 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3107         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3108
3109         Fix #75848.
3110         * class.cs (TypeContainer.CanElideInitializer): New helper.
3111         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3112         can safely emitting the initializer of a field.
3113
3114 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3115
3116         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3117           allowed inside a switch (without loop). Fixed bug #75433.
3118
3119 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3120
3121         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3122         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3123
3124 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3125
3126         * driver.cs : kinda reverting the default encoding changes (not exact 
3127           revert since I noticed that "codepage:reset" might not work fine).
3128
3129 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3130
3131         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3132           Location. Now getter and setter store location correctly.
3133           (errors/cs0111-12.cs now reports the expected location.)
3134
3135 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3136
3137         * driver.cs : Use default encoding on the environment.
3138           Removed (now that) extra parameter for SeekableStreamReader.
3139         * support.cs : (SeekableStreamReader) third .ctor() argument for
3140           StreamReader is not required (always true). preamble size could
3141           be acquired in simpler and safe way.
3142
3143 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3144
3145         * cs-parser.jay: report CS0642 at warning level 3
3146           and report CS0642 for an if else statement also
3147           fixes bug #74745. Patch by John Luke (and a bit
3148           modified by me).
3149           Removed extra CS0642 warning check for "while",
3150           "for" and "fixed".
3151         * statement.cs: In Block.Resolve(), CS0642 check
3152           is reimplemented to check a sequence of an empty
3153           statement and a block.
3154
3155           Both fix bug #66777.
3156
3157 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3158
3159         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3160         detection until I fix it.
3161         
3162         * cs-tokenizer.cs: Changed error message.
3163         
3164         * cs-parser.jay: Fixed 2 error locations.
3165         
3166         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3167         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3168         properties.
3169         
3170         * enum.cs (GetSignatureForError): Fixed.
3171         
3172         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3173         method detection.
3174         
3175         * class.cs,
3176         * typemanager.cs (RegisterProperty): Removed.
3177         
3178         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3179
3180 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3181
3182         Fix #75874.
3183         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3184         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3185
3186 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3187
3188         * expression.cs : tiny fix is required for not warning positive ulong.
3189           See test-441.cs.
3190
3191 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3192
3193         * expression.cs : add CS0652 check for constant and integral
3194           expression. Fixed bug #53974.
3195
3196 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3197
3198         * expression.cs : in DoNumericPromotions(), check if there is implicit
3199           conversion overload for string (to check CS0034). Fixed bug #52492.
3200
3201 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3202
3203         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3204
3205 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3206
3207         * ecore.cs : report location when it is *not* Null.
3208
3209 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3210
3211         * codegen.cs,
3212           ecore.cs,
3213           flowanalysis.cs,
3214           expression.cs:
3215           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3216           correctly. Fixed bug #75721.
3217
3218 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3219
3220         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3221         loop that performs 'min (pos, char_count)'.
3222
3223         Fix #75862.
3224         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3225         converted value in Operator.OnesComplement.
3226
3227 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3228
3229         * anonymous.cs: If the anon method is pulled into a helper class,
3230         it needs to be `internal' not `private'. Fixes runtime behavior on
3231         msft. bug #75704
3232
3233 2005-08-20  Martin Baulig  <martin@ximian.com>
3234
3235         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3236         scope if we don't already have it.
3237
3238         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3239         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3240         fixes #75867.
3241
3242 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3243
3244         Fix #75803
3245         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3246         is a partial class.
3247
3248 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3249
3250         The big constants rewrite
3251         Fix #75746, #75685 and more
3252         As a side effect saved 1MB for MWF ;-)
3253         
3254         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3255         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3256         enum based for corlib compilation.
3257         
3258         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3259         subtractions.
3260         
3261         * class.cs (FixedField.Define): Use ResolveAsConstant.
3262         
3263         * const.cs (IConstant): Interface constants and enums.
3264         (Const.ResolveValue): New method for constant resolvning.
3265         (ExternalConstant): Constants from imported assemblies.
3266         
3267         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3268         conversion; like enums.
3269         (Constant.ToType): Converts this constant to different type.
3270         (Constant.Increment): Adds 1.
3271         
3272         * convert.cs (ImplicitConversionRequired): Simplified.
3273         
3274         * cs-parser.jay: Create EnumMember directly.
3275         
3276         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3277         
3278         * doc.cs (GenerateEnumDocComment): Removed.
3279         
3280         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3281         (ConvertIntLiteral): Removed.
3282         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3283         
3284         * enum.cs (EnumMember): Implement IConstant.
3285         (Enum.IsValidEnumConstant): Removed.
3286         (Enum.GetNextDefaultValue): Removed.
3287         (Enum.FindMembers): Updated.
3288         (Enum.GenerateDocComment): Iterate enum members.
3289         
3290         * expression.cs (Cast.TryReduce): Handle enums correctly.
3291         (New.Constantify): Made public.
3292         (MemberAccess.DoResolve): Removed contant specific if(s).
3293         
3294         * literal.cs (NullLiteral): Implement new abstract methods.
3295         
3296         * statement.cs (GotoCase.Resolve): Use new constant methods.
3297         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3298         
3299         * typemanager.cs (LookupEnum): Removed.
3300         (IsEnumType): Fixed to work with corlib.
3301         (RegisterConstant): Removed.
3302         (LookupConstant): Removed.
3303         (GetConstant): Changed to work with IConstant.
3304
3305 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3306
3307         * location.cs : Fixed overflown (>255) column number.
3308
3309 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3310
3311         First cut of the qualified-alias-member feature.
3312         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3313         token.
3314         * cs-parser.jay (DOUBLE_COLON): New token.
3315         (namespace_or_type_name): Add rule for recognizing
3316         qualified-alias-members.
3317         (primary_expression): Likewise.
3318         (element_access): Allow QualifiedAliasMember as a possible
3319         type-bearing expression.
3320         (local_variable_type, local_variable_pointer_type): Likewise.
3321         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3322         aliases in the current and enclosing namespace declarations.
3323         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3324         * decl.cs (MemberName.is_double_colon): New.
3325         (MemberName.MemberName): Add new constructor for alias-member.
3326         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3327         * expression.cs (QualifiedAliasMember): New expression type.
3328
3329 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3330
3331         * location.cs : it borked when no argument was specified.
3332
3333 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3334
3335         * location.cs : tiny ToString() format fix.
3336
3337 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3338
3339         * statement.cs : oops, it was missing.
3340
3341 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3342
3343         A set of fixes for precise line/column location.
3344
3345         * location.cs :
3346           "token" field now holds a file/line "delta", a line number offset 
3347           from the segment, and a column number. See also:
3348           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3349           December/009508.html
3350           Removed static IsNull. Use instance IsNull property instead.
3351         * cs-tokenizer.cs :
3352           For some tokens it stores Location. For Identifier it stores
3353           LocatedToken which is a pair of string name and location.
3354           Column numbers are adjusted only at getChar().
3355         * report.cs :
3356           Use Location.ToString() for reporting (it now contains column).
3357         * cs-parser.jay :
3358           Largely modified to use LocatedToken instead of
3359           string (IDENTIFIER), and to acquire Location from some tokens.
3360         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3361           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3362           codegen.cs :
3363           Now MemberName holds Location. DeclSpace.ctor() receives Location
3364           as a parameter. Removed extra parameters to all derived classes.
3365           Replaced Location.IsNull() with instance property.
3366         * assign.cs, expression.cs :
3367           Added .ctor() overload that omits Location.
3368         * attribute.cs :
3369           Added "nameEscaped" flag that indicates the identifier was escaped
3370           in the source file. This fixes bug #57047.
3371
3372 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3373
3374         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3375         New method, looking for lo-case imported cls type.
3376
3377         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3378         here.
3379
3380         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3381
3382         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3383
3384         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3385         all_imported_types.
3386         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3387
3388         Optimized to save 3.5 MB for SWF compilation.
3389
3390 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3393         (PartialContainer.Create): Moved logic AddToContainer.
3394         (PartialContainer.MarkForDuplicationCheck): Shares name.
3395         
3396         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3397         place.
3398         
3399         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3400         initialization.
3401         (Namespace.GetSignatureForError): New method.
3402         
3403         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3404         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3405
3406 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3407
3408         Fix #75669.
3409         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3410         member lookup rather than qualifier_type, since qualifier_type can
3411         be null.
3412
3413 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3414
3415         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3416         enum member.
3417
3418 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3419
3420         * statement.cs: Copy the local exception into the exception
3421         captured local.  Fixes 75674
3422
3423 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3424
3425         Fix #75658.
3426         * expression.cs (Invocation.OverloadResolve): Don't report error
3427         CS1501 if error CS1502 has been reported.
3428         (New.DoResolve): Delegate CS1501 reporting to
3429         Invocation.OverloadResolve.
3430
3431         Fix #75656.
3432         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3433         invariant-meaning-in-block property in an enclosing block if
3434         necessary.
3435
3436 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3437
3438         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3439         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3440         (Switch.CheckSwitch): Just save 50kb for SWF.
3441
3442 2005-07-27  Martin Baulig  <martin@ximian.com>
3443
3444         * anonymous.cs (CaptureContext.AddField): Added
3445         `AnonymousContainer am' argument; compute its toplevel scope if
3446         it's not already computed.  Fixes #75649.
3447
3448 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3449
3450         Fix #75628.
3451         * class.cs (Constructor.Emit): Reset block to null if the block
3452         resolve fails.
3453
3454 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3455
3456         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3457
3458 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3459
3460         * class.cs (MethodData.Define): Check whether accessor implementing
3461         interface is public.
3462
3463         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3464
3465 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3466
3467         Fix #57245
3468         * namespace.cs (LookupType): Moved same type check to...
3469         
3470         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3471         with the same name.
3472
3473 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3474
3475         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3476         already found a typebuilder.
3477         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3478         MemberNames, not strings.
3479
3480         * const.cs (Error_ExpressionMustBeConst): 
3481         Rename from Error_EpressionMustBeConst.
3482         * const.cs, class.cs, statement.cd: Update.
3483
3484 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3485
3486         Fix #65573
3487
3488         * const.cs (Const.LookupConstantValue): Report missing contant expression
3489         everytime.
3490         (Error_EpressionMustBeConstant): Only one error method.
3491
3492         * class.cs, statement.c: Updated.
3493
3494 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3495
3496         * statement.cs (Block.Flags): Add back HasVarargs.
3497         (Block.flags): Make protected.
3498         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3499
3500         * typemanager.cs (types, typecontainers, user_types): Remove.
3501         (UserTypes, TypeContainers): Likewise.
3502         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3503         (CleanUp, Reset): Update.
3504         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3505         (GetNestedType): Use Type.GetNestedType.
3506         (CoreLookupType): Take two arguments, the namespace and the
3507         basename of the type.  Update to use the Namespace.Lookup
3508         mechanism.
3509         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3510         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3511         string concatenation and substring matches.
3512         * class.cs, enum.cs, delegate.cs: Update to changes.
3513
3514 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3515
3516         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3517         Expression and made virtual.
3518
3519         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3520         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3521
3522         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3523
3524         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3525         error message.
3526
3527         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3528         change.
3529
3530 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3531
3532         Fix #57707
3533         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3534         AssemblyCultureAttribute is not used on executable.
3535
3536         * rootcontext.cs,
3537         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3538
3539 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3540
3541         Fix #60638.
3542         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3543         New.  Reports CS0252/CS0253.
3544         Mostly taken from preliminary patch by Duncak Mak.
3545         (Binary.DoResolveOperator): Store results of operator lookup.
3546         Use them to detect if we need to warn about unintended reference
3547         comparisons.
3548
3549 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3550
3551         Fix #72969.
3552         * namespace.cs (Namespace.Lookup): Add back location parameter.
3553         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3554         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3555
3556         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3557         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3558         (Namespace.LookupType): ... this.
3559         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3560         of namespaces.
3561         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3562         purported to handle pointers.
3563         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3564         CoreLookupType.
3565
3566 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3567
3568         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3569         type as namespace.
3570
3571 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3572
3573         * namespace.cs (Namespace.Lookup): Drop location parameter.
3574         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3575         (NamespaceEntry.Lookup): ... this.
3576         (NamespaceEntry.Error_AmbiguousTypeReference):
3577         Move here from DeclSpace.
3578         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3579         names ...
3580         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3581         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3582         Move to NamespaceEntry.
3583         * delegate.cs, expression.cs: Update to changes.
3584
3585 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3586
3587         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3588         CheckAttributeType and refactored.
3589         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3590         ResolveAsTypeTerminal error handling.
3591         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3592         handling.
3593         (GetSignatureForError): Print errors in same way.
3594
3595         * class.cs,
3596         * codegen.cs: Reflect attribute GetSignatureForError change.
3597
3598         * ecore.cs,
3599         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3600
3601         * namespace.cs (UsingEntry): Refactored to make fields private.
3602
3603         * assign.cs,
3604         statement.cs: Error_UnexpectedKind has extra parameter.
3605
3606 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3607
3608         * ecore.cs (IAlias): Remove.
3609         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3610         that implement the interface.
3611         * namespace.cs (Namespace): Likewise.
3612         (Namespace.declspaces): Renamed from 'defined_names'.
3613         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3614         DeclSpace instead of an IAlias.
3615         * tree.cs (Tree.AddDecl): Update.
3616
3617 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3618
3619         * statement.cs (Block.Flags); Remove HasVarargs.
3620         (Block.HasVarargs): Move to ToplevelBlock.
3621         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3622         (Block.Variables): Make protected.  Initialize variable hashtable
3623         if necessary.
3624         (Block.AddVariable): Update.
3625         (Block.Resolve): Update to changes.
3626         (ToplevelBlock.HasVarargs): New boolean.
3627         (ToplevelBlock.ThisVariable): Move here from Block.
3628         (ToplevelBlock.AddThisVariable): Likewise.
3629         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3630         * expression.cs (This.ResolveBase): Update to changes.
3631         (ArglistAccess.DoResolve): Likewise.
3632
3633 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3634
3635         Fix #75321
3636         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3637
3638         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3639         not used and not used & assigned.
3640         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3641
3642 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3643
3644         Fix #75053
3645         * expression.cs (Is.DoResolve): null is never provided type.
3646
3647 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3648
3649         Fix #52496
3650         * cs-parser.jay: Less strict event error rule to catch more errors.
3651
3652 2005-07-08  Martin Baulig  <martin@ximian.com>
3653
3654         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3655         gettter (allowed) or setter (not allowed).
3656
3657         * class.cs (Accessor): Implement IIteratorContainer.
3658         (Accessor.Yields): New public field.
3659         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3660         per-accessor basis.
3661
3662         * cs-parser.jay
3663         (get_accessor_declaration, set_accessor_declaration): Set the
3664         `yields' flag on the accessor, not the property.
3665         (property_declaration): Do the iterators check on a per-accessor
3666         basis and not for the whole property.
3667
3668 2005-07-08  Martin Baulig  <martin@ximian.com>
3669
3670         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3671         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3672
3673 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3674
3675         Fix #74975
3676         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3677         (ExtractSecurityPermissionSet): Cope with self referencing security
3678         attributes properly.
3679
3680         * driver.cs (SetOutputFile): Made public property OutputFile.
3681
3682 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3683
3684         Fix #75486.
3685         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3686         has_nonstatic_fields.  Make into a FieldBase pointer.
3687         (TypeContainer.AddField): Add CS0282 check.
3688         (TypeContainer.EmitType): Update.
3689
3690 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3691
3692         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3693         compare if they start with __.
3694
3695 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3696
3697         * statement.cs (Switch.SwitchGoverningType): Only look at
3698         UserCasts that don't need implicit standard conversions to one of
3699         the allowed switch types (Fixes test-322.cs).
3700         (LocalInfo.Resolve): Re-enable sanity-test.
3701
3702 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3703
3704         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3705         
3706         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3707         
3708         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3709
3710 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3711
3712         Fix #75472.
3713         * ecore.cs (SimpleName.GetSignatureForError): Add.
3714         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3715         (MemberAccess.GetSignatureForError): Add.
3716
3717 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3718  
3719         The big error and warning messages review.
3720         
3721         * anonymous.cs,
3722         * assign.cs,
3723         * attribute.cs,
3724         * class.cs,
3725         * codegen.cs,
3726         * convert.cs,
3727         * cs-parser.jay,
3728         * cs-tokenizer.cs,
3729         * decl.cs,
3730         * delegate.cs,
3731         * doc.cs,
3732         * driver.cs,
3733         * ecore.cs,
3734         * enum.cs,
3735         * expression.cs,
3736         * flowanalysis.cs,
3737         * iterators.cs,
3738         * literal.cs,
3739         * location.cs,
3740         * modifiers.cs,
3741         * namespace.cs,
3742         * parameter.cs,
3743         * pending.cs,
3744         * report.cs,
3745         * rootcontext.cs,
3746         * statement.cs,
3747         * support.cs,
3748         * tree.cs,
3749         * typemanager.cs: Updated.
3750         
3751         * class.cs: (MethodCore.SetYields): Moved here to share.
3752         (PropertyMethod.Define): Moved iterator setup here.
3753         
3754         * iterators.cs: Add orig_method to have full access to parent
3755         container.
3756
3757 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3758
3759         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3760         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3761         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3762         variable of struct type.
3763         * expression.cs (Unary.ResolveOperator): Update to change.
3764         (Indirection.VerifyFixed): Likewise.
3765         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3766         (ParameterReference.VerifyFixed): Value parameters are fixed.
3767         (This.VerifyFixed): Treat 'this' as a value parameter.
3768         * statement.cs (LocalInfo.IsFixed): Remove.
3769
3770 2005-07-01  Martin Baulig  <martin@ximian.com>
3771
3772         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3773         `ec.EmitThis ()' to get the correct scope.
3774
3775 2005-07-01  Martin Baulig  <martin@ximian.com>
3776
3777         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3778         instance is a ParameterReference; fixes #75299.
3779
3780 2005-07-01  Martin Baulig  <martin@ximian.com>
3781
3782         Reverted Marek's latest patch (r46725):
3783         - it contains structural changes which are neither mentioned in
3784           the ChangeLog nor explained anywhere; for example the additional
3785           argument of EmitContext's and Iterator's .ctor's and the
3786           TypeContainer.DefineMembers() change.
3787         - structural changes like this should go in in seperate patches
3788           and not be hidden in a huge patch which just seems to affect
3789           warnings and errors.
3790           a big and hard to understand patch.
3791         - it breaks iterators and causes regressions, for instance in
3792           test-iter-03.cs.      
3793
3794 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3795
3796         Fix #75412.
3797         * expression.cs (Indexers.map): Remove.
3798         (Indexers.Append): Filter out inaccessible setters and getters.
3799         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3800
3801         Fix #75283.
3802         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3803         Refactored from ...
3804         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3805         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3806         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3807         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3808
3809 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3810
3811         Fix #75322
3812         * class.cs (FieldBase.GetInitializerExpression): One more field
3813         for backup.
3814
3815 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3816
3817         * pending.cs: Do not define a proxy if the base method is virtual,
3818         it will be picked up by the runtime (bug 75270).
3819
3820 2005-06-08  Martin Baulig  <martin@ximian.com>
3821
3822         The big Iterators rewrite :-)
3823
3824         * iterators.cs: Rewrite this to use the anonymous methods framework.
3825
3826         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3827         before the TypeContainers; see 2test-21.cs.
3828
3829         * class.cs
3830         (TypeContainer.DefineType): Don't create a new EmitContext if we
3831         already have one (this only happens if we're an Iterator).
3832         (TypeContainer.Define): Also call Define() on all our iterators.
3833         (Method.CreateEmitContext): Added support for iterators.
3834
3835         * anonymous.cs
3836         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3837         (AnonymousContainer.CreateMethodHost): Moved here from
3838         AnonymousMethod and made abstract.
3839         (AnonymousContainer.CreateScopeType): New abstract method.
3840         (AnonymousContainer.IsIterator): New public property.
3841         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3842         get the ScopeTypeBuilder rather than manually defining it here. 
3843         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3844         iterators here.
3845
3846         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3847         before RootContext.DefineTypes().
3848
3849         * codegen.cs (EmitContext.RemapToProxy): Removed.
3850         (EmitContext.CurrentAnonymousMethod): Changed type from
3851         AnonymousMethod -> AnonymousContainer.
3852         (EmitContext.ResolveTopBlock): Protect from being called twice.
3853         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3854         (EmitContext.EmitThis): Removed the iterators hacks; use the
3855         anonymous methods framework for that.
3856
3857         * statement.cs
3858         (ToplevelBlock.Container): Make this a property, not a field.
3859         (ToplevelBlock.ReParent): New public method; move the
3860         ToplevelBlock into a new container.
3861         (Foreach.TemporaryVariable): Simplify.
3862
3863 2005-06-05  Martin Baulig  <martin@ximian.com>
3864
3865         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3866         (Block.AddTemporaryVariable): New public method; creates a new
3867         `LocalInfo' for a temporary variable.
3868         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3869         variables here.
3870         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3871         non-iterator variables.
3872
3873 2005-06-05  Martin Baulig  <martin@ximian.com>
3874
3875         * statement.cs (Foreach.TemporaryVariable): Create the
3876         LocalBuilder in the Emit phase and not in Resolve since in some
3877         situations, we don't have an ILGenerator during Resolve; see
3878         2test-19.cs for an example.
3879
3880 2005-06-04  Martin Baulig  <martin@ximian.com>
3881
3882         **** Merged r45395 from GCS ****
3883
3884         The big Foreach rewrite - Part II.
3885
3886         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3887         with `PropertyInfo ienumerator_getcurrent'.
3888
3889         * codegen.cs (VariableStorage): Removed.
3890
3891         * statement.cs
3892         (Foreach): Derive from Statement, not ExceptionStatement.
3893         (Foreach.CollectionForeach): New nested class.  Moved all the code
3894         dealing with collection foreach here.
3895         (Foreach.ForeachHelperMethods): Removed.
3896         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3897
3898 2005-05-23  Martin Baulig  <martin@ximian.com>
3899
3900         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3901         don't need to.  Fix #75014.
3902
3903 2005-05-20  Martin Baulig  <martin@ximian.com>
3904
3905         Merged r44808 from GMCS.
3906
3907         * class.cs (TypeContainer.CircularDepException): Removed.
3908         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3909         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3910         (CS0146) and interface (CS0529) dependencies here.
3911
3912 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3913
3914         * expression.cs (Invocation.EmitCall): Fix initialization
3915         'this_call' to reflect current behaviour.  Fix indentation.
3916
3917         * convert.cs (FindMostEncompassedType): Add two trivial special
3918         cases (number_of_types == 0 || number_of_types == 1).
3919         (FindMostEncompasingType): Likewise.
3920
3921 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3922
3923         Some cleanups preparing for the fix of #75283.
3924         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3925         error testing.
3926         (EventExpr.InstanceResolve): Likewise.
3927         (EventExpr.DoResolve): Remove redundant checks.
3928
3929 2005-06-10  Duncan Mak  <duncan@novell.com>
3930
3931         * cs-tokenizer.cs (process_directives): New flag for controlling
3932         the processing of preprocessor directives.
3933         (x_token): After seeing a '#', return Token.NONE instead of going
3934         to handle_preprocessing_directive() when not processing
3935         directives. This avoids unnecessary processing during the token peek in
3936         is_punct().
3937
3938         This fixes #74939.
3939
3940         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3941         the existing error reporting methods instead of Report.Error.
3942
3943         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3944         after Raja's rewrite.
3945
3946 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3947
3948         * class.cs: Small fix.
3949
3950 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3951
3952         Fix #75160.
3953         * class.cs (GetPartialBases): Fix return value check of
3954         part.GetClassBases.
3955
3956 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3957
3958         Ensure that partial classes are registered in their enclosing
3959         namespace.  Initial part of fix of #75160.
3960         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3961         Register declspace with namespace here, not in
3962         DeclSpace.RecordDecl.
3963         * cs-parser.jay: Pass namespace to RecordDecl.
3964         * class.cs (PartialContainer.Create): Likewise.
3965         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3966         called.
3967         * decl.cs (Declspace.RecordDecl): Remove.
3968         * namespace.cs (NamespaceEntry.DefineName): Remove.
3969
3970 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3971
3972         * rootcontext.cs: Reset TargetExt as well.
3973
3974 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3975
3976         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3977         -langversion:ISO-1.
3978
3979 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3980
3981         Fix #75080, cs0119.cs.
3982         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3983         of ...
3984         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3985         allowing ExprClass.Type and ExprClass.Namespace for
3986         ResolveFlags.VariableOrValue.
3987         (Expression.Resolve) [1-argument variant]: Change default resolve
3988         flags based on language version.
3989         (Expression.Error_UnexpectedKind): Use a simple string array
3990         rather than an ArrayList.
3991         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3992         not ExprClass.Type.
3993         (TypeOfVoid.DoResolve): Likewise.
3994         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3995         flags argument -- it always has the same value.
3996
3997 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3998
3999         Fix #75081.
4000         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4001         Use it in the error message.
4002         * assign.cs, expression.cs, statement.cs: Update.
4003
4004 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4005
4006         Fix #75088.
4007         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4008         the "almostMatchedMember" case too.
4009         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4010         that failed the accessibility checks to 'almost_match'.
4011
4012 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4013
4014         * attribute.cs: Use internal MethodBuilder methods to set
4015         ExactSpelling and SetLastError on PInvoke methods, instead
4016         of passing them via charset.  Fixes #75060.
4017
4018 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4019
4020         * parameter.cs (Parameter): Remove TODO comment.
4021         (Parameter.DefineParameter): Remove Location parameter.
4022         (Parameters.LabelParameters): Likewise.
4023         * class.cs (Constructor.Emit): Update to change.
4024         (MethodData.Emit): Likewise.
4025         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4026         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4027
4028 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4029
4030         * parameter.cs,
4031           Removed Parameters.Location and added Parameter.Location instead.
4032           Removed Location parameter from Emit() and GetSignature().
4033         * anonymous.cs,
4034           class.cs,
4035           cs-parser.jay,
4036           delegate.cs,
4037           iterators.cs,
4038           statement.cs :
4039           Modified all related calls.
4040
4041 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4042
4043         Improve user-defined conversion handling.
4044         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4045         applicable operators.
4046         (AddConversionOperators): New.  Helper for GetConversionOperators.
4047         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4048         there is only one most encompassed/encompassing type.
4049         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4050         "applicable operator" handling.
4051         (UserConversion): Move cache here from GetConversionOperators.
4052         Directly cache the chosen operator, rather than the whole
4053         MethodGroup.
4054         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4055         case.  Allow conversion of decimal to sbyte and byte too.
4056         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4057         New static methods.  Used to avoid allocating EmptyExpressions in
4058         convert.cs.
4059
4060 2005-05-24  Duncan Mak  <duncan@novell.com>
4061
4062         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4063         another class, used in Convert.ExplicitNumericConversion.
4064         (CastToDecimal): New class, similar to above, but casts to
4065         System.Decimal, used in Convert.ImplicitNumericConversion and also
4066         in explicit convesion from double/float to decimal.
4067
4068         * convert.cs (ImplicitNumericConversion): Handle implicit
4069         conversions to System.Decimal.
4070         (ExplicitNumericConversion): handle explicit conversions to
4071         System.Decimal.
4072
4073         This fixes #68711.
4074         
4075 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4076
4077         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4078         know the type at this stage, just break through.   Fixes #75008 
4079
4080 2005-05-19  Martin Baulig  <martin@ximian.com>
4081
4082         * delegate.cs
4083         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4084         to disable error reporting.
4085
4086         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4087         here since we don't want to report an error; see the new test-336.cs.
4088
4089 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4090
4091         * statement.cs (ToplevelBlock.GetParameterReference)
4092         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4093         Move here from class Block.
4094         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4095         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4096
4097 2005-05-18  Martin Baulig  <martin@ximian.com>
4098
4099         Fix #74978.
4100
4101         * flowanalysis.cs
4102         (FlowBranching.Reachability): Add non-static public And() and Or()
4103         methods.
4104         (FlowBranchingSwitch): New class; do the `break_origins' thing
4105         like in FlowBranchingLoop.
4106         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4107         reachability, not just locals and parameters.
4108         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4109         switch; MergeBreakOrigins() now takes care of that.
4110
4111 2005-05-18  Martin Baulig  <martin@ximian.com>
4112
4113         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4114         a loop and may leave it, reset the barrier; fixes #74974.
4115
4116 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4117         
4118         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4119         is back.
4120         
4121         * cs-parser.jay: Catch more lexical errors.
4122         
4123         * report.cs: Add one more Error method.
4124         
4125         * rootcontext.cs,
4126         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4127
4128 2005-05-17  Martin Baulig  <martin@ximian.com>
4129
4130         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4131         #70970. 
4132
4133 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4134
4135         Fix test-382.cs.  Emit values of decimal constants.
4136         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4137         Carved out of ...
4138         (TypeContainer.AddField): ... this.
4139         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4140         with initializers to include 'Const's.
4141         (ClassPart.RegisterFieldForInitialization): Forward to
4142         PartialContainer.
4143         * const.cs (Const.Const): Pass initializer to base class.
4144         (Const.Define): In case of decimal constants, register them for
4145         initialization in a static constructor.
4146
4147 2005-05-14  Martin Baulig  <martin@ximian.com>
4148
4149         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4150         do not call ResolveUnreachable() on unreachable statements in
4151         here, see the comment in the source code.
4152
4153 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4154
4155         Fix #74934.
4156         * expression.cs (BinaryResolveOperator): If one of the operands of
4157         an equality comparison is 'null' and the other is a pointer type,
4158         convert the null to a NullPointer.
4159         * convert.cs (ImplicitReferenceConversion): If the expression is a
4160         NullLiteral and the target type is a pointer type, return a
4161         NullPointer instead.
4162         (ImplicitConversionStandard): Likewise.
4163
4164 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4165         
4166         * cs-parser.jay: Set readonly context based on special constructs.
4167         
4168         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4169         readonly variable error handling.
4170         
4171         * rootcontext.cs (EmitCode): Don't verify members when error
4172         occurred.
4173         
4174         * statement.cs (LocalInfo): Add reaodnly context information.
4175         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4176
4177 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4178
4179         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4180         for #74041 to initialize 'resolved' to false only for explicit
4181         blocks.  Fixes #74873.
4182
4183 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4184
4185         Fix #74920.
4186         * typemanager.cs (unmanaged_enclosing_types): New.
4187         (IsUnmanagedType): Avoid infloops by using
4188         'unmanaged_enclosing_types' to talk with recursive invocations.
4189
4190 2005-05-13  Martin Baulig  <martin@ximian.com>
4191
4192         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4193         instance variable, not a local.  Fix #74873.
4194         (Block.ResolveUnreachable): Set it to true here.
4195
4196 2005-05-11  Duncan Mak  <duncan@novell.com>
4197
4198         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4199         continuing to process for 'arg'.
4200         (handle_preprocessing_directive): Check the argument of the #endif
4201         directive and report error CS1025 if there are any trailing
4202         characters.
4203
4204         According to the C# spec, having even whitespace after the #endif
4205         directive is illegal; however, because we call arg.TrimEnd ()
4206         beforehand, we have the same behavior as csc, allowing whitespace
4207         after the directive.
4208
4209         Fixes #74892.
4210
4211 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4212
4213         Fix #74863.
4214         
4215         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4216         (Constructor.GetObsoleteAttribute): Implemented correctly.
4217
4218 2005-05-10  Martin Baulig  <martin@ximian.com>
4219
4220         * support.cs (ReflectionParameters.ParameterModifier): Use
4221         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4222         and `ParameterAttributes.In'.  Fixes #74884.
4223
4224 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4225
4226         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4227         
4228         * expression.cs (Argument.GetParameterModifier): Turned to property.
4229         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4230         
4231         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4232         its C# equivalent.
4233         
4234 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4235
4236         Fix #74852.
4237         * decl.cs (MemberCache.AddMethods): Register override methods,
4238         rather than non-override methods.
4239         * typemanager.cs (RegisterOverride): New.
4240         (IsOverride): Update.
4241
4242 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4243
4244         Fix #73105.
4245         
4246         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4247         recursive declaration.
4248         
4249         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4250         
4251 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4254         
4255         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4256
4257 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4258
4259         Fix #74797.
4260         * decl.cs (DeclSpace.FamilyAccessible): 
4261         Use TypeManager.IsNestedFamilyAccessible.
4262
4263         Fix reopened #64812.
4264         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4265         internal'.
4266
4267 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4268             Abin Thomas  <projectmonokochi@rediffmail.com>
4269             Anoob V E  <projectmonokochi@rediffmail.com>
4270             Harilal P R  <projectmonokochi@rediffmail.com>
4271
4272         Fix #64812.
4273         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4274         allow access to all static members.
4275
4276 2005-05-04  Martin Baulig  <martin@ximian.com>
4277
4278         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4279
4280 2005-05-04  Martin Baulig  <martin@ximian.com>
4281
4282         Fix #74655.
4283
4284         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4285         section at the end; make things work if `default' is not the last
4286         section.        
4287
4288 2005-05-04  Martin Baulig  <martin@ximian.com>
4289
4290         Fix #70400.
4291
4292         * statement.cs (Switch): Replaced the `got_default' field with a
4293         `default_section' one.
4294         (Switch.CheckSwitch): Set `default_section' here.
4295         (Switch.Resolve): If we're a constant switch and the constant is
4296         not found, use the default section.
4297
4298 2005-05-03  Martin Baulig  <martin@ximian.com>
4299
4300         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4301
4302         * statement.cs (Foreach.ArrayForeach): New nested class.
4303         (Foreach.TemporaryVariable): New nested class.
4304         (Foreach.EmitArrayForeach): Removed; this is now in the new
4305         ArrayForeach class.
4306
4307 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4308
4309         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4310         more conservative.
4311         (VerifyPendingMethods): Revert change below.
4312
4313         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4314         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4315         that used to trigger warning -28.  Remove warning -28.
4316         * expression.cs (Invocation.OverloadResolve): Use
4317         TypeManager.IsOverride to distinguish override methods.
4318
4319         Fix #74773.
4320         * pending.cs (VerifyPendingMethods): If a base type implements the
4321         requested interface, don't bother checking individual methods of
4322         the base type.  As a side-effect, this prevents the creation of
4323         unnecessary proxies.
4324
4325 2005-05-02  Martin Baulig  <martin@ximian.com>
4326
4327         Fix #70182.
4328
4329         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4330         Also `And' the locals if the old vector is null.
4331         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4332         null; in this case we basically reset all the variables.        
4333
4334 2005-05-02  Martin Baulig  <martin@ximian.com>
4335
4336         Fix #74529.
4337
4338         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4339         Added `FlowBranching branching' argument; always `and' the
4340         variables instead of `or'ing them unless we're an infinite loop.
4341
4342         * statement.cs (While.Resolve): Create a new sibling unless we're
4343         infinite.       
4344
4345 2005-05-02  Martin Baulig  <martin@ximian.com>
4346
4347         Fix #70140.
4348
4349         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4350         arguments; use it instead of creating a new TopLevelBlock.
4351         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4352         our ConstructorInitializer.
4353
4354         * statement.cs
4355         (TopLevelBlock.TopLevelBranching): New public property.
4356         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4357         and create our `TopLevelBranching'.
4358
4359         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4360         anonymous method host, use `block.TopLevelBranching' rather than
4361         creating a new branching.
4362
4363 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4364
4365         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4366         a ScopeInfo, if any of the current children is a child of the new
4367         entry, move those children there.
4368
4369 2005-04-30  Martin Baulig  <martin@ximian.com>
4370
4371         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4372         at the beginning of a SwitchSection.  Fix #73335.
4373
4374 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4375
4376         Fix #74378
4377         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4378         
4379         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4380         (FieldExpr.DoResolve): Obsolete members are ignored for field
4381         initializers.
4382         
4383 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4384
4385         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4386         of arrays detection.
4387
4388         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4389         verification.
4390         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4391
4392         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4393         arrays report.
4394
4395 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4396
4397         * cs-parser.jay: Use the prefered version of -unsafe in error
4398         message.
4399
4400 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4401
4402         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4403         circumstances.
4404
4405 2005-04-20  John Luke  <john.luke@gmail.com>
4406
4407         * driver.cs: fix typo in error message, --outout to --output
4408
4409 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4410
4411         * codegen.cs (InRefOutArgumentResolving): New field.
4412         
4413         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4414         fields outside contructor.
4415         
4416         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4417         
4418 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4419
4420         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4421         parameter code was not completed ever, so it was not as up-to-date
4422         as local variables.  Must finish it.
4423
4424         The bug fix was to compare the Toplevel of the block, not the
4425         current block.  Thanks for Ben for pointing this out. 
4426
4427 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4428
4429         * decl.cs (AddMethods): Use the declaring type of the problem
4430         method to determine if we want to squash a warning.
4431
4432 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * attribute.cs: Removed debug output.
4435
4436         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4437         
4438         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4439         Report.Stderr.
4440         
4441 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4442
4443         Fix #74481.
4444         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4445         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4446         all null comparisons against reference types.
4447
4448 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4449
4450         Fix# 74565
4451         * class.cs (TypeContainer.CircularDepException) New nested
4452         exception class.
4453         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4454         (TypeContainer.DefineType): Removed error, reset InTransit before
4455         exit.
4456         (Class.DefineType): Throw exception when is in Transit.
4457         Catch exception and report error.
4458         (Struct.DefineType): Throw exception when is in Transit.
4459         Catch exception and report error.
4460         (Interface.DefineType): Throw exception when is in Transit.
4461         Catch exception and report error.
4462
4463         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4464         handle nested exception handlers.
4465
4466         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4467         a catch.
4468
4469         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4470         InFinally and InCatch storage.
4471
4472         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4473         (Catch.Resolve): Set and Restore ec.InCatch.
4474         (Try.Resolve): Set and Restore ec.InFinally.
4475         (Try.HasCatch): True when try has catch.
4476
4477 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4478
4479         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4480           for the same event member, so exclude such cases from warning 419.
4481           Fixed bug #74633.
4482
4483 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4484
4485         * expression.cs (Binary.ResolveOperator): Apply patch from John
4486         Luke to fix bug 59864: operators &, | and ^ on enumerations
4487         require that the same enum type on both sides.
4488
4489         * driver.cs: Add warnings to old flag usage, this is to assist
4490         people who produce Makefiles and hope that the Makefiles will be
4491         used on Windows.
4492
4493         * class.cs (TypeContainer.EmitType): Moved the definition of the
4494         special $PRIVATE$ field from the resolve phase to the Emit phase.
4495         During resolve we do not know if we are a struct with
4496         HasExplicitLayout, we know this only after the attributes for the
4497         type are emitted.
4498
4499         Set the FieldOffset to zero on the dummy field that we create for
4500         the class.   Fixes 74590.
4501
4502 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4503
4504         Fix #73834.
4505         * ecore.cs (PropertyExpr.resolved): New.
4506         (DoResolve): Use it to handle a case of double resolution here.
4507         Handle a case of identical-name-and-type-name.
4508         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4509         resolution by storing the results of expression resolution back
4510         into the "probes" array.
4511
4512 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4513
4514         Fix cs0208-7.cs and cs0208-8.cs.
4515         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4516         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4517         error reporting to point out the reason a struct is not unmanaged.
4518
4519 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4520
4521         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4522           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4523
4524 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4525
4526         Fix #74528.
4527         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4528         IdenticalNameAndTypeName here.
4529         (EventExpr.InstanceResolve): Likewise.
4530
4531 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4532
4533         C# 2.0 DefaultCharSetAttribute implementation
4534         
4535         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4536         which allows us to set GlobalNamespace for every resolve.
4537         (Attribute.ResolveArguments): Cut from Resolve.
4538         (Attribute.GetCharSetValue): Returns CharSet named argument.
4539         (Attribute.DefinePInvokeMethod): Gets default charset from
4540         module settings.
4541         (GlobalAttribute.ResolveAsTypeStep): Override.
4542         (GlobalAttribute.ResolveArguments): Override.
4543         
4544         * class.cs (TypeAttr): Is protected.
4545         
4546         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4547         (ModuleClass.DefaultCharSetType): New memeber.
4548         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4549         
4550         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4551         charset from module.
4552         
4553         * delegate.cs (TypeAttr): Override.
4554         (Delegate.DefineType): Use this TypeAttr.
4555         
4556         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4557         at very early stage (before types are defined) to resolve model
4558         module attributes. It will probably not work with corlib but it
4559         should be ok.
4560         
4561         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4562         charset from module.
4563         
4564         * typemanager.cs (default_charset_type): New type.
4565
4566 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4567
4568         * decl.cs (MemberCache.AddMethods): Don't warn if
4569         System.Object.Finalize has buggy MethodAttributes.
4570
4571         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4572         removed below.
4573
4574 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4575
4576         * doc.cs : detect ambiguous reference to overloaded members.
4577           Fixed bug #71603. MS 1.1 csc does not detect it.
4578
4579 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4580
4581         * doc.cs : delegates must not be referenced with parameters.
4582           Fixed bug #71605.
4583
4584 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4585
4586         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4587
4588 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4589
4590         * driver.cs (MainDriver): Stop processing if the CLS stage found
4591         errors. 
4592
4593         (CompilerCallableEntryPoint.InvokeCompiler): Always
4594         reset after execution;   Take a TextWriter argument for the
4595         output.
4596
4597         * report.cs: Use the error stream instead of hardcoding stderr. 
4598
4599 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4600
4601         * class.cs: Reduce code paths to test, too small of an
4602         optimization to make it worth the extra testing.  Always perform
4603         it. 
4604
4605 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4606
4607         Fix #74510.
4608         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4609         operators that had errors reported on them.
4610
4611 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4612
4613         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4614         argument types.
4615         (Attribute.Resolve): Add named argument type checking.
4616         
4617         * class.cs (FixedField.Define): Use IsPrimitiveType
4618         
4619         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4620         
4621         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4622         unsafe parameter types.
4623         
4624         * statement.cs (Using.ResolveExpression): Add better error description.
4625         
4626         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4627         
4628 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4629
4630         Fix #74484.
4631         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4632         AttributeUsageAttribute in the emitcontext of the attribute class,
4633         not in the emitcontext of the attributable entity it was attached to.
4634         * cs-parser.jay: Use 'current_class', not 'current_container',
4635         when creating a GlobalAttribute.
4636
4637 2005-04-08  Alp Toker  <alp@atoker.com>
4638
4639         * pending.cs: The fix to #58413 failed to compile methods implementing
4640         interfaces with/without params modifiers and vice versa, even though
4641         params modifiers aren't part of the signature. Make the modifier check
4642         less strict as in csc.
4643
4644 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4645             Anoob V E  <projectmonokochi@rediffmail.com>
4646             Harilal P R  <projectmonokochi@rediffmail.com>
4647
4648         Fix #58413.
4649         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4650         modifiers of pending methods.
4651         (PendingImplementation.PendingImplementation): Initialize it.
4652         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4653         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4654         with ParameterData.  Add check for modifiers.
4655         * class.cs (MethodData.Define): Update to changes.
4656
4657 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4658
4659         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4660
4661 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4664         property.
4665         
4666         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4667         
4668         * rootcontext.cs,
4669         * typemanager.cs: Registered RequiredAttributeAttribute.
4670         
4671 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4672
4673         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4674         Warning CS0169 is back at level 3.
4675         (IMethodData.SetMemberIsUsed): New method.
4676         
4677         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4678         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4679         
4680         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4681
4682         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4683         contants.
4684         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4685         is used.
4686         
4687         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4688         is used.
4689         
4690         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4691         to avoid the problems with nested types.
4692
4693 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4694             Anoob V.E  <projectmonokochi@rediffmail.com>
4695             Harilal P.R  <projectmonokochi@rediffmail.com>
4696             Raja R Harinath  <rharinath@novell.com>
4697
4698         Fix #73820.
4699         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4700         attribute.
4701         * typemanager (GetConstructor): Make public.
4702
4703 2005-04-05  John Luke  <john.luke@gmail.com>
4704             Raja R Harinath  <rharinath@novell.com>
4705
4706         Fix #62232.
4707         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4708         struct too.  Return false quicker in a few cases.
4709         (VerifyUnManaged): Use it.
4710
4711 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4712
4713         Fix #74041.
4714         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4715         not 'unreachable_seen'.
4716
4717 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4718
4719         * attribute.cs (Attribute.GetValue): Removed unused.
4720         
4721         * codegen.cs (CodeGen.TrimExt): Removed unused.
4722         
4723         * cs-parser.jay (output): Removed unused.
4724         
4725         * cs-tokenizer.cs (hex_digits): Removed unused.
4726         
4727         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4728         
4729         * expression.cs (Indirection.LoadExprValue): Removed unused.
4730         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4731         
4732         * iterators.cs (Iterator.param_types): Removed unused.
4733         
4734         * statement.cs (Goto.block): Removed unused.
4735         (ToplevelBlock.did): Removed unused.
4736         (Switch.ResolveConstantSwitch): Removed unused.
4737
4738 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4739
4740         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4741         resetting thingy.
4742
4743 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4744
4745         Fix #74232 and cs0208-3.cs.
4746         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4747         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4748         unmanaged type.  Don't use FieldBuilders when 't' is a
4749         TypeBuilder.  Use ModFlags and MemberType fields.
4750         * class.cs (MemberBase.member_type): Rename from MemberType.
4751         (MemberBase.MemberType): New property.  Determines member_type on
4752         demand.
4753         (MemberBase.DoDefine): Don't initialize MemberType here.
4754         (FieldMember.Define): Likewise.
4755
4756 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4757
4758         Fix #74241
4759         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4760         Attributes are emitted there.
4761         
4762 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4763
4764         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4765         keyword in 'partial enum' too.
4766         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4767         is not allowed).
4768         Report from Kamil Skalski <nazgul@omega.pl>.
4769
4770         Fix #74309.
4771         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4772         have partial containers too.
4773
4774         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4775         in block' checks to Block.CheckInvariantMeaningInBlock.
4776         * statement.cs (Block.GetKnownVariableInfo): Make private.
4777         (Block.IsVariableUsedInChildBlock): Remove.
4778         (Block.IsVariableUsedInBlock): Likewise.
4779         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4780         conflicting declaration.
4781         (Block.AddVariable): Make error messages less long-winded and more
4782         specific.  Show location of conflicting declaration.
4783         * parameter.cs (Parameters.Location): New readonly property.
4784
4785 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4786
4787         Clean up semantics of invoking ResolveMemberAccess.
4788         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4789         can have an instance, ensure that we pass in a non-TypeExpression
4790         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4791         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4792         argument.  Update to changes and simplify.
4793         (FieldExpr.Emitinstance): Remove CS0120 check.
4794         (PropertyExpr.EmitInstance): Likewise.
4795         * expression.cs (Argument.Resolve): Likewise.
4796         (Invocation.DoResolve): Update to changes in semantics of
4797         InstanceExpression.
4798
4799 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4800
4801         Fix #74241
4802         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4803         customization.
4804         
4805         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4806
4807 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4808
4809         Fix difference in behaviour with commandline invocation.
4810         * driver.cs (Driver.Reset): New.
4811         (CompilerCallableEntryPoint): Call it.
4812
4813         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4814         variable" warnings if the boolean expression failed to resolve.
4815
4816 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4817
4818         * attribute.cs: Fix the union of several permissions when some of them
4819         are unrestricted (so the result isn't an unrestricted permission set).
4820         Fix #74036.
4821
4822 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4823
4824         * ecore.cs (MemberExpr): New class.  Convert from interface
4825         IMemberExpr.
4826         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4827         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4828         error checks.
4829         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4830         (MethodGroupExpr.IsExplicitImpl): Remove.
4831         (Expression.GetFieldFromEvent): Remove.
4832         (SimpleName.MemberStaticCheck): Remove.
4833         (SimpleName.DoSimpleNameResolve): Update to changes.
4834         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4835         (MemberAccess.IdenticalNameAndTypeName): Remove.
4836         (MemberAccess.error176): Move to MemberExpr.
4837         (MemberAccess.DoResolve): Update to changes.
4838         (BaseAccess.DoResolve): Likewise.
4839
4840 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4841
4842         C# 2.0 Conditional attribute class implementation
4843         
4844         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4845         Analyzes class whether it has attribute which has ConditionalAttribute
4846         and its condition is not defined.
4847         
4848         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4849         (Class.IsExcluded): New method. Search for at least one defined
4850         condition in ConditionalAttribute of attribute class.
4851
4852 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4853
4854         * ecore.cs (PropertyExpr): Derive from Expression, not
4855         ExpressionStatement.
4856         (PropertyExpr.EmitStatement): Remove.
4857
4858 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4859
4860         Fix #74060.
4861         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4862         internal field "value__" of an enum be private.  The examples for
4863         "value__" that I found on MSDN all used FieldAttributes.Private.
4864
4865         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4866         Don't mention IL method attribute names.
4867
4868         Fix #47991.  Remove a TODO.
4869         * statement.cs (Block.Toplevel): Make into a field.
4870         (Block.Parameters): Move into ToplevelBlock.
4871         (Block.known_variables): Rename from child_variable_names.
4872         (Block.Block): Remove variants that take Parameters.  Initialize
4873         'Toplevel' with the immediately surrounding toplevel block.
4874         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4875         LocalInfo parameter.
4876         (Block.GetKnownVariableInfo): New.
4877         (Block.IsVariableNameUsedInChildBlock): Update.
4878         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4879         the block, even though it may not be in scope.
4880         (Block.AddVariable): Remove Parameters parameter.  Use
4881         Toplevel.Parameters instead.
4882         (Block.AddConstant): Remove Parameters parameter.
4883         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4884         (Block.IsParamaterReference): Likewise.
4885         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4886         (ToplevelBlock.Parameters): New.  Moved from Block.
4887         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4888         initialize Parameters to a non-null value.
4889         * cs-parser.jay: Update to changes.
4890         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4891         simple names that mean different things in the same block.  Use
4892         Block.IsVariableNameUsedInBlock.
4893
4894 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4895
4896         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4897         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4898         GetTypeHandle.  It is possible for a reflected type to derive from
4899         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4900         System.Array during mscorlib compilation).
4901         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4902         contain a method_hash, don't create one either.  Don't create a
4903         deep copy of the base cache's method_hash.
4904         (MemberCache.SetupCache): Rename back from DeepCopy.
4905         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4906         already initialized.  If we see an override function, add its
4907         underlying base virtual function to the member_hash too.
4908
4909         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4910
4911 2005-03-26  Raja R Harinath  <harinath@acm.org>
4912
4913         Fix #73038.
4914         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4915         fails to resolve, ensure that the LHS is still resolved as an
4916         lvalue.
4917
4918 2005-03-25  Raja R Harinath  <harinath@acm.org>
4919
4920         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4921         ec.ContainerType.
4922         (Enum.current_ec): Remove.
4923         (Enum.LookupEnumValue): Remove EmitContext argument.
4924         Just uses the one created during DefineType.
4925         (Enum.FindMembers): Update.
4926         * expression.cs (MemberAccess.DoResolve): Update.
4927
4928 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4929
4930         * assign.cs (Assign.DoResolve): Check for CS1717 when
4931         source and target are same (uses Equals).
4932
4933         * expression.cs (LocalVariableReference, ParameterReference,
4934         This): Implemented Equals, GetHashCode.
4935
4936         * statement.cs (Block.GetParameterReference): Removed useless
4937         local variable.
4938
4939 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix cs0128.cs
4942         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4943         blocks before deciding whether the error is cs0136 or cs0128.
4944
4945         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4946         (using_alias_directive, using_namespace_directive): Pass
4947         MemberName, not an expression to Namespace.UsingAlias and
4948         Namespace.Using.
4949         (MakeName): Use the MemberName of the namespace.
4950         * namespace.cs (Namespace.MemberName): New.
4951         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4952         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4953         Likewise.
4954         * decl.cs (MemberName.Name): Make readonly.
4955         (MemberName.FromDotted): New "constructor".
4956         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4957         (MemberCore.Name): Compute from MemberName on demand.
4958         (MemberCore.SetMemberName): Provide a way to change the
4959         MemberName.
4960         (MemberCore.AddToContainer): Don't take a fullname parameter.
4961         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4962         fully qualified name of the container to the member name.
4963         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4964         only if the type is a member of the root container.
4965         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4966         MemberName.Left rather than searching for an embedded ".".
4967         (PartialContainer.CreatePart): Update to changes in RootContext.
4968         (MemberBase.ShortName): Turn into a property.  Use
4969         MemberCore.SetMemberName.
4970         (MemberBase.ExplicitInterfaceName): Remove.
4971         (MemberBase.UpdateMemberName): Remove.
4972         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4973         (PropertyBase.SetMemberName): New override.
4974         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4975         (Tree.GetDecl): New.
4976         (Tree.AllDecls): Rename from Decls.
4977         * attribute.cs, enum.cs, report.cs: Update to changes.
4978         * driver.cs (MainDriver): Use MemberName.FromDotted on
4979         RootContext.MainClass.
4980
4981 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4982
4983         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4984         checks.
4985
4986         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4987
4988 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4989
4990         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4991         property accessor modifiers.
4992
4993         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4994         fixed buffer attribute (CS1716).
4995         (PropertyMethod.HasCustomAccessModifier): When property accessor
4996         has custom modifier.
4997
4998         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4999         modifiers.
5000         (PropertyExpr.DoResolveLValue): Add CS0272.
5001
5002 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5003
5004         * convert.cs: When converting to a pointer, use the proper Conv.U
5005         or Conv.I depending on the source data type.
5006
5007         * cs-tokenizer.cs: Make the size for large decimal constants,
5008         fixes #72957.
5009
5010 2005-03-17  Martin Baulig  <martin@ximian.com>
5011
5012         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5013         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5014
5015 2005-03-17  Martin Baulig  <martin@ximian.com>
5016
5017         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5018         to bool so we can return an error condition.
5019         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5020         returned an error.
5021
5022 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5023
5024         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5025         attributes.
5026
5027 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5028
5029         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5030         Refactor to avoid traversing the list of assemblies, and to avoid
5031         string concatenation.
5032         * typemanager.cs (guid_attr_type): Remove.
5033         (negative_hits, pointers, references): Remove hashes.
5034         (type_hash): New.
5035         (GetConstructedType): New.  Uses type_hash to handle constructed
5036         types (arrays, references, pointers).
5037         (GetReferenceType, GetPointerType): Use it.
5038         (GetNestedType): New.  Uses type_hash to handle nested types of
5039         reflected types.
5040         (LookupType, LookupTypeDirect): Remove.
5041         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5042         'types' hash and LookupTypeReflection directly.
5043         (params_string, params_object): Use GetConstructedType.
5044         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5045         top-level types.
5046         (Namespace.Lookup): Use cached_types.
5047         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5048         provided by old TypeManager.LookupType.
5049         * rootcontext.cs (MakeFQN): Remove.
5050         * decl.cs (DeclSpace.MakeFQN): Likewise.
5051         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5052         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5053         TypeManager.GetConstructedType.
5054         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5055
5056 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5057
5058         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5059         indexers.
5060
5061         * cs-parser.jay: Reports CS1527 for any namespace element.
5062
5063         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5064         Added CS0407.
5065
5066         * expression.cs (ParameterReference.IsAssigned): Changed error to
5067         CS0269.
5068         (Error_WrongNumArguments): Moved CS0245 detection here.
5069
5070         * statement.cs (Return.Resolve): Add CS1622 report.
5071
5072 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5075
5076 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5077
5078         * attribute.cs expression.cs: Get rid of some allocations.
5079
5080 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5081
5082         * doc.cs : just eliminate the latest change.
5083
5084 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5085
5086         * doc.cs : commented out the latest change. It breaks xml-030.cs
5087
5088 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5089
5090         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5091           fail. So invoke CreateType() in FindDocumentedType().
5092
5093 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5094
5095         * cs-tokenizer.cs : added IsKeyword().
5096         * doc.cs : Detect keyword incorrectly used as identifier.
5097           Allow identifiers prefixed by @.
5098
5099 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5100
5101         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5102         It caused exception in namespace resolving (again!).
5103         
5104         * class.cs (Class.ctor): Removed exit.
5105         (PropertyMethod.ctor): ditto.
5106         
5107         * codegen.cs (Codegen.Reset): Reset static data.
5108         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5109         
5110         * cs-tokenizer.cs (Cleanup): Removed.
5111         
5112         * driver.cs (GetSystemDir): Rewrote to one line command.
5113         It caused problem with unloaded dynamic modules.
5114         (UnixParseOption): Removed Exit.
5115         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5116         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5117         Now can be mcs used as library.
5118         
5119         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5120         empty location.
5121         
5122         * location.cs (Reset): Reset static data.
5123         
5124         * namespace.cs (Reset): Reset static data.
5125         
5126         * report.cs (Report.Reset): Reset static data.
5127         
5128         * rootcontext.cs (RootContext.Reset): Reset static data.
5129         
5130         * tree.cs (RootTypes.ctor): Use Location.Null
5131         
5132         * typemanager.cs (TypeManager.Reset): Reset static data.
5133         (CoreLookupType): Removed Exit.
5134         (TypeHandle.Reset): Reset static data.
5135         
5136 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5137
5138         Fix #73516.
5139         * typemanager.cs (ComputeNamespaces): Import namespaces from
5140         referenced modules too.
5141
5142 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5143
5144         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5145         than '.'.
5146
5147 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5148
5149         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5150         enclosing DeclSpace.  This ensures that a name-lookup populates
5151         more caches and there are fewer 'TypeExpression's.  Carve out
5152         nested type lookup into ...
5153         (LookupNestedTypeInHierarchy): ... this.
5154
5155 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5156
5157         Clean up a few partial-class semantics.  
5158         Fixes test-357.cs and cs1618-2.cs.
5159         * cs-parser.jay (struct_declaration): Use 'current_class' as
5160         parent of newly-created struct.  Remove call to Register ().
5161         Use 'pop_current_class' to complete handing the current struct.
5162         (interface_declaration): Likewise.
5163         (class_declaration): Likewise.
5164         (enum_declaration): Use 'current_class' as parent of newly created
5165         enum.
5166         (delegate_declaration): Likewise.
5167         (pop_current_class): New function.  This is used to handle closing
5168         up the 'current_class' and 'current_container', and pointing them
5169         to the enclosing class/container.
5170         (CSharpParser): Initialize 'current_class' too.
5171         * decl.cs (MemberCore): Add check for invariant: a partial
5172         container is not a parsed entity, and thus does not enclose any
5173         parsed members.
5174         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5175         (DeclSpace.BaseTypeExpr): Use it.
5176         (DeclSpace.LookupType): Add check for invariant.
5177         * class.cs (TypeContainer): Add check for invariant: a nested
5178         class should have the same NamespaceEntry as its enclosing class.
5179         (TypeContainer.EmitFieldInitializers): Make virtual.
5180         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5181         MemberCore.
5182         (TypeContainer.Register): Remove.
5183         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5184         null.  Use TypeResolveEmitContext for resolving base types and
5185         interfaces.  Move initialization of Parts.TypeBuilder here from
5186         ...
5187         (TypeContainer.DefineNestedTypes): ... here.
5188         (PartialContainer): Take a Namespace not a NamespaceEntry.
5189         (PartialContainer.Create): Don't use Register.  Call the
5190         appropriate Add... function directly.
5191         (ClassPart): Take both the PartialContainer and the enclosing
5192         class as constructor arguments.
5193         (ClassPart.EmitFieldInitializers): Override.
5194         (ClassPart.PartFindNestedTypes): Remove.
5195         (FieldBase.GetInitializerExpression): Resolve the initializer
5196         expression in the emit context of the enclosing class.
5197         * tree.cs (RootTypes): Remove Register ().
5198         
5199 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5200
5201         * cs-parser.jay: Removed CS0134.
5202         
5203         * driver.cs: Removed CS1901.
5204         
5205         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5206         for predefined types.
5207
5208 2005-03-07  Duncan Mak  <duncan@novell.com>
5209
5210         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5211         well. Fixes bug #73454.
5212
5213 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5214
5215         * cs-tokenizer.cs (xtoken): Add CS1035.
5216         
5217         * class.cs (MethodData.Define): Add CS0683.
5218         (FieldMember.ctor): Add CS0681.
5219
5220 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5221
5222         * ecore.cs (SimpleName.DoResolve): Rename from
5223         SimpleName.DoResolveAllowStatic.
5224         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5225         Pass 'intermediate' flag to MemberStaticCheck.
5226         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5227         of "intermediate" lookups via MemberAccess.
5228         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5229         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5230
5231 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5232
5233         Fix #73394.
5234         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5235         slipped in because of variable names that are identical to a
5236         builtin type's BCL equivalent ('string String;', 'int Int32;').
5237         (PropertyExpr.EmitInstance): Likewise.
5238
5239 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5240
5241         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5242         
5243         * report.cs (warning_ignore_table): Made public.
5244
5245 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5246
5247         Fix #73282.
5248         * class.cs (MethodData.Emit): Pass 'container' to
5249         container.GetObsoleteAttribute instead of 'container.Parent'.
5250
5251 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5252
5253         * cs-parser.jay: Add 1534 error test.
5254
5255         * iterators.cs (Yield.CheckContext): Add error 1629.
5256         (Iterator.ctor): Save unsafe modifier.
5257         (MoveNextMethod.DoEmit): Restore unsafe context.
5258
5259         * namespace.cs (UsingAlias): Better error message.
5260
5261 2005-03-03  Dan Winship  <danw@novell.com>
5262
5263         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5264         the warning message [#73219]
5265
5266 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5267
5268         Fix compile with MCS 1.0.0.0.
5269         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5270         w_restore to not depend on string constant folding.
5271
5272 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5273
5274         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5275         CS0246 check to users who passed 'silent = false'.
5276         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5277         check.
5278         (SimpleName.SimpleNameResolve): Update.
5279         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5280         (MemberAccess.IdenticalNameAndTypeName): Update.
5281         * doc.cs (FindDocumentedTypeNonArray): Update.
5282
5283 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5284
5285         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5286         * parameters.cs (ComputeAndDefineParameters): Remove.
5287         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5288         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5289         Use GetParameterInfo.
5290
5291 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5292
5293         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5294
5295 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5296
5297         Unify DeclSpace.LookupType and DeclSpace.FindType.
5298         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5299         is in charge of defining nested types on demand.
5300         (DeclSpace.LookupType): Use it when the current_type is a
5301         TypeBuilder.  Use LookupTypeDirect for reflected types.
5302         (DeclSpace.FindType): Remove.
5303         (DeclSpace.LookupInterfaceOrClass): Likewise.
5304         (DeclSpace.DefineTypeAndParents): Likewise.
5305         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5306         DeclSpace.LookupType.
5307         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5308         * typemanager.cs (LookupType): Simplify.
5309         (AddUserType): Remove type from negative_hits.
5310         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5311         * class.cs (TypeContainer.FindMembers): Move handling of nested
5312         types ...
5313         (TypeContainer.FindMembers_NestedTypes): ... here.
5314         (TypeContainer.FindNestedType): Implement override.
5315         (ClassPart.FindNestedType): Delegate to PartialContainer.
5316         (ClassPart.PartFindNestedType): Looks up the nested types of the
5317         part alone.
5318
5319 2005-03-02  Martin Baulig  <martin@ximian.com>
5320
5321         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5322         static constructor in static classes.
5323
5324 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5325
5326         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5327         sizeParamIndex is not specified.
5328
5329 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5330
5331         Fix #73117
5332         * report.cs (WarningMessage.IsEnabled): Missing null check.
5333
5334 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5335
5336         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5337         in the fields and not in the properties.
5338
5339 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5340
5341         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5342         fields as well.
5343
5344 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5345
5346         * attribute.cs: Small refactoring (improved robustness).
5347         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5348         (ValidateGuid): Removed.
5349         (Resolve): Removed referenced to above mentioned.
5350         (GetAttributeUsage): Made private and changed to work without
5351         class assistance.
5352         (GetIndexerAttributeValue): Don't crash.
5353         (GetConditionalAttributeValue): Ditto.
5354         (GetClsCompliantAttributeValue): Ditto.
5355         (ExtractSecurityPermissionSet): All attributes exceptions are
5356         error 648.
5357         (GetPropertyValue): New helper.
5358         (GetMethodImplOptions): New method.
5359         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5360         some missing properties.
5361         
5362         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5363         (Method.ApplyAttributeBuilder): Updated.
5364         
5365         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5366         exception.
5367
5368 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5369
5370         Fix #73052.
5371         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5372         non-simple types (array, pointer, reference).
5373
5374 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5375
5376         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5377
5378         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5379         for operators.
5380         (Method.CheckBase): Catch wrong destructor here.
5381         (MethodData.Define): Add errors 550, 668.
5382
5383         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5384
5385         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5386
5387         * pending.cs (VerifyPendingMethods): Add error 551.
5388
5389         * typemanager.cs (CSharpName): Next error report helper.
5390
5391 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5392
5393         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5394         attributes. Removed useless attribute double check.
5395         It saves almost 2MBs for corlib.
5396
5397 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5398
5399         Fix #72924.
5400         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5401         called twice in case of error.
5402
5403 2005-02-23  Chris Toshok  <toshok@ximian.com>
5404
5405         Fix compiler portions of #72827.
5406         * statement.cs (Block.Emit): call Begin/EndScope on the
5407         EmitContext instead of the ILGenerator.
5408
5409         * codegen.cs (EmitContext.BeginScope): new method, call
5410         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5411         we have one.)
5412         (EmitContext.BeginScope): same, but EndScope and CloseScope
5413
5414         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5415         offset and call the superclass's OpenScope(int) with it.
5416         (SymbolWriter.CloseScope): get the current il
5417         offset and call superclass's CloseScope(int) with it.
5418
5419 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5420
5421         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5422         CS1677 for out and ref as well.
5423
5424         * class.cs (Method.Define): Add error CS1599 detection.
5425         
5426         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5427         
5428         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5429         
5430         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5431         
5432         * support.cs.cs (ModifierDesc): New helper method.
5433
5434 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5435             Abin Thomas  <projectmonokochi@rediffmail.com>
5436             Anoob V E  <projectmonokochi@rediffmail.com>
5437             Harilal P R  <projectmonokochi@rediffmail.com>
5438
5439         Fix #57851, #72718.
5440         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5441         MemberLookup (used for error reporting) actually returns a result.
5442         Fix error report number (122, not 112).
5443
5444 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5445             Anoob V E  <projectmonokochi@rediffmail.com>
5446             Harilal P R  <projectmonokochi@rediffmail.com>
5447
5448         Fix #71134.
5449         * pending.cs (PendingImplementation.GetAbstractMethods):
5450         Find NonPublic members too.
5451
5452 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5453
5454         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5455         Fixed error 217.
5456         
5457         * class.cs (MethodCore.CheckMethodAgainstBase):
5458         Add error 239 report.
5459
5460 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5461
5462         Fix #68955.
5463         * expression.cs (Invocation.IsApplicable): Make public.
5464         (Invocation.IsParamsMethodApplicable): Likewise.
5465         * delegate.cs (Delegate.VerifyApplicability): Don't use
5466         Invocation.VerifyArgumentCompat for parameter applicability
5467         testing.  Use Invocation.IsApplicable and
5468         Invocation.IsParamsMethodApplicable.
5469
5470 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5471
5472         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5473         
5474         * class.cs (Operator.Define): Add error 217 report.
5475         
5476 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5477
5478         * namespace.cs (UsingEntry.Resolve): Undo change below.
5479
5480 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5481
5482         Fix #72756.
5483         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5484         disable the error message when the extended MemberLookup also
5485         fails.
5486         (Expression.MemberLookupFinal): Update.
5487         (SimpleName.DoSimpleNameResolve): Update.
5488         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5489         Don't use MemberLookupFinal.
5490         (New.DoResolve): Update.
5491         (BaseAccess.CommonResolve): Update.
5492
5493 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5494
5495         Fix #72732.
5496         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5497         occured previously, don't resolve again.
5498
5499 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5500
5501         Fix #69949
5502         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5503         argument. Call ResolveAttributeUsage for unresolved.
5504         when types doesn't match ctor arguments.
5505         
5506         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5507         for nested attribute classes.
5508         (Class.attribute_usage): Removed.
5509         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5510         for attribute class.
5511         
5512         * ecore.cs (IsAttribute): Removed.
5513         
5514         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5515         
5516         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5517         now normal types.
5518         (attribute_types): Removed.
5519         (EmitCode): Global attributes are emited as the latest.
5520
5521 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * class.cs (EmitFieldInitializers): Don't emit field initializer
5524         for default values when optimilization is on.
5525         
5526         * constant.cs (Constant.IsDefaultValue): New property.
5527         
5528         * driver.cs: Add /optimize handling.
5529         
5530         * constant.cs,
5531         * ecore.cs,
5532         * literal.cs: Implement new IsDefaultValue property.
5533         
5534         * rootcontext.cs (Optimize): New field, holds /optimize option.
5535
5536 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5537
5538         Fix crasher in re-opened #72347.
5539         * namespace.cs (Namespace.Lookup): Return null if
5540         DeclSpace.DefineType returns null.
5541
5542         Fix #72678.
5543         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5544
5545 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5546
5547         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5548         now returns null if it cannot resolve to an lvalue.
5549         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5550         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5551         returned null.  Remove check for SimpleName.
5552         (EventExpr.DoResolveLValue): New.
5553         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5554         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5555         error from ...
5556         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5557         avoid CS0131 error.
5558         (Unary.ResolveOperator): Move CS0211 check ...
5559         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5560         CS0131 error.
5561         (Unary.DoResolveLValue): Simplify.
5562         (AddressOf.DoResolveLValue): New.
5563         (ArrayAccess.DoResolveLValue): New.
5564
5565 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * attribute.cs (Attribute.Resolve): Add arguments casting for
5568         when types doesn't match ctor arguments.
5569
5570 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5571
5572         Fix parts of #63202.
5573         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5574         lookup of operator in base type.  Ensure that all checks happen
5575         when the operator resolves to an "op_..." method.
5576
5577 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5578
5579         Fix #71992.
5580         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5581         'ignore_cs0104' parameter.  Pass it to ...
5582         (NamespaceEntry.Lookup): ... this.
5583         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5584         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5585         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5586         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5587         Update.  Request that cs0104 errors be ignored.
5588         (ComposedCast.ResolveAsTypeStep): Update.
5589
5590 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5591
5592         Fix #59209.
5593         * expression.cs (Invocation.BetterFunction): Remove support for
5594         comparing virtual functions and their overrides.
5595         (Invocation.IsOverride): New.
5596         (Invocation.OverloadResolve): Don't consider 'override' functions
5597         during candidate selection.  Store them in a lookaside list.
5598         If the selected method is a 'virtual' function, use the list to
5599         find any overrides that are closer to the LHS type.
5600
5601 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5602
5603         * expression.cs (New.DoResolve): Add complex core type reduction.
5604         (New.Constantify): Converts complex core type syntax like 'new int ()'
5605         to simple constant.
5606         
5607 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5608
5609         * decl.cs (EntryType.EntryType): New constructor to create an
5610         updated copy of a cache entry.
5611         (MemberCache.AddMethods): Use it.
5612         (MemberCache.ClearDeclaredOnly): Remove.
5613         (MemberCache.MemberCache): Update.
5614
5615 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5616
5617         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5618         variable.  This one is represents the actual low-level declaration
5619         of the method, as opposed to the semantic level `IsStatic'.   
5620
5621         An anonymous method which is hosted into a static method might be
5622         actually an instance method.  IsStatic would reflect the
5623         container, while MethodIsStatic represents the actual code
5624         generated.
5625
5626         * expression.cs (ParameterReference): Use the new MethodIsStatic
5627         instead of IsStatic.
5628
5629         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5630         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5631         set on the current EmitContext. 
5632
5633         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5634         resolve our casted expression as an LValue.  This triggers the
5635         proper LValue processing that is later required by Assign.
5636
5637         This fixes 72347.
5638
5639         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5640
5641 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5642
5643         C# 2.0 Fixed buffer implementation
5644
5645         * anonymous.cs: Update after RegisterHelperClass renaming.
5646
5647         * attribute.cs (AttributeTester.fixed_buffer_cache):
5648         Cache of external fixed buffers.
5649         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5650         implementation if field is fixed buffer else null.
5651
5652         * class.cs
5653         (TypeContainer.AddField): Accept FieldMember instead of Field.
5654         (FieldBase.IsFieldClsCompliant): Extracted code from
5655         VerifyClsCompliance descendant customization.
5656         (FixedField): New class handles fixed buffer fields.
5657         (FixedFieldExternal): Keeps information about imported fixed
5658         buffer.
5659         (IFixedField): Make access to internal or external fixed buffer
5660         same.
5661
5662         * cs-parser.jay: Add fixed buffer parsing.
5663
5664         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5665         buffer.
5666
5667         * expression.cs (Indirection): Extended implementation to accept
5668         fixed buffer field.
5669         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5670         (ElementAccess.MakePointerAccess): Get type as parameter.
5671         (DoResolve): Add fixed buffer field expression conversion.
5672         (DoResolveLValue): Ditto.
5673         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5674         (ArrayPtr): Derives from FixedBufferPtr.
5675         (ArrayPtr.Emit): Add extra emit for array elements.
5676
5677         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5678
5679         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5680         for compiler generated types.
5681         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5682
5683         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5684         and consume less memory.
5685         (Fixed.Resolve): Add fixed buffer case.
5686
5687         * typemanager.cs (compiler_generated_attr_ctor,
5688         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5689         (HasElementType): Add our own implementation to work on every
5690         runtime.
5691
5692 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5693
5694         * anonymous.cs (CaptureContext): Track whether `this' has been
5695         referenced.   
5696
5697         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5698         only captured `this' if it was implicitly done (instance
5699         methods/variables were used). 
5700
5701         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5702         `this' must be captured.
5703
5704 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5705  
5706         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5707         is null it means that there has been no need to capture anything,
5708         so we just create a sibling.
5709
5710         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5711
5712         Just a partial fix.  The other half is fairly elusive.
5713         
5714 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5715
5716         Fix #52586, cs0121-4.cs.
5717         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5718         and return a hashtable.
5719         (MemberCache.ClearDeclaredOnly): New.
5720         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5721         the method_hash of a base type too.
5722         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5723         type methods.  Overwrite entries with the same MethodHandle so
5724         that the ReflectedType is correct.  The process leaves in base
5725         virtual functions and their overrides as distinct entries.
5726         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5727         matters since it was boxed in a ArrayList before.
5728         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5729         modifier.
5730         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5731         case of a virtual function and its override (choose the overload
5732         as better).
5733         (Invocation.OverloadResolve): Avoid 'override' members during
5734         'applicable_type' calculation.
5735
5736 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5737
5738         Combine two near-redundant caches.
5739         * typemanager.cs (method_params): Rename from method_internal_params.
5740         (TypeManager.GetParameterData): New.  Replace
5741         Invocation.GetParameterData.
5742         (TypeManager.LookupParametersByBuilder): Remove.
5743         * expression.cs (Invocation.method_parameter_cache): Remove.
5744         (Invocation.GetParameterData): Remove.
5745         Update to changes.
5746         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5747         Update to changes.
5748
5749 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5750
5751         Fix #72015.
5752         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5753         TypeManager.multicast_delegate_type is null, resolve it by looking
5754         up "System.MulticastDelegate".
5755         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5756
5757 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5758             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5759             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5760
5761         Fix cs0164.cs.
5762         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5763         (LabeledStatement.AddReference): New.  Set 'referenced'.
5764         (Goto.Resolve): Use it.
5765
5766 2005-02-05  John Luke  <john.luke@gmail.com>
5767
5768         * driver.cs: remove duplicate -doc line in Usage ()
5769
5770 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5771
5772         * location.cs (Location.AddFile): Fix CS2002 error report.
5773
5774 2005-02-02  Martin Baulig  <martin@ximian.com>
5775
5776         * delegate.cs (Delegate.DefineType): Report an internal error if
5777         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5778         details.        
5779
5780 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5781
5782         Fix a crasher in a variant of #31984.
5783         * const.cs (Constant.CheckBase): New override that defers the
5784         new-or-override check in case the base type hasn't been populated
5785         yet.
5786         (Constant.Define): Ensure the new-or-override check is performed.
5787
5788 2005-02-01  Duncan Mak  <duncan@ximian.com>
5789
5790         * const.cs (LookupConstantValue): Check that `ce' is not null
5791         before calling GetValue ().
5792
5793 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5794
5795         Fix test-334.cs (#69519).
5796         * cs-parser.jay (using_alias_directive): Pass in an expression to
5797         NamespaceEntry.UsingAlias.
5798         (using_namespace_directive): Pass in an expression to
5799         NamespaceEntry.Using.
5800         (namespace_name): Don't flatten to a string.
5801         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5802         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5803         ResolveAsTypeStep.
5804         (NamespaceEntry.UsingEntry): Likewise.
5805         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5806         changes.
5807         (NamespaceEntry.LookupForUsing): Remove.
5808         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5809         names.
5810         (NamespaceEntry.Lookup): Remove support for dotted names.
5811
5812 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5813
5814         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5815         split into two.
5816         (NamespaceEntry.ImplicitParent): Compute on demand.
5817         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5818         parallels the current.
5819         (NamespaceEntry.LookupForUsing): Use it.
5820         (NamespaceEntry.Lookup): If the current namespace-entry is
5821         implicit, don't search aliases and using tables.
5822
5823 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5824
5825         Fix #31984.
5826         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5827         BaseCache here.
5828         (TypeContainer.BaseCache): Compute on demand.
5829         (TypeContainer.FindMembers): Define constants and types if they're
5830         not already created.
5831         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5832         check.
5833         * const.cs (Constant.Define): Make idempotent.
5834
5835 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5836
5837         * pending.cs: Produce better code (no nops produced by using Ldarg
5838         + value).
5839         
5840         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5841         i - 1' it should be arg + 1.
5842
5843         Fixes bug #71819.
5844
5845 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5846
5847         * attribute.cs (Attribute.CheckAttributeType): Make private
5848         non-virtual.
5849         (Attribute.ResolveType): Make virtual.
5850         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5851         handling of RootContext.Tree.Types.
5852
5853 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5854
5855         Update attribute-handling to use the SimpleName/MemberAccess
5856         mechanisms.
5857         * cs-parser.jay (attribute): Pass in an expression to the
5858         constructors of Attribute and GlobalAttribute.
5859         * attribute.cs (Attribute): Take an expression for the name.
5860         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5861         passed in attribute name expression.
5862         (Attribute.CheckAttributeType): Use it.
5863         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5864         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5865         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5866         argument to prevent error messages if the lookup fails.
5867
5868 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5869
5870         * expression.cs (Indirection): Implemented IVariable interface
5871         to support indirection in AddressOf operator.
5872         (PointerArithmetic.Emit): Add optimalization for case where
5873         result can be precomputed.
5874
5875 2005-01-26  Martin Baulig  <martin@ximian.com>
5876
5877         * class.cs (TypeContainer.AttributeTargets): Return the correct
5878         AttributeTargets depending on our `Kind' instead of throwing an
5879         exception; fixes #71632.
5880
5881 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5882
5883         Fix #71257
5884         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5885         constant members.
5886
5887 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5888
5889         Fix #71602.
5890         * expression.cs (MemberAccess.DoResolve): Don't complain with
5891         cs0572 when the LHS of a member access has identical name and type
5892         name.
5893
5894 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5895
5896         Fix #71651, #71675
5897         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5898         CreatePermission.
5899         Create custom PermissionSet only for PermissionSetAttribute.
5900
5901 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5902
5903         Fix #71649
5904         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5905         delegates in static class.
5906
5907 2005-01-24  Martin Baulig  <martin@ximian.com>
5908
5909         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5910         merging an implicit block, just use its reachability.
5911
5912         * statement.cs (Block.Resolve): Make the unreachable code check
5913         work wrt. implicit blocks; see test-337 from #63842.
5914
5915 2005-01-21  Alp Toker  <alp@atoker.com>
5916  
5917         * cs-parser.jay: destructor_declaration's container is PartialContainer
5918         not Class when partial types are used, so use Kind prop instead of
5919         'is'.
5920         
5921 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5922
5923         * cs-parser.jay: Improve error reporting when an interface
5924         declares new types.
5925
5926 2005-01-20  Dick Porter  <dick@ximian.com>
5927
5928         * support.cs: SeekableStreamReader fix from Sandor Dobos
5929         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5930         chars are read.  Fixes bug 70369.
5931
5932 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5933
5934         * cs-parser.jay (catch_clause): Simplify current_block handling
5935         somewhat.
5936
5937 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5938
5939         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5940         code with ImplicitStandardConversion to handle the implicit
5941         conversion of method groups into valid delegate invocations. 
5942
5943         The problem is that in parameter handling we were using this code
5944         path.  Fixes bug #64698
5945
5946 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5947
5948         * cs-parser.jay: Fix several infelicities.
5949         - Avoid assigning to the parser value stack.  Code like 
5950           '$3 = null' is unclean.  Synthesize a value for the code block
5951           instead. 
5952         - Avoid using oob_stack for storing location information.  Use ...
5953         (_mark_): ... this.  New (empty) rule.  Saves the current location
5954         in $$.
5955         (foreach_statement): Avoid using oob_stack for current_block
5956         handling.  Use technique used in for_statement and
5957         using_statement.  Synthesize a value for the code block to store
5958         additional intermediate information.
5959
5960 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5961
5962         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5963         of a different type is only allowed to private fields of a
5964         containing type, not on fields of a base class.
5965
5966         See test-174.cs and error cs0122-9.cs
5967
5968 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5969
5970         Fix test-335.cs (bug #58126).
5971         * cs-parser.jay (argument): Split out non-expression parts of the
5972         rule into 'non_simple_argument'.
5973         (invocation_expression): Support parenthesized invocations with
5974         multiple arguments, and with single non-simple arguments.
5975
5976 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5977
5978         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5979         places.
5980
5981 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5982
5983         Fix cs0038-1.cs, cs1640-6.cs.
5984         * ecore.cs (Expression.Resolve): Remove special-case for
5985         SimpleName in error-handling.
5986         (Expression.almostMatchedMembers): Relax access permission to
5987         protected.
5988         (Expression.MemberLookupFailed): Handle duplicates in
5989         almostMatchedMembers list.
5990         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5991         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5992         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5993         overload if the passed in MemberInfo is a MethodBase.
5994
5995 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5996
5997         Fix #70749
5998         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5999         for non-CAS & merge permission sets properly.
6000
6001 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6002
6003         Improve standard-compliance of simple name and member access 
6004         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6005         * ecore.cs (FullNamedExpression): New abstract base class 
6006         for Namespaces and TypeExpressions.
6007         (ResolveFlags.SimpleName): Remove.
6008         (SimpleName): Remove support for dotted names.
6009         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6010         DeclSpace.FindType and DeclSpace.LookupType.
6011         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6012         (Expression.ExprClassName): Make member function.
6013         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6014         a namespace.  Remove creation of dotted "SimpleName"s.
6015         (MemberAccess.DoResolve): Likewise.
6016         * decl.cs (DeclSpace.Cache): Make private.
6017         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6018         (DeclSpace.FindType): Update.
6019         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6020         FullNamedExpression.
6021         * namespace.cs (Namespace): Derive from FullNamedExpression
6022         so that it can be part of expression resolution.
6023         (Namespace.Lookup): Return an FullNamedExpression.
6024         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6025         namespace.
6026         * rootcontext.cs (NamespaceLookup): Remove.
6027         (LookupType): Move to DeclSpace.
6028         * attribute.cs (CheckAttributeType): Update.
6029         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6030         (FindDocumentedTypeNonArray): Likewise.
6031
6032 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6033
6034         Fix cs0509.cs, cs1632.cs.
6035         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6036         is the same as IsInterface.
6037         (TypeContainer.GetClassBases): Likewise.
6038         * statement.cs (LabeledStatement.ig): New field.
6039         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6040         label.
6041         (LabeledStatement.DoEmit): Check that the label was created with
6042         the same ILGenerator.
6043
6044 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6045
6046         Fix #71058
6047         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6048         accessors to its properties.
6049
6050         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6051         from accessors to property.
6052         
6053 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6054
6055         Fix #70722
6056         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6057         only for overrides.
6058         
6059 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6060
6061         * attribute.cs: Check for null and empty strings.  
6062
6063         I have lost another battle to Paolo.
6064
6065 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6066
6067         Fix #70942
6068         * class.cs (PropertyMethod): Set Parent field in ctors.
6069         (SetMethod.InternalParameters): Add unsafe switch hack.
6070         Override MarkForDuplicationCheck where it is appropriate.
6071
6072         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6073         It says whether container allows members with the same name.
6074         Base default is no.
6075         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6076         Removed is_method parameter.
6077
6078 2005-01-06  Duncan Mak  <duncan@ximian.com>
6079
6080         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6081         because the previous change led to incorrect reporting of CS1032
6082         ("Cannot define/undefine preprocessor symbols after first token in
6083         file"). Instead of using `tokens_seen' as the only flag that
6084         triggers CS1040, introduce `comments_seen'. This new flag is used
6085         to signify having seen comments on the current line, so it is
6086         unset after a newline.
6087
6088 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6089
6090         * doc.cs : When searching for a type, find nested type too.
6091           This fixes bug #71040.
6092
6093 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6094
6095         * doc.cs :
6096           - Warn missing member comment on those classes which also does not
6097             have doc comments. Fixed bug #71041.
6098           - Don't warn missing doc comment on default constructor.
6099             Fixed bug #71042.
6100
6101 2005-01-06  Duncan Mak  <duncan@ximian.com>
6102
6103         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6104         comments, set `tokens_seen' to true. This allows us to detect
6105         misplaced preprocessor directives (i.e. not at the beginning of
6106         the a line, nor after whitespaces). In that case, report error
6107         CS1040. This fixes bug #56460.
6108
6109         * cs-parser.jay (interface_member_declaration): Add checks for
6110         IsExplicitImpl, and report CS0541 error if an interface member is
6111         defined as an explicit interface declaration.
6112
6113 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6114
6115         Fix #70817
6116         * class.cs (PropertyMethod): Set Parent field in ctors.
6117         (SetMethod.InternalParameters): Add unsafe switch hack.
6118         
6119         * decl.cs (MemberCore.Parent): Cannot be readonly.
6120
6121 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6122
6123         * decl.cs (DeclSpace.ResolveType): Remove.
6124         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6125         Merge in code from ...
6126         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6127         * class.cs, enum.cs: Update to changes.
6128
6129 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6130
6131         * anonymous.cs: Ensure that we init the scope of our parent if it
6132         has not been initialized yet.
6133
6134 2004-12-30  Duncan Mak  <duncan@ximian.com>
6135
6136         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6137         if field.FieldBuilder is null. Fixes #70758.
6138
6139         * convert.cs: Fixed some typos and updated some of the comments.
6140         (ImplicitStandardConversionExists):
6141         (TryImplicitIntConversion): If `target_type' is an interface and
6142         the type of `ic' implements this interface, return true or a new
6143         BoxedCast instead of null. This fixes #70468.
6144
6145 2004-12-29  Duncan Mak  <duncan@ximian.com>
6146
6147         * expression.cs (Argument.Emit): Check that Expr is
6148         IMemoryLocation before casting to it, and report CS1510 otherwise.
6149
6150         This fixes #70402.
6151
6152 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6153
6154         * statement.cs (Block.ThisVariable): remove the recursion here, to
6155         make the --profile more sane.
6156
6157 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6158
6159         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6160         assembly, by JB Evain.
6161
6162 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6163
6164         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6165           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6166         "parent" refers to enclosing type/class.  "base" refers to superclass.
6167
6168 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6169
6170         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6171         Ensure that we only have GlobalAttributes.
6172         * attribute.cs (Attribute.Emit): Make non-virtual.
6173         (GlobalAttribute.Emit): Remove.
6174         (Attribute.Resolve): Make virtual.
6175         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6176         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6177         the argument. Don't create one.
6178         (Attribute.GetObsoleteAttribute): Likewise.
6179         (Attribute.GetClsCompliantAttributeValue): Likewise.
6180         * class.cs, decl.cs: Update to changes.
6181
6182 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6183
6184         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6185         
6186         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6187         
6188         * statement.cs (Foreach.Resolve): Add error 186 report.
6189
6190 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6191
6192         * expression.cs (Conditional.DoResolve): Add warning 429.
6193         
6194         * statement.cs (If.Resolve): Add warning 665.
6195
6196 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6197
6198         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6199         except when in the parser, and in GlobalAttribute.
6200         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6201         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6202         RootContext.Tree.Types.NamespaceEntry once work is done.
6203         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6204         and resets RootContext.Tree.Types.NamespaceEntry.
6205
6206 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6207
6208         * cs-parser.jay: Don't create a block for every variable.
6209
6210 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6211
6212         * location.cs: Provide extra information.
6213
6214         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6215         variables from the captured environment, it is the ldarg_0.
6216
6217 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6218
6219         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6220         find a conclusion.
6221         
6222         * class.cs: Changed warning level for 169 to avoid developer
6223         displeasure from warning flooding. It will be changed back when they
6224         fix most of current BCL warnings.
6225         
6226         * RootContext.cs: Pushed default WarningLevel to 3.
6227         
6228         * statement.cs: Removed unused variable.
6229
6230 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6231
6232         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6233         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6234         Add error 502 report.
6235         (StaticClass.DefineType): Add error 441 report.
6236         (Class.AllowedModifiersProp): New virtual property as temporary
6237         extension to AllowedModifiers.
6238         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6239         to share implementation with StaticClass and don't call virtual
6240         methods from ctor.
6241         
6242         * driver.cs (MainDriver): Add error 1558 test.
6243
6244         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6245         report. Moved error 36 test here.
6246
6247         * statement.cs (Throw.Resolve): Add error 724 report.
6248
6249         * typemanager.cs: Add out_attribute_type core type.
6250         
6251 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6252
6253         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6254         3018 report.
6255         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6256
6257         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6258         3017 report.
6259         
6260         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6261
6262         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6263         Add error 3023 report.
6264         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6265
6266         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6267         implementation.
6268
6269 2004-12-12  John Luke  <john.luke@gmail.com>
6270
6271         * driver.cs (AddArgs): take -- into account when
6272         adding arguments, fixes bug 65710 
6273
6274 2004-12-12  Martin Baulig  <martin@ximian.com>
6275
6276         * expression.cs (Unary.TryReduceNegative): Added support for
6277         SByteConstant and ByteConstant.
6278         (Unary.Reduce): Check error values from TryReduceNegative().
6279
6280 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6281
6282         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6283         and report exception as error 182.
6284
6285 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6286
6287         * driver.cs (Main): Fix message when there are warnings.
6288
6289 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6290
6291         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6292
6293 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6294
6295         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6296         Reduced number of warnings.
6297         
6298         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6299
6300 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6301
6302         * driver.cs: Removed message.
6303
6304         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6305
6306 2004-12-08    <vargaz@freemail.hu>
6307
6308         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6309
6310 2004-12-08  Martin Baulig  <martin@ximian.com>
6311
6312         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6313         instead of a CS3002 for properties and indexer.
6314
6315 2004-12-08  Martin Baulig  <martin@ximian.com>
6316
6317         * decl.cs (MemberName.ToString): Make this work again.
6318
6319 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6320
6321         * attribute.cs (Resolve): Add error 591 detection.
6322
6323         * class.cs (FieldMember.Define): Add error 1547 detection.
6324         (Indexer.Define): Add error 620 detection.
6325         (Operator.Define): Add error 590 detection.
6326
6327         * ecore.cs: Missing argument for error 79.
6328
6329         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6330         detection.
6331
6332 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6333
6334         Fix #70106
6335         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6336         only.
6337
6338 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6339
6340         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6341           Some operator comments were suppressed.
6342         * doc.cs : Implicit/explicit operator name in doc comments are like
6343           "op_Explicit(type)~returnType", so added suffix handling.
6344
6345 2004-12-07  Martin Baulig  <martin@ximian.com>
6346
6347         * decl.cs
6348         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6349         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6350         (DeclSpace.ec): New protected field; store the EmitContext here.
6351         (DeclSpace.EmitContext): New public property; moved here from
6352         `TypeContainer'.
6353         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6354         EmitContext.
6355
6356         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6357         (Enum.Emit): Don't create a new EmitContext.
6358
6359         * delegate.cs (Delegate.DefineType): Always create the
6360         EmitContext.
6361
6362         * iterators.cs (Iterators.DefineIterator): Create a new
6363         EmitContext and store it in `ec'.
6364
6365 2004-08-24  Martin Baulig  <martin@ximian.com>
6366
6367         * typemanager.cs
6368         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6369         this for accessibility checks.
6370         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6371         IsNestedFamilyAccessible.
6372         (TypeManager.IsSubclassOf): New method, do what the name actually
6373         says.   
6374
6375 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6376
6377         Fix crash on cs0657-17.cs.
6378         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6379         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6380         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6381         the case where the NamespaceEntry gets overwritten.
6382
6383 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6384
6385         Fixed #69195, #56821
6386         * ecore.cs (ResolveBoolean): Tiny refactoring.
6387
6388         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6389         of right expression resolving when left is false constant and
6390         operator is LogicalAnd OR true constant and operator is LogicalOr.
6391
6392         * statement.cs (ResolveUnreachable): Always reports warning.
6393
6394 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6395
6396         * class.cs: Distinguish between 1721 and 1722 (just a little help
6397         for the programmer).
6398
6399 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6400
6401         * delegate.cs: Only allow this on new versions of the language. 
6402
6403 2004-12-02  Duncan Mak  <duncan@ximian.com>
6404
6405         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6406         Expression class.
6407         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6408         here as a static method. Take an additional bool out parameter
6409         `must_do_cs1540_check' for signaling to InstanceResolve.
6410         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6411         member field from PropertyExpr class and made it an argument of
6412         the method instead.
6413         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6414         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6415         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6416         and `remove_accessor' as well as InstanceResolve: report CS0122
6417         where applicable.
6418
6419         Fixes #70129.
6420
6421 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6422
6423         Fix test-327.cs, test-328.cs, and put in early infrastructure
6424         for eventually fixing #52697.
6425         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6426         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6427         from other methods.
6428         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6429         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6430         (VerifyUsing, error246): Update.
6431         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6432         'NamespaceEntry.LookupNamespaceOrType'.
6433
6434 2004-12-03  Martin Baulig  <martin@ximian.com>
6435
6436         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6437         method as our child, call AnonymousMethod.Compatible() on it.
6438
6439 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6440
6441         Disable XML documentation support in 'basic' profile.
6442         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6443         Redirect XmlElement to System.Object.
6444         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6445         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6446         * mcs.exe.sources: Add doc-bootstrap.cs.
6447         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6448         of doc.cs.
6449
6450 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6451
6452         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6453           comments are allowed.
6454
6455 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6456
6457         * delegate.cs: Add checks for subtypes in paramaters and return values
6458         in VerifyMethod () to add support for Covariance/Contravariance
6459         in delegates.
6460         
6461 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6462
6463         * report.cs: Remove extra closing parenthesis.
6464
6465         * convert.cs (Error_CannotImplicitConversion): If the name of the
6466         types are the same, provide some extra information.
6467
6468         * class.cs (FieldBase): Use an unused bit field from the field to
6469         encode the `has_offset' property from the FieldMember.  This saves
6470         a couple of Ks on bootstrap compilation.
6471
6472         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6473         method as our child, return the AnonymousMethod resolved
6474         expression.
6475
6476         * expression.cs (New.DoResolve): Allow return values from
6477         NewDelegate to also include AnonymousMethods.
6478
6479         Fixes #70150.
6480
6481 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6482
6483         Fix bug #70102
6484         * attribute.cs (Resolve): Improved implementation of params
6485         attribute arguments.
6486
6487         * support.cs (ParameterData): Add HasParams to be faster.
6488
6489 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6490
6491         all things are for /doc support:
6492
6493         * doc.cs: new file that supports XML documentation generation.
6494         * mcs.exe.sources: added doc.cs.
6495         * driver.cs:
6496           Handle /doc command line option.
6497           Report error 2006 instead of 5 for missing file name for /doc.
6498           Generate XML documentation when required, after type resolution.
6499         * cs-tokenizer.cs:
6500           Added support for picking up documentation (/// and /** ... */),
6501           including a new XmlCommentState enumeration.
6502         * cs-parser.jay:
6503           Added lines to fill Documentation element for field, constant,
6504           property, indexer, method, constructor, destructor, operator, event
6505           and class, struct, interface, delegate, enum.
6506           Added lines to warn incorrect comment.
6507         * rootcontext.cs :
6508           Added Documentation field (passed only when /doc was specified).
6509         * decl.cs:
6510           Added DocComment, DocCommentHeader, GenerateDocComment() and
6511           OnGenerateDocComment() and some supporting private members for
6512           /doc feature to MemberCore.
6513         * class.cs:
6514           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6515         * delegate.cs:
6516           Added overriden DocCommentHeader.
6517         * enum.cs:
6518           Added overriden DocCommentHeader and GenerateDocComment().
6519
6520 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6521
6522         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6523         unwrapping the enumeration values, chain to
6524         DoConstantNumericPromotions again, so we can promote things to the
6525         fundamental types (takes care of enums that are bytes, sbytes).
6526
6527         Fixes bug #62054.
6528
6529 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6530
6531         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6532         Fix long-standing bug in type-lookup.  Use FindType instead of
6533         LookupType when ec.ResolvingTypeTree.
6534         (Attribute.ResolveType, Attribute.Resolve)
6535         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6536         Update to changes.
6537         (Attributes.Search): Remove internal version.  Update.
6538         (Attributes.SearchMulti): Update.
6539         (Attributes.GetClsCompliantAttribute): Remove.
6540         (Attributes.GetIndexerNameAttribute): Remove.
6541         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6542         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6543         * class.cs (Indexer.Define): Likewise.
6544
6545 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6546
6547         Fix bug #68790
6548         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6549         MarshallByReference members access.
6550
6551         * expression.cs: Use CheckMarshallByRefAccess;
6552         Better error CS0197 message.
6553
6554         * report.cs: Print whole related error message.
6555
6556 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6557
6558         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6559         the current directory to help debugging.
6560
6561 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6562
6563         * class (GetClassBases): Better error 60 report.
6564         (EventProperty): Disabled warning 67 detection.
6565
6566 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6567
6568         Fix bug #60324
6569         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6570
6571         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6572         precise values.
6573
6574 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6575
6576         Fix bug #49488
6577         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6578
6579         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6580
6581 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6582
6583         * attribute.cs (Attribute.Resolve): Refine error reporting and
6584         report a cs0117 if the identifier does not exist, to distinguish
6585         from 0617 which is a miss-use of the actual identifier.
6586
6587         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6588         between cs0070 and cs0079.
6589
6590         * class.cs (MemberBase.DoDefine): When reporting a wrong
6591         accessibility level, we use MethodCore to compare instead of
6592         Method (this was a regression in some refactoring effort).
6593
6594         So now we correctly report cs0056 again.
6595
6596         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6597         testing the target_type (which was known to be object_type) and
6598         not the source type (which is anonymous_method).
6599
6600         Fixed reporting of error cs1660.
6601
6602         * expression.cs (UserCast.Source): Expose the underlying cast.
6603
6604         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6605         allowed types to find a match to int32 first (most common).
6606
6607         In addition, it ignores any ImplicitUserConversions that did an
6608         internal implicit conversion (as the switch statement allows only
6609         one integral conversion to exist).
6610
6611         * class.cs (PartialContainer.Create): rename `name' to
6612         `member_name' for clarity.  Then replace the string calls with a
6613         call to MemberName.GetPartialName, as now using
6614         MemberName.ToString is an error (this is due to the side effects
6615         it had, that were fixed in the past).
6616
6617         This will restore the error reporting on a number of partial class
6618         errors that were missusing this (and getting an exception as a
6619         results, which is now just a plain textual warning, because
6620         yyparse debug output would crash otherwise).
6621
6622 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6623
6624         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6625
6626 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6627
6628         * rootcontext.cs (LookupType): Make sure to cache lookups that
6629         don't give us a negative result. This saves about 5% of corlib
6630         compilation time.
6631
6632 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6633
6634         * report.cs (AbstractMessage.Print): messages are sent to stderr
6635
6636         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6637         non-interface in the list of interfaces (at this point, either
6638         parent was properly set, or a base class is being listed in the
6639         interfaces section).
6640
6641         This flags error 1722, and resolves the crash from bug 69259.
6642
6643 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6644
6645         * statement.cs (Using.EmitExpressionFinally): make this work right
6646         for valuetypes. Fixes 69926.
6647
6648 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6649
6650         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6651         converted to an enum" here, before we try to change the underlying
6652         type.  This code exists, but it is a different code path than the
6653         one used while encoding constants.
6654
6655         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6656         old bug: when converting from the null literal to a pointer,
6657         return an EmptyCast, not the NullLiteral.
6658
6659         This fixes #69921, the recent null_type changes probably made this
6660         bug more prominent.
6661
6662         (ImplicitReferenceConversionExists): In addition, resynchronized
6663         the code here, so it matches the same code in
6664         ImplicitReferenceConversionExists for the `from any class-type S
6665         to any interface-type T'.
6666         
6667
6668 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6669
6670         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6671
6672 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * cs-parser.jay: Use verbosity accordingly. 
6675
6676 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6677
6678         * expression.cs (Unary.ResolveOperator): Do not report warning;
6679         AddressOf reads from variable.
6680         
6681         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6682
6683 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6684
6685         Fix bug #69462
6686
6687         * attribute.cs (Attributable): Removed CheckTargets.
6688         (Attributes.Emit): Explicit attribute targets are tested here.
6689
6690         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6691         not enabled for interfaces.
6692
6693         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6694         (GetAssemblyName): Ouch next bug there.
6695
6696 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6697
6698         * expression.cs: Error 275 added.
6699         
6700 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6701
6702         Fix bug #69177 (Implemented decimal constant support)
6703
6704         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6705         (BinaryFold): Add DecimalConstant.
6706
6707         * const.cs (Define): Decimal constant 
6708         (is not constant.
6709         (ChangeType): Add decimal type handling.
6710         (LookupConstantValue): Don't set value for decimal type but
6711         emit DecimalConstantAttribute. Needed for constant optimization.
6712
6713         * constant.cs (ToDecimal): New method.
6714         (ConvertToDecimal): New method.
6715         (IntConstant): Implemented ConvertToDecimal.
6716         (DecimalConstant.Emit): Emit optimized version for decimals in
6717         int range.
6718
6719         * expression.cs (ResolveOperator): Changed order of constant
6720         reduction to work correctly with native types which have
6721         overloaded operators.
6722         (ResolveMemberAccess): Extract constant value from attribute
6723         for decimal type.
6724
6725         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6726
6727         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6728         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6729         (ChangeType): Decimal is special.
6730         (TypeToCoreType): Add decimal type.
6731
6732 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6733
6734         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6735         decimal types.
6736
6737 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6738
6739         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6740         test cs1667-5.cs.
6741
6742 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6743
6744         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6745
6746         * pending.cs (PendingImplementation): Grab only interfaces.
6747
6748 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6749
6750         * statement.cs (ForeachHelperMethods): Add location member and
6751         error 202 detection.
6752
6753 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6754
6755         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6756         automatically handled by executable.make.
6757         (PROGRAM): Make profile-specific.
6758
6759 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6760
6761         * expression.cs (DoResolveBase): Fixed wrong warning for out
6762         variables.
6763
6764 2004-11-18  Martin Baulig  <martin@ximian.com>
6765
6766         Merged latest changes into gmcs.  Please keep this comment in
6767         here, it makes it easier for me to see what changed in MCS since
6768         the last time I merged.
6769
6770 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6771
6772         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6773         (TypeHandle.GetMemberCache): New.
6774         (TypeHandle.TypeHandle): Update.
6775         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6776         (TypeManager.LookupParentInterfacesCache):
6777         Rename from LookupInterfaceCache.  Optimize slightly.
6778         (TypeManager.MemberLookup_FindMembers): Update.
6779         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6780         multi-type variant.
6781         (AddCacheContents): Rename from AddHashtable.
6782         * class.cs (TypeContainer.parent_container): Remove.
6783         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6784         (TypeContainer.DoDefineMembers): Don't initialize it.
6785         Update to name changes.
6786         
6787 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6788
6789         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6790         that factors the code to check access modifiers on override.  
6791
6792         (PropertyBase): Use the code here.
6793
6794         Patch from Lluis S'anchez, fixes bug #69361.
6795
6796 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6797
6798         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6799         routine that is used to report the use of a captured variable
6800         whose address has been taken.
6801
6802         There are two checks: one when variables are being captured and
6803         the other check is when the address of a variable is taken. 
6804         
6805         (because an anonymous methods might be resolved before *or* after
6806         the address has been taken) and 
6807
6808         * expression.cs (Conditional.DoResolve): Remove the special
6809         casing that Martin added to trueExpr and falseExpr being both
6810         NullLiteral.  We get the right behavior now just by introducing
6811         the null_type into the compiler. 
6812
6813         * convert.cs (ExplicitConversion): Change the code to use
6814         null_type instead of testing `expr is NullLiteral'.
6815         (ImplicitConversionStandard): use null_type too.
6816         (ImplicitReferenceConversionExists): use null_type too.
6817         (ImplicitReferenceConversion): use null_type too.
6818
6819         * literal.cs: The type of `NullLiteral' is now null_type instead
6820         of object_type. 
6821         (Resolve): Set the type here.
6822
6823         * typemanager.cs: Introduce null_type.
6824
6825 2004-11-17  Martin Baulig  <martin@ximian.com>
6826
6827         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6828         direction, like FindMembers() does.  Fixes #69546, testcase is in
6829         test-315.cs.    
6830
6831 2004-11-16  Martin Baulig  <martin@ximian.com>
6832
6833         This is based on a patch from Marek Safar, see bug #69082.
6834         Fixes bugs #63705 and #67130.
6835
6836         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6837         method; create a MemberCache for an interface type and cache the
6838         result.
6839
6840         * decl.cs (IMemberContainer.ParentContainer): Removed.
6841         (IMemberContainer.ParentCache): New property.
6842         (MemberCache.SetupCacheForInterface): Removed.
6843         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6844         to create a cache for an interface's "parent".
6845
6846         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6847         interfaces too.
6848
6849 2004-11-16  Martin Baulig  <martin@ximian.com>
6850
6851         Merged back from gmcs; these changes already went into gmcs a
6852         couple of weeks ago.
6853
6854         * typemanager.cs
6855         (TypeManager.AddUserType): Removed the `ifaces' argument.
6856         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6857         `TypeExpr []'.
6858         (TypeManager.AddUserInterface): Removed.
6859         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6860         `TypeExpr []'.
6861         (TypeManager.GetInterfaces): Likewise.
6862         (TypeManager.GetExplicitInterfaces): Likewise.
6863
6864         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6865
6866         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6867         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6868
6869 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6870
6871         * statement.cs: Avoid adding bools to a hashtable.
6872
6873 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6876         calling an unsafe method from a safe location.
6877
6878 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6879
6880         Fix #69167
6881         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6882
6883 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6884
6885         * namespace.cs (VerifyUsing): use GetPartialName instead of
6886         ToString. 
6887
6888 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6889
6890         * statement.cs (Return.Resolve): Fix regression in typo: if
6891         `in_exc', we have to request a NeedReturnLabel, this was a typo
6892         introduced in the anonymous method check-in.  Fixes #69131.
6893
6894         * Indexers were using the ShortName when defining themselves,
6895         causing a regression in the compiler bootstrap when applying the
6896         patch from 2004-11-02 (first part), now they use their full name
6897         and the bug is gone.
6898
6899 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6900
6901         * driver.cs: Strip the path from the names of embedded resources. Fixes
6902         #68519.
6903
6904 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6905
6906         Fix error message regression: cs0104-2.cs.
6907         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6908         (AliasEntry.Resolve): Update.
6909         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6910         'silent' flag.
6911         (RootContext.LookupType): Update.
6912
6913 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6914
6915         * cs-parser.jay: Add support for handling accessor modifiers
6916         * class: Add support port accessor modifiers and error checking,
6917         define PropertyMethod.Define as virtual (not abstract anymore)
6918         * ecore.cs: Add checking for proeprties access with access modifiers
6919         * iterators.cs: Modify Accessor constructor call based in the modified
6920         constructor
6921 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6922
6923         * expression.cs (StringConcat): Handle being called twice,
6924         as when we have a concat in a field init with more than two
6925         ctors in the class
6926
6927 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6928
6929         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6930         special case explicit implementations, we should always produce
6931         the .property or .event declaration.
6932         
6933         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6934         since it will not return correct data if people use this
6935         unresolved in the presence of using statements (see test-313).
6936
6937         * class.cs (MethodData.Define): If we are an explicit interface
6938         implementation, set the method name to the full name of the
6939         interface plus the name of the method.  
6940
6941         Notice that using the method.MethodName.GetFullName() does not
6942         work, as it will only contain the name as declared on the source
6943         file (it can be a shorthand in the presence of using statements)
6944         and not the fully qualifed type name, for example:
6945
6946         using System;
6947
6948         class D : ICloneable {
6949                 object ICloneable.Clone ()  {
6950                 }
6951         }
6952
6953         Would produce a method called `ICloneable.Clone' instead of
6954         `System.ICloneable.Clone'.
6955
6956         * namespace.cs (Alias.Resolve): Use GetPartialName.
6957         
6958 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6959
6960         * cs-parser.jay: Add error 1055 report.
6961
6962 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6963
6964         * assign.cs (Assign.DoResolve): Only do the transform of
6965         assignment into a New if the types are compatible, if not, fall
6966         through and let the implicit code deal with the errors and with
6967         the necessary conversions. 
6968
6969 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6970
6971         * cs-parser.jay: Add error 1031 report.
6972
6973         * cs-tokenizer.cs: Add location for error 1038.
6974
6975 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6976
6977         * cs-parser.jay: Add error 1016 report.
6978
6979 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6980
6981         * cs-parser.jay: Add errors 1575,1611 report.
6982
6983 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6984
6985         * cs-parser.jay: Add error 1001 report.
6986
6987 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6988
6989         Fix #68850
6990         * attribute.cs (GetMarshal): Add method argument for
6991         caller identification.
6992
6993         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6994         agument for GetMarshal and RuntimeMissingSupport.
6995
6996 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6997
6998         * attribute.cs (ExtractSecurityPermissionSet): Removed
6999         TypeManager.code_access_permission_type.
7000
7001         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7002
7003 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7004
7005         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7006         for obsolete use of a variable here.   Fixes regression on errors
7007         cs0619-25 and cs0619-26.
7008
7009 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7010
7011         Fix #62358, implemented security attribute encoding.
7012
7013         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7014         Tests permitted SecurityAction for assembly or other types.
7015         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7016         data from SecurityPermissionAttribute to PermisionSet class.
7017
7018         * class.cs (ApplyAttributeBuilder): Added special handling
7019         for System.Security.Permissions.SecurityAttribute based types.
7020
7021         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7022         special handling for System.Security.Permissions.SecurityAttribute
7023         based types.
7024
7025         * enum.cs (ApplyAttributeBuilder): Added special handling
7026         for System.Security.Permissions.SecurityAttribute based types.
7027
7028         * parameter.cs (ApplyAttributeBuilder): Added special handling
7029         for System.Security.Permissions.SecurityAttribute based types.
7030
7031         * rootcontext.cs: Next 2 core types.
7032
7033         * typemanager.cs (TypeManager.security_permission_attr_type):
7034         Built in type for the SecurityPermission Attribute.
7035         (code_access_permission_type): Build in type.
7036
7037 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7038
7039         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7040         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7041         all of this information into
7042         EmitContext.EmitCapturedVariableInstance.
7043         
7044         * codegen.cs (EmitCapturedVariableInstance): move here the
7045         funcionality of emitting an ldarg.0 in the presence of a
7046         remapping.   This centralizes the instance emit code.
7047
7048         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7049         then emit a load of this: it means that we have reached the
7050         topmost ScopeInfo: the one that contains the pointer to the
7051         instance of the class hosting the anonymous method.
7052
7053         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7054         captures to the topmost CaptureContext.
7055
7056 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7057
7058         * expression.cs (LocalVariableReference): Move the knowledge about
7059         the iterators into codegen's EmitCapturedVariableInstance.
7060
7061 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7062
7063         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7064         all code paths return a value from an anonymous method (it is the
7065         same as the 161 error, but for anonymous methods).
7066
7067 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7068
7069         The introduction of anonymous methods in the compiler changed
7070         various ways of doing things in the compiler.  The most
7071         significant one is the hard split between the resolution phase
7072         and the emission phases of the compiler.
7073
7074         For instance, routines that referenced local variables no
7075         longer can safely create temporary variables during the
7076         resolution phase: they must do so from the emission phase,
7077         since the variable might have been "captured", hence access to
7078         it can not be done with the local-variable operations from the runtime.
7079         
7080         * statement.cs 
7081
7082         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7083         is a toplevel block.
7084
7085         (ToplevelBlock): A new kind of Block, these are the blocks that
7086         are created by the parser for all toplevel method bodies.  These
7087         include methods, accessors and anonymous methods.
7088
7089         These contain some extra information not found in regular blocks:
7090         A pointer to an optional CaptureContext (for tracking captured
7091         local variables and parameters).  A pointer to the parent
7092         ToplevelBlock.
7093         
7094         (Return.Resolve): Catch missmatches when returning a value from an
7095         anonymous method (error 1662).
7096         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7097         phase.
7098
7099         (Break.Resolve): ditto.
7100
7101         (SwitchLabel): instead of defining the labels during the
7102         resolution phase, we now turned the public ILLabel and ILLabelCode
7103         labels into methods called GetILLabelCode() and GetILLabel() that
7104         only define the label during the Emit phase.
7105
7106         (GotoCase): Track the SwitchLabel instead of the computed label
7107         (its contained therein).  Emit the code by using
7108         SwitchLabel.GetILLabelCode ().
7109
7110         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7111         whether the Local has been captured or not.
7112
7113         (LocalInfo.IsCaptured): New property, used to tell whether the
7114         local has been captured.
7115         
7116         * anonymous.cs: Vastly updated to contain the anonymous method
7117         support.
7118
7119         The main classes here are: CaptureContext which tracks any
7120         captured information for a toplevel block and ScopeInfo used to
7121         track the activation frames for various local variables.   
7122
7123         Each toplevel block has an optional capture context associated
7124         with it.  When a method contains an anonymous method both the
7125         toplevel method and the anonymous method will create a capture
7126         context.   When variables or parameters are captured, they are
7127         recorded on the CaptureContext that owns them, for example:
7128
7129         void Demo () {
7130              int a;
7131              MyDelegate d = delegate {
7132                  a = 1;
7133              }
7134         }
7135
7136         Here `a' will be recorded as captured on the toplevel
7137         CapturedContext, the inner captured context will not have anything
7138         (it will only have data if local variables or parameters from it
7139         are captured in a nested anonymous method.
7140
7141         The ScopeInfo is used to track the activation frames for local
7142         variables, for example:
7143
7144         for (int i = 0; i < 10; i++)
7145                 for (int j = 0; j < 10; j++){
7146                    MyDelegate d = delegate {
7147                         call (i, j);
7148                    }
7149                 }
7150
7151         At runtime this captures a single captured variable `i', but it
7152         captures 10 different versions of the variable `j'.  The variable
7153         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7154         recorded on a child.  
7155
7156         The toplevel ScopeInfo will also track information like the `this'
7157         pointer if instance variables were referenced (this is necessary
7158         as the anonymous method lives inside a nested class in the host
7159         type of the method). 
7160
7161         (AnonymousMethod): Expanded to track the Toplevel, implement
7162         `AnonymousMethod.Compatible' to tell whether an anonymous method
7163         can be converted to a target delegate type. 
7164
7165         The routine now also produces the anonymous method content
7166
7167         (AnonymousDelegate): A helper class that derives from
7168         DelegateCreation, this is used to generate the code necessary to
7169         produce the delegate for the anonymous method that was created. 
7170
7171         * assign.cs: API adjustments for new changes in
7172         Convert.ImplicitStandardConversionExists.
7173
7174         * class.cs: Adjustments to cope with the fact that now toplevel
7175         blocks are of type `ToplevelBlock'. 
7176
7177         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7178         insteda of standard blocks.
7179
7180         Flag errors if params arguments are passed to anonymous methods.
7181
7182         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7183         `CurrentAnonymousMethod' which points to the current Anonymous
7184         Method.  The variable points to the AnonymousMethod class that
7185         holds the code being compiled.  It is set in the new EmitContext
7186         created for the anonymous method.
7187
7188         (EmitContext.Phase): Introduce a variable and an enumeration to
7189         assist in enforcing some rules about when and where we are allowed
7190         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7191         only one that enfonces this right now).
7192
7193         (EmitContext.HaveCaptureInfo): new helper method that returns
7194         whether we have a CapturedContext initialized.
7195
7196         (EmitContext.CaptureVariable): New method used to register that a
7197         LocalInfo must be flagged for capturing. 
7198
7199         (EmitContext.CapturedParameter): New method used to register that a
7200         parameters must be flagged for capturing. 
7201         
7202         (EmitContext.CapturedField): New method used to register that a
7203         field must be flagged for capturing. 
7204
7205         (EmitContext.HaveCapturedVariables,
7206         EmitContext.HaveCapturedFields): Return whether there are captured
7207         variables or fields. 
7208
7209         (EmitContext.EmitMethodHostInstance): This is used to emit the
7210         instance for the anonymous method.  The instance might be null
7211         (static methods), this (for anonymous methods that capture nothing
7212         and happen to live side-by-side with the current method body) or a
7213         more complicated expression if the method has a CaptureContext.
7214
7215         (EmitContext.EmitTopBlock): Routine that drives the emission of
7216         code: it will first resolve the top block, then emit any metadata
7217         and then emit the code.  The split is done so that we can extract
7218         any anonymous methods and flag any captured variables/parameters.
7219         
7220         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7221         during this phase, the ILGenerator should not be used as labels
7222         and local variables declared here might not be accessible to any
7223         code that is part of an anonymous method.  
7224
7225         Exceptions to this include the temporary variables that are
7226         created by some statements internally for holding temporary
7227         variables. 
7228         
7229         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7230         metadata for a cb
7231
7232         (EmitContext.TemporaryReturn): This method is typically called
7233         from the Emit phase, and its the only place where we allow the
7234         ReturnLabel to be defined other than the EmitMeta.  The reason is
7235         that otherwise we would have to duplicate a lot of logic in the
7236         Resolve phases of various methods that today is on the Emit
7237         phase. 
7238
7239         (EmitContext.NeedReturnLabel): This no longer creates the label,
7240         as the ILGenerator is not valid during the resolve phase.
7241
7242         (EmitContext.EmitThis): Extended the knowledge in this class to
7243         work in anonymous methods in addition to iterators. 
7244
7245         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7246         code is necessary on the stack to access the instance to a local
7247         variable (the variable will be accessed as a field).
7248
7249         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7250         EmitContext.EmitAddressOfParameter): Routines to support
7251         parameters (not completed at this point). 
7252         
7253         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7254         will also remove the parameters.
7255
7256         * convert.cs (Convert): Define a `ConstantEC' which points to a
7257         null.  This is just to prefity some code that uses
7258         ImplicitStandardConversion code and do not have an EmitContext
7259         handy.
7260
7261         The idea is to flag explicitly that at that point in time, it is
7262         known that the conversion will not trigger the delegate checking
7263         code in implicit conversions (which requires a valid
7264         EmitContext). 
7265
7266         Everywhere: pass new EmitContext parameter since
7267         ImplicitStandardConversionExists now requires it to check for
7268         anonymous method conversions. 
7269
7270         (Convert.ImplicitStandardConversionExists): If the type of an
7271         expression is the anonymous_method_type, and the type is a
7272         delegate, we invoke the AnonymousMethod.Compatible method to check
7273         whether an implicit conversion is possible. 
7274
7275         (Convert.ImplicitConversionStandard): Only do implicit method
7276         group conversions if the language level is not ISO_1.
7277
7278         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7279         MethodInfo for the Invoke method.  used by Delegate and
7280         AnonymousDelegate.
7281
7282         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7283         method conversions if the target type is a delegate.
7284
7285         Removed extra debugging nops.
7286
7287         (LocalVariableReference): Turn the `local_info' into a public
7288         field. 
7289
7290         Add `prepared' field, the same hack used for FieldExprs to cope
7291         with composed assignments, as Local variables do not necessarily
7292         operate purely on the stack as they used to: they can be captured
7293         fields. 
7294
7295         Add `temp' for a temporary result, like fields.
7296
7297         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7298
7299         It now copes with Local variables that are captured and emits the
7300         proper instance variable to load it from a field in the captured
7301         case. 
7302
7303         (ParameterReference.DoResolveBase): During the resolve phase,
7304         capture parameters if we are in an anonymous method.
7305
7306         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7307         anonymous method, use the EmitContext helper routines to emit the
7308         parameter reference.
7309
7310         * iterators.cs: Set RemapToProxy to true/false during the
7311         EmitDispose class.
7312
7313         * parameters.cs (GetParameterByName): New helper method. 
7314
7315         * typemanager.cs (anonymous_method_type) a new type that
7316         represents an anonyous method.  This is always an internal type,
7317         used as a fencepost to test against the anonymous-methodness of an
7318         expression. 
7319         
7320 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7321
7322         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7323         561 report.
7324         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7325
7326 2004-10-18  Martin Baulig  <martin@ximian.com>
7327
7328         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7329         `Type' directly, but call ResolveType() on it.
7330         (Catch.Resolve): Likewise.
7331         (Foreach.Resolve): Likewise.
7332
7333 2004-10-18  Martin Baulig  <martin@ximian.com>
7334
7335         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7336         `Type' directly, but call ResolveType() on it.
7337         (Probe.DoResolve): Likewise.
7338         (ArrayCreation.LookupType): Likewise.
7339         (TypeOf.DoResolve): Likewise.
7340         (SizeOf.DoResolve): Likewise.
7341
7342 2004-10-18  Martin Baulig  <martin@ximian.com>
7343
7344         * expression.cs (Invocation.BetterFunction): Put back
7345         TypeManager.TypeToCoreType().
7346
7347 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7348
7349         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7350         the ResolveType.
7351
7352 2004-10-18  Martin Baulig  <martin@ximian.com>
7353
7354         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7355         `Type' directly, but call ResolveType() on it.
7356
7357 2004-10-18  Martin Baulig  <martin@ximian.com>
7358
7359         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7360         `Type' directly, but call ResolveType() on it.
7361         (MemberBase.DoDefine): Likewise.
7362
7363         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7364         `Type' directly, but call ResolveType() on it.
7365         (ComposedCast.DoResolveAsTypeStep): Likewise.
7366
7367         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7368         `Type' directly, but call ResolveType() on it.
7369
7370 2004-10-17  John Luke  <john.luke@gmail.com>
7371
7372         * class.cs (Operator.GetSignatureForError): use CSharpName
7373
7374         * parameter.cs (Parameter.GetSignatureForError): Returns
7375         correct name even if was not defined.
7376
7377 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7378
7379         Fix #65816.
7380         * class.cs (TypeContainer.EmitContext): New property.
7381         (DefineNestedTypes): Create an emitcontext for each part.
7382         (MethodCore.DoDefineParameters): Use container's emitcontext.
7383         Pass type array to InternalParameters.
7384         (MemberBase.DoDefine): Use container's emitcontext.
7385         (FieldMember.Define): Likewise.
7386         (Event.Define): Likewise.
7387         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7388         Pass type array to InternalParameters.
7389         (SetIndexerMethod.GetParameterInfo): Likewise.
7390         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7391         * delegate.cs (Define): Pass emitcontext to
7392         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7393         array to InternalParameters.
7394         * expression.cs (ParameterReference.DoResolveBase): Pass
7395         emitcontext to GetParameterInfo.
7396         (ComposedCast.DoResolveAsTypeStep): Remove check on
7397         ec.ResolvingTypeTree.
7398         * parameter.cs (Parameter.Resolve): Change argument to
7399         EmitContext.  Use ResolveAsTypeTerminal.
7400         (Parameter.GetSignature): Change argument to EmitContext.
7401         (Parameters.ComputeSignature): Likewise.
7402         (Parameters.ComputeParameterTypes): Likewise.
7403         (Parameters.GetParameterInfo): Likewise.
7404         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7405         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7406         * support.cs (InternalParameters..ctor): Remove variant that takes
7407         a DeclSpace.
7408         * typemanager.cs (system_intptr_expr): New.
7409         (InitExpressionTypes): Initialize it.
7410
7411 2004-10-12  Chris Toshok  <toshok@ximian.com>
7412
7413         * cs-parser.jay: fix location for try_statement and catch_clause.
7414
7415 2004-10-11  Martin Baulig  <martin@ximian.com>
7416
7417         * report.cs: Don't make --fatal abort on warnings, we have
7418         -warnaserror for that.
7419
7420 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7421
7422         More DeclSpace.ResolveType avoidance.
7423         * decl.cs (MemberCore.InUnsafe): New property.
7424         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7425         with newly created EmitContext.
7426         (FieldMember.Define): Likewise.
7427         * delegate.cs (Delegate.Define): Likewise.
7428         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7429         only if normal name-lookup fails.
7430         (TypeExpr.DoResolve): Enable error-checking.
7431         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7432         (SizeOf.DoResolve): Likewise.
7433         (ComposedCast.DoResolveAsTypeStep): Likewise.
7434         (StackAlloc.DoResolve): Likewise.
7435         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7436         (Block.Unsafe): New property.
7437         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7438         (Unsafe): Set 'unsafe' flag of contained block.
7439         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7440         (Fixed.Resolve): Likewise.
7441         (Catch.Resolve): Likewise.
7442         (Using.ResolveLocalVariableDecls): Likewise.
7443         (Foreach.Resolve): Likewise.
7444
7445 2004-10-05  John Luke <john.luke@gmail.com>
7446
7447         * cs-parser.jay: add location to error CS0175
7448
7449 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7450
7451         * ecore.cs (Expression.Constantity): Add support for turning null
7452         into a constant.
7453
7454         * const.cs (Const.Define): Allow constants to be reference types
7455         as long as the value is Null.
7456
7457 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7458
7459         * namespace.cs (NamespaceEntry.Using): No matter which warning
7460         level is set, check if this namespace name has already been added.
7461
7462 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7463
7464         * expression.cs: reftype [!=]= null should always use br[true,false].
7465         # 67410
7466
7467 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7468
7469         Fix #67108
7470         * attribute.cs: Enum conversion moved to 
7471         GetAttributeArgumentExpression to be applied to the all
7472         expressions.
7473
7474 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7475
7476         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7477         * class.c (TypeContainer.DefineType): Flag error if
7478         base types aren't accessible due to access permissions.
7479         * decl.cs (DeclSpace.ResolveType): Move logic to
7480         Expression.ResolveAsTypeTerminal.
7481         (DeclSpace.ResolveTypeExpr): Thin layer over
7482         Expression.ResolveAsTypeTerminal.
7483         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7484         Refactor code into NestedAccess.  Use it.
7485         (DeclSpace.NestedAccess): New.
7486         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7487         argument to silence errors.  Check access permissions.
7488         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7489         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7490         (Cast.DoResolve): Likewise.
7491         (New.DoResolve): Likewise.
7492         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7493         (TypeOf.DoResolve): Likewise.
7494
7495         * expression.cs (Invocation.BetterConversion): Return the Type of
7496         the better conversion.  Implement section 14.4.2.3 more faithfully.
7497         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7498         section 14.4.2.2 explicit.
7499         (Invocation.OverloadResolve): Update.
7500         (Invocation): Remove is_base field.
7501         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7502         (Invocation.Emit): Likewise.
7503
7504 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7505
7506         * README: Update to changes.
7507
7508 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7509
7510         * cs-parser.jay: Reverted 642 warning fix.
7511
7512 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7513
7514         Fix bug #66615
7515         * decl.cs (FindMemberWithSameName): Indexer can have more than
7516         1 argument.
7517
7518 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7519
7520         * expression.cs (LocalVariableReference.DoResolveLValue):
7521         Do not report warning 219 for out values.
7522         (EmptyExpression.Null): New member to avoid extra allocations.
7523
7524 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7525
7526         * cs-parser.jay: Fix wrong warning 642 report.
7527
7528         * cs-tokenizer.cs (CheckNextToken): New helper;
7529         Inspect next character if is same as expected.
7530
7531 2004-09-23  Martin Baulig  <martin@ximian.com>
7532
7533         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7534         (Convert.ImplicitReferenceConversionExists): Likewise.
7535
7536 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7537
7538         * class.cs (Operator.Define): Add error 448 and 559 report.
7539
7540 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7541
7542         * class.cs (MemberBase.IsTypePermitted): New protected
7543         method for checking error CS0610.
7544
7545 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7546
7547         * class.cs (TypeContainer.HasExplicitLayout): New property
7548         Returns whether container has StructLayout attribute set Explicit.
7549         (FieldMember): New abstract class for consts and fields.
7550         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7551         (Field): Reuse FieldMember.
7552
7553         * const.cs (Const): Reuse FieldMember.
7554
7555         * rootcontext.cs: EmitConstants call moved to class.
7556
7557 2004-09-22  Martin Baulig  <martin@ximian.com>
7558
7559         Thanks to Peter Sestoft for this bug report.
7560
7561         * expression.cs (Conditional): If both the `trueExpr' and the
7562         `falseExpr' is a NullLiteral, return a NullLiteral.
7563
7564 2004-09-22  Martin Baulig  <martin@ximian.com>
7565
7566         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7567         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7568         for the "get_Current" call.
7569
7570 2004-09-22  Martin Baulig  <martin@ximian.com>
7571
7572         Marek and me just fixed one of our oldest bugs: #28562 :-)
7573
7574         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7575
7576         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7577         we're an EnumConstant, just return that.
7578         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7579         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7580         to get the value which'll actually be written into the attribute.
7581         However, we have to use GetValue() to access the attribute's value
7582         in the compiler.        
7583
7584 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7585
7586         * constant.cs (Constant.IsNegative): New abstract property
7587         IsNegative.
7588
7589         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7590         (StackAlloc.DoResolve): Reused IsNegative.
7591
7592 2004-09-21  Martin Baulig  <martin@ximian.com>
7593
7594         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7595         if we're used in an iterator, we may be called from different
7596         methods.
7597
7598         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7599         we actually have an exception block.
7600
7601 2004-09-20  John Luke <jluke@cfl.rr.com>
7602
7603         * class.cs, cs-parser.jay: Improve the error report for 1520:
7604         report the actual line where the error happens, not where the
7605         class was declared.
7606
7607         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7608         Pass location information that was available elsewhere.
7609
7610 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7611
7612         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7613         runtime to delay sign assemblies.
7614
7615 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7616
7617         * cs-parser.jay: Do not report the stack trace, this is barely
7618         used nowadays.
7619
7620 2004-08-22  John Luke  <john.luke@gmail.com>
7621  
7622         * driver.cs : check that a resource id is not already used
7623         before adding it, report CS1508 if it is, bug #63637
7624
7625 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7626
7627         * ecore.cs: Removed dead code.
7628
7629 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7630
7631         * class.cs: Do not report warning CS0067 on the interfaces.
7632
7633 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7634
7635         * cs-parser.jay: Add error 504 report.
7636
7637 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7638
7639         * rootcontext.cs: WarningLevel is 4 by default now.
7640
7641         * statement.cs (Fixed.Resolve): Do not null
7642         VariableInfo.
7643
7644 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7645
7646         Fixed bug #55780
7647         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7648         deep search when property is not virtual.
7649         (PropertyExpr.ResolveAccessors): Make one call for both
7650         accessors.
7651
7652 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7653
7654         Fixed bug #65766
7655         * statement.cs: Error 152 report constains also location.
7656
7657 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7658
7659         Fixed bug #65766
7660         * const.cs: Explicitly set constant as static.
7661
7662 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7663
7664         Fixed bug #64226
7665         * cs-parser.jay: Add error 1017 report.
7666
7667 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7668
7669         Fixed bug #59980, #64224
7670         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7671
7672         * typemanager.cs (IsSpecialMethod): Simplified
7673
7674 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7675
7676         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7677         condition with better params.
7678
7679 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7680
7681         Fixed bug #65238
7682         * attribute.cs (Resolve): Property has to have both
7683         accessors.
7684
7685 2004-09-14  Martin Baulig  <martin@ximian.com>
7686
7687         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7688
7689 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7690
7691         Fixed bug #61902
7692         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7693         called and is obsolete then this member suppress message
7694         when call is inside next [Obsolete] method or type.
7695
7696         * expression.cs: Use TestObsoleteMethodUsage member.
7697
7698 2004-09-14  Martin Baulig  <martin@ximian.com>
7699
7700         * cs-parser.jay: Sync a bit with the GMCS version.
7701
7702 2004-09-14  Martin Baulig  <martin@ximian.com>
7703
7704         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7705         (CSharpParser.yacc_verbose_flag): New public field.
7706
7707         * genericparser.cs: Removed.
7708
7709 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7710
7711         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7712
7713 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7714
7715         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7716
7717 2004-09-10  Martin Baulig  <martin@ximian.com>
7718
7719         Backported my MemberName changes from GMCS into MCS.
7720
7721         - we are now using a special `MemberName' class instead of using
7722         strings; in GMCS, the `MemberName' also contains the type
7723         arguments.
7724
7725         - changed the grammar rules a bit:
7726           * the old `member_name' is now a `namespace_or_type_name':
7727             The rule is that we use `namespace_or_type_name' everywhere
7728             where we expect either a "member name" (GetEnumerator) or a
7729             "member name" with an explicit interface name
7730             (IEnumerable.GetEnumerator).
7731             In GMCS, the explicit interface name may include type arguments
7732             (IEnumerable<T>.GetEnumerator).
7733           * we use `member_name' instead of just `IDENTIFIER' for
7734             "member names":
7735             The rule is that we use `member_name' wherever a member may
7736             have type parameters in GMCS.       
7737
7738         * decl.cs (MemberName): New public class.
7739         (MemberCore.MemberName): New public readonly field.
7740         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7741         (DeclSpace): Likewise.
7742
7743         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7744         * enum.cs (Enum.ctor): Likewise.
7745
7746         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7747         MemberName.     
7748         (AliasEntry.ctor): Take a MemberName, not an Expression.
7749         (AliasEntry.UsingAlias): Likewise.
7750
7751         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7752         (IMethodData.MemberName): Changed type from string to MemberName.
7753         (MemberBase.ExplicitInterfaceName): Likewise.
7754         (AbstractPropertyEventMethod.SetupName): Make this private.
7755         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7756         argument; compute the member name here.
7757         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7758         on the `member.MemberName' and the `prefix'.
7759
7760         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7761         not `type_name'.
7762         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7763         thus, we get a `MemberName' instead of a `string'.  These
7764         declarations may have type parameters in GMCS.
7765         (interface_method_declaration, delegate_declaration): Likewise.
7766         (class_declaration, interface_declaration): Likewise.
7767         (method_header): Use `namespace_or_type_name' instead of
7768         `member_name'.  We may be an explicit interface implementation.
7769         (property_declaration, event_declaration): Likewise.
7770         (member_name): This is now just an `IDENTIFIER', not a
7771         `namespace_or_type_name'.
7772         (type_name, interface_type): Removed.
7773         (namespace_or_type_name): Return a MemberName, not an Expression.
7774         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7775         call GetTypeExpression() on the MemberName to get an expression.
7776         (IndexerDeclaration.interface_type): Changed type from string to
7777         MemberName.
7778         (MakeName): Operate on MemberName's instead of string's.
7779
7780 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7781
7782         Fix bug #55770.
7783         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7784         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7785         lookup to avoid symbols introduced by 'using'.
7786         * rootcontext.cs (NamespaceLookup): Update.
7787
7788 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7789
7790         * class.cs (TypeContainer.DoDefineMembers): Do not call
7791         DefineDefaultConstructor for static classes.
7792
7793 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * attribute.cs (Attribute.Resolve): Add error 653 report.
7796
7797         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7798         report.
7799         (Method.ApplyAttributeBuilder): Add error 685 report.
7800         (Operator.Define): Add error 564 report.
7801
7802         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7803
7804         * expression.cs (Invocation.DoResolve): Add error
7805         245 and 250 report.
7806
7807         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7808         error 674 report.
7809
7810 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7811
7812         * class.cs (ConstructorInitializer.Resolve):
7813         Wrong error number (515->516).
7814
7815 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7816
7817         * class.cs (Indexer.Define): Add error 631 report.
7818
7819 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7820
7821         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7822
7823 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7824
7825         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7826
7827 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7828
7829         * cs-parser.jay: Added error CS0241 report.
7830
7831 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7832
7833         * cs-parser.jay (fixed_statement): Introduce a scope for the
7834         declaration in the 'fixed' statement.
7835
7836 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7837
7838         * cs-parser.jay: Added CS0230 error report.
7839
7840 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7841
7842         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7843
7844 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7845
7846         * expression.cs (Argument.Resolve): Added error CS0192 and
7847         CS0199 report.
7848
7849 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7850
7851         C# 2.0 #pragma warning feature
7852
7853         * cs-tokenizer.cs (PreProcessPragma): New method; 
7854         Handles #pragma directive.
7855
7856         * report.cs (WarningRegions): New class; Support
7857         class for #pragma warning directive. It tests whether
7858         warning is enabled for a given line.
7859
7860 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7861
7862         * const.cs: Add more descriptive error report, tahnks to
7863         Sebastien. 
7864
7865 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7866
7867         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7868
7869 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7870
7871         * expression.cs: Apply patch from Ben: Remove dead code from
7872         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7873         as that code just threw an exception anwyays.
7874
7875         * const.cs: Remove the call to the turnintoconstant, for details
7876         see bug: #63144
7877         
7878         * literal.cs: The type of the null-literal is the null type;  So
7879         we use a placeholder type (literal.cs:System.Null, defined here)
7880         for it.
7881
7882         * expression.cs (Conditional.DoResolve): Remove some old code that
7883         is no longer needed, conversions have been fixed.
7884
7885         (ArrayCreationExpression.DoResolve): Return false if we fail to
7886         resolve the inner expression.
7887
7888 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7889
7890         Fix test-290.cs.
7891         * cs-parser.jay (delegate_declaration): Record a delegate
7892         declaration as a type declaration.
7893         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7894
7895 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7896
7897         * parameter.cs: Do not crash if the type can not be resolved. 
7898
7899         * expression.cs: Report errors with unsafe pointers, fixes #64896
7900
7901 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7902
7903         * expression.cs: Pointer arith always needs to do a conv.i
7904         if the operand is a long. fix 65320
7905
7906 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7907
7908         Fixed cs0619-37.cs, cs0619-38.cs
7909
7910         * enum.cs (GetObsoleteAttribute): Removed.
7911
7912         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7913         on Enum member is double staged. The first is tested member
7914         and then enum.
7915
7916 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7917
7918         Fixed #56986, #63631, #65231
7919
7920         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7921         adds member to name container.
7922         (TypeContainer.AddToTypeContainer): New method, adds type to
7923         name container.
7924         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7925         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7926         AddOperator): Simplified by reusing AddToMemberContainer.
7927         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7928         instead of field.
7929         (Method.CheckForDuplications): Fixed implementation to test all
7930         possibilities.
7931         (MemberBase): Detection whether member is explicit interface
7932         implementation is now in constructor.
7933         (MemberBase.UpdateMemberName): Handles IndexerName.
7934         (Accessor): Changed to keep also location information.
7935         (AbstractPropertyEventMethod): Is derived from MemberCore.
7936         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7937         will be emited or not.
7938         (PropertyBase.AreAccessorsDuplicateImplementation):
7939         Tests whether accessors are not in collision with some method.
7940         (Operator): Is derived from MethodCore to simplify common
7941         operations.
7942
7943         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7944         must be performed.
7945         (DeclSpace.AddToContainer): Adds the member to defined_names
7946         table. It tests for duplications and enclosing name conflicts.
7947
7948         * enum.cs (EnumMember): Clean up to reuse the base structures
7949
7950 2004-09-03  Martin Baulig  <martin@ximian.com>
7951
7952         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7953         into TypeContainer, to make partial classes work again.
7954
7955 2004-09-03  Martin Baulig  <martin@ximian.com>
7956
7957         * rootcontext.cs (RootContext.V2): Removed.
7958
7959 2004-03-23  Martin Baulig  <martin@ximian.com>
7960
7961         * expression.cs (Invocation.OverloadResolve): Added `bool
7962         may_fail' argument and use it instead of the Location.IsNull() hack.
7963
7964 2004-09-03  Martin Baulig  <martin@ximian.com>
7965
7966         Merged latest changes into gmcs.  Please keep this comment in
7967         here, it makes it easier for me to see what changed in MCS since
7968         the last time I merged.
7969
7970 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7971
7972         Fix #61128.
7973         * expression.cs (BetterConversion): Don't allow either conversion 
7974         to be null.  Remove redundant implicit conversion test when 'q ==
7975         null' -- when this function is invoked, we already know that the
7976         implicit conversion exists.
7977         (BetterFunction): Assume that 'best' is non-null.  Remove
7978         redundant reimplementation of IsApplicable when 'best' is null.
7979         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7980         number of arguments.
7981         (IsAncestralType): Extract from OverloadResolve.
7982         (OverloadResolve): Make robust to the MethodGroupExpr being
7983         unsorted.  Implement all the logic of Section 14.5.5.1, and
7984         support overloading of methods from multiple applicable types.
7985         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7986
7987         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7988         (RealError, Warning): Append type of report to related symbol.
7989
7990 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7991
7992         * enum.cs: Fixed CLS-Compliance checks for enum members.
7993         Error tests cs3008-8.cs, cs3014-8.cs
7994
7995 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7996
7997         Fixed bug #62342, #63102
7998         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7999         like ImplementMethod.
8000
8001 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8002
8003         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8004         Fixed bug #65170.
8005
8006 2004-09-02  Martin Baulig  <martin@ximian.com>
8007
8008         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8009         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8010         on the MethodBase.
8011
8012 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8013
8014         C# 2.0 Static classes implemented
8015
8016         * class.cs (TypeContainer): instance_constructors,
8017         initialized_fields, initialized_static_fields,
8018         default_constructor, base_inteface_types are protected to be
8019         accessible from StaticClass.
8020         (TypeContainer.DefineDefaultConstructor): New virtual method
8021         for custom default constructor generating
8022         (StaticClass): New class to handle "Static classes" feature.
8023
8024         * cs-parser.jay: Handle static keyword on class like instance
8025         of StaticClass.
8026
8027         * driver.cs: Added "/langversion" command line switch with two
8028         options (iso-1, default).
8029
8030 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8031
8032         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8033
8034 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8035
8036         * delegate.cs: Style.
8037
8038 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8039
8040         * delegate.cs: Add seperate instance expr field for miguel.
8041
8042 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8043
8044         * PointerArithmetic (Resolve): make sure we are not doing
8045         pointer arith on void*. Also, make sure we are resolved
8046         by not setting eclass until resolve.
8047
8048         All callers: Make sure that PointerArithmetic gets resolved.
8049
8050 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8051
8052         * ArrayCreation (LookupType): If the type does not resolve 
8053         to an array, give an error.
8054
8055 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8056
8057         * statement.cs (Try.Resolve): Fixed bug #64222
8058
8059 2004-08-27  Martin Baulig  <martin@ximian.com>
8060
8061         * class.cs
8062         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8063         crash here.     
8064
8065 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * ecore.cs (Constantify): Get underlying type via
8068         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8069         Windows in special cases.
8070
8071 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8072
8073         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8074         for obtaining also private methods.
8075         (GetRemoveMethod): Used GetRemoveMethod (true)
8076         for obtaining also private methods.
8077
8078 2004-08-24  Martin Baulig  <martin@ximian.com>
8079
8080         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8081         MethodAttributes.HideBySig for operators.
8082
8083 2004-08-23  Martin Baulig  <martin@ximian.com>
8084
8085         Back to the old error reporting system :-)
8086
8087         * report.cs (Message): Removed.
8088         (Report.MessageData, ErrorData, WarningData): Removed.
8089         (Report.Error, Warning): Back to the old system.
8090
8091 2004-08-23  Martin Baulig  <martin@ximian.com>
8092
8093         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8094
8095         * class.cs (TypeContainer.ParentContainer): New public virtual
8096         method; replaces the explicit interface implementation.
8097         (ClassPart.ParentContainer): Override.
8098
8099 2004-08-23  Martin Baulig  <martin@ximian.com>
8100
8101         * statement.cs (Switch): Added support for constant switches; see
8102         #59428 or test-285.cs.
8103
8104 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8105
8106         Fixed bug #62740.
8107         * statement.cs (GetEnumeratorFilter): Removed useless
8108         logic because C# specs is strict. GetEnumerator must be
8109         public.
8110
8111 2004-08-22  Martin Baulig  <martin@ximian.com>
8112
8113         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8114         a switch and may break, reset the barrier.  Fixes #59867.
8115
8116 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8117
8118         CLS-Compliance speed up (~5% for corlib)
8119
8120         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8121         New method. Tests container for CLS-Compliant names
8122
8123         * class.cs (TypeContainer.VerifyClsName): New method.
8124         Checks whether container name is CLS Compliant.
8125         (Constructor): Implements IMethodData.
8126
8127         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8128         low-case table for CLS Compliance test.
8129         (MemberCache.VerifyClsParameterConflict): New method.
8130         Checks method parameters for CS3006 error.
8131
8132         * enum.cs (EnumMember): Is derived from MemberCore.
8133         (Enum.VerifyClsName): Optimized for better performance.
8134
8135 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8136
8137         * report.cs: Renamed Error_T to Error and changed all
8138         references.
8139
8140 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8141
8142         * class.cs (TypeContainer.IndexerArrayList): New inner class
8143         container for indexers.
8144         (TypeContainer.DefaultIndexerName): New constant for default
8145         indexer name. Replaced all "Item" with this constant.
8146         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8147
8148         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8149         DefaultMemberAttribute constructor.
8150
8151 2004-08-05  Martin Baulig  <martin@ximian.com>
8152
8153         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8154         Fix bug #59429.
8155
8156 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8157
8158         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8159         multi platforms problem.
8160
8161         * compiler.csproj: Included shared files.
8162
8163 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8164
8165         Fix bug 60333, 55971 in the more general way
8166         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8167         Added arg_type argument for constant conversion.
8168         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8169
8170 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8171
8172         Fix bug #59760
8173         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8174         OperatorArrayList, MethodCoreArrayList for typecontainer
8175         containers. Changed class member types to these new types.
8176         (MethodArrayList.DefineMembers): Added test for CS0659.
8177
8178 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8179
8180         * cfold.cs: Synchronize the folding with the code in expression.cs
8181         Binary.DoNumericPromotions for uint operands.
8182
8183         * attribute.cs: Revert patch from Raja, it introduced a regression
8184         while building Blam-1.2.1 (hard to isolate a test case).
8185
8186 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8187
8188         Fix for #55382
8189         * class.cs:
8190         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8191         name collision.
8192         (MethodCore.parent_method): New member. The method we're overriding
8193         if this is an override method.
8194         (MethodCore.CheckBase): Moved from Method class and made common.
8195         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8196         private.
8197         (MethodCore.CheckForDuplications): New abstract method. For custom
8198         member duplication search in a container
8199         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8200         method and its return type.
8201         (Event.conflict_symbol): New member. Symbol with same name in the
8202         parent class.
8203
8204         * decl.cs:
8205         (MemberCache.FindMemberWithSameName): New method. The method
8206         is looking for conflict with inherited symbols.
8207
8208 2004-08-04  Martin Baulig  <martin@ximian.com>
8209
8210         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8211
8212         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8213
8214 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8215
8216         * report.cs (Message): New enum for better error, warning reference in
8217         the code.
8218         (MessageData): New inner abstract class. It generally handles printing of
8219         error and warning messages.
8220         Removed unused Error, Warning, Message methods.
8221
8222 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8223
8224         Fix for cs0592-8.cs test
8225         * attribute.cs
8226         (Attributable.ValidAttributeTargets): Made public.
8227         (Attribute.ExplicitTarget): New member for explicit target value.
8228         (Attribute.CheckTargets): Now we translate explicit attribute
8229         target to Target here.
8230
8231 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8232
8233         * ecore.cs (MethodGroupExpr): new IsBase property.
8234
8235         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8236
8237         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8238         rather than an instance expr.
8239
8240         (DelegateCreation.Emit): Use the method group rather than
8241         the instance expression. Also, if you have base.Foo as the
8242         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8243
8244         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8245
8246         (NewDelegate.DoResolve): Only check for the existance of Invoke
8247         if the method is going to be needed. Use MethodGroupExpr.
8248
8249         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8250
8251         * expression.cs: For pointer arith., make sure to use
8252         the size of the type, not the size of the pointer to
8253         the type.
8254
8255 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8256
8257         Fix for #60722
8258         * class.cs (Class): Added error CS0502 test.
8259
8260 2004-08-03  John Luke  <jluke@cfl.rr.com>
8261             Raja R Harinath  <rharinath@novell.com>
8262
8263         Fix for #60997.
8264         * attribute.cs (Attribute.complained_before): New flag.
8265         (Attribute.ResolveType, Attribute.Resolve),
8266         (Attribute.DefinePInvokeMethod): Set it.
8267         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8268         
8269 2004-08-03  Martin Baulig  <martin@ximian.com>
8270
8271         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8272         use a user-defined operator; we still need to do numeric
8273         promotions in case one argument is a builtin type and the other
8274         one has an implicit conversion to that type.  Fixes #62322.
8275
8276 2004-08-02  Martin Baulig  <martin@ximian.com>
8277
8278         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8279         (LocalInfo.IsThis): New public property.
8280         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8281
8282 2004-08-01  Martin Baulig  <martin@ximian.com>
8283
8284         * class.cs (TypeContainer.GetClassBases): Don't set the default
8285         here since we may get called from GetPartialBases().
8286         (TypeContainer.DefineType): If GetClassBases() didn't return a
8287         parent, use the default one.
8288
8289 2004-07-30  Duncan Mak  <duncan@ximian.com>
8290
8291         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8292
8293 2004-07-30  Martin Baulig  <martin@ximian.com>
8294
8295         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8296
8297         * class.cs (SourceMethod): New public class, derive from the
8298         symbol writer's ISourceMethod.
8299         (Method): Use the new symbol writer API.
8300
8301         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8302         as argument and use the new symbol writer.
8303
8304         * location.cs
8305         (SourceFile): Implement the symbol writer's ISourceFile.
8306         (Location.SymbolDocument): Removed.
8307         (Location.SourceFile): New public property.
8308
8309         * symbolwriter.cs: Use the new symbol writer API.
8310
8311 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8312
8313         * Makefile (install-local): Remove.  Functionality moved to
8314         executable.make.
8315
8316 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8317
8318         * Makefile: Install mcs.exe.config file together with mcs.exe.
8319         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8320         correct runtime version.
8321         
8322 2004-07-25  Martin Baulig  <martin@ximian.com>
8323
8324         * class.cs
8325         (TypeContainer.RegisterOrder): Removed, this was unused.
8326         (TypeContainer, interface_order): Removed.
8327         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8328         TypeContainer as argument since we can also be called with a
8329         `PartialContainer' for a partial class/struct/interface.
8330         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8331         of checking whether we're an `Interface' - we could be a
8332         `PartialContainer'.
8333         (PartialContainer.Register): Override; call
8334         AddClass()/AddStruct()/AddInterface() on our parent.
8335
8336         * cs-parser.jay (interface_member_declaration): Add things to the
8337         `current_container', not the `current_class'.
8338
8339         * rootcontext.cs (RegisterOrder): The overloaded version which
8340         takes an `Interface' was unused, removed.
8341
8342         * typemanager.cs (TypeManager.LookupInterface): Return a
8343         `TypeContainer', not an `Interface'.
8344         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8345         contain a `PartialContainer' for an interface, so check it's
8346         `Kind' to figure out what it is.
8347
8348 2004-07-25  Martin Baulig  <martin@ximian.com>
8349
8350         * class.cs (Class.DefaultTypeAttributes): New public constant.
8351         (Struct.DefaultTypeAttributes): Likewise.
8352         (Interface.DefaultTypeAttributes): Likewise.
8353         (PartialContainer.TypeAttr): Override this and add the
8354         DefaultTypeAttributes.
8355
8356 2004-07-25  Martin Baulig  <martin@ximian.com>
8357
8358         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8359         we can just use the `Parent' field instead.
8360
8361 2004-07-25  Martin Baulig  <martin@ximian.com>
8362
8363         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8364
8365 2004-07-25  Martin Baulig  <martin@ximian.com>
8366
8367         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8368         our parts before defining any methods.
8369         (TypeContainer.VerifyImplements): Make this virtual.
8370         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8371         on our PartialContainer.
8372
8373 2004-07-25  Martin Baulig  <martin@ximian.com>
8374
8375         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8376
8377         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8378         argument, we can just use the `Parent' field instead.
8379
8380         * class.cs
8381         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8382         (MemberBase.DoDefine): Likewise.
8383
8384 2004-07-24  Martin Baulig  <martin@ximian.com>
8385
8386         * decl.cs (MemberCore.Parent): New public field.
8387         (DeclSpace.Parent): Moved to MemberCore.
8388
8389         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8390         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8391         parent's .ctor.
8392         (FieldBase, Field, Operator): Likewise.
8393         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8394         (EventField, Event): Likewise.
8395
8396 2004-07-23  Martin Baulig  <martin@ximian.com>
8397
8398         * class.cs (PartialContainer): New public class.
8399         (ClassPart): New public class.
8400         (TypeContainer): Added support for partial classes.
8401         (TypeContainer.GetClassBases): Splitted some of the functionality
8402         out into GetNormalBases() and GetPartialBases().
8403
8404         * cs-tokenizer.cs (Token.PARTIAL): New token.
8405         (Tokenizer.consume_identifier): Added some hacks to recognize
8406         `partial', but only if it's immediately followed by `class',
8407         `struct' or `interface'.
8408
8409         * cs-parser.jay: Added support for partial clases.
8410
8411 2004-07-23  Martin Baulig  <martin@ximian.com>
8412
8413         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8414         a `DeclSpace' and also made it readonly.
8415         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8416         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8417         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8418
8419         * cs-parser.jay: Pass the `current_class', not the
8420         `current_container' (at the moment, this is still the same thing)
8421         to a new Method, Property, Event, Indexer or Constructor.
8422
8423 2004-07-23  Martin Baulig  <martin@ximian.com>
8424
8425         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8426         and removed the `current_interface' one.
8427         (struct_declaration, class_declaration, interface_declaration):
8428         Set `current_class' to the newly created class/struct/interface;
8429         set their `Bases' and call Register() before parsing their body.
8430
8431 2004-07-23  Martin Baulig  <martin@ximian.com>
8432
8433         * class.cs (Kind): New public enum.
8434         (TypeContainer): Made this class abstract.
8435         (TypeContainer.Kind): New public readonly field.
8436         (TypeContainer.CheckDef): New public method; moved here from
8437         cs-parser.jay.
8438         (TypeContainer.Register): New public abstract method.
8439         (TypeContainer.GetPendingImplementations): New public abstract
8440         method.
8441         (TypeContainer.GetClassBases): Removed the `is_class' and
8442         `is_iface' parameters.
8443         (TypeContainer.DefineNestedTypes): Formerly known as
8444         DoDefineType().
8445         (ClassOrStruct): Made this class abstract.
8446
8447         * tree.cs (RootTypes): New public type. 
8448
8449 2004-07-20  Martin Baulig  <martin@ximian.com>
8450
8451         * tree.cs (Tree.RecordNamespace): Removed.
8452         (Tree.Namespaces): Removed.
8453
8454         * rootcontext.cs (RootContext.IsNamespace): Removed.
8455
8456         * cs-parser.jay (namespace_declaration): Just create a new
8457         NamespaceEntry here.
8458
8459 2004-07-20  Martin Baulig  <martin@ximian.com>
8460
8461         * statement.cs (ExceptionStatement): New abstract class.  This is
8462         now used as a base class for everyone who's using `finally'.
8463         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8464         our local variables before using them.
8465
8466         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8467         virtual method.  This is used by Yield.Resolve() to "steal" an
8468         outer block's `finally' clauses.
8469         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8470         argument.
8471
8472         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8473         version which takes an ExceptionStatement.  This version must be
8474         used to create exception branchings.
8475
8476         * iterator.cs
8477         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8478         (Iterator.EmitMoveNext): Added exception support; protect the
8479         block with a `fault' clause, properly handle 'finally' clauses.
8480         (Iterator.EmitDispose): Run all the `finally' clauses here.
8481
8482 2004-07-20  Martin Baulig  <martin@ximian.com>
8483
8484         * iterator.cs: This is the first of a set of changes in the
8485         iterator code.  Match the spec more closely: if we're an
8486         IEnumerable, then GetEnumerator() must be called.  The first time
8487         GetEnumerator() is called, it returns the current instance; all
8488         subsequent invocations (if any) must create a copy.
8489
8490 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * expression.cs: Resolve the constant expression before returning
8493         it. 
8494
8495 2004-07-19  Martin Baulig  <martin@ximian.com>
8496
8497         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8498         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8499         the return type of the new EmitContext.
8500
8501 2004-07-18  Martin Baulig  <martin@ximian.com>
8502
8503         * class.cs (Property.Define): Fix iterators.
8504
8505         * iterators.cs (Iterator.Define): Moved the
8506         `container.AddInterator (this)' call here from the .ctor; only do
8507         it if we resolved successfully.
8508
8509 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8510
8511         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8512         `true' for preprocessing directives that we parse.  The return
8513         value indicates whether we should return to regular tokenizing or
8514         not, not whether it was parsed successfully.
8515
8516         In the past if we were in: #if false ... #line #endif, we would
8517         resume parsing after `#line'.  See bug 61604.
8518
8519         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8520         building: IsEnumType should return true only for enums, not for
8521         enums or System.Enum itself.  This fixes #61593.
8522
8523         Likely what happened is that corlib was wrong: mcs depended on
8524         this bug in some places.  The bug got fixed, we had to add the
8525         hack, which caused bug 61593.
8526
8527         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8528         that was a workaround for the older conditions.
8529
8530 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8531
8532         * assign.cs: IAssignMethod has a new interface, as documented
8533         inline. All assignment code now uses this new api.
8534
8535         * ecore.cs, expression.cs: All classes which implement
8536         IAssignMethod now use the new interface.
8537
8538         * expression.cs (Invocation): add a hack to EmitCall so that
8539         IndexerAccess can be the target of a compound assignment without
8540         evaluating its arguments twice.
8541
8542         * statement.cs: Handle changes in Invocation api.
8543
8544 2004-07-16  Martin Baulig  <martin@ximian.com>
8545
8546         * iterators.cs: Rewrote this.  We're now using one single Proxy
8547         class for both the IEnumerable and the IEnumerator interface and
8548         `Iterator' derives from Class so we can use the high-level API.
8549
8550         * class.cs (TypeContainer.AddIterator): New method.
8551         (TypeContainer.DoDefineType): New protected virtual method, which
8552         is called from DefineType().
8553         (TypeContainer.DoDefineMembers): Call DefineType() and
8554         DefineMembers() on all our iterators.
8555         (TypeContainer.Emit): Call Emit() on all our iterators.
8556         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8557
8558         * codegen.cs (EmitContext.CurrentIterator): New public field.
8559
8560 2004-07-15  Martin Baulig  <martin@ximian.com>
8561
8562         * typemanager.cs
8563         (TypeManager.not_supported_exception_type): New type.   
8564
8565 2004-07-14  Martin Baulig  <martin@ximian.com>
8566
8567         * iterators.cs: Use real error numbers.
8568
8569 2004-07-14  Martin Baulig  <martin@ximian.com>
8570
8571         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8572         requires this to be a System.Collection.IEnumerable and not a
8573         class implementing that interface.
8574         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8575
8576 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8577
8578         * class.cs: Fixed previous fix, it broke some error tests.
8579
8580 2004-07-12  Martin Baulig  <martin@ximian.com>
8581
8582         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8583         Fixes #61293.
8584
8585 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8586
8587         * assign.cs (LocalTemporary): Add new argument: is_address,If
8588         `is_address' is true, then the value that we store is the address
8589         to the real value, and not the value itself.
8590         
8591         * ecore.cs (PropertyExpr): use the new local temporary
8592         stuff to allow us to handle X.Y += z (where X is a struct)
8593
8594 2004-07-08  Martin Baulig  <martin@ximian.com>
8595
8596         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8597         not always return, just like we're doing in Using.Resolve().
8598
8599 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8600
8601         * cs-parser.jay (fixed_statement): flag this as Pinned.
8602
8603 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8604
8605         * typemanager.cs (TypeManager): Removed MakePinned method, this
8606         mechanism is replaced with the .NET 2.x compatible mechanism of
8607         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8608
8609         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8610         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8611         `IsFixed' property which has a different meaning.
8612
8613 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8614
8615         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8616         visible from inside a nested class, not just the names of the
8617         immediately enclosing class.
8618         Fix for bug #60730.
8619
8620 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8621
8622         * expression.cs (BetterConversion): Remove buggy special-case
8623         handling of "implicit constant expression conversions".  At this
8624         point, we already know that the conversion is possible -- we're
8625         only checking to see which is better.
8626
8627 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8628
8629         * cs-parser.jay: Added error CS0210 test.
8630
8631 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8632
8633         * cs-parser.jay: Added error CS0134 test.
8634
8635 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8636
8637         Fix bug #52507
8638         * cs-parser.jay: Added error CS0145 test.
8639
8640 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8641
8642         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8643
8644 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8645         
8646         * expression.cs (StackAlloc.Resolve): The argument may not
8647         be a constant; deal with this case.
8648         
8649 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8650
8651         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8652         GetIndexerAttributeValue.
8653         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8654
8655         * class.cs (Indexer.Define): Added error tests for CS0415,
8656         CS0609.
8657
8658 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8659
8660         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8661         property code.
8662
8663 2004-06-23  Martin Baulig  <martin@ximian.com>
8664
8665         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8666         neither return nor throw, reset the barrier as well.  Fixes #60457.
8667
8668 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8669
8670         * class.cs : EventAttributes is now set to None by default.
8671           This fixes bug #60459.
8672
8673 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8674
8675         Fix bug #60219
8676         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8677         Don't throw exception but return null (it's sufficient now).
8678
8679 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8680
8681         * typemanager.cs (GetArgumentTypes): Faster implementation.
8682
8683 2004-06-18  Martin Baulig  <martin@ximian.com>
8684
8685         * attribute.cs (Attribute.Resolve): Check whether we're an
8686         EmptyCast which a Constant child.  Fixes #60333.
8687
8688 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8689
8690         * statement.cs (EmitCollectionForeach): Account for the fact that
8691         not all valuetypes are in areas which we can take the address of.
8692         For these variables, we store to a temporary variable. Also, make
8693         sure that we dont emit a `callvirt' on a valuetype method.
8694
8695 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8696
8697         * expression.cs (StackAlloc.DoReSolve): Added test for
8698         negative parameter (CS0247).
8699
8700 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8701
8702         Fix bug #59792
8703         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8704
8705 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8706
8707         Fix bug #59781
8708         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8709         ulong.
8710
8711 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8712
8713         Fix bug #58254 & cs1555.cs, cs1556.cs
8714         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8715
8716 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8717
8718         * cs-parser.jay: Added error CS1669 test for indexers.
8719
8720 2004-06-11  Martin Baulig  <martin@ximian.com>
8721
8722         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8723         call this twice: for params and varargs methods.
8724
8725 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8726
8727         * class.cs:
8728         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8729
8730 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8731
8732         * attribute.cs (Attribute.GetValidTargets): Made public.
8733
8734         * class.cs: 
8735         (AbstractPropertyEventMethod): New class for better code sharing.
8736         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8737         CS1667 report.
8738         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8739
8740 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8741
8742         Fix bug #59477.
8743         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8744         that the call to Resolve is part of a MemberAccess.
8745         (Expression.Resolve): Use it for SimpleName resolution.
8746         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8747         Add 'intermediate' boolean argument.
8748         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8749         error message when the SimpleName can be resolved ambiguously
8750         between an expression and a type.
8751         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8752         public.
8753         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8754         call on the left-side.
8755
8756 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8757
8758         * class.cs:
8759         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8760
8761 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8762
8763         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8764
8765 2004-06-11  Martin Baulig  <martin@ximian.com>
8766
8767         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8768         varargs methods if applicable.
8769
8770 2004-06-11  Martin Baulig  <martin@ximian.com>
8771
8772         * expression.cs (Invocation.EmitCall): Don't use
8773         `method.CallingConvention == CallingConventions.VarArgs' since the
8774         method could also have `CallingConventions.HasThis'.
8775
8776 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8777
8778         * class.cs (Event.GetSignatureForError): Implemented.
8779         Fixed crash in error test cs3010.cs
8780
8781 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8782
8783         * cs-tokenizer.cs: Change the way we track __arglist to be
8784         consistent with the other keywords.
8785
8786 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8787
8788         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8789         tomorrow.
8790
8791 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8792
8793         * codegen.cs: Check that all referenced assemblies have a strongname
8794         before strongnaming the compiled assembly. If not report error CS1577.
8795         Fix bug #56563. Patch by Jackson Harper.
8796         * typemanager.cs: Added a method to return all referenced assemblies.
8797         Fix bug #56563. Patch by Jackson Harper.
8798
8799 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8800
8801         * class.cs:
8802         (Method.ApplyAttributeBuilder): Moved and added conditional
8803         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8804
8805         * delegate.cs:
8806         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8807
8808 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8809
8810         Fixed #59640
8811         * class.cs: (EventField.attribute_targets): Changed default target.
8812
8813 2004-06-08  Martin Baulig  <martin@ximian.com>
8814
8815         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8816
8817 2004-06-08  Martin Baulig  <martin@ximian.com>
8818
8819         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8820
8821 2004-06-07  Martin Baulig  <martin@ximian.com>
8822
8823         Added support for varargs methods.
8824
8825         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8826         keyword.
8827
8828         * cs-parser.jay: Added support for `__arglist'.
8829
8830         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8831
8832         * expression.cs (Argument.AType): Added `ArgList'.
8833         (Invocation): Added support for varargs methods.
8834         (ArglistAccess): New public class.
8835         (Arglist): New public class.
8836
8837         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8838
8839         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8840         a method's top-level block if the method has varargs.
8841
8842         * support.cs (ReflectionParameters, InternalParameters): Added
8843         support for varargs methods.    
8844
8845 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8846
8847         * class.cs: Provide location in indexer error report.
8848
8849         * driver.cs: Use standard names.
8850
8851         * namespace.cs: Catch the use of using after a namespace has been
8852         declared also on using aliases.
8853
8854 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8855
8856         Bug #50820.
8857         * typemanager.cs (closure_private_ok, closure_invocation_type)
8858         (closure_qualifier_type, closure_invocation_assembly)
8859         (FilterWithClosure): Move to ...
8860         (Closure): New internal nested class.
8861         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8862         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8863         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8864         (MemberLookup, MemberLookupFailed): Use it.
8865         * expression.cs (New.DoResolve): Treat the lookup for the
8866         constructor as being qualified by the 'new'ed type.
8867         (Indexers.GetIndexersForTypeOrInterface): Update.
8868
8869 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8870
8871         * attribute.cs
8872         (GetConditionalAttributeValue): New method. Returns
8873         condition of ConditionalAttribute.
8874         (SearchMulti): New method.  Returns all attributes of type 't'.
8875         Use it when attribute is AllowMultiple = true.
8876         (IsConditionalMethodExcluded): New method.
8877
8878         * class.cs
8879         (Method.IsExcluded): Implemented. Returns true if method has conditional
8880         attribute and the conditions is not defined (method is excluded).
8881         (IMethodData): Extended interface for ConditionalAttribute support.
8882         (PropertyMethod.IsExcluded): Implemented.
8883
8884         * decl.cs
8885         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8886
8887         * expression.cs
8888         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8889         on the method.
8890
8891 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8892
8893         * expression.cs (ArrayCreationExpression): Make this just an
8894         `expression'. It can't be a statement, so the code here was
8895         dead.
8896
8897 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8898
8899         Fixed #59072
8900         * typemanager.cs (GetFullNameSignature): New method for
8901         MethodBase types.
8902
8903 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8904
8905         Fixed #56452
8906         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8907         Use this method when MethodBuilder is null.
8908         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8909         Added test for error CS0626 (MONO reports error for this situation).
8910         (IMethodData.GetSignatureForError): Extended interface.
8911
8912 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8913
8914         * attribute.cs
8915         (AttributeTester.GetObsoleteAttribute): Returns instance of
8916         ObsoleteAttribute when type is obsolete.
8917
8918         * class.cs
8919         (TypeContainer.VerifyObsoleteAttribute): Override.
8920         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8921         (MethodCode.VerifyObsoleteAttribute): Override.
8922         (MemberBase.VerifyObsoleteAttribute): Override.
8923
8924         * decl.cs
8925         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8926         and report proper error.
8927
8928         *delegate.cs
8929         Delegate.VerifyObsoleteAttribute): Override.
8930
8931         * ecore.cs
8932         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8933         and report proper error.
8934         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8935
8936         * enum.cs
8937         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8938         and enum member.
8939
8940         * expression.cs
8941         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8942         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8943         Added test for ObsoleteAttribute.
8944
8945         * statement.cs
8946         (Catch): Derived from Statement.
8947
8948 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8949  
8950         Fixed bug #59071 & cs0160.cs
8951  
8952         * statement.cs (Try.Resolve): Check here whether order of catch
8953         clauses matches their dependencies.
8954
8955 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8956
8957         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8958         caused a regression: #59343.  Referencing nested classes from an
8959         assembly stopped working.
8960
8961 2004-05-31  Martin Baulig  <martin@ximian.com>
8962
8963         MCS is now frozen for beta 2.
8964
8965 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8966
8967         * convert.cs: add a trivial cache for overload operator resolution.
8968
8969 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8970
8971         * decl.cs: If possible, use lookuptypedirect here. We can only do
8972         this if there is no `.' after the namespace. Avoids using
8973         LookupType, which does lots of slow processing.
8974         (FindNestedType) New method, does what it says :-).
8975         * namespace.cs: use LookupTypeDirect.
8976         * rootcontext.cs: use membercache, if possible.
8977         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8978
8979 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8980
8981         * expression.cs:
8982         According to the spec, 
8983
8984         In a member access of the form E.I, if E is a single identifier,
8985         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8986         field, property, localvariable, or parameter with the same type as
8987         the meaning of E as a type-name (§3.8), then both possible
8988         meanings of E are permitted.
8989
8990         We did not check that E as a simple-name had the same type as E as
8991         a type name.
8992
8993         This trivial check gives us 5-7% on bootstrap time.
8994
8995 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8996
8997         * expression.cs (Invocation.OverloadResolve): Avoid the
8998         use of hashtables and boxing here by allocating on demand.
8999
9000 2004-05-30  Martin Baulig  <martin@ximian.com>
9001
9002         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9003         we're doing a silent lookup.  Don't try to lookup nested types in
9004         TypeManager.object_type (thanks to Ben Maurer).
9005
9006 2004-05-30  Martin Baulig  <martin@ximian.com>
9007
9008         Committing a patch from Ben Maurer.
9009
9010         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9011
9012 2004-05-29  Martin Baulig  <martin@ximian.com>
9013
9014         * class.cs (IMethodData.ShouldIgnore): New method.
9015
9016         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9017         `Location' argument, we don't need it anywhere.  Use
9018         `IMethodData.ShouldIgnore ()' instead of
9019         `MethodData.GetMethodFlags ()'.
9020         (TypeManager.AddMethod): Removed.
9021         (TypeManager.AddMethod2): Renamed to AddMethod.
9022
9023 2004-05-29  Martin Baulig  <martin@ximian.com>
9024
9025         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9026
9027         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9028         converting from a class type S to an interface type and we already
9029         have an object on the stack, don't box it again.  Fixes #52578.
9030
9031 2004-05-29  Martin Baulig  <martin@ximian.com>
9032
9033         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9034         Added support for `params' parameters.  Fixes #59267.
9035
9036 2004-05-29  Martin Baulig  <martin@ximian.com>
9037
9038         * literal.cs (NullPointer): Provide a private .ctor which sets
9039         `type' to TypeManager.object_type.  Fixes #59048.
9040
9041 2004-05-29  Martin Baulig  <martin@ximian.com>
9042
9043         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9044         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9045
9046         * ecore.cs (EventExpr.instance_expr): Make the field private.
9047
9048 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9049
9050         Fixed bug #50080 & cs0214-2.cs
9051         * expression.cs (Cast.DoResolve): Check unsafe context here.
9052         
9053         * statement.cs (Resolve.DoResolve): Likewise.
9054
9055 2004-05-26  Martin Baulig  <martin@ximian.com>
9056
9057         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9058
9059         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9060         (RootContext.LookupType): Pass down the `silent' flag.
9061
9062 2004-05-25  Martin Baulig  <martin@ximian.com>
9063
9064         * expression.cs
9065         (MethodGroupExpr.IdenticalTypeName): New public property.
9066         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9067         expression actually refers to a type.
9068
9069 2004-05-25  Martin Baulig  <martin@ximian.com>
9070
9071         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9072         for #56176 and made it actually work.
9073
9074 2004-05-25  Martin Baulig  <martin@ximian.com>
9075
9076         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9077         (FieldExpr, PropertyExpr): Override and implement
9078         CacheTemporaries.  Fixes #52279.
9079
9080 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9081
9082         * location.cs: In the new compiler listing a file twice is a
9083         warning, not an error.
9084
9085 2004-05-24  Martin Baulig  <martin@ximian.com>
9086
9087         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9088         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9089
9090 2004-05-24  Martin Baulig  <martin@ximian.com>
9091
9092         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9093         walking the `using' list.  Fixes #53921.
9094
9095 2004-05-24  Martin Baulig  <martin@ximian.com>
9096
9097         * const.cs (Const.LookupConstantValue): Added support for
9098         EmptyCast's; fixes #55251.
9099
9100 2004-05-24  Martin Baulig  <martin@ximian.com>
9101
9102         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9103         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9104         which does the CS0135 check.  The reason is that we first need to
9105         check whether the variable actually exists.
9106
9107 2004-05-24  Martin Baulig  <martin@ximian.com>
9108
9109         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9110         than RootContext.LookupType() to find the explicit interface
9111         type.  Fixes #58584.
9112
9113 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9114
9115         * Makefile: Simplify.  Use executable.make.
9116         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9117
9118 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9119
9120         * decl.cs:
9121         * enum.cs:
9122         Use the invariant culture when doing String.Compare for CLS case
9123         sensitivity.
9124         
9125 2004-05-23  Martin Baulig  <martin@ximian.com>
9126
9127         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9128         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9129
9130         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9131         
9132 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9133
9134         * class.cs (MemberBase.Define): Reuse MemberType member for 
9135         resolved type. Other methods can use it too.
9136
9137 2004-05-23  Martin Baulig  <martin@ximian.com>
9138
9139         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9140         the variable also exists in the current block (otherwise, we need
9141         to report a CS0103).  Fixes #58670.
9142
9143 2004-05-23  Martin Baulig  <martin@ximian.com>
9144
9145         * flowanalysis.cs (Reachability.Reachable): Compute this
9146         on-the-fly rather than storing it as a field.
9147
9148 2004-05-23  Martin Baulig  <martin@ximian.com>
9149
9150         * flowanalysis.cs (Reachability.And): Manually compute the
9151         resulting `barrier' from the reachability.      
9152        
9153 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9154
9155         Fix bug #57835
9156         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9157         instance of ObsoleteAttribute when symbol is obsolete.
9158
9159         * class.cs
9160         (IMethodData): Extended interface for ObsoleteAttribute support.
9161
9162 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * attribute.cs: Fix bug #55970
9165
9166 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9167
9168         Fix bug #52705
9169         * attribute.cs
9170         (GetObsoleteAttribute): New method. Creates the instance of
9171         ObsoleteAttribute.
9172         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9173         ObsoleteAttribute when member is obsolete.
9174         (AttributeTester.Report_ObsoleteMessage): Common method for
9175         Obsolete error/warning reporting.
9176
9177         * class.cs
9178         (TypeContainer.base_classs_type): New member for storing parent type.
9179
9180         * decl.cs
9181         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9182         for this MemberCore.
9183
9184 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9185
9186         * attribute.cs, const.cs: Fix bug #58590
9187
9188 2004-05-21  Martin Baulig  <martin@ximian.com>
9189
9190         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9191         out parameters if the end of the method is unreachable.  Fixes
9192         #58098. 
9193
9194 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9195
9196         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9197         Hari was right, why extra method.
9198
9199 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9200
9201         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9202
9203 2004-05-20  Martin Baulig  <martin@ximian.com>
9204
9205         Merged this back from gmcs to keep the differences to a minumum.
9206
9207         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9208         instead of a Declspace.
9209         (Attribute.ResolveType): Likewise.
9210         (Attributes.Search): Likewise.
9211         (Attributes.Contains): Likewise.
9212         (Attributes.GetClsCompliantAttribute): Likewise.
9213
9214         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9215         argument.
9216         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9217         DeclSpace.
9218
9219 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9220
9221         Fix bug #58688 (MCS does not report error when the same attribute
9222         is assigned twice)
9223
9224         * attribute.cs (Attribute.Emit): Distinction between null and default.
9225
9226 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9227
9228         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9229         of a top-level attribute without an attribute target.
9230         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9231         Make non-static.
9232         (Attribute.Conditional_GetConditionName), 
9233         (Attribute.Obsolete_GetObsoleteMessage): Update.
9234         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9235         part of ScanForIndexerName.
9236         (Attribute.CanIgnoreInvalidAttribute): New function.
9237         (Attribute.ScanForIndexerName): Move to ...
9238         (Attributes.ScanForIndexerName): ... here.
9239         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9240         (Attributes.Search): New internal variant that can choose not to
9241         complain if types aren't resolved.  The original signature now
9242         complains.
9243         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9244         complaints suppressed.
9245         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9246         only if it not useful.
9247         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9248         top-level for attributes that are shared between the assembly
9249         and a top-level class.
9250         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9251         * class.cs: Update to reflect changes.
9252         (DefineIndexers): Fuse loops.
9253         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9254         a couple more variants of attribute names.
9255
9256 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9257
9258         Fix bug #52585 (Implemented explicit attribute declaration)
9259
9260         * attribute.cs:
9261         (Attributable.ValidAttributeTargets): New abstract method. It gets
9262         list of valid attribute targets for explicit target declaration.
9263         (Attribute.Target): It holds target itself.
9264         (AttributeSection): Removed.
9265         (Attribute.CheckTargets): New method. It checks whether attribute
9266         target is valid for the current element.
9267
9268         * class.cs:
9269         (EventProperty): New class. For events that are declared like
9270         property (with add and remove accessors).
9271         (EventField): New class. For events that are declared like field.
9272         class.cs
9273
9274         * cs-parser.jay: Implemented explicit attribute target declaration.
9275
9276         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9277         Override ValidAttributeTargets.
9278
9279         * parameter.cs:
9280         (ReturnParameter): Class for applying custom attributes on 
9281         the return type.
9282         (ParameterAtribute): New class. Class for applying custom
9283         attributes on the parameter type.
9284
9285 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9286
9287         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9288         definitions. 
9289
9290         (Method): Allow UNSAFE here.
9291
9292         * modifiers.cs: Support unsafe reporting.
9293
9294 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9295
9296         * decl.cs: Fix bug #58478.
9297
9298 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9299
9300         * statement.cs: When checking for unreachable code on an EmptyStatement,
9301         set the location. Fixes bug #58488.
9302
9303 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9304
9305         * driver.cs: Add -pkg handling.
9306
9307         From Gonzalo: UseShelLExecute=false
9308
9309 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9310
9311         * attribute.cs:
9312         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9313         for attribute.
9314         (Attribute.IsClsCompliaceRequired): Moved to base for better
9315         accesibility.
9316         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9317         when attribute is AttributeUsageAttribute.
9318         (Attribute.GetValidTargets): Simplified.
9319         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9320         attribute for this type.
9321         (Attribute.ApplyAttributes): Method renamed to Emit and make
9322         non-static.
9323         (GlobalAttributeSection): New class for special handling of global
9324         attributes (assembly, module).
9325         (AttributeSection.Emit): New method.
9326
9327         * class.cs: Implemented Attributable abstract methods.
9328         (MethodCore.LabelParameters): Moved to Parameter class.
9329         (Accessor): Is back simple class.
9330         (PropertyMethod): Implemented Attributable abstract class.
9331         (DelegateMethod): Implemented Attributable abstract class.
9332         (Event): New constructor for disctintion between normal Event
9333         and Event with accessors.
9334
9335         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9336
9337         * codegen.cs, const.cs, decl.cs, delegate.cs:
9338         (CommonAssemblyModulClass): Implemented Attributable abstract class
9339         and simplified.
9340
9341         * enum.cs: Implement IAttributeSupport interface.
9342         (EnumMember): New class for emum members. Implemented Attributable
9343         abstract class
9344
9345         * parameter.cs:
9346         (ParameterBase): Is abstract.
9347         (ReturnParameter): New class for easier [return:] attribute handling.
9348
9349         * typemanager.cs: Removed builder_to_attr.
9350
9351 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9352
9353         Fix bug #57151.
9354         * attribute.cs (Attribute.GetPositionalValue): New function.
9355         * class.cs (TypeContainer.VerifyMembers): New function.
9356         (TypeContainer.Emit): Use it.
9357         (ClassOrStruct): New base class for Class and Struct.
9358         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9359         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9360         class.
9361         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9362         then each non-static field should have a FieldOffset attribute.
9363         Otherwise, none of the fields should have a FieldOffset attribute.
9364         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9365         and FieldOffset attributes.
9366         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9367         (TypeManager.field_offset_attribute_type): New core types.
9368         (TypeManager.InitCoreTypes): Initialize them.
9369
9370 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9371
9372         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9373         Return correct type.
9374         From bug #58270.
9375
9376 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9377
9378         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9379         be implicitly converted to ulong.
9380         
9381         * expression.cs: The logic for allowing operator &, | and ^ worked
9382         was wrong, it worked before because we did not report an error in
9383         an else branch.  Fixes 57895.
9384
9385         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9386         allow volatile fields to be reference types.
9387
9388 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9389
9390         * driver.cs: Add support for /debug-
9391
9392 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9393
9394         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9395         Add a 'complain' parameter to silence errors.
9396         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9397         silently overlooked type-resolutions.
9398         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9399         to reflect changes.
9400         (Attributes.Search): New function.
9401         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9402         (Attributes.GetAttributeFullName): Remove hack.
9403         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9404         Update to reflect changes.
9405         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9406         Use Attributes.Search instead of nested loops.
9407
9408 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9409
9410         * decl.cs:
9411         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9412         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9413         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9414
9415         * report.cs: (Report.Warning): Renamed to Warning_T because of
9416         parameter collision.
9417
9418 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9419
9420         * expression.cs (MemberAccess.ResolveMemberAccess):
9421         Exit with non-zero status after Report.Error.
9422         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9423         Likewise.
9424         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9425
9426 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9427
9428         * support.cs: Don't hang when the file is empty.
9429
9430 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9431
9432         * support.cs: In SeekableStreamReader, compute the preamble size of the
9433           underlying stream. Position changes should take into account that initial
9434           count of bytes.
9435
9436 2004-05-03  Todd Berman  <tberman@sevenl.net>
9437
9438         * driver.cs: remove unused GetSysVersion function.
9439
9440 2004-05-03  Todd Berman  <tberman@sevenl.net>
9441
9442         * driver.cs: Remove the hack from saturday, as well as the hack
9443         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9444         link_paths to get that bit proper.
9445
9446 2004-05-01  Todd Berman  <tberman@sevenl.net>
9447
9448         * driver.cs: Try a LoadFrom before a Load, this checks the current
9449         path. This is currently a bug in mono that is be fixed, however, this
9450         provides a workaround for now. This will be removed when the bug
9451         is fixed.
9452
9453 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9454
9455         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9456         incomplete key pairs (#57941).
9457
9458 2004-05-01  Todd Berman  <tberman@sevenl.net>
9459
9460         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9461         from the GAC
9462
9463 2004-04-30  Jackson Harper  <jackson@ximian.com>
9464
9465         * codegen.cs: Open keys readonly.
9466         
9467 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9468
9469         * typemanager.cs: don't report cyclic struct layout when a struct
9470         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9471         which has 2 Pango.Rectangle fields.
9472
9473 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9474
9475         * expression.cs: Handle IntPtr comparisons with IL code
9476         rather than a method call.
9477
9478 2004-04-29  Martin Baulig  <martin@ximian.com>
9479
9480         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9481         the list of PropertyInfo's in class hierarchy and find the
9482         accessor.  Fixes #56013.
9483
9484 2004-04-29  Martin Baulig  <martin@ximian.com>
9485
9486         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9487
9488 2004-04-29  Martin Baulig  <martin@ximian.com>
9489
9490         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9491
9492         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9493
9494 2004-04-29  Martin Baulig  <martin@ximian.com>
9495
9496         * class.cs (ConstructorInitializer.Resolve): Check whether the
9497         parent .ctor is accessible.  Fixes #52146.
9498
9499 2004-04-29  Martin Baulig  <martin@ximian.com>
9500
9501         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9502
9503         * statement.cs (Using.EmitLocalVariableDecls): Use
9504         TypeManager.idisposable_type, not typeof (IDisposable).
9505         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9506
9507 2004-04-29  Martin Baulig  <martin@ximian.com>
9508
9509         * class.cs (Event.Define): Don't emit the field and don't set
9510         RTSpecialName and SpecialName for events on interfaces.  Fixes
9511         #57703. 
9512
9513 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9514
9515         Refactor Attribute.ApplyAttributes.
9516         * attribute.cs (Attributable): New base class for objects that can
9517         have Attributes applied on them.
9518         (Attribute): Make AttributeUsage fields public.
9519         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9520         (Attribute.IsInternalCall): New property.
9521         (Attribute.UsageAttr): Convert to a public read-only property.
9522         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9523         (Attribute.ResolveType, Attribute.Resolve)
9524         (Attribute.ScanForIndexerName): Update to reflect changes.
9525         (Attribute.CheckAttributeTarget): Re-format.
9526         (Attribute.ApplyAttributes): Refactor, to various
9527         Attributable.ApplyAttributeBuilder methods.
9528         * decl.cs (MemberCore): Make Attributable.
9529         * class.cs (Accessor): Make Attributable.
9530         (MethodData.ApplyAttributes): Use proper attribute types, not
9531         attribute names.
9532         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9533         (TypeContainer.ApplyAttributeBuilder)
9534         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9535         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9536         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9537         (Operator.ApplyAttributeBuilder): New factored-out methods.
9538         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9539         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9540         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9541         * parameter.cs (ParameterBase): New Attributable base class
9542         that can also represent Return types.
9543         (Parameter): Update to the changes.
9544
9545 2004-04-29  Jackson Harper  <jackson@ximian.com>
9546
9547         * driver.cs: Prefer the corlib system version when looking for
9548         assemblies in the GAC. This is still a hack, but its a better hack
9549         now.
9550         
9551 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9552
9553         * decl.cs, enum.cs: Improved error 3005 reporting.
9554   
9555         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9556         (related_symbols): New private member for list of symbols
9557         related to reported error/warning.
9558         
9559         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9560
9561 2004-04-29  Martin Baulig  <martin@ximian.com>
9562
9563         * ecore.cs (Expression.Constantify): If we're an enum and
9564         TypeManager.TypeToCoreType() doesn't give us another type, use
9565         t.UnderlyingSystemType.  Fixes #56178.  
9566
9567 2004-04-29  Martin Baulig  <martin@ximian.com>
9568
9569         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9570         interfaces and for each interface, only add members directly
9571         declared in that interface.  Fixes #53255.
9572
9573 2004-04-28  Martin Baulig  <martin@ximian.com>
9574
9575         * expression.cs (ConditionalLogicalOperator): Use a temporary
9576         variable for `left' to avoid that we evaluate it more than once;
9577         bug #52588.
9578
9579 2004-04-28  Martin Baulig  <martin@ximian.com>
9580
9581         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9582         `void[]' (CS1547).
9583
9584 2004-04-28  Martin Baulig  <martin@ximian.com>
9585
9586         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9587         void (CS1547).
9588
9589         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9590         whether the type is not void (CS1547).
9591
9592 2004-04-28  Martin Baulig  <martin@ximian.com>
9593
9594         * expression.cs (Unary.DoResolveLValue): Override this and report
9595         CS0131 for anything but Operator.Indirection.
9596
9597 2004-04-28  Martin Baulig  <martin@ximian.com>
9598
9599         Committing a patch from Ben Maurer; see bug #50820.
9600
9601         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9602         check for classes.
9603
9604         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9605         classes.        
9606
9607 2004-04-28  Martin Baulig  <martin@ximian.com>
9608
9609         Committing a patch from Ben Maurer; see bug #50820.
9610
9611         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9612         check for classes.
9613
9614         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9615         classes.        
9616
9617 2004-04-28  Martin Baulig  <martin@ximian.com>
9618
9619         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9620         (Block.AddLabel): Call DoLookupLabel() to only search in the
9621         current block.
9622
9623 2004-04-28  Martin Baulig  <martin@ximian.com>
9624
9625         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9626         comparing StringConstants and NullLiterals in Equality and Inequality.
9627
9628 2004-04-28  Jackson Harper  <jackson@ximian.com>
9629
9630         * driver.cs: Attempt to load referenced assemblies from the
9631         GAC. This is the quick and dirty version of this method that
9632         doesnt take into account versions and just takes the first
9633         canidate found. Will be good enough for now as we will not have more
9634         then one version installed into the GAC until I update this method.
9635
9636 2004-04-28  Martin Baulig  <martin@ximian.com>
9637
9638         * typemanager.cs (TypeManager.CheckStructCycles): New public
9639         static method to check for cycles in the struct layout.
9640
9641         * rootcontext.cs (RootContext.PopulateTypes): Call
9642         TypeManager.CheckStructCycles() for each TypeContainer.
9643         [Note: We only need to visit each type once.]
9644
9645 2004-04-28  Martin Baulig  <martin@ximian.com>
9646
9647         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9648
9649         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9650         success and added `out object value'.  Use a `bool resolved' field
9651         to check whether we've already been called rather than
9652         `ConstantValue != null' since this breaks for NullLiterals.
9653
9654 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9655
9656         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9657         setting of this flag, since the 'set' method may be non-public.
9658
9659 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9660
9661         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9662         check on current_vector.Block.
9663
9664 2004-04-27  Martin Baulig  <martin@ximian.com>
9665
9666         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9667         a field initializer.  Fixes #56459.
9668
9669 2004-04-27  Martin Baulig  <martin@ximian.com>
9670
9671         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9672         we're not attempting to use an indexer.  Fixes #52154.
9673
9674 2004-04-27  Martin Baulig  <martin@ximian.com>
9675
9676         * statement.cs (Return): Don't create a return label if we don't
9677         need it; reverts my change from January 20th.  Thanks to Ben
9678         Maurer for this.
9679
9680 2004-04-27  Martin Baulig  <martin@ximian.com>
9681
9682         According to the spec, `goto' can only leave a nested scope, but
9683         never enter it.
9684
9685         * statement.cs (Block.LookupLabel): Only lookup in the current
9686         block, don't recurse into parent or child blocks.
9687         (Block.AddLabel): Check in parent and child blocks, report
9688         CS0140/CS0158 if we find a duplicate.
9689         (Block): Removed this indexer for label lookups.
9690         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9691         this already does the error reporting for us.
9692
9693         * flowanalysis.cs
9694         (FlowBranching.UsageVector.Block): New public variable; may be null.
9695         (FlowBranching.CreateSibling): Added `Block' argument.
9696         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9697         label for the target of a `goto' and check whether we're not
9698         leaving a `finally'.
9699
9700 2004-04-27  Martin Baulig  <martin@ximian.com>
9701
9702         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9703         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9704         just for returns).
9705
9706 2004-04-27  Martin Baulig  <martin@ximian.com>
9707
9708         * statement.cs (Block.AddLabel): Also check for implicit blocks
9709         and added a CS0158 check.
9710
9711 2004-04-27  Martin Baulig  <martin@ximian.com>
9712
9713         * flowanalysis.cs (FlowBranchingLoop): New class.
9714         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9715         UsageVector's instead of an ArrayList.
9716         (FlowBranching.Label): Likewise.
9717         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9718         (FlowBranching.AddBreakVector): New method.
9719
9720 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9721
9722         * attribute.cs: Small regression fix: only convert the type if we
9723         the type is different, fixes System.Drawing build.
9724
9725 2004-04-27  Martin Baulig  <martin@ximian.com>
9726
9727         * attribute.cs (Attribute.Resolve): If we have a constant value
9728         for a named field or property, implicity convert it to the correct
9729         type.
9730
9731 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9732
9733         * statement.cs (Block.Block): Implicit blocks share
9734         'child_variable_names' fields with parent blocks.
9735         (Block.AddChildVariableNames): Remove.
9736         (Block.AddVariable): Mark variable as "used by a child block" in
9737         every surrounding block.
9738         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9739         been used in a child block, complain about violation of "Invariant
9740         meaning in blocks" rule.
9741         * cs-parser.jay (declare_local_variables): Don't use
9742         AddChildVariableNames.
9743         (foreach_statement): Don't create an implicit block: 'foreach'
9744         introduces a scope.
9745
9746 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9747
9748         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9749         converting from 0L to ulong.  Fixes 57522.
9750
9751 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9752
9753         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9754         derived class hides via 'new' keyword field from base class (test-242.cs).
9755         TODO: Handle this in the more general way.
9756         
9757         * class.cs (CheckBase): Ditto.
9758
9759 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9760
9761         * decl.cs (caching_flags): New member for storing cached values
9762         as bit flags.
9763         (MemberCore.Flags): New enum where bit flags for caching_flags
9764         are defined.
9765         (MemberCore.cls_compliance): Moved to caching_flags.
9766         (DeclSpace.Created): Moved to caching_flags.
9767
9768         * class.cs: Use caching_flags instead of DeclSpace.Created
9769         
9770 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9771
9772         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9773         if we are only a derived class, not a nested class.
9774
9775         * typemanager.cs: Same as above, but do this at the MemberLookup
9776         level (used by field and methods, properties are handled in
9777         PropertyExpr).   Allow for the qualified access if we are a nested
9778         method. 
9779
9780 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9781
9782         * class.cs: Refactoring.
9783         (IMethodData): New inteface; Holds links to parent members
9784         to avoid member duplication (reduced memory allocation).
9785         (Method): Implemented IMethodData interface.
9786         (PropertyBase): New inner classes for get/set methods.
9787         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9788         (Event): New inner classes for add/remove methods.
9789         (Event.DelegateMethod): Implemented IMethodData interface.
9790
9791         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9792         EmitContext (related to class.cs refactoring).
9793
9794 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9795
9796         * delegate.cs (Delegate.VerifyApplicability): If the number of
9797         arguments are the same as the number of parameters, first try to
9798         verify applicability ignoring  any 'params' modifier on the last
9799         parameter.
9800         Fixes #56442.
9801
9802 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9803
9804         * class.cs (TypeContainer.AddIndexer): Use
9805         'ExplicitInterfaceName' to determine if interface name was
9806         explicitly specified.  'InterfaceType' is not initialized at this time.
9807         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9808         Indexers array is already in the required order.  Initialize
9809         'IndexerName' only if there are normal indexers.
9810         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9811         (TypeContainer.Emit): Emit DefaultMember attribute only if
9812         IndexerName is initialized.
9813         Fixes #56300.
9814
9815 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9816
9817         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9818         Fixes #57007
9819
9820 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9821
9822         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9823         attributes.
9824         Fix for #56456.
9825
9826         * attribute.cs (Attribute.Resolve): Check for duplicate named
9827         attributes.
9828         Fix for #56463.
9829
9830 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9831
9832         * iterators.cs (MarkYield): track whether we are in an exception,
9833         and generate code accordingly.  Use a temporary value to store the
9834         result for our state.
9835
9836         I had ignored a bit the interaction of try/catch with iterators
9837         since their behavior was not entirely obvious, but now it is
9838         possible to verify that our behavior is the same as MS .NET 2.0
9839
9840         Fixes 54814
9841
9842 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9843
9844         * iterators.cs: Avoid creating temporaries if there is no work to
9845         do. 
9846
9847         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9848         Enumerations, use TypeManager.EnumToUnderlying and call
9849         recursively. 
9850
9851         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9852         bug #57013
9853
9854         (This.Emit): Use EmitContext.EmitThis to emit our
9855         instance variable.
9856
9857         (This.EmitAssign): Ditto.
9858
9859         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9860         codepaths, we will move all the functionality into
9861         Mono.CSharp.This 
9862
9863         (FieldExpr.EmitAssign): Ditto.
9864
9865         This fixes several hidden bugs that I uncovered while doing a code
9866         review of this today.
9867
9868         * codegen.cs (EmitThis): reworked so the semantics are more clear
9869         and also support value types "this" instances.
9870
9871         * iterators.cs: Changed so that for iterators in value types, we
9872         do not pass the value type as a parameter.  
9873
9874         Initialization of the enumerator helpers is now done in the caller
9875         instead of passing the parameters to the constructors and having
9876         the constructor set the fields.
9877
9878         The fields have now `assembly' visibility instead of private.
9879
9880 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9881
9882         * expression.cs (Argument.Resolve): Check if fields passed as ref
9883         or out are contained in a MarshalByRefObject.
9884
9885         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9886         another compiler type.
9887
9888 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9889
9890         * class.cs (Indexer.Define): use the new name checking method.
9891         Also, return false on an error.
9892         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9893         (is_identifier_[start/part]_character): make static.
9894
9895 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9896
9897         * expression.cs (Binary.ResolveOperator): Do no append strings
9898         twice: since we can be invoked more than once (array evaluation)
9899         on the same concatenation, take care of this here.  Based on a fix
9900         from Ben (bug #56454)
9901
9902 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9903
9904         * codegen.cs: Fix another case where CS1548 must be reported (when 
9905         delay-sign isn't specified and no private is available #56564). Fix
9906         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9907         error when MCS is used on the MS runtime and we need to delay-sign 
9908         (which seems unsupported by AssemblyBuilder - see #56621).
9909
9910 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9911
9912         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9913         (TypeManager.ComputeNamespaces): Faster implementation for
9914         Microsoft runtime.
9915
9916         * compiler.csproj: Updated AssemblyName to mcs.
9917
9918 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9919
9920         * rootcontext.cs: Add new types to the boot resolution.
9921
9922         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9923         MulticastDelegate is not allowed.
9924
9925         * typemanager.cs: Add new types to lookup: System.TypedReference
9926         and ArgIterator.
9927
9928         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9929         check for TypedReference or ArgIterator, they are not allowed. 
9930
9931         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9932         makes us properly catch 1510 in some conditions (see bug 56016 for
9933         details). 
9934
9935 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9936
9937         * CryptoConvert.cs: update from corlib version
9938         with endian fixes.
9939
9940 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * class.cs (Indexer.Define): Check indexername declaration
9943
9944 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9945
9946         * attribute.cs (IsClsCompliant): Fixed problem with handling
9947         all three states (compliant, not-compliant, undetected).
9948
9949 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9950
9951         * attribute.cs (Attribute): Location is now public.
9952         (Resolve): Store resolved arguments (pos_values) in attribute class.
9953         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9954         (GetClsCompliantAttributeValue): New method that gets
9955         CLSCompliantAttribute value.
9956         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9957         if exists else null.
9958         (AttributeTester): New class for CLS-Compliant verification routines.
9959
9960         * class.cs (Emit): Add CLS-Compliant verification.
9961         (Method.GetSignatureForError): Implemented.
9962         (Constructor.GetSignatureForError): Implemented
9963         (Constructor.HasCompliantArgs): Returns if constructor has
9964         CLS-Compliant arguments.
9965         (Constructor.Emit): Override.
9966         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9967         is needed to test only parameters.
9968         (FieldBase.GetSignatureForError): Implemented.
9969         (TypeContainer): New member for storing base interfaces.
9970         (TypeContainer.FindMembers): Search in base interfaces too.
9971
9972         * codegen.cs (GetClsComplianceAttribute): New method that gets
9973         assembly or module CLSCompliantAttribute value.
9974         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9975         for assembly.
9976         (ModuleClass.Emit): Add error 3012 test.
9977
9978         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9979
9980         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9981         state for all decl types.
9982         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9983         if CLS-Compliant tests are required.
9984         (IsClsCompliaceRequired): New method. Analyze whether code
9985         must be CLS-Compliant.
9986         (IsExposedFromAssembly): New method. Returns true when MemberCore
9987         is exposed from assembly.
9988         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9989         value or gets cached value.
9990         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9991         is explicitly marked with CLSCompliantAttribute.
9992         (IsIdentifierClsCompliant): New abstract method. This method is
9993         used to testing error 3005.
9994         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9995         for identifier and parameters CLS-Compliant testing.
9996         (VerifyClsCompliance): New method. The main virtual method for
9997         CLS-Compliant verifications.
9998         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9999         null. I don't know why is null (too many public members !).
10000         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10001         and get value of first CLSCompliantAttribute that found.
10002
10003         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10004         (VerifyClsCompliance): Override and add extra tests.
10005
10006         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10007         clscheck- disable CLS-Compliant verification event if assembly is has
10008         CLSCompliantAttribute(true).
10009
10010         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10011         ApllyAttribute is now called in emit section as in the other cases.
10012         Possible future Emit integration.
10013         (IsIdentifierClsCompliant): New override.
10014         (VerifyClsCompliance): New override.
10015         (GetEnumeratorName): Returns full enum name.
10016
10017         * parameter.cs (GetSignatureForError): Implemented.
10018
10019         * report.cs (WarningData): New struct for Warning message information.
10020         (LocationOfPreviousError): New method.
10021         (Warning): New method. Reports warning based on the warning table.
10022         (Error_T): New method. Reports error based on the error table.
10023
10024         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10025         verifications are done here.
10026
10027         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10028
10029         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10030         CLSCompliantAttribute.
10031         (all_imported_types): New member holds all imported types from other
10032         assemblies.
10033         (LoadAllImportedTypes): New method fills static table with exported types
10034         from all referenced assemblies.
10035         (Modules): New property returns all assembly modules.
10036
10037 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10038
10039         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10040         throwing a parser error.
10041
10042         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10043         which removes the hardcoded get_/set_ prefixes for properties, as
10044         IL allows for the properties to be named something else.  
10045
10046         Bug #56013
10047
10048         * expression.cs: Do not override operand before we know if it is
10049         non-null.  Fix 56207
10050
10051 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10052
10053         * typemanager.cs: support for pinned variables.
10054
10055 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10056
10057         * decl.cs, typemanager.cs: Avoid using an arraylist
10058         as a buffer if there is only one result set.
10059
10060 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10061
10062         * expression.cs: Make sure you cant call a static method
10063         with an instance expression, bug #56174.
10064
10065 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10066
10067         * class.cs (IsDuplicateImplementation): Improve error reporting to
10068         flag 663 (method only differs in parameter modifier).
10069
10070         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10071         in preprocessor directives.
10072
10073         * location.cs (LookupFile): Allow for the empty path.
10074
10075         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10076         better approach for some of that patch, but its failing with the
10077         CharSet enumeration.  For now try/catch will do.
10078
10079         * typemanager.cs: Do not crash if a struct does not have fields.
10080         Fixes 56150.
10081
10082 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10083
10084         * expression.cs: cs0213, cant fix a fixed expression.
10085         fixes 50231.
10086
10087 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10088
10089         * cs-parser.jay: detect invalid embeded statements gracefully.
10090         bug #51113.
10091
10092 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10093
10094         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10095         As a regex:
10096         s/
10097         the invocation type may not be a subclass of the tye of the item/
10098         The type of the item must be a subclass of the invocation item.
10099         /g
10100
10101         Fixes bug #50820.
10102
10103 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10104
10105         * attribute.cs: Added methods to get a string and a bool from an
10106         attribute. Required to information from AssemblyKeyFileAttribute,
10107         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10108         * codegen.cs: Modified AssemblyName creation to include support for
10109         strongnames. Catch additional exceptions to report them as CS1548.
10110         * compiler.csproj: Updated include CryptoConvert.cs.
10111         * compiler.csproj.user: Removed file - user specific configuration.
10112         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10113         Mono.Security assembly. The original class is maintained and tested in
10114         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10115         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10116         like CSC 8.0 (C# v2) supports.
10117         * Makefile: Added CryptoConvert.cs to mcs sources.
10118         * rootcontext.cs: Added new options for strongnames.
10119
10120 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10121
10122         * driver.cs: For --expect-error, report error code `2'
10123         if the program compiled with no errors, error code `1' if
10124         it compiled with an error other than the one expected.
10125
10126 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10127
10128         * compiler.csproj: Updated for Visual Studio .NET 2003.
10129         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10130         * compiler.sln: Updated for Visual Studio .NET 2003.
10131
10132 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10133
10134         * expression.cs: Fix bug #47234. We basically need to apply the
10135         rule that we prefer the conversion of null to a reference type
10136         when faced with a conversion to 'object' (csc behaviour).
10137
10138 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10139
10140         * statement.cs: Shorter form for foreach, eliminates
10141         a local variable. r=Martin.
10142
10143 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10144
10145         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10146         checks if we can use brtrue/brfalse to test for 0.
10147         * expression.cs: use the above in the test for using brtrue/brfalse.
10148         cleanup code a bit.
10149
10150 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10151
10152         * expression.cs: Rewrite string concat stuff. Benefits:
10153
10154         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10155         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10156         rather than a concat chain.
10157
10158         * typemanager.cs: Add lookups for more concat overloads.
10159
10160 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10161
10162         * expression.cs: Emit shorter il code for array init.
10163
10164         newarr
10165         dup
10166         // set 1
10167
10168         // set 2
10169
10170         newarr
10171         stloc.x
10172
10173         ldloc.x
10174         // set 1
10175
10176         ldloc.x
10177         // set 2
10178
10179 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10180
10181         * statement.cs: Before, two switch blocks would be merged if the
10182         total size of the blocks (end_item - begin_item + 1) was less than
10183         two times the combined sizes of the blocks.
10184
10185         Now, it will only merge if after the merge at least half of the
10186         slots are filled.
10187
10188         fixes 55885.
10189
10190 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10191
10192         * class.cs : csc build fix for GetMethods(). See bug #52503.
10193
10194 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10195
10196         * expression.cs: Make sure fp comparisons work with NaN.
10197         This fixes bug #54303. Mig approved this patch a long
10198         time ago, but we were not able to test b/c the runtime
10199         had a related bug.
10200
10201 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10202
10203         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10204
10205 2004-03-19  Martin Baulig  <martin@ximian.com>
10206
10207         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10208         error here and not in our caller.
10209
10210 2004-03-19  Martin Baulig  <martin@ximian.com>
10211
10212         * interface.cs: Completely killed this file.
10213         (Interface): We're now a TypeContainer and live in class.cs.
10214
10215         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10216         argument; we're now also called for interfaces.
10217         (TypeContainer.DefineMembers): Allow this method being called
10218         multiple times.
10219         (TypeContainer.GetMethods): New public method; formerly known as
10220         Interface.GetMethod().  This is used by PendingImplementation.
10221         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10222         it's now private and non-static.
10223         (Interface): Moved this here; it's now implemented similar to
10224         Class and Struct.
10225         (Method, Property, Event, Indexer): Added `bool is_interface'
10226         argument to their .ctor's.
10227         (MemberBase.IsInterface): New public field.
10228
10229         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10230         instances instead of InterfaceMethod, InterfaceProperty, etc.
10231         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10232         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10233
10234 2004-03-19  Martin Baulig  <martin@ximian.com>
10235
10236         * class.cs (MethodCore.IsDuplicateImplementation): New private
10237         method which does the CS0111 checking.
10238         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10239         Use IsDuplicateImplementation().
10240
10241 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10242
10243         * decl.cs (FindMemberToOverride): New method to find the correct
10244         method or property to override in the base class.
10245         * class.cs
10246             - Make Method/Property use the above method to find the
10247               version in the base class.
10248             - Remove the InheritableMemberSignatureCompare as it is now
10249               dead code.
10250
10251         This patch makes large code bases much faster to compile, as it is
10252         O(n) rather than O(n^2) to do this validation.
10253
10254         Also, it fixes bug 52458 which is that nested classes are not
10255         taken into account when finding the base class member.
10256
10257         Reviewed/Approved by Martin.
10258
10259 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10260
10261         * interface.cs: In all interface classes removed redundant
10262         member initialization.
10263
10264 2004-03-16  Martin Baulig  <martin@ximian.com>
10265
10266         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10267
10268 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10269
10270         * decl.cs (DefineTypeAndParents): New helper method to define a
10271         type's containers before the type itself is defined;  This is a
10272         bug exposed by the recent changes to Windows.Forms when an
10273         implemented interface was defined inside a class that had not been
10274         built yet.   
10275
10276         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10277
10278         (Check): Loop correctly to report errors modifiers
10279         (UNSAFE was not in the loop, since it was the same as TOP).
10280
10281         * interface.cs: Every interface member now takes a ModFlags,
10282         instead of a "is_new" bool, which we set on the base MemberCore. 
10283
10284         Every place where we called "UnsafeOk" in the interface, now we
10285         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10286         the unsafe settings from the member declaration instead of the
10287         container interface. 
10288
10289         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10290
10291         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10292         `set_indexer_name' to the pending bits (one per type).
10293
10294         We fixed a bug today that was picking the wrong method to
10295         override, since for properties the existing InterfaceMethod code
10296         basically ignored the method name.  Now we make sure that the
10297         method name is one of the valid indexer names.
10298
10299 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10300  
10301         * support.cs (SeekableStreamReader): Keep track of stream byte
10302         positions and don't mix them with character offsets to the buffer.
10303
10304         Patch from Gustavo Giráldez
10305
10306 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10307
10308         * interface.cs (InterfaceSetGetBase): Removed double member
10309         initialization, base class does it as well.
10310
10311 2004-03-13  Martin Baulig  <martin@ximian.com>
10312
10313         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10314         when compiling corlib.
10315
10316 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10317
10318         * convert.cs (ExplicitConversion): We were reporting an error on
10319         certain conversions (object_type source to a value type, when the
10320         expression was `null') before we had a chance to pass it through
10321         the user defined conversions.
10322
10323         * driver.cs: Replace / and \ in resource specifications to dots.
10324         Fixes 50752
10325
10326         * class.cs: Add check for duplicate operators.  Fixes 52477
10327
10328 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10329
10330         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10331         that are in the middle of the statements, not only at the end.
10332         Fixes #54987
10333
10334         * class.cs (TypeContainer.AddField): No longer set the
10335         `HaveStaticConstructor' flag, now we call it
10336         `UserDefineStaticConstructor' to diferentiate the slightly
10337         semantic difference.
10338
10339         The situation is that we were not adding BeforeFieldInit (from
10340         Modifiers.TypeAttr) to classes that could have it.
10341         BeforeFieldInit should be set to classes that have no static
10342         constructor. 
10343
10344         See:
10345
10346         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10347
10348         And most importantly Zoltan's comment:
10349
10350         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10351
10352         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10353          before its static fields are used', i.e. initialization does not need
10354          to be triggered by the first access to the type. Setting this flag
10355          helps the JIT to compile better code, since it can run the static
10356          constructor at JIT time, and does not need to generate code to call it
10357          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10358          this flag for lots of classes like String. 
10359          
10360          csc sets this flag if the type does not have an explicit static 
10361          constructor. The reasoning seems to be that if there are only static
10362          initalizers for a type, and no static constructor, then the programmer
10363          does not care when this initialization happens, so beforefieldinit
10364          can be used.
10365          
10366          This bug prevents the AOT compiler from being usable, since it 
10367          generates so many calls to mono_runtime_class_init that the AOT code
10368          is much slower than the JITted code. The JITted code is faster, 
10369          because it does not generate these calls if the vtable is type is
10370          already initialized, which is true in the majority of cases. But the
10371          AOT compiler can't do this."
10372
10373 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10374
10375         * class.cs (MethodData.Emit): Refactor the code so symbolic
10376         information is generated for destructors;  For some reasons we
10377         were taking a code path that did not generate symbolic information
10378         before. 
10379
10380 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10381
10382         * class.cs: Create a Constructor.CheckBase method that
10383         takes care of all validation type code. The method
10384         contains some code that was moved from Define.
10385
10386         It also includes new code that checks for duplicate ctors.
10387         This fixes bug #55148.
10388
10389 2004-03-09  Joshua Tauberer <tauberer@for.net>
10390
10391         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10392         a { ... }-style array creation invokes EmitStaticInitializers
10393         which is not good for reference-type arrays.  String, decimal
10394         and now null constants (NullCast) are not counted toward
10395         static initializers.
10396
10397 2004-03-05  Martin Baulig  <martin@ximian.com>
10398
10399         * location.cs (SourceFile.HasLineDirective): New public field;
10400         specifies whether the file contains or is referenced by a "#line"
10401         directive.
10402         (Location.DefineSymbolDocuments): Ignore source files which
10403         either contain or are referenced by a "#line" directive.        
10404
10405 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10406
10407         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10408         direct access to our parent, so check the method inline there.
10409
10410 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10411
10412         * expression.cs (Invocation.EmitCall): Miguel's last commit
10413         caused a regression. If you had:
10414
10415             T t = null;
10416             t.Foo ();
10417
10418         In Foo the implict this would be null.
10419
10420 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10421
10422         * expression.cs (Invocation.EmitCall): If the method is not
10423         virtual, do not emit a CallVirt to it, use Call.
10424
10425         * typemanager.cs (GetFullNameSignature): Improve the method to
10426         cope with ".ctor" and replace it with the type name.
10427
10428         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10429         as an argument the ConstructorBuilder where it is being defined,
10430         to catch the recursive constructor invocations.
10431
10432 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10435         routines to check if a type is an enumerable/enumerator allow
10436         classes that implement the IEnumerable or IEnumerator interfaces.
10437
10438         * class.cs (Property, Operator): Implement IIteratorContainer, and
10439         implement SetYields.
10440
10441         (Property.Define): Do the block swapping for get_methods in the
10442         context of iterators.   We need to check if Properties also
10443         include indexers or not.
10444
10445         (Operator): Assign the Block before invoking the
10446         OperatorMethod.Define, so we can trigger the Iterator code
10447         replacement. 
10448
10449         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10450         Property and Operator classes are not created when we parse the
10451         declarator but until we have the block completed, so we use a
10452         singleton SimpleIteratorContainer.Simple to flag whether the
10453         SetYields has been invoked.
10454
10455         We propagate this setting then to the Property or the Operator to
10456         allow the `yield' to function.
10457
10458 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10459
10460         * codegen.cs: Implemented attribute support for modules.
10461         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10462         Assembly/Module functionality.
10463
10464         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10465         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10466         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10467
10468 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10469
10470         * interface.cs (FindMembers): The operation is performed on all base
10471         interfaces and not only on the first. It is required for future CLS Compliance patch.
10472
10473 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10474
10475         * statement.cs, codegen.cs:
10476         This patch deals with patterns such as:
10477
10478         public class List : IEnumerable {
10479
10480                 public MyEnumerator GetEnumerator () {
10481                         return new MyEnumerator(this);
10482                 }
10483
10484                 IEnumerator IEnumerable.GetEnumerator () {
10485                         ...
10486                 }
10487                 
10488                 public struct MyEnumerator : IEnumerator {
10489                         ...
10490                 }
10491         }
10492
10493         Before, there were a few things we did wrong:
10494         1) we would emit callvirt on a struct, which is illegal
10495         2) we emited ldarg when we needed to emit ldarga
10496         3) we would mistakenly call the interface methods on an enumerator
10497         type that derived from IEnumerator and was in another assembly. For example:
10498
10499         public class MyEnumerator : IEnumerator
10500
10501         Would have the interface methods called, even if there were public impls of the
10502         method. In a struct, this lead to invalid IL code.
10503
10504 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10505
10506         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10507           renamed to Emit.
10508
10509         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10510
10511 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10512
10513         * cs-parser.jay: Fix small regression: we were not testing V2
10514         compiler features correctly.
10515
10516         * interface.cs: If the emit context is null, then create one
10517
10518 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10519
10520         * decl.cs (GetSignatureForError): New virtual method to get full name
10521           for error messages.
10522
10523         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10524           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10525
10526         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10527           Duplicated members and code in these classes has been removed.
10528           Better encapsulation in these classes.
10529
10530 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10531
10532         * assign.cs (Assign.DoResolve): When dealing with compound
10533         assignments, there is a new rule in ECMA C# 2.4 (might have been
10534         there before, but it is documented here) that states that in:
10535
10536         a op= b;
10537
10538         If b is of type int, and the `op' is a shift-operator, then the
10539         above is evaluated as:
10540
10541         a = (int) a op b 
10542
10543         * expression.cs (Binary.ResolveOperator): Instead of testing for
10544         int/uint/long/ulong, try to implicitly convert to any of those
10545         types and use that in pointer arithmetic.
10546
10547         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10548         method to print information for from the type, not from the
10549         null-method we were given.
10550
10551 2004-02-01  Duncan Mak  <duncan@ximian.com>
10552
10553         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10554         parsing for cmd, fixes bug #53694.
10555
10556 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10559         in the member name duplication tests. Property and operator name duplication
10560         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10561
10562 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10563
10564         * interface.cs (PopulateMethod): Fixed crash when interface method
10565         returns not existing type (error test cs0246-3.cs).
10566
10567 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10568
10569         * cs-parser.jay (interface_accessors): Re-write actions to also
10570         store attributes attached to get and set methods. Fix spelling
10571         while at it.
10572
10573         (inteface_property_declaration): Modify accordingly.
10574
10575         (InterfaceAccessorInfo): New helper class to store information to pass
10576         around between rules that use interface_accessors.
10577
10578         * interface.cs (Emit): Apply attributes on the get and set
10579         accessors of properties and indexers too.
10580
10581         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10582         right MethodBuilder when applying attributes to the get and set accessors.
10583
10584 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10585
10586         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10587
10588 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10591
10592 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10595         changes that treat `yield' specially when present before `break'
10596         or `return' tokens.
10597
10598         * cs-tokenizer.cs: yield is no longer a keyword.
10599
10600 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10601
10602         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10603         setting for default constructors.
10604         For default constructors are almost every time set wrong Modifier. The
10605         generated IL code has been alright. But inside mcs this values was
10606         wrong and this was reason why several of my CLS Compliance tests
10607         failed.
10608
10609 2004-01-22  Martin Baulig  <martin@ximian.com>
10610
10611         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10612         not a QualifiedIdentifier.  This is what `type_name_expression'
10613         was previously doing.
10614         (type_name_expression): Removed; the code is now in
10615         `namespace_or_type_name'.
10616         (qualified_identifier): Removed, use `namespace_or_type_name'
10617         instead.
10618         (QualifiedIdentifier): Removed this class.      
10619
10620 2004-01-22  Martin Baulig  <martin@ximian.com>
10621
10622         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10623         not a string as alias name.
10624
10625 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10626
10627         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10628         #52730 bug, and instead compute correctly the need to use a
10629         temporary variable when requesting an address based on the
10630         static/instace modified of the field and the constructor.
10631  
10632 2004-01-21  Martin Baulig  <martin@ximian.com>
10633
10634         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10635         class and namespace before looking up aliases.  Fixes #52517.
10636
10637 2004-01-21  Martin Baulig  <martin@ximian.com>
10638
10639         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10640         assinged in a 'try'; fixes exception4.cs.
10641
10642 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10643         * class.cs : Implemented parameter-less constructor for TypeContainer
10644
10645         * decl.cs: Attributes are now stored here. New property OptAttributes
10646
10647         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10648
10649         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10650
10651 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10652
10653         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10654           (CSharpSignature): New method for indexer and property signature.
10655
10656 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10657
10658         * pending.cs (IsVirtualFilter): Faster implementation.
10659
10660 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10661
10662         * typemanager.cs: Avoid inclusion of same assembly more than once.
10663
10664 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10665
10666         * cs-parser.jay: Fixed problem where the last assembly attribute
10667           has been applied also to following declaration (class, struct, etc.)
10668           
10669 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10670
10671         * class.cs: Added error CS0538, CS0539 reporting.
10672         Fixed crash on Microsoft runtime when field type is void.
10673
10674         * cs-parser.jay: Added error CS0537 reporting.
10675
10676         * pending.cs: Added error CS0535 reporting.
10677         Improved error report for errors CS0536, CS0534.
10678
10679 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10680
10681         Merge a few bits from the Anonymous Method MCS tree.
10682
10683         * statement.cs (ToplevelBlock): New class for toplevel methods,
10684         will hold anonymous methods, lifted variables.
10685
10686         * cs-parser.jay: Create toplevel blocks for delegates and for
10687         regular blocks of code. 
10688
10689 2004-01-20  Martin Baulig  <martin@ximian.com>
10690
10691         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10692         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10693         and `NeedExplicitReturn'; added `IsLastStatement'.
10694         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10695         have a `ReturnLabel' or we're not unreachable.
10696
10697         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10698         child's reachability; don't just override ours with it.  Fixes
10699         #58058 (lluis's example).
10700         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10701         InFinally(), InLoop(), InSwitch() and
10702         BreakCrossesTryCatchBoundary() methods.
10703
10704         * statement.cs (Return): Do all error checking in Resolve().
10705         Unless we are the last statement in a top-level block, always
10706         create a return label and jump to it.
10707         (Break, Continue): Do all error checking in Resolve(); also make
10708         sure we aren't leaving a `finally'.
10709         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10710         statement in a top-level block.
10711         (Block.Flags): Added `IsDestructor'.
10712         (Block.IsDestructor): New public property.
10713
10714 2004-01-20  Martin Baulig  <martin@ximian.com>
10715
10716         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10717
10718 2004-01-20  Martin Baulig  <martin@ximian.com>
10719
10720         * statement.cs (Statement.ResolveUnreachable): New public method.
10721         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10722         (Block.Resolve): Resolve unreachable statements.
10723
10724 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10725
10726         * expression.cs: We need to fix the case where we do
10727         not have a temp variable here.
10728
10729         * assign.cs: Only expression compound assignments need
10730         temporary variables.
10731
10732 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10733
10734         * flowanalysis.cs: Reduce memory allocation in a few ways:
10735           - A block with no variables should not allocate a bit
10736             vector for itself.
10737           - A method with no out parameters does not need any tracking
10738             for assignment of the parameters, so we need not allocate
10739             any data for it.
10740           - The arrays:
10741                 public readonly Type[] VariableTypes;
10742                 public readonly string[] VariableNames;
10743             Are redundant. The data is already stored in the variable
10744             map, so we need not allocate another array for it.
10745           - We need to add alot of checks for if (params | locals) == null
10746             due to the first two changes.
10747
10748 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10751         implement IMemoryLocation, we store a copy on a local variable and
10752         take the address of it.  Patch from Benjamin Jemlich
10753
10754         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10755         to use a special "type_name_expression" rule which reduces the
10756         number of "QualifiedIdentifier" classes created, and instead
10757         directly creates MemberAccess expressions.
10758
10759 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10762         that fixes #52853.  Null literal assignment to ValueType
10763
10764         * class.cs (MethodData.Emit): Instead of checking the name of the
10765         method to determine if its a destructor, create a new derived
10766         class from Method called Destructor, and test for that.  
10767
10768         * cs-parser.jay: Create a Destructor object instead of a Method.  
10769
10770         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10771
10772         Fixes: 52933
10773
10774 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * expression.cs (Binary.ResolveOperator): Perform an implicit
10777         conversion from MethodGroups to their delegate types on the
10778         Addition operation.
10779
10780         * delegate.cs: Introduce a new class DelegateCreation that is the
10781         base class for `NewDelegate' and `ImplicitDelegateCreation',
10782         factor some code in here.
10783
10784         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10785         conversion from MethodGroups to compatible delegate types. 
10786
10787         * ecore.cs (Expression.Resolve): Do not flag error 654
10788         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10789         we allow conversions from MethodGroups to delegate types now.
10790
10791         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10792         assignments in v2 either.
10793
10794 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10795
10796         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10797         static read-only fields in ctors.
10798
10799         Applied patch from Benjamin Jemlich 
10800
10801         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10802
10803 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10804
10805         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10806         here to return true, as they can be used like this:
10807
10808                 (XXX) int.MEMBER ()
10809
10810         Fixed 49836 and all the other dups
10811
10812 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10813
10814         * driver.cs: Implement /win32res and /win32icon.
10815
10816 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * cs-parser.jay: Add a rule to improve error handling for the
10819         common mistake of placing modifiers after the type.
10820
10821 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10822
10823         * cs-parser.jay (interface_event_declaration): Catch
10824         initialization of events on interfaces, and report cs0068
10825
10826         * cs-parser.jay (interface_event_declaration): Catch
10827         initialization of events. 
10828
10829         * ecore.cs: Better report missing constructors.
10830
10831         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10832         the error reporting done in the wrong place.  Fix.
10833
10834         * expression.cs (Binary.ResolveOperator): Catch the 
10835         operator + (E x, E y) error earlier, and later allow for implicit
10836         conversions in operator +/- (E e, U x) from U to the underlying
10837         type of E.
10838
10839         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10840         52596, if the container class is abstract, the default constructor
10841         is protected otherwise its public (before, we were always public).
10842
10843         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10844         fixed statement.
10845
10846         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10847         Jemlich that fixes bug #52597, MCS was generating invalid code for
10848         idisposable structs.   Thanks to Ben for following up with this
10849         bug as well.
10850
10851 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10852
10853         * driver.cs: Allow assemblies without code to be generated, fixes
10854         52230.
10855
10856 2004-01-07  Nick Drochak <ndrochak@gol.com>
10857
10858         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10859
10860 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10861
10862         * cs-parser.jay: Add rules to improve error reporting if fields or
10863         methods are declared at the namespace level (error 116)
10864
10865         * Add rules to catch event add/remove
10866
10867 2004-01-04  David Sheldon <dave-mono@earth.li>
10868
10869   * expression.cs: Added matching ")" to error message for 
10870   CS0077
10871
10872 2004-01-03 Todd Berman <tberman@gentoo.org>
10873
10874         * ecore.cs, attribute.cs:
10875         Applying fix from #52429.
10876
10877 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10878
10879         * ecore.cs, expression.cs, statement.cs:
10880         Total rewrite of how we handle branching. We
10881         now handle complex boolean expressions with fewer
10882         jumps. As well if (x == 0) no longer emits a ceq.
10883
10884         if (x is Foo) is much faster now, because we generate
10885         better code.
10886
10887         Overall, we get a pretty big improvement on our benchmark
10888         tests. The code we generate is smaller and more readable.
10889
10890         I did a full two-stage bootstrap. The patch was reviewed
10891         by Martin and Miguel.
10892
10893 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10894
10895         * cs-parser.jay: Make primary_expression not take a QI.
10896         we dont need this because the member_access rule covers
10897         us here. So we replace the rule with just IDENTIFIER.
10898
10899         This has two good effects. First, we remove a s/r conflict.
10900         Second, we allocate many fewer QualifiedIdentifier objects.
10901
10902 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10903
10904         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10905         set the correct information via SRE. This prevents
10906         hanging on the MS runtime. Fixes #29374.
10907
10908 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10909
10910         * convert.cs: correctly handle conversions to value types
10911         from Enum and ValueType as unboxing conversions.
10912
10913         Fixes bug #52569. Patch by Benjamin Jemlich.
10914
10915 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10916
10917         * expression.cs (BetterConversion): Prefer int -> uint
10918         over int -> ulong (csc's behaviour). This fixed bug #52046.
10919
10920 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10921
10922         * decl.cs (MemberCache.FindMembers): now returns a
10923         MemberInfo [].
10924
10925         * typemanager.cs: In general, go with with ^^.
10926         (CopyNewMethods): take an IList.
10927         (RealMemberLookup): Only allocate an arraylist
10928         if we copy from two sets of methods.
10929
10930         This change basically does two things:
10931         1) Fewer array lists allocated due to CopyNewMethods.
10932         2) the explicit cast in MemberList costed ALOT.
10933
10934 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10935
10936         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10937         a hashtable to avoid needless string allocations when an identifier is
10938         used more than once (the common case).
10939
10940 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10941
10942         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10943         is broken, it will not return anything. So, we
10944         have to use the information we have in mcs to
10945         do the task.
10946
10947         * typemanager.cs: Add a cache for GetInterfaces,
10948         since this will now be used more often (due to ^^)
10949
10950         (GetExplicitInterfaces) New method that gets the
10951         declared, not effective, interfaces on a type
10952         builder (eg, if you have interface IFoo, interface
10953         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10954         { IBar }.
10955
10956         This patch makes MCS able to bootstrap itself on
10957         Windows again.
10958
10959 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10960
10961         * expression.cs: Remove the Nop's that Miguel put
10962         in by mistake.
10963
10964 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10965
10966         * report.cs, codegen.cs: Give the real stack trace to
10967         the error when an exception is thrown.
10968
10969 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10970
10971         * decl.cs: only allocate hashtables for ifaces if 
10972         it is an iface!
10973
10974 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10975
10976         * expression.cs: fix the error from cs0121-2.cs
10977         (a parent interface has two child interfaces that
10978         have a function with the same name and 0 params
10979         and the function is called through the parent).
10980
10981 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10982
10983         * class.cs, rootcontext.cs, typmanager.cs: do not
10984         leak pointers.
10985
10986 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10987
10988         * codegen.cs: remove stack for the ec flow branching.
10989         It is already a linked list, so no need.
10990
10991 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10992
10993         * Makefile: Allow custom profiler here.
10994
10995 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10996
10997         * typemanager.cs (LookupType):
10998           - Use a static char [], because split takes
10999             a param array for args, so it was allocating
11000             every time.
11001           - Do not store true in a hashtable, it boxes.
11002
11003 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11004
11005         * flowanalysis.cs: bytify common enums.
11006
11007 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11008
11009         * modifiers.cs: Add a new set of flags for the
11010         flags allowed on explicit interface impls.
11011         * cs-parser.jay: catch the use of modifiers in
11012         interfaces correctly.
11013         * class.cs: catch private void IFoo.Blah ().
11014
11015         All related to bug #50572.
11016
11017 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11018
11019         * decl.cs: Rewrite the consistant accessability checking.
11020         Accessability is not linear, it must be implemented in
11021         a tableish way. Fixes #49704.
11022
11023 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11024
11025         * expression.cs: Handle negation in a checked context.
11026         We must use subtraction from zero. Fixes #38674.
11027
11028 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11029
11030         * class.cs: Ignore static void main in DLLs.
11031         * rootcontext.cs: Handle the target type here,
11032         since we are have to access it from class.cs
11033         * driver.cs: account for the above.
11034
11035 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11036
11037         * report.cs: Give line numbers and files if available.
11038
11039 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11040
11041         * driver.cs: Implement /addmodule.
11042
11043         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11044         ModuleBuilders.
11045
11046 2003-12-20  Martin Baulig  <martin@ximian.com>
11047
11048         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11049         (FieldBase.IsAssigned): Removed this field.
11050         (FieldBase.SetAssigned): New public method.
11051         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11052
11053 2003-12-20  Martin Baulig  <martin@ximian.com>
11054
11055         * expression.cs (LocalVariableReference.DoResolve): Don't set
11056         `vi.Used' if we're called from DoResolveLValue().
11057
11058         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11059         returns the usage vector it just merged into the current one -
11060         pass this one to UsageWarning().
11061         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11062         of the `EmitContext', don't call this recursively on our children.
11063
11064 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11065
11066         * driver.cs: Implement /target:module.
11067
11068 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11069
11070         * support.cs (CharArrayHashtable): New helper class.
11071
11072         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11073         char arrays, not strings, so we can avoid creating a string in
11074         consume_identifier if the identifier is a keyword.
11075
11076 2003-12-16  Martin Baulig  <martin@ximian.com>
11077
11078         * statement.cs (LocalInfo.Assigned): Removed this property.
11079         (LocalInfo.Flags): Removed `Assigned'.
11080         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11081         and uses flow analysis.
11082         (Block.UsageWarning): Made this method private.
11083         (Block.Resolve): Call UsageWarning() if appropriate.
11084
11085         * expression.cs (LocalVariableReference.DoResolve): Always set
11086         LocalInfo.Used here.
11087
11088 2003-12-13  Martin Baulig  <martin@ximian.com>
11089
11090         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11091         any value here; we're now using flow analysis to figure out
11092         whether a statement/block returns a value.
11093
11094 2003-12-13  Martin Baulig  <martin@ximian.com>
11095
11096         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11097         working again.
11098         (FlowBranching.MergeFinally): Don't call
11099         `branching.CheckOutParameters()' here, this is called in
11100         MergeTopBlock().
11101         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11102         when adding the `finally' vector.       
11103
11104 2003-12-13  Martin Baulig  <martin@ximian.com>
11105
11106         * flowanalysis.cs
11107         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11108         actually work and also fix #48962.
11109
11110 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11111
11112         * decl.cs: Do not check System.Object for nested types,
11113         since we know it does not have any. Big bang for buck:
11114
11115         BEFORE:
11116            Run 1:   8.35 seconds
11117            Run 2:   8.32 seconds
11118            corlib:  17.99 seconds
11119         AFTER:
11120            Run 1:   8.17 seconds
11121            Run 2:   8.17 seconds
11122            corlib:  17.39 seconds
11123
11124 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11125
11126         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11127         time we are returning 0 members, so we save alot here.
11128
11129 2003-12-11  Martin Baulig  <martin@ximian.com>
11130
11131         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11132         `MergeChild()', also just take the `FlowBranching' as argument;
11133         call Merge() on it and return the result.
11134         (FlowBranching.Merge): We don't need to do anything if we just
11135         have one sibling.
11136
11137 2003-12-11  Martin Baulig  <martin@ximian.com>
11138
11139         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11140         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11141         Maurer for this idea.
11142
11143 2003-12-11  Martin Baulig  <martin@ximian.com>
11144
11145         * flowanalysis.cs (MergeResult): This class is now gone; we now
11146         use the `UsageVector' for this.  The reason for this is that if a
11147         branching just has one sibling, we don't need to "merge" them at
11148         all - that's the next step to do.
11149         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11150         `MergeResult'.
11151
11152 2003-12-11  Martin Baulig  <martin@ximian.com>
11153
11154         Reworked flow analyis and made it more precise and bug-free.  The
11155         most important change is that we're now using a special `Reachability'
11156         class instead of having "magic" meanings of `FlowReturns'.  I'll
11157         do some more cleanups and optimizations and also add some more
11158         documentation this week.
11159
11160         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11161         largely reworked this class.
11162         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11163         the new `Reachability' class instead of having "magic" values here.
11164         (FlowBranching): We're now using an instance of `Reachability'
11165         instead of having separate `Returns', `Breaks' etc. fields.
11166
11167         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11168         based on flow analysis; ignore the return value of block.Emit ().
11169
11170 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11171
11172         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11173         if they are private.
11174
11175 2003-12-09  Martin Baulig  <martin@ximian.com>
11176
11177         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11178         call them directly on the UsageVector.
11179
11180 2003-12-09  Martin Baulig  <martin@ximian.com>
11181
11182         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11183         Changed return type from `FlowReturns' to `Reachability'.
11184
11185 2003-12-09  Martin Baulig  <martin@ximian.com>
11186
11187         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11188         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11189         `Reachable' fields with a single `Reachability' one.
11190
11191 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11192
11193         * class.cs (FindMembers): Remove foreach's.
11194
11195         Bootstrap times:
11196
11197         BEFORE
11198                 Run 1:   8.74 seconds
11199                 Run 2:   8.71 seconds
11200
11201         AFTER
11202                 Run 1:   8.64 seconds
11203                 Run 2:   8.58 seconds
11204
11205
11206 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11207
11208         * cs-parser.jay:
11209         * gen-treedump.cs:
11210         * statement.cs:
11211         This patch does a few things:
11212                 1. EmptyStatement is now a singleton, so it is never reallocated.
11213                 2. All blah is EmptyStatement constructs have been changed to
11214                    blah == EmptyStatement.Value, which is much faster and valid
11215                    now that EmptyStatement is a singleton.
11216                 3. When resolving a block, rather than allocating a new array for
11217                    the non-empty statements, empty statements are replaced with
11218                    EmptyStatement.Value
11219                 4. Some recursive functions have been made non-recursive.
11220         Mainly the performance impact is from (3), however (1) and (2) are needed for
11221         this to work. (4) does not make a big difference in normal situations, however
11222         it makes the profile look saner.
11223
11224         Bootstrap times:
11225
11226         BEFORE
11227         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11228         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11229         Total memory allocated: 56397 KB
11230
11231         AFTER
11232         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11233         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11234         Total memory allocated: 55666 KB
11235
11236 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11237
11238         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11239         than the hashtable in a hashtable version
11240
11241         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11242         we always end up concating a string. This results in a huge perf
11243         loss, because many strings have to be tracked by the GC. In this
11244         patch, we first use a hashtable that works with two keys, so that
11245         the strings do not need to be concat'ed.
11246
11247         Bootstrap times:
11248         BEFORE
11249                 Run 1:   8.74 seconds
11250                 Run 2:   8.71 seconds
11251
11252         AFTER
11253                 Run 1:   8.65 seconds
11254                 Run 2:   8.56 seconds
11255
11256 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11257
11258         * Makefile: Add a new target `do-time' that does a quick and simple
11259         profile, leaving easy to parse output.
11260
11261 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11262
11263         * codegen.cs (Init): Create the dynamic assembly with 
11264         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11265
11266 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11267
11268         * support.cs: Make the PtrHashtable use only one
11269         instance of its comparer.
11270
11271 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11272
11273         * typemanager.cs: Fix lookup of GetNamespaces.
11274
11275 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * expression.cs: Removed redundant line.
11278
11279         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11280         ArrayLists, use for loops with bounds.  
11281
11282         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11283         arraylist.
11284
11285         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11286         arraylists, use for loop with bounds.
11287
11288         The above three changes give us a 0.071 second performance
11289         improvement out of 3.294 seconds down to 3.223.  On my machine
11290         the above changes reduced the memory usage by 1,387 KB during
11291         compiler bootstrap.
11292
11293         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11294         QualifiedIdentifiers.  Before we created a new string through
11295         concatenation, and mostly later on, the result would be
11296         manipulated by DecomposeQI through string manipulation.
11297
11298         This reduced the compiler memory usage for bootstrapping from
11299         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11300         compile times in 0.05 seconds.
11301
11302 2003-11-28  Dick Porter  <dick@ximian.com>
11303
11304         * support.cs: Do string compares with the Invariant culture.
11305
11306         * rootcontext.cs: 
11307         * gen-treedump.cs: 
11308         * expression.cs: 
11309         * driver.cs: 
11310         * decl.cs: 
11311         * codegen.cs: 
11312         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11313         the comparison is done with the Invariant culture.
11314
11315 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11316
11317         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11318         GetEnumerator method.
11319
11320         (ProbeCollectionType): Iterate starting at the most specific type
11321         upwards looking for a GetEnumerator
11322
11323         * expression.cs: Shift count can be up to 31 for int/uint and 63
11324         for long/ulong.
11325
11326 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11327
11328         * statement.cs (Block.LookupLabel): Also look for the label on the
11329         children blocks.  Use a hash table to keep track of visited
11330         nodes. 
11331
11332         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11333         we actually did transform the other operand, otherwise fall back
11334         to the common codepath that casts to long.
11335
11336         * cs-tokenizer.cs: Use the same code pattern as the int case.
11337         Maybe I should do the parsing myself, and avoid depending on the
11338         Parse routines to get this done.
11339
11340 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11341
11342         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11343         which fixes bug 51347.  This time test it.
11344
11345         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11346         attributes for example can not tell the difference between these.
11347         The difference was only a syntax feature of the language. 
11348
11349         * attribute.cs: Apply attributes to delegates.
11350
11351         * delegate.cs: Call the apply attributes method.
11352
11353 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11354
11355         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11356         comparing 0 vs Byte.MinValue, not the value
11357
11358         (ImplicitConversionRequired): When reporting a conversion error,
11359         use error 31 to print out the constant error instead of the
11360         simpler 29.
11361
11362         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11363         which fixes bug 51347.
11364
11365 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11366
11367         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11368         which fixes the -warnaserror command line option.
11369
11370 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11371
11372         * cfold.cs (DoNumericPromotions): During constant folding of
11373         additions on UIntConstant, special case intconstants with
11374         IntConstants like we do on the expression binary operator. 
11375
11376 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * convert.cs (ImplicitReferenceConversion): We were missing a case
11379         (System.Enum are not value types or class types, so we need to
11380         classify them separatedly).
11381
11382         * driver.cs: We do not support error 2007.
11383
11384 2003-11-12 Jackson Harper <jackson@ximian.com>
11385
11386         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11387         system directory. Also use the full file name so users can
11388         libraries names mscorlib-o-tron.dll in a non system dir.
11389
11390 2003-11-10  Martin Baulig  <martin@ximian.com>
11391
11392         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11393         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11394         calling `ResolveType()' on them, directly assign their `Type'.
11395
11396 2003-11-08  Martin Baulig  <martin@ximian.com>
11397
11398         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11399         return value and the `out parent' parameter.
11400         (TypeContainer.DefineType): Moved the CS0644 check into
11401         GetClassBases().  Don't pass the interface types to the
11402         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11403         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11404
11405         * ecore.cs (TypeExpr.IsAttribute): New property.
11406         (TypeExpr.GetInterfaces): New method.
11407
11408         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11409         TypeExpr instead of a Type.
11410         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11411         (Interface.DefineType): Don't pass the interface types to the
11412         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11413         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11414
11415         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11416         instead of a `Type[]'.
11417         (TypeManager.RegisterBuilder): Likewise.
11418         (TypeManager.AddUserInterface): Likewise.
11419         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11420         `Type[]' and also return a `TypeExpr[]'.
11421         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11422
11423 2003-11-08  Martin Baulig  <martin@ximian.com>
11424
11425         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11426         Expression.     
11427
11428 2003-11-08  Martin Baulig  <martin@ximian.com>
11429
11430         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11431         TypeManager.ResolveExpressionTypes().
11432
11433         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11434         instead of an Expression.
11435         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11436         (TypeExpression): New public class; formerly known as `TypeExpr'.
11437
11438         * expression.cs (ComposedCast): Derive from TypeExpr.
11439
11440         * typemanager.cs (TypeManager.system_*_expr): These are now
11441         TypExpr's instead of Expression's.
11442         (TypeManager.ResolveExpressionTypes): New public static function;
11443         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11444         of them.        
11445
11446 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11447
11448         * expression.cs (New.DoResolve): Do not dereference value that
11449         might be a null return.
11450
11451         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11452         sure that the constant value has the right type.  Fixes an
11453         unreported bug, similar to 50425.
11454
11455         * const.cs (Const.LookupConstantValue): Call
11456         ImplicitStandardConversionExists before doing a conversion to
11457         avoid havng the TypeManager.ChangeType do conversions.
11458
11459         Reduced the number of casts used
11460
11461         (Const.ChangeType): New routine to enable reuse of the constant
11462         type changing code from statement.
11463
11464         * typemanager.cs (ChangeType): Move common initialization to
11465         static global variables.
11466
11467         Fixes #50425.
11468
11469         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11470         every value type to go through, even if it was void.  Fix that. 
11471
11472         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11473         character of the define, and the is_identifier_part_character for
11474         the rest of the string.
11475
11476 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * expression.cs (UnaryMutator.EmitCode): When I updated
11479         LocalVariableReference.DoResolve, I overdid it, and dropped an
11480         optimization done on local variable references.
11481
11482 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11483
11484         * ecore.cs: Convert the return from Ldlen into an int.
11485
11486 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11487
11488         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11489         the accessibility, this is a special case for toplevel non-public
11490         classes (internal for instance).
11491
11492 2003-10-20  Nick Drochak <ndrochak@gol.com>
11493
11494         * ecore.cs: Fix typo and build.  Needed another right paren.
11495
11496 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11497
11498         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11499         `internal' case regular and protected, but not allowing protected
11500         to be evaluated later.  Bug 49840
11501
11502 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11505         to kb.Nlast, and not the kb.nFirst to isolate the switch
11506         statement.
11507
11508         Extract the underlying type, so enumerations of long/ulong are
11509         treated like long/ulong.
11510
11511 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11512
11513         * expression.cs (New): Overload the meaning of RequestedType to
11514         track the possible creation of the NewDelegate type, since
11515         DoResolve is invoked more than once for new constructors on field
11516         initialization.
11517
11518         See bugs: #48800 and #37014
11519
11520         * cs-parser.jay (declare_local_constants): Take an arraylist
11521         instead of a single constant.
11522
11523         (local_constant_declaration): It should take a
11524         constant_declarators, not a constant_declarator.  Fixes 49487
11525
11526         * convert.cs: Fix error report.
11527
11528 2003-10-13 Jackson Harper <jackson@ximian.com>
11529
11530         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11531         bug #49611
11532
11533 2003-10-09  Martin Baulig  <martin@ximian.com>
11534
11535         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11536         to the .ctor.
11537         (MethodCore.DoDefineParameters): Removed the TypeContainer
11538         argument; use the DeclSpace which was passed to the .ctor instead.
11539         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11540         TypeContainer; we only need a DeclSpace here.
11541
11542 2003-10-09  Martin Baulig  <martin@ximian.com>
11543
11544         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11545         to the .ctor.
11546         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11547         EmitContext's .ctor.    
11548
11549 2003-10-09  Martin Baulig  <martin@ximian.com>
11550
11551         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11552         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11553         AsAccessible(), moved them as well.
11554
11555         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11556
11557 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11558
11559         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11560
11561 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11564         generation for >=, as spotted by Paolo, bug 48679.  
11565         Patch from David Waite.
11566
11567         * cs-tokenizer.cs: Add handling for #pragma.
11568
11569         * cs-parser.jay: Allow for both yield and yield return in the
11570         syntax.  The anti-cobolization of C# fight will go on!
11571
11572         * class.cs (TypeBuilder.DefineType): Catch error condition here
11573         (Parent.DefineType erroring out and returning null).
11574
11575         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11576         coping with enumerations variables, we were mistakenly processing
11577         them as a regular value type instead of built-in types.  Fixes the
11578         bug #48063
11579
11580         * typemanager.cs (IsBuiltinOrEnum): New method.
11581
11582 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11583
11584         * cs-parser.jay: Upgrade: yield now needs the return clause.
11585
11586 2003-09-19  Martin Baulig  <martin@ximian.com>
11587
11588         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11589         `MemberCache parent' argument.  Normally, an interface doesn't
11590         have a parent type except System.Object, but we use this in gmcs
11591         for generic type parameters.
11592
11593 2003-09-18  Martin Baulig  <martin@ximian.com>
11594
11595         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11596         on `type.IsInterface'; don't check whether the type has a parent
11597         to determine whether it's an interface.
11598
11599 2003-09-15  Martin Baulig  <martin@ximian.com>
11600
11601         * class.cs (TypeContainer.DefineType): Added an error flag to
11602         avoid reporting duplicate CS0146's ("class definition is
11603         circular.").
11604
11605         * driver.cs (Driver.MainDriver): Abort if
11606         RootContext.ResolveTree() reported any errors.
11607
11608 2003-09-07  Martin Baulig  <martin@ximian.com>
11609
11610         * report.cs (Error, Warning): Added overloaded versions which take
11611         a `params object[] args' and call String.Format().
11612
11613 2003-09-07  Martin Baulig  <martin@ximian.com>
11614
11615         * decl.cs (DeclSpace..ctor): Don't call
11616         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11617         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11618         (DeclSpace.RecordDecl): New method.
11619
11620         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11621
11622 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11623
11624         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11625         value attributes to be applied to ParameterBuilders.
11626
11627         * class.cs (MethodCore.LabelParameters): Make static and more
11628         generic so that it can be used from other places - like interface
11629         methods, for instance.
11630
11631         * interface.cs (Interface.Emit): Call LabelParameters before
11632         emitting attributes on the InterfaceMethod.
11633
11634 2003-08-26  Martin Baulig  <martin@ximian.com>
11635
11636         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11637         resolving aliases; fixes #47927.
11638
11639 2003-08-26  Martin Baulig  <martin@ximian.com>
11640
11641         * statement.cs (Using.DoResolve): This is internally emitting a
11642         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11643         do not always return.  Fixes #47681.
11644
11645 2003-08-26  Martin Baulig  <martin@ximian.com>
11646
11647         * decl.cs (MemberCore): Moved WarningNotHiding(),
11648         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11649         into MemberBase.
11650         (AdditionResult): Make this nested in DeclSpace.
11651         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11652         argument; call NamespaceEntry.Define() unless we're nested in a
11653         class or struct.
11654
11655         * namespace.cs (Namespace.DefineName): New public function.  This
11656         is called from DeclSpace's .ctor to add 
11657         (Namespace.Lookup): Include DeclSpaces in the lookup.
11658
11659         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11660
11661         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11662
11663 2003-08-25  Martin Baulig  <martin@ximian.com>
11664
11665         * convert.cs (Convert.ExplicitReferenceConversion): When
11666         converting from an interface type to a class, unbox if the target
11667         type is a struct type.  Fixes #47822.
11668
11669 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11670
11671         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11672         #47854.
11673
11674 2003-08-22  Martin Baulig  <martin@ximian.com>
11675
11676         * class.cs (TypeManager.DefineType): When defining a nested type,
11677         call DefineType() on our parent; fixes #47801.
11678
11679 2003-08-22  Martin Baulig  <martin@ximian.com>
11680
11681         * class.cs (MethodData.Define): While checking if a method is an
11682         interface implementation, improve the test a bit more to fix #47654.
11683
11684 2003-08-22  Martin Baulig  <martin@ximian.com>
11685
11686         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11687         correctly; fixes #47722.
11688
11689 2003-08-22  Martin Baulig  <martin@ximian.com>
11690
11691         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11692         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11693
11694         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11695
11696 2003-08-22  Martin Baulig  <martin@ximian.com>
11697
11698         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11699         can only be assigned in static constructors.  Fixes #47161.
11700
11701 2003-08-22  Martin Baulig  <martin@ximian.com>
11702
11703         Rewrote and improved the flow analysis code.
11704
11705         * flowbranching.cs (FlowBranching): Make this class abstract.
11706         (FlowBranching.CreateBranching): New static function to create a
11707         new flow branching.
11708         (FlowBranchingBlock, FlowBranchingException): New classes.
11709         (FlowBranching.UsageVector.Type): New public readonly field.
11710         (FlowBranching.UsageVector.Breaks): Removed the setter.
11711         (FlowBranching.UsageVector.Returns): Removed the setter.
11712         (FlowBranching.UsageVector): Added Break(), Return(),
11713         NeverReachable() and Throw() methods to modify the reachability.
11714         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11715         done by FlowBranching.Merge().
11716         (FlowBranching.UsageVector.MergeChild): New method; merges the
11717         merge result into the current vector.
11718         (FlowBranching.Merge): New abstract method to merge a branching.
11719
11720 2003-08-12  Martin Baulig  <martin@ximian.com>
11721
11722         * expression.cs (Indirection.CacheTemporaries): Create the
11723         LocalTemporary with the pointer type, not its element type.
11724
11725 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11726
11727         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11728         token was a keyword or not.
11729
11730         Add `error' options where an IDENTIFIER was expected;  Provide
11731         CheckToken and CheckIdentifierToken convenience error reporting
11732         functions. 
11733
11734         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11735
11736         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11737         NameSpaceEntry NameSpaceEntry.
11738
11739         (LookupInterfaceOrClass): Avoid creating a full qualified name
11740         from namespace and name: avoid doing lookups when we know the
11741         namespace is non-existant.   Use new Tree.LookupByNamespace which
11742         looks up DeclSpaces based on their namespace, name pair.
11743
11744         * driver.cs: Provide a new `parser verbose' to display the
11745         exception thrown during parsing.  This is turned off by default
11746         now, so the output of a failure from mcs is more graceful.
11747
11748         * namespace.cs: Track all the namespaces defined in a hashtable
11749         for quick lookup.
11750
11751         (IsNamespace): New method
11752
11753 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11756         we know that we need to concatenate (full typename can never be
11757         null). 
11758
11759         * class.cs: ditto.
11760
11761         * statement.cs: Use a bitfield;  Do not initialize to null things
11762         which are done by the constructor by default.
11763
11764         * cs-parser.jay: bug fix, parameter was 4, not 3.
11765
11766         * expression.cs: Just use the property;
11767
11768         * statement.cs: No need for GetVariableInfo method.
11769
11770 2003-08-08  Martin Baulig  <martin@ximian.com>
11771
11772         * flowanalysis.cs (FlowReturns): This is now nested in the
11773         `FlowBranching' class.
11774         (MyBitVector): Moved this here from statement.cs.
11775         (FlowBranching.SiblingType): New enum type.
11776         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11777
11778 2003-08-07  Martin Baulig  <martin@ximian.com>
11779
11780         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11781         `FlowBranching' class and called `BranchingType'.
11782
11783 2003-08-07  Martin Baulig  <martin@ximian.com>
11784
11785         * flowanalysis.cs: Moved all the control flow analysis code into
11786         its own file.
11787
11788 2003-08-07  Martin Baulig  <martin@ximian.com>
11789
11790         * assign.cs (Assign.DoResolve): `target' must either be an
11791         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11792         #37319.
11793
11794 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11795
11796         * expression.cs (BinaryMethod): This kind of expression is created by the
11797         Binary class if it determines that the operator has to be handled
11798         by a method.
11799
11800         (BinaryDelegate): This kind of expression is created if we are
11801         dealing with a + or - operator on delegates.
11802
11803         (Binary): remove method, argumetns, and DelegateOperator: when
11804         dealing with methods, 
11805
11806         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11807
11808         * statement.cs (Block): use bitfields for the three extra booleans
11809         we had in use.   Remove unused topblock parameter.
11810
11811         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11812
11813         * assign.cs: Drop extra unneeded tests.
11814
11815 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11816
11817         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11818
11819         * statement.cs (Foreach): Use VariableStorage instead of
11820         LocalBuilders.   
11821
11822         * codegen.cs (VariableStorage): New class used by clients that
11823         require a variable stored: locals or fields for variables that
11824         need to live across yield.
11825
11826         Maybe provide a convenience api for EmitThis+EmitLoad?
11827
11828         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11829         these bad boys.
11830
11831 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11834         RemapParameterLValue): New methods that are used to turn a
11835         precomputed FieldInfo into an expression like this:
11836
11837                 instance.FieldInfo
11838
11839         The idea is to use this instead of making LocalVariableReference
11840         have more than one meaning.
11841
11842         * cs-parser.jay: Add error production to BASE.
11843
11844         * ecore.cs: Deal with TypeManager.GetField returning null, which
11845         is now a valid return value.
11846
11847         (FieldExprNoAddress): New expression for Fields whose address can
11848         not be taken.
11849
11850         * expression.cs (LocalVariableReference): During the resolve
11851         phases, create new expressions if we are in a remapping context.
11852         Remove code that dealt with remapping here.
11853
11854         (ParameterReference): same.
11855
11856         (ProxyInstance): New expression, like the `This' expression, but
11857         it is born fully resolved.  We know what we are doing, so remove
11858         the errors that are targeted to user-provided uses of `this'.
11859
11860         * statement.cs (Foreach): our variable is now stored as an
11861         Expression;  During resolution, follow the protocol, dont just
11862         assume it will return this.
11863
11864 2003-08-06  Martin Baulig  <martin@ximian.com>
11865
11866         * support.cs (SeekableStreamReader.cs): New public class.
11867
11868         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11869         SeekableStreamReader instead of the normal StreamReader.
11870
11871 2003-08-04  Martin Baulig  <martin@ximian.com>
11872
11873         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11874         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11875         deambiguate casts and delegate invocations.
11876         (parenthesized_expression): Use the new tokens to ensure this is
11877         not a cast of method invocation.
11878
11879         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11880         when reading a `)' and Deambiguate_CloseParens () was previously
11881         called.
11882
11883         * expression.cs (ParenthesizedExpression): New class.  This is
11884         just used for the CS0075 test.
11885         (Binary.DoResolve): Check for CS0075.   
11886
11887 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11888
11889         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11890         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11891         reference comparison.
11892
11893         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11894         examine the ReturnType for equality - this is necessary in the
11895         cases of implicit and explicit operators whose signature also
11896         includes the return type.
11897
11898 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11899
11900         * namespace.cs: Cache the result of the namespace computation,
11901         instead of computing it every time.
11902
11903 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11904
11905         * decl.cs: Use a global arraylist that we reuse over invocations
11906         to avoid excesive memory consumption.  Reduces memory usage on an
11907         mcs compile by one meg (45 average).
11908
11909         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11910         private, work around that.
11911
11912 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11913
11914         * literal.cs (IntLiteral): Define Zero and One static literals. 
11915
11916         * cs-parser.jay (integer_literal): use static literals to reduce
11917         memory usage for the most used literals (0, 1 and -1).  211kb
11918         reduced in memory usage.
11919
11920         Replace all calls to `new ArrayList' with `new
11921         ArrayList(4)' which is a good average number for most allocations,
11922         and also requires only 16 bytes of memory for its buffer by
11923         default. 
11924
11925         This reduced MCS memory usage in seven megabytes for the RSS after
11926         bootstrapping.
11927
11928 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11929
11930         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11931         handle params methods the correct way by forming only one
11932         applicable set with params and normal methods in them. Earlier we
11933         were looking at params methods only if we found no normal methods
11934         which was not the correct thing to do.
11935
11936         (Invocation.BetterFunction): Take separate arguments indicating
11937         when candidate and the best method are params methods in their
11938         expanded form.
11939
11940         This fixes bugs #43367 and #46199.
11941
11942         * attribute.cs: Documentation updates.
11943
11944         (CheckAttribute): Rename to CheckAttributeTarget.
11945         (GetValidPlaces): Rename to GetValidTargets.
11946
11947         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11948         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11949
11950         Fixes bug #44468.
11951
11952 2003-07-28  Martin Baulig  <martin@ximian.com>
11953
11954         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11955         name when looking up the base class of a nested class.  Fixes #46977.
11956
11957 2003-07-26  Martin Baulig  <martin@ximian.com>
11958
11959         * expression.cs (Indexers.Indexer): New nested struct; contains
11960         getter, setter and the indexer's type.
11961         (Indexers.Properties): This is now an ArrayList of
11962         Indexers.Indexer's.
11963         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11964         indexer doesn't have any getters.
11965
11966         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11967         for embedded property and indexer assignments.
11968
11969 2003-07-26  Martin Baulig  <martin@ximian.com>
11970
11971         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11972         preprocessor directive is not the first non-whitespace character
11973         on a line.
11974
11975 2003-07-26  Martin Baulig  <martin@ximian.com>
11976
11977         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11978         namespace parsing, follow the spec more closely.
11979
11980         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11981         NamespaceEntry.Lookup().
11982
11983 2003-07-25  Martin Baulig  <martin@ximian.com>
11984
11985         * MethodCore.cs (OverridesSomething): New public field; it's set
11986         from TypeContainer.DefineMembers if this method overrides
11987         something (which doesn't need to be a method).  Fix #39462.
11988
11989 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11990
11991         * typemanager.cs (GetMembers): Ensure that the list of members is
11992         reversed. This keeps things in sync.
11993
11994         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11995         find an AttributeUsage attribute.
11996
11997         * expression.cs (Invocation.OverloadResolve): Perform the check
11998         which disallows Invoke to be directly called on a Delegate.
11999
12000         (Error_InvokeOnDelegate): Report error cs1533.
12001
12002 2003-07-25  Martin Baulig  <martin@ximian.com>
12003
12004         * expression.cs (Indexers.GetIndexersForType): Only look in the
12005         interface hierarchy if the requested type is already an
12006         interface.  Fixes #46788 while keeping #46502 fixed.
12007
12008 2003-07-25  Martin Baulig  <martin@ximian.com>
12009
12010         * class.cs (TypeContainer.DefineMembers): Check whether all
12011         readonly fields have been assigned and report warning CS0649 if
12012         not.
12013
12014         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12015         a valuetype.
12016
12017 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12018
12019         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12020         returned from GetMethods to make things consistent with the
12021         assumptions MCS makes about ordering of methods.
12022
12023         This should comprehensively fix bug #45127 and it does :-)
12024
12025         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12026         ordering is actually reverse.
12027
12028         * Clean up some debug messages I left lying around.
12029
12030         * interface.cs (Populate*): Get rid of code which emits attributes
12031         since the stage in which we emit attributes is the 'Emit' stage,
12032         not the define stage.
12033
12034         (Emit): Move attribute emission for interface members here.
12035
12036 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12037
12038         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12039         closely: we eliminate methods in base types when we have an
12040         applicable method in a top-level type.
12041
12042         Please see section 14.5.5.1 for an exact description of what goes
12043         on. 
12044
12045         This fixes bug #45127 and a host of other related to corlib compilation.
12046
12047         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12048         array is the method corresponding to the top-level type (this is
12049         because of the changes made to icall.c) so we change this
12050         accordingly.
12051
12052         (MethodGroupExpr.Name): This too.
12053
12054         * typemanager.cs (GetElementType): New method which does the right
12055         thing when compiling corlib. 
12056
12057         * everywhere: Make use of the above in the relevant places.
12058
12059 2003-07-22  Martin Baulig  <martin@ximian.com>
12060
12061         * cs-parser.jay (invocation_expression): Moved
12062         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12063         `cast_expression', but create a InvocationOrCast which later
12064         resolves to either an Invocation or a Cast.
12065
12066         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12067         method; call this before EmitStatement() to make sure that this
12068         expression can be used as a statement.
12069
12070         * expression.cs (InvocationOrCast): New class; resolves to either
12071         an Invocation or a Cast.
12072
12073         * statement.cs (StatementExpression): Call ResolveStatement() on
12074         the ExpressionStatement before emitting it.
12075
12076 2003-07-21  Martin Baulig  <martin@ximian.com>
12077
12078         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12079         `ref' and `out' attributes match; fixes #46220.
12080         (MemberAccess.ResolveMemberAccess): You can't reference a type
12081         through an expression; fixes #33180.
12082         (Indexers.GetIndexersForType): Don't return the indexers from
12083         interfaces the class implements; fixes #46502.
12084
12085 2003-07-21  Martin Baulig  <martin@ximian.com>
12086
12087         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12088         CS0661 checks; fixes bug #30442.
12089
12090 2003-07-21  Martin Baulig  <martin@ximian.com>
12091
12092         * decl.cs (AdditionResult): Added `Error'.
12093
12094         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12095
12096         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12097         makes cs0031.cs actually work.
12098
12099 2003-07-20  Martin Baulig  <martin@ximian.com>
12100
12101         * namespace.cs: Fixed that bug which caused a crash when compiling
12102         the debugger's GUI.
12103
12104 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12105
12106         * typemanager.cs (LookupTypeReflection): Never expose types which
12107         are NotPublic, NestedPrivate, NestedAssembly, or
12108         NestedFamANDAssem.  We used to return these, and later do a check
12109         that would report a meaningful error, but the problem is that we
12110         would not get the real match, if there was a name override.
12111
12112 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12113
12114         * namespace.cs (Namespace, Name): Do not compute the namespace
12115         name dynamically, compute it in the constructor.  This reduced
12116         memory usage by 1697 KB.
12117
12118         * driver.cs: Use --pause to pause at the end.
12119
12120 2003-07-17  Peter Williams  <peter@newton.cx>
12121
12122         * Makefile: Change the name of the test target so that it doesn't
12123         conflict with the recursive test target.
12124
12125 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12126
12127         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12128         AddressOf): Do not use EmitThis, that was wrong, use the actual
12129         this pointer.
12130
12131 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12132
12133         * class.cs (MethodData.Define): While checking if a method is an
12134         interface implementation, improve the test: If we are not public
12135         (use new test here: use the computed MethodAttributes directly,
12136         instead of the parsed modifier flags) check if the `implementing'
12137         method comes from an interface or not.
12138
12139         * pending.cs (VerifyPendingMethods): Slightly better error
12140         message.
12141
12142         * makefile: add test target that does the mcs bootstrap.
12143
12144 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12145
12146         * interface.cs (Define): Do nothing here since there are no
12147         members to populate etc. Move the attribute emission out of here
12148         since this was just totally the wrong place to put it. Attribute
12149         application happens during the 'Emit' phase, not in the 'Define'
12150         phase.
12151
12152         (Emit): Add this method and move the attribute emission here
12153
12154         * rootcontext.cs (EmitCode): Call the Emit method on interface
12155         types too.
12156
12157 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12158
12159         * expression.cs (OverloadResolve): Report error only if Location
12160         is not 'Null' which means that there was a probe going on.
12161
12162 2003-07-14  Martin Baulig  <martin@ximian.com>
12163
12164         * expression.cs (ConditionalLogicalOperator): New public class to
12165         implement user defined conditional logical operators.
12166         This is section 14.11.2 in the spec and bug #40505.
12167
12168 2003-07-14  Martin Baulig  <martin@ximian.com>
12169
12170         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12171
12172 2003-07-14  Martin Baulig  <martin@ximian.com>
12173
12174         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12175
12176         * ecore.cs (IVariable.VerifyFixed): New interface method.
12177
12178         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12179         operator, check whether the variable is actually fixed.  Fixes bug
12180         #36055.  Set a variable definitely assigned when taking its
12181         address as required by the spec.
12182
12183         * statement.cs (LocalInfo.IsFixed): New field.
12184         (LocalInfo.MakePinned): Set `IsFixed' to true.
12185
12186 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12187
12188         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12189         for .ctors, ensure that we only ask for members declared in the
12190         attribute type (BindingFlags.DeclaredOnly).
12191
12192         Fixes bug #43632.
12193
12194         * expression.cs (Error_WrongNumArguments): Report error 1501
12195         correctly the way CSC does.
12196
12197 2003-07-13  Martin Baulig  <martin@ximian.com>
12198
12199         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12200         lookup on the fully qualified name, to make things like "X.X" work
12201         where "X.X" is a fully qualified type name, but we also have a
12202         namespace "X" in the using list.  Fixes #41975.
12203
12204 2003-07-13  Martin Baulig  <martin@ximian.com>
12205
12206         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12207         function. If we're a CompoundAssign, we need to create an embedded
12208         CompoundAssign, not an embedded Assign.
12209         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12210         Fixes #45854.
12211
12212 2003-07-13  Martin Baulig  <martin@ximian.com>
12213
12214         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12215         work to fix bug #46088.
12216
12217 2003-07-13  Ravi Pratap <ravi@ximian.com>
12218
12219         * class.cs (Operator.Emit): Do not emit attributes here - it is
12220         taken care of by the Method class that we delegate too. This takes
12221         care of bug #45876.
12222
12223 2003-07-10  Martin Baulig  <martin@ximian.com>
12224
12225         * expression.cs (TypeOfVoid): New class.
12226         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12227
12228 2003-07-10  Martin Baulig  <martin@ximian.com>
12229
12230         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12231         bug #35957.
12232
12233 2003-07-10  Martin Baulig  <martin@ximian.com>
12234
12235         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12236         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12237
12238         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12239
12240         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12241
12242 2003-07-10  Martin Baulig  <martin@ximian.com>
12243
12244         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12245         of decimal.  Fixes #42850.
12246
12247         NOTE: I also fixed the created byte blob, but this doesn't work on
12248         the MS runtime and csc never produces any byte blobs for decimal
12249         arrays.
12250
12251 2003-07-10  Martin Baulig  <martin@ximian.com>
12252
12253         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12254         structs; fixes #32068.
12255         (Block.AddChildVariableNames): Fixed #44302.
12256
12257 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12258
12259         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12260
12261 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12262
12263         * attribute.cs: And this test is onger needed.
12264
12265 2003-07-08  Martin Baulig  <martin@ximian.com>
12266
12267         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12268         inaccessible types.  Fixes #36313.
12269
12270         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12271
12272         * namespace.cs (NamespaceEntry): Create implicit entries for all
12273         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12274         implicit entries for N1.N2 and N1.
12275
12276 2003-07-08  Martin Baulig  <martin@ximian.com>
12277
12278         Rewrote the handling of namespaces to fix a lot of the issues
12279         wrt. `using' aliases etc.
12280
12281         * namespace.cs (Namespace): Splitted this class into a
12282         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12283
12284         * typemanager.cs (TypeManager.IsNamespace): Removed.
12285         (TypeManager.ComputeNamespaces): Only compute namespaces from
12286         loaded assemblies here, not the namespaces from the assembly we're
12287         currently compiling.
12288
12289 2003-07-08  Martin Baulig  <martin@ximian.com>
12290
12291         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12292
12293 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12294
12295         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12296         already fixed it.  
12297
12298         I thought about the memory savings here, but LookupTypeReflection
12299         is used under already very constrained scenarios.  Compiling
12300         corlib or mcs only exposes one hit, so it would not really reduce
12301         any memory consumption.
12302
12303 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12304
12305         * typemanager.cs: fixes bug #45889 by only adding public types from
12306         other assemblies to the list of known types.
12307
12308 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12309
12310         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12311         on the type we resolved.
12312
12313 2003-07-05  Martin Baulig  <martin@ximian.com>
12314
12315         * pending.cs (PendingImplementation.ParentImplements): Don't
12316         create the proxy if the parent is abstract.
12317
12318         * class.cs (TypeContainer.DefineIndexers): Process explicit
12319         interface implementations first.  Fixes #37714.
12320
12321 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12322
12323         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12324         defined recursively;  but since we modify the input parameters
12325         (left is set to `this' temporarily), we reset this value if the
12326         left_is_explicit is false, which gives the original semantics to
12327         the code.  
12328
12329         * literal.cs (NullPointer): new class used to represent a null
12330         literal in a pointer context.
12331
12332         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12333         type is a pointer, use a NullPointer object instead of a
12334         NullLiteral.   Closes 43687
12335
12336         (ExplicitConversion): Convert pointer values using
12337         the conv opcode to the proper type.
12338
12339         * ecore.cs (New): change ValueTypeVariable property into a method,
12340         that returns whether the valuetype is suitable for being used.
12341
12342         * expression.cs (Binary.DoNumericPromotions): Only return if we
12343         the int constant was a valid uint, and we can return both left and
12344         right as uints.  If not, we continue processing, to trigger the
12345         type conversion.  This fixes 39018.
12346
12347         * statement.cs (Block.EmitMeta): During constant resolution, set
12348         the CurrentBlock property on the emitcontext, so that we resolve
12349         constants propertly.
12350
12351 2003-07-02  Martin Baulig  <martin@ximian.com>
12352
12353         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12354         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12355
12356         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12357         than emitting it here.
12358
12359         * statement.cs: Fixed some more flow analysis bugs.
12360
12361 2003-07-02  Martin Baulig  <martin@ximian.com>
12362
12363         * class.cs (MethodData.Define): When implementing interface
12364         methods, set Final unless we're Virtual.
12365
12366         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12367         check work for interface methods.
12368
12369 2003-07-01  Martin Baulig  <martin@ximian.com>
12370
12371         * ecore.cs (EmitContext.This): Replaced this property with a
12372         GetThis() method which takes a Location argument.  This ensures
12373         that we get the correct error location for a CS0188.
12374
12375 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12378         ImplicitStandardConversion.
12379
12380         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12381
12382 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12383
12384         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12385         optimization.
12386
12387 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12388
12389         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12390         constructors.
12391
12392         (MethodData.Define): Turn off initlocals for unsafe methods.
12393
12394 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12395
12396         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12397         complete;  Fixes #37521.
12398
12399         * delegate.cs: Use Modifiers.TypeAttr to compute the
12400         TypeAttributes, instead of rolling our own.  This makes the flags
12401         correct for the delegates.
12402
12403 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * class.cs (Constructor.Define): Set the private flag for static
12406         constructors as well.
12407
12408         * cs-parser.jay (statement_expression): Set the return value to
12409         null, to avoid a crash when we catch an error.
12410
12411 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * cs-parser.jay: Applied patch from Jackson that adds support for
12414         extern and unsafe modifiers to destructor declarations.
12415
12416         * expression.cs: Report error 21 if the user is trying to index a
12417         System.Array.
12418
12419         * driver.cs: Add an error message, suggested by the bug report.
12420
12421         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12422         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12423
12424 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12425
12426         * namespace.cs: Add some information to reduce FAQs.
12427
12428 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12431         underlying enumeration types.  Fixes #43915.
12432
12433         * expression.cs: Treat ushort/short as legal values to be used in
12434         bitwise operations.
12435
12436 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12437
12438         * delegate.cs: transfer custom attributes for paramenters from
12439         the delegate declaration to Invoke and BeginInvoke.
12440
12441 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12442
12443         * attribute.cs: handle custom marshalers and emit marshal info
12444         for fields, too.
12445
12446 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12447
12448         * makefile.gnu: Added anonymous.cs to the compiler sources.
12449
12450 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12451
12452         * iterators.cs: Change the name of the proxy class to include two
12453         underscores.
12454
12455         * cs-parser.jay: Update grammar to include anonymous methods.
12456
12457         * anonymous.cs: new file.
12458
12459 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * class.cs (Field.Define): Add missing test for pointers and
12462         safety. 
12463
12464 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12465
12466         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12467         we use the stobj opcode.
12468
12469         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12470         since it wasn't the correct fix. 
12471
12472         It still is puzzling that we are required to use stobj for IntPtr
12473         which seems to be a ValueType.
12474
12475 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12476
12477         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12478         during regular simple name resolution.   Now, the trick is that
12479         instead of returning for processing the simplename, we do a
12480         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12481         contextual lookup type).   If a match is found, return that, if
12482         not, return for further composition.
12483
12484         This fixes long-standing 30485.
12485
12486         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12487         using the address to initialize an object, do an Stobj instead of
12488         using the regular Stelem.
12489
12490         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12491         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12492         Because if we are a BaseIndexerAccess that value will be true.
12493         Fixes 43643.
12494
12495         * statement.cs (GotoCase.Resolve): Return after reporting an
12496         error, do not attempt to continue. 
12497
12498         * expression.cs (PointerArithmetic.Emit): If our operand is a
12499         long, convert our constants to match the operand before
12500         multiplying.  Convert to I type before adding.   Fixes 43670.
12501
12502 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12503
12504         * enum.cs (ImplicitConversionExists) : Rename to
12505         ImplicitEnumConversionExists to remove ambiguity. 
12506
12507         * ecore.cs (NullCast): New type of cast expression class which
12508         basically is very similar to EmptyCast with the difference being
12509         it still is a constant since it is used only to cast a null to
12510         something else
12511         (eg. (string) null)
12512
12513         * convert.cs (ImplicitReferenceConversion): When casting a null
12514         literal, we return a NullCast.
12515
12516         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12517         should be around anymore.
12518
12519         The renaming (reported was slightly wrong). Corrections:
12520
12521         ConvertImplicitStandard -> ImplicitConversionStandard
12522         ConvertExplicitStandard -> ExplicitConversionStandard
12523
12524         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12525         before passing them in !
12526
12527         * convert.cs (ImplicitConversionStandard): When comparing for
12528         equal expr and target types, ensure that expr is not a
12529         NullLiteral.
12530
12531         In general, we must not be checking (expr_type ==
12532         target_type) in the top level conversion methods
12533         (ImplicitConversion, ExplicitConversion etc). This checking is
12534         done in the methods that they delegate to.
12535
12536 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12537
12538         * convert.cs: Move Error_CannotConvertType,
12539         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12540         ImplicitNumericConversion, ImplicitConversionExists,
12541         ImplicitUserConversionExists, StandardConversionExists,
12542         FindMostEncompassedType, FindMostSpecificSource,
12543         FindMostSpecificTarget, ImplicitUserConversion,
12544         ExplicitUserConversion, GetConversionOperators,
12545         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12546         TryImplicitIntConversion, Error_CannotConvertImplicit,
12547         ConvertImplicitRequired, ConvertNumericExplicit,
12548         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12549         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12550         its own file.
12551
12552         Perform the following renames:
12553
12554         StandardConversionExists -> ImplicitStandardConversionExists
12555         ConvertImplicit -> ImplicitConversion
12556         ConvertImplicitStandard -> ImplicitStandardConversion
12557         TryImplicitIntConversion -> ImplicitIntConversion
12558         ConvertImplicitRequired -> ImplicitConversionRequired
12559         ConvertNumericExplicit -> ExplicitNumericConversion
12560         ConvertReferenceExplicit -> ExplicitReferenceConversion
12561         ConvertExplicit -> ExplicitConversion
12562         ConvertExplicitStandard -> ExplicitStandardConversion
12563
12564 2003-05-19  Martin Baulig  <martin@ximian.com>
12565
12566         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12567         (TypeInfo): Added support for structs having structs as fields.
12568
12569         * ecore.cs (FieldExpr): Implement IVariable.
12570         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12571         VariableInfo for the field.
12572
12573 2003-05-18  Martin Baulig  <martin@ximian.com>
12574
12575         * expression.cs (This.DoResolve): Report a CS0027 if we're
12576         emitting a field initializer.
12577
12578 2003-05-18  Martin Baulig  <martin@ximian.com>
12579
12580         * expression.cs (This.ResolveBase): New public function.
12581         (This.DoResolve): Check for CS0188.
12582
12583         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12584         This.Resolve().
12585
12586         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12587         `instance_expression' to null if we don't have any non-static
12588         methods.
12589
12590 2003-05-18  Martin Baulig  <martin@ximian.com>
12591
12592         Reworked the way how local variables and parameters are handled by
12593         the flow analysis code.
12594
12595         * statement.cs (TypeInfo, VariableMap): New public classes.
12596         (VariableInfo): New public class.  This is now responsible for
12597         checking whether a variable has been assigned.  It is used for
12598         parameters and local variables.
12599         (Block.EmitMeta): Take the InternalParameters as argument; compute
12600         the layout of the flow vectors here.
12601         (Block.LocalMap, Block.ParameterMap): New public properties.
12602         (FlowBranching): The .ctor doesn't get the InternalParameters
12603         anymore since Block.EmitMeta() now computes the layout of the flow
12604         vector.
12605         (MyStructInfo): This class is now known as `StructInfo' and nested
12606         in `TypeInfo'; we don't access this directly anymore.
12607
12608         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12609         property and removed IsAssigned(), IsFieldAssigned(),
12610         SetAssigned() and SetFieldAssigned(); we now call them on the
12611         VariableInfo so we don't need to duplicate this code everywhere.
12612
12613         * expression.cs (ParameterReference): Added `Block block' argument
12614         to the .ctor.
12615         (LocalVariableReference, ParameterReference, This): The new
12616         VariableInfo class is now responsible for all the definite
12617         assignment stuff.
12618
12619         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12620         IsParameterAssigned, SetParameterAssigned): Removed.
12621
12622 2003-05-18  Martin Baulig  <martin@ximian.com>
12623
12624         * typemanager.cs (InitCoreTypes): Try calling
12625         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12626         the 3-args-version.  Corlib now also needs our `void_type'.
12627         (GetMethod): Added overloaded version which takes an optional
12628         `bool report_errors' to allow lookups of optional methods.
12629
12630 2003-05-12  Martin Baulig  <martin@ximian.com>
12631
12632         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12633         only used for locals and not for parameters.
12634
12635 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12636
12637         * support.cs (InternalParameters.ParameterType): Return the
12638         ExternalType of the parameter.
12639
12640         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12641         they were unused.
12642
12643 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * class.cs (MethodData.Define): Do not set the `newslot' on
12646         interface members, if they are also flagged as "override".
12647
12648         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12649         better code for ++i and i++.  This only works for static fields
12650         and local variables.
12651
12652         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12653         want to pull the DeclSpace out of the builder_to_declspace instead
12654         of the TypeBuilder (like in TypeContainer.FindMembers).
12655
12656         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12657         instead of LookupTypeContainer.  Fixes the crash on .NET for
12658         looking up interface members.
12659
12660         * const.cs: Create our own emit context during the Definition
12661         stage, so that constants are evaluated in the proper context, when
12662         a recursive definition happens.
12663
12664 2003-05-11  Martin Baulig  <martin@ximian.com>
12665
12666         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12667         new block for a switch section.
12668         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12669         the adding/lookup in the switch block.  Fixes #39828.
12670
12671 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12674         functionality: I needed to convert the data after I had performed
12675         the add/sub operation into the operands type size.
12676
12677         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12678         pass the type for the box operation, otherwise the resulting
12679         object would have been of type object.
12680
12681         (BoxedCast): Add constructor to specify the type to box as.
12682
12683 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * iterators.cs: I was reusing the `count' variable inadvertently,
12686         take steps to not allow this to happen.
12687
12688 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12689
12690         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12691         by creating an array at the point where the params starts and
12692         putting all those arguments there, then adjusting the size of the
12693         array.
12694
12695 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * expression.cs (New.AddressOf): Implement interface
12698         IMemoryLocation.  This is used when the `new' operator is used in
12699         the context of an invocation to a method on a value type.
12700
12701         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12702         example. 
12703
12704         * namespace.cs: Also check the using aliases here.
12705
12706         * driver.cs: Move the test for using validity after the types have
12707         been entered, so we do a single pass that also includes the using
12708         aliases. 
12709
12710         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12711         in the regular case.   CreateSiblingForFinally is doing extra
12712         error checking.
12713
12714         * attribute.cs (GetAttributeArgumentExpression): Store the result
12715         on an out value, and use the return value to indicate failure
12716         instead of using null (which is a valid return for Constant.GetValue).
12717
12718         * statement.cs: Perform the analysis flow for the increment
12719         portion after the statement, because this will be the real flow of
12720         execution.  Fixes #42385
12721
12722         * codegen.cs (EmitContext.EmitArgument,
12723         EmitContext.EmitStoreArgument): New helper functions when the
12724         RemapToProxy flag is set.
12725
12726         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12727         function.
12728
12729         Add support for remapping parameters. 
12730
12731         * iterators.cs: Propagate parameter values;  Store parameter
12732         values in the proxy classes.
12733
12734 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12737         need a proxy reference;  I do not know what I was thinking
12738
12739         * cs-parser.jay (constructor_initializer): catch another error,
12740         and display nice message.
12741
12742         (field_declaration): catch void field declaration
12743         to flag a better error. 
12744
12745         * class.cs (MemberBase.CheckBase): Report an error instead of a
12746         warning if a new protected member is declared in a struct. 
12747         (Field.Define): catch the error of readonly/volatile.
12748
12749         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12750
12751         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12752         volatile variable is taken
12753
12754 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12755
12756         * statement.cs (Fixed.Resolve): Report an error if we are not in
12757         an unsafe context.
12758
12759 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12760
12761         * typemanager.cs: reuse the code that handles type clashes for
12762         delegates and enumerations.
12763
12764         * class.cs (Report28): Always report.
12765
12766         * expression.cs (EncodeAsAttribute): Allow nulls here.
12767
12768 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12769
12770         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12771         the functionality for testing whether an expression is valid for
12772         an attribute here.  Also handle the case of arrays of elements
12773         being stored. 
12774
12775         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12776         encoding a linear array into an array of objects that are suitable
12777         to be passed to an CustomAttributeBuilder.
12778
12779         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12780
12781         * ecore.cs: (FieldExpr): Handle field remapping here.
12782
12783         * iteratators.cs: Pass the instance variable (if the method is an
12784         instance method) to the constructors, so we can access the field
12785         variables on the class.
12786
12787         TODO: Test this with structs.  I think the THIS variable on
12788         structs might have to be a pointer, and not a refenrece
12789
12790 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12791
12792         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12793         local variables to fields in a proxy class.
12794
12795         * iterators.cs (PopulateProxy): Rename our internal fields to
12796         <XXX>.  
12797         Create a <THIS> field if we are an instance method, so we can
12798         reference our parent container variables.
12799         (MapVariable): Called back from the EmitContext code to enter a
12800         new variable to field mapping into the proxy class (we just create
12801         a FieldBuilder).
12802
12803         * expression.cs
12804         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12805         for using the remapped locals to fields.
12806
12807         I placed the code here, because that gives the same semantics to
12808         local variables, and only changes the Emit code.
12809
12810         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12811         statements inside iterators.
12812         (VariableInfo): Add a FieldBuilder for the cases when we are
12813         remapping local variables to fields in a proxy class
12814
12815         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12816         current_block != null.
12817
12818         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12819         not cope with strings, as it has been moved to the
12820         TableSwitchEmit.  Fixed bug in switch generation.
12821
12822         * expression.cs (New.DoResolve): Provide more context for the user
12823         when reporting an error.
12824
12825         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12826         pointers. 
12827
12828         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12829         check the permissions for it.  Note than in a type-resolution
12830         context the check was already present in DeclSpace.ResolveType,
12831         but was missing from the MemberAccess.
12832
12833         (ArrayCreation.CheckIndices): warn if the user has
12834         more nested levels of expressions, but there are no more
12835         dimensions specified.  Avoids crash on bug 41906.
12836
12837 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12838
12839         * statement.cs (Block): replace Implicit bool, for a generic
12840         flags.   
12841         New flag: `Unchecked'.  This is used during the EmitMeta phase
12842         (which is out-of-line with the regular Resolve/Emit process for a
12843         statement, as this is done ahead of time, but still gets a chance
12844         to call constant resolve).
12845
12846         (Block.Flags): new enum for adding a new flag.
12847
12848         (Block.EmitMeta): track the state of unchecked.
12849
12850         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12851         to enable constant resolution to work there as well.
12852
12853 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12854
12855         * typemanager.cs (ienumerable_type): Also look up
12856         System.Collections.IEnumerable. 
12857
12858 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12859
12860         TODO: Test more than one conditional per method.
12861
12862         * class.cs (Indexer.Define): Report the location where the user is
12863         referencing the unsupported feature.
12864
12865         (MethodData): Overload the use of `conditionals' to
12866         minimize the creation of needless ArrayLists.   This saves roughly
12867         212kb on my machine.
12868
12869         (Method): Implement the new IIteratorContainer interface.
12870         (Method.SetYields): Implement the method by setting the ModFlags
12871         to contain METHOD_YIELDS.
12872
12873         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12874         which just got set to null.
12875
12876         * iterators.cs: New file.
12877
12878         (Yield, YieldBreak): New statements.
12879
12880         * statement.cs (Return.Resolve): Flag an error if we are used in
12881         an iterator method.
12882
12883         * codegen.cs (InIterator): New flag set if the code is being
12884         compiled in an iterator method.
12885
12886         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12887         internal modifier, and we just use it to avoid adding extra
12888         fields, as this is seldom used.  
12889
12890         * cs-parser.jay: Add yield_statement (yield and yield break).
12891
12892         * driver.cs: New flag -v2 to turn on version 2 features. 
12893
12894         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12895         hashtable when v2 is enabled.
12896
12897 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12898
12899         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12900         there is already a namespace defined with this name.
12901
12902         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12903         people upgraded their corlibs.
12904
12905         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12906         always use fully qualified types, no need to use the compiler
12907         front end.
12908
12909         (TypeManager.IsNamespace): Use binarysearch.
12910
12911         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12912         AddDelegate): I did not quite use the new IsValid API properly: I
12913         have to pass the short-name and the fullname.  I was passing only
12914         the basename instead of the fullname sometimes. 
12915
12916         (TypeContainer.DefineType): call NamespaceClash.
12917
12918         * interface.cs (Interface.DefineType): use NamespaceClash before
12919         defining the type.
12920
12921         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12922         defining the type.
12923
12924         * enum.cs: (Enum.DefineType): use NamespaceClash before
12925         defining the type.
12926
12927         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12928         speed increase.  First, use the negative_hits cache when we get a
12929         negative.  Second, add the type with its full original name
12930         instead of the new . and + encoded name (reflection uses + to
12931         separate type from a nested type).  Use LookupTypeReflection
12932         directly which bypasses the type->name hashtable (that we already
12933         know does not contain the type.
12934
12935         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12936         location/container type. 
12937
12938         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12939
12940 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12943
12944         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12945         method is being referenced in the method group from a static
12946         context, and report error 120 if so.
12947
12948         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12949         Error118. 
12950
12951         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12952         is created, we create the A namespace).
12953
12954         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12955         Fixes #41591
12956
12957 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12958
12959         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12960         invocation to ModuleBuilder.GetType with the same values will
12961         return a new type instance, so we need to cache its return
12962         values. 
12963
12964         * expression.cs (Binary.ResolveOperator): Only allow the compare
12965         operators on enums if they are of the same type.
12966
12967         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12968         types of ValueType on their own case.  Before we were giving them
12969         the same treatment as objects.
12970
12971         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12972         fullname.  Short name is used to compare against container name.
12973         Fullname is used to check against defined namespace names.
12974
12975         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12976         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12977
12978         (Method.CheckBase): Call parent.
12979         (MemberBase.CheckBase): Check for protected members on sealed
12980         classes.
12981         (PropertyBase.CheckBase): Call parent.
12982         (Field.Define): Call parent.
12983
12984         * report.cs: Negative error codes are now mapped to 8000 - code,
12985         so that the display is render more nicely.
12986
12987         * typemanager.cs: Do not use try/catch, instead report a regular
12988         error. 
12989
12990         (GetPointerType, GetReferenceType): These methods provide
12991         mechanisms to obtain the T* and T& from a T.  We had the code
12992         previously scattered around the code base, and it also used
12993         TypeManager.LookupType that would go through plenty of caches.
12994         This one goes directly to the type source.
12995
12996         In some places we did the Type.GetType followed by
12997         ModuleBuilder.GetType, but not in others, so this unifies the
12998         processing as well.
12999
13000         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13001         statements now that we have namespace information.
13002
13003         * typemanager.cs (IsNamespace): New method, returns whether the
13004         string presented is a namespace or not.
13005
13006         (ComputeNamespaces): New public entry point, computes the list of
13007         available namespaces, using the GetNamespaces API call in Mono, or
13008         the slower version in MS.NET.   
13009
13010         Now before we start the semantic analysis phase, we have a
13011         complete list of namespaces including everything that the user has
13012         provided.
13013
13014         Deleted old code to cache namespaces in .nsc files.
13015
13016 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13017
13018         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13019         class/struct location definition Location for the implicit
13020         constructor location.
13021
13022         (Operator.Define): Use the location of the operator for the
13023         implicit Method definition.
13024
13025         (Constructor.Emit): use the constructor location for the implicit
13026         base initializer constructor.
13027
13028         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13029         and the Expression class now contains two new methods:
13030
13031         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13032         isolate type lookup from the rest of the resolution process.
13033
13034         Since we use Expressions to hold type definitions due to the way
13035         we parse the input we have historically overloaded Resolve to
13036         perform the Type lookups if a special flag is passed.  Now this is
13037         eliminated and two methods take their place. 
13038
13039         The differences in the two methods between xStep and xTerminal is
13040         that xStep is involved in our current lookup system that uses
13041         SimpleNames to compose a name, while xTerminal is used just to
13042         catch the case where the simplename lookup failed.
13043
13044 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * expression.cs (ResolveMemberAccess): Remove redundant code.
13047         TypeExpr expressions are always born fully resolved.
13048
13049         * interface.cs (PopulateMethod): Do not lookup the types twice.
13050         We were doing it once during SemanticAnalysis and once during
13051         PopulateMethod.
13052
13053         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13054         in local variable type definitions, were being returned as a
13055         SimpleName (we decomposed everything into a string), that is
13056         because primary_expression was being used instead of a type in the
13057         grammar (reduce/reduce conflicts).
13058
13059         The part that was wrong is that we converted the expression into a
13060         string (an oversimplification in one hand, compounded with primary
13061         expressions doing string concatenation).
13062
13063         So things like:
13064
13065         A.B.C [] x;
13066
13067         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13068         using clauses from working on this particular context.  And a type
13069         was being matched directly against "A.B.C[]".
13070
13071         We now use the correct approach, and allow for ComposedCast to be
13072         part of the unary expression.  So the "A.B.C []" become a composed
13073         cast of "A.B.C" (as a nested group of MemberAccess with a
13074         SimpleName at the end) plus the rank composition "[]". 
13075
13076         Also fixes 35567
13077
13078 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13079
13080         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13081         for the access level checking.
13082
13083         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13084         `TypeContainer container', because I kept getting confused when I
13085         was debugging this code.
13086
13087         * expression.cs (Indexers): Instead of tracking getters/setters,
13088         we now track them in parallel.  We create one arraylist less, but
13089         most importantly it is possible now for the LValue code to find a
13090         matching get for a set.
13091
13092         (IndexerAccess.DoResolveLValue): Update the code.
13093         GetIndexersForType has been modified already to extract all the
13094         indexers from a type.  The code assumed it did not.
13095
13096         Also make the code set the correct return type for the indexer.
13097         This was fixed a long time ago for properties, but was missing for
13098         indexers.  It used to be void_type.
13099
13100         (Binary.Emit): Test first for doubles instead of
13101         floats, as they are more common.
13102
13103         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13104         when dealing with floats and the <=, >= operators.  This fixes bug
13105         #39314 
13106
13107         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13108         to load the array value by emitting a load on the foreach variable
13109         type.  This was incorrect.  
13110
13111         We now emit the code to load an element using the the array
13112         variable type, and then we emit the conversion operator.
13113
13114         Fixed #40176
13115
13116 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13117
13118         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13119
13120 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13121
13122         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13123         test for protection before we test for signatures. 
13124
13125         (MethodSignature.ToString): implement.
13126
13127         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13128         to the case where we reduced into a LongConstant.
13129
13130         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13131         depend on whether the information is acurrate, because the
13132         Microsoft runtime will always claim that the array type is public,
13133         regardless of the real state.
13134
13135         If the type is a pointer, another problem happens: the type is
13136         reported as non-public in Microsoft.  
13137
13138         In both cases we have to call CheckAccessLevel recursively with
13139         the underlying type as the argument to be tested.
13140
13141 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13142
13143         * assign.cs (Assign.Emit): If we are dealing with a compound
13144         assignment expression, we should use the code path that stores the
13145         intermediate result in a temporary value.  This fixes #40903.
13146
13147         *expression.cs (Indirection.ToString): Provide ToString method for
13148         debugging. 
13149
13150 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13151
13152         * class.cs: Null out fields holding references to Block objects so
13153         they can be garbage collected.
13154
13155         * expression.cs (OverloadResolve): Remove unused local.
13156
13157 2003-04-07  Martin Baulig  <martin@ximian.com>
13158
13159         * codegen.cs (EmitContext.CurrentFile): New public field.
13160         (EmitContext.Mark): Use the CurrentFile to check whether the
13161         location is in the correct file.
13162         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13163
13164 2003-04-07  Martin Baulig  <martin@ximian.com>
13165
13166         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13167
13168         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13169         location.  [FIXME: The location argument which gets passed to this
13170         method is sometimes wrong!]
13171
13172 2003-04-07  Nick Drochak <ndrochak@gol.com>
13173
13174         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13175
13176 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13177
13178         * expression.cs (Indirection.EmitAssign): We were using the
13179         temporary, but returning immediately instead of continuing the
13180         EmitAssing flow.
13181
13182 2003-04-06  Martin Baulig  <martin@ximian.com>
13183
13184         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13185         if it's a nested child, but also deriving from the outer class.
13186         See test 190.cs.
13187
13188         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13189         nested child, but also deriving from the outer class.  See
13190         test-190.cs.
13191         (FilterWithClosure): We may access private members of the outer
13192         class if we're a nested child and deriving from the outer class.
13193         (RealMemberLookup): Only set `closure_private_ok' if the
13194         `original_bf' contained BindingFlags.NonPublic.
13195
13196 2003-04-05  Martin Baulig  <martin@ximian.com>
13197
13198         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13199
13200 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13201
13202         * class.cs (Event.Define): Do not allow abstract events to have
13203         initializers. 
13204
13205 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13206
13207         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13208         block in event declarations.
13209
13210         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13211         value type, get its address.
13212
13213         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13214         leaving a class on the stack instead of a boolean value (int
13215         0/1).  Change the code so we compare against null, and then the
13216         result against zero.
13217
13218         * class.cs (TypeContainer.GetClassBases): We were checking for the
13219         parent class being sealed too late.
13220
13221         * expression.cs (Binary.Emit): For <= and >= when dealing with
13222         floating point values, use cgt.un and clt.un instead of cgt and
13223         clt alone.
13224
13225 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13226
13227         * statement.cs: Apply the same optimization as MS: skip the 
13228         GetEnumerator returning an IEnumerator, and use the one returning a 
13229         CharEnumerator instead. This allows us to avoid the try-finally block 
13230         and the boxing.
13231
13232 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13233
13234         * cs-parser.jay: Attributes cannot be applied to
13235                          namespaces. Fixes #40473
13236
13237 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13238
13239         * class.cs:
13240         (Add*): check if the name is valid using the full name for constants,
13241         fields, properties and events.
13242
13243 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13244
13245         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13246         char constants to be part of the enumeration.
13247
13248         * expression.cs (Conditional.DoResolve): Add support for operator
13249         true. Implements the missing functionality from 14.12
13250
13251         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13252         operator true/false as required by the spec.
13253
13254         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13255         implicit conversion to boolean.
13256
13257         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13258         also one where the type implements `operator true'. 
13259
13260         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13261         get an expression that will invoke operator true based on an
13262         expression.  
13263
13264         (GetConversionOperators): Removed the hack that called op_True
13265         here.  
13266
13267         (Expression.ResolveBoolean): Move this from Statement.
13268
13269 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13270
13271         * ecore.cs (FieldExpr): do not allow initialization of initonly
13272         fields on derived classes
13273
13274 2003-03-13  Martin Baulig  <martin@ximian.com>
13275
13276         * statement.cs (Block.Emit): Call ig.BeginScope() and
13277         ig.EndScope() when compiling with debugging info; call
13278         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13279
13280 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * expression.cs (Indexers): Do not construct immediately, allow
13283         for new members to be appended as we go.  Fixes 38143
13284
13285 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13286
13287         * expression.cs: save/restore context when resolving an unchecked
13288         expression.
13289
13290 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13291
13292         * cfold.cs: Catch division by zero in modulus operator during
13293         constant folding.
13294
13295 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * interface.cs (Interface.DefineMembers): Avoid defining members
13298         twice. 
13299
13300 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * driver.cs: handle the +/- options for -noconfig
13303
13304         * statement.cs (Unckeched.Resolve): Also track the state of
13305         unchecked in the Resolve phase.
13306
13307 2003-02-27  Martin Baulig  <martin@ximian.com>
13308
13309         * ecore.cs (Expression.MemberLookup): Don't create a
13310         MethodGroupExpr for something which is not a method.  Fixes #38291.
13311
13312 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13313
13314         * class.cs (MemberBase.CheckParameters): Also check that the type
13315         is unmanaged if it is a pointer.
13316
13317         * expression.cs (SizeOf.Resolve): Add location information.
13318
13319         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13320         a managed type is declared.
13321
13322         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13323         parameter modifiers as well.  Fixes bug 38606
13324
13325         * class.cs: Very sad.  Am backing out the speed up changes
13326         introduced by the ArrayList -> Array in the TypeContainer, as they
13327         were not actually that much faster, and introduced a bug (no error
13328         reports on duplicated methods).
13329
13330         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13331         source first, this will guarantee that we have a valid expression
13332         before calling in lower levels functions that will require a
13333         resolved object.  Then use this original_source in the
13334         target.ResolveLValue instead of the original source that was
13335         passed to us.
13336
13337         Another change.  Use target.Resolve instead of LValueResolve.
13338         Although we are resolving for LValues, we will let the Assign code
13339         take care of that (it will be called again from Resolve).  This
13340         basically allows code like this:
13341
13342         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13343         class Y { void A (X x) { x [0] += o; }
13344
13345         The problem was that the indexer was trying to resolve for
13346         set_Item (idx, object o) and never finding one.  The real set_Item
13347         was set_Item (idx, X).  By delaying the process we get the right
13348         semantics. 
13349
13350         Fixes bug 36505
13351
13352 2003-02-23  Martin Baulig  <martin@ximian.com>
13353
13354         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13355         while calling DoEmit ().
13356
13357         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13358         source files; if you use the #line directive inside a method, the
13359         compiler stops emitting line numbers for the debugger until it
13360         reaches the end of the method or another #line directive which
13361         restores the original file.
13362
13363 2003-02-23  Martin Baulig  <martin@ximian.com>
13364
13365         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13366
13367 2003-02-23  Martin Baulig  <martin@ximian.com>
13368
13369         * statement.cs (Block.AddChildVariableNames): We need to call this
13370         recursively, not just for our immediate children.
13371
13372 2003-02-23  Martin Baulig  <martin@ximian.com>
13373
13374         * class.cs (Event.Define): Always make the field private, like csc does.
13375
13376         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13377         actually work, fixes bug #37521.
13378
13379 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * delegate.cs: When creating the various temporary "Parameters"
13382         classes, make sure that we call the ComputeAndDefineParameterTypes
13383         on those new parameters (just like we do with the formal ones), to
13384         allow them to be resolved in the context of the DeclSpace.
13385
13386         This fixes the bug that Dick observed in Bugzilla #38530.
13387
13388 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13389
13390         * expression.cs (ResolveMemberAccess): When resolving a constant,
13391         do not attempt to pull a constant if the value was not able to
13392         generate a valid constant.
13393
13394         * const.cs (LookupConstantValue): Do not report more errors than required.
13395
13396 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13397
13398         * expression.cs: fixes bug #38328.
13399
13400 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13401
13402         * class.cs: Changed all the various members that can be part of a
13403         class from being an ArrayList to be an Array of the right type.
13404         During the DefineType type_list, interface_list, delegate_list and
13405         enum_list are turned into types, interfaces, delegates and enums
13406         arrays.  
13407
13408         And during the member population, indexer_list, event_list,
13409         constant_list, field_list, instance_constructor_list, method_list,
13410         operator_list and property_list are turned into their real arrays.
13411
13412         Although we could probably perform this operation earlier, for
13413         good error reporting we need to keep the lists and remove the
13414         lists for longer than required.
13415
13416         This optimization was triggered by Paolo profiling the compiler
13417         speed on the output of `gen-sample-program.pl' perl script. 
13418
13419         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13420         not crash in methods like MemberLookupFailed that use this field.  
13421
13422         This problem arises when the compiler fails to resolve a type
13423         during interface type definition for example.
13424
13425 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13426
13427         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13428         inherit from System.Object, so we have to stop at null, not only
13429         when reaching System.Object.
13430
13431 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13434         DeclaredOnly because the parent indexer might have had a different
13435         name, but did not loop until the top of the hierarchy was reached.
13436
13437         The problem this one fixes is 35492: when a class implemented an
13438         indexer from an interface, we were getting the interface method
13439         (which was abstract) and we were flagging an error (can not invoke
13440         abstract method).
13441
13442         This also keeps bug 33089 functioning, and test-148 functioning.
13443
13444         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13445         out if a method is special is to see if it is declared in a
13446         property or event, or whether it is one of the predefined operator
13447         names.   This should fix correctly #36804.
13448
13449 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13450
13451         The goal here is to remove the dependency on EmptyCast.Peel ().
13452         Killing it completely.
13453
13454         The problem is that currently in a number of places where
13455         constants are expected, we have to "probe" for an EmptyCast, and
13456         Peel, which is not the correct thing to do, as this will be
13457         repetitive and will likely lead to errors. 
13458
13459         The idea is to remove any EmptyCasts that are used in casts that
13460         can be reduced to constants, so we only have to cope with
13461         constants. 
13462
13463         This bug hunt was triggered by Bug 37363 and the desire to remove
13464         the duplicate pattern where we were "peeling" emptycasts to check
13465         whether they were constants.  Now constants will always be
13466         constants.
13467
13468         * ecore.cs: Use an enumconstant here instead of wrapping with
13469         EmptyCast.  
13470
13471         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13472         throwing me off.  By handling this we can get rid of a few hacks.
13473
13474         * statement.cs (Switch): Removed Peel() code.
13475
13476 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13477
13478         * class.cs: Location information for error 508
13479
13480         * expression.cs (New.DoResolve): Add a guard against double
13481         resolution of an expression.  
13482
13483         The New DoResolve might be called twice when initializing field
13484         expressions (see EmitFieldInitializers, the call to
13485         GetInitializerExpression will perform a resolve on the expression,
13486         and later the assign will trigger another resolution
13487
13488         This leads to bugs (#37014)
13489
13490         * delegate.cs: The signature for EndInvoke should contain any ref
13491         or out parameters as well.  We were not doing this in the past. 
13492
13493         * class.cs (Field.Define): Do not overwrite the type definition
13494         inside the `volatile' group.  Turns out that volatile enumerations
13495         were changing the type here to perform a validity test, which
13496         broke conversions. 
13497
13498 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13499
13500         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13501         and structs, we do not want to load the instance variable
13502
13503         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13504         enum_type has to be handled like an object reference (implicit
13505         conversions exists from this to object), but the regular IsClass
13506         and IsValueType tests will never return true for this one.
13507
13508         Also we use TypeManager.IsValueType instead of type.IsValueType,
13509         just for consistency with the rest of the code (this is only
13510         needed if we ever use the construct exposed by test-180.cs inside
13511         corlib, which we dont today).
13512
13513 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13514
13515         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13516         just InternalCall.
13517
13518 2003-02-09  Martin Baulig  <martin@ximian.com>
13519
13520         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13521         (Namespace.DefineNamespaces): New static public method; this is
13522         called when we're compiling with debugging to add all namespaces
13523         to the symbol file.
13524
13525         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13526         pass it to the Namespace's .ctor.
13527
13528         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13529         and MethodBase arguments; pass the namespace ID to the symwriter;
13530         pass the MethodBase instead of the token to the symwriter.
13531         (SymbolWriter.DefineNamespace): New method to add a namespace to
13532         the symbol file.
13533
13534 2003-02-09  Martin Baulig  <martin@ximian.com>
13535
13536         * symbolwriter.cs: New file.  This is a wrapper around
13537         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13538         methods here in near future.
13539
13540 2003-02-09  Martin Baulig  <martin@ximian.com>
13541
13542         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13543         ILGenerator.MarkSequencePoint() which are actually used by the
13544         symbol writer.
13545
13546 2003-02-09  Martin Baulig  <martin@ximian.com>
13547
13548         * location.cs (SourceFile): New public sealed class.  This
13549         contains the name and an index which is used in the location's token.
13550         (Location): Reserve an appropriate number of bits in the token for
13551         the source file instead of walking over that list, this gives us a
13552         really huge performance improvement when compiling with debugging.
13553
13554         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13555         `SourceFile' argument instead of a string.
13556         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13557         but don't parse/tokenize here, we need to generate the list of all
13558         source files before we do that.
13559         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13560         the files.
13561
13562         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13563         instead of a string.
13564
13565         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13566         of a string.
13567
13568 2003-02-09  Martin Baulig  <martin@ximian.com>
13569
13570         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13571         filename on `#line default'.
13572
13573 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13574
13575         * statement.cs: don't clear the pinned var when the fixed statement
13576         returns from the method (fixes bug#37752).
13577
13578 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13579
13580         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13581         to IsValueType.
13582
13583 2003-02-07  Martin Baulig  <martin@ximian.com>
13584
13585         * driver.cs: Removed the `--debug-args' command line argument.
13586
13587         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13588         automatically by the AsssemblyBuilder.
13589         (CodeGen.InitializeSymbolWriter): We don't need to call any
13590         initialization function on the symbol writer anymore.  This method
13591         doesn't take any arguments.
13592
13593 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13594
13595         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13596         from referenced assemblies as well.
13597
13598 2003-02-02  Martin Baulig  <martin@ximian.com>
13599
13600         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13601
13602 2003-02-02  Martin Baulig  <martin@ximian.com>
13603
13604         * class.cs (Constructor.Emit): Open the symbol writer before
13605         emitting the constructor initializer.
13606         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13607         single-stepping through constructor initializers.
13608
13609 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13610
13611         * class.cs: Handle error 549: do not allow virtual methods in
13612         sealed classes. 
13613
13614 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13615
13616         * decl.cs: Check access levels when resolving types
13617
13618 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13619
13620         * statement.cs: Add parameters and locals set in catch blocks that might 
13621         return to set vector
13622
13623 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13624
13625         * class.cs (Operator): Set the SpecialName flags for operators.
13626
13627         * expression.cs (Invocation.DoResolve): Only block calls to
13628         accessors and operators on SpecialName methods.
13629
13630         (Cast.TryReduce): Handle conversions from char constants.
13631
13632
13633 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13634
13635         * statement.cs: small memory and time optimization in FlowBranching.
13636
13637 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13638
13639         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13640         problem that the last fix but in the other sid (Set).
13641
13642         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13643         access when there is no indexer in the hierarchy.
13644
13645 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13646
13647         * class.cs: Combine some if statements.
13648
13649 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13650
13651         * driver.cs: fixed bug #37187.
13652
13653 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13654
13655         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13656         any indexer, it's needed to build a list with all the indexers in the
13657         hierarchy (AllGetters), else we have problems. Fixes #35653.
13658
13659 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13660
13661         * class.cs (MethodData.Define): It is wrong for an interface
13662         implementation to be static in both cases: explicit and implicit.
13663         We were only handling this in one case.
13664
13665         Improve the if situation there to not have negations.
13666
13667         * class.cs (Field.Define): Turns out that we do not need to check
13668         the unsafe bit on field definition, only on usage.  Remove the test.
13669
13670 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13671
13672         * driver.cs: use assembly.Location instead of Codebase (the latest
13673         patch made mcs fail when using MS assemblies).
13674
13675 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13676
13677         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13678         get the path to *corlib.dll.
13679
13680 2003-01-21  Nick Drochak <ndrochak@gol.com>
13681
13682         * cs-tokenizer.cs:
13683         * pending.cs:
13684         * typemanager.cs: Remove compiler warnings
13685
13686 2003-01-20  Duncan Mak  <duncan@ximian.com>
13687
13688         * AssemblyInfo.cs: Bump the version number to 0.19.
13689
13690 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13691
13692         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13693
13694 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13695
13696         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13697
13698 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13699
13700         * cs-parser.jay: Small fix: we were not comparing the constructor
13701         name correctly.   Thanks to Zoltan for the initial pointer.
13702
13703 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13704
13705         * cs-tokenizer.cs: Set file name when specified with #line
13706
13707 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13708
13709         * cs-parser.jay: Only perform the constructor checks here if we
13710         are named like the class;  This will help provider a better
13711         error.  The constructor path is taken when a type definition is
13712         not found, but most likely the user forgot to add the type, so
13713         report that rather than the constructor error.
13714
13715 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13716
13717         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13718         allocations.
13719
13720 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13721
13722         * cs-parser.jay: Add cleanup call.
13723
13724 2003-01-13  Duncan Mak  <duncan@ximian.com>
13725
13726         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13727         consistent with other methods.
13728
13729 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13730
13731         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13732
13733 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13734
13735         * attribute.cs: only set GuidAttr to true when we have a
13736         GuidAttribute.
13737
13738 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13739
13740         * ecore.cs:
13741         * expression.cs:
13742         * typemanager.cs: fixes to allow mcs compile corlib with the new
13743         Type.IsSubclassOf fix.
13744
13745 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13746
13747         * expression.cs (LocalVariableReference.DoResolve): Classify a
13748         constant as a value, not as a variable.   Also, set the type for
13749         the variable.
13750
13751         * cs-parser.jay (fixed_statement): take a type instead of a
13752         pointer_type, so we can produce a better error message later.
13753
13754         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13755         as an error.  
13756
13757         (For.DoEmit): Make inifinite loops have a
13758         non-conditional branch back.
13759
13760         (Fixed.DoEmit): First populate the pinned variables, then emit the
13761         statement, then clear the variables.  Before I was emitting the
13762         code once for each fixed piece.
13763
13764
13765 2003-01-08  Martin Baulig  <martin@ximian.com>
13766
13767         * statement.cs (FlowBranching.MergeChild): A break in a
13768         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13769
13770 2003-01-08  Martin Baulig  <martin@ximian.com>
13771
13772         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13773         lives in the same number space than `param_map'.  Fixes #36154.
13774
13775 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13776
13777         * cs-parser.jay (constructor_declaration): Set the
13778         Constructor.ModFlags before probing for it.  This makes the
13779         compiler report 514, 515 and 132 (the code was there, but got
13780         broken). 
13781
13782         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13783         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13784         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13785
13786 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13787
13788         * enum.cs: create the enum static fields using the enum type.
13789
13790 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13791
13792         * class.cs: don't try to create the ParamBuilder for the return
13793         type if it's not needed (and handle it breaking for the ms runtime
13794         anyway).
13795
13796 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13797
13798         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13799
13800 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13801
13802         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13803         the command.   This showed up while compiling the JANET source
13804         code, which used \r as its only newline separator.
13805
13806 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * class.cs (Method.Define): If we are an operator (because it
13809         reuses our code), then set the SpecialName and HideBySig.  #36128
13810
13811 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13814         exception, report error 120 `object reference required'.
13815
13816         * driver.cs: Add --pause option, used during to measure the size
13817         of the process as it goes with --timestamp.
13818
13819         * expression.cs (Invocation.DoResolve): Do not allow methods with
13820         SpecialName to be invoked.
13821
13822 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13823
13824         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13825         number before adding it.
13826
13827 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13828
13829         * ecore.cs (StandardImplicitConversion): When in an unsafe
13830         context, we allow conversion between void * to any other pointer
13831         type. This fixes bug #35973.
13832
13833 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13834
13835         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13836         is not thrown when extensionless outputs are used 
13837
13838 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13839
13840         * rootcontext.cs: fixed compilation of corlib.
13841
13842 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * attribute.cs (Attributes.Contains): Add new method.
13845
13846         * class.cs (MethodCore.LabelParameters): if the parameter is an
13847         `out' parameter, check that no attribute `[In]' has been passed.
13848
13849         * enum.cs: Handle the `value__' name in an enumeration.
13850
13851 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13852
13853         * decl.cs: Added special case to allow overrides on "protected
13854         internal" methods
13855
13856 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13857
13858         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13859         since it makes much more sense.
13860
13861         (Attributes.ctor): Don't require a Location parameter.
13862
13863         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13864
13865         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13866         since we already have that information per attribute.
13867
13868         * everywhere : make appropriate changes.
13869
13870         * class.cs (LabelParameters): Write the code which actually
13871         applies attributes to the return type. We can't do this on the MS
13872         .NET runtime so we flag a warning in the case an exception is
13873         thrown.
13874
13875 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13876
13877         * const.cs: Handle implicit null conversions here too.
13878
13879 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13880
13881         * class.cs (MethodCore.LabelParameters): Remove the extra
13882         Type [] parameter since it is completely unnecessary. Instead
13883         pass in the method's attributes so that we can extract
13884         the "return" attribute.
13885
13886 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13887
13888         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13889         of ignoring it and letting the compile continue.
13890
13891         * typemanager.cs (ChangeType): use an extra argument to return an
13892         error condition instead of throwing an exception.
13893
13894 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13895
13896         * expression.cs (Unary.TryReduce): mimic the code for the regular
13897         code path.  Perform an implicit cast in the cases where we can
13898         implicitly convert to one of the integral types, and then reduce
13899         based on that constant.   This fixes bug #35483.
13900
13901 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13902
13903         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13904
13905 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13906
13907         * namespace.cs: fixed bug #35489.
13908
13909 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * class.cs: Remove some dead code.
13912
13913         * cs-parser.jay: Estimate the number of methods needed
13914         (RootContext.MethodCount);
13915
13916         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13917         numbers instead of StringBuilders.
13918
13919         * support.cs (PtrHashtable): Add constructor with initial size;
13920         We can now reduce reallocations of the method table.
13921
13922 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13923
13924         * attribute.cs (ApplyAttributes): Keep track of the emitted
13925         attributes on a per-target basis. This fixes bug #35413.
13926
13927 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13928
13929         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13930         default to the Windows 1252 encoding.
13931
13932         (UnixParseOption): Support version, thanks to Alp for the missing
13933         pointer. 
13934
13935         * AssemblyInfo.cs: Add nice assembly information.
13936
13937         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13938         (bug 35169).
13939
13940         * cs-parser.jay: Allow a trailing comma before the close bracked
13941         in the attribute_section production.
13942
13943         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13944         address of the instance was being taken, I will take this out,
13945         because we take the address of the object immediately here.
13946
13947 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13948
13949         * typemanager.cs (AreMultipleAllowed): Take care of the most
13950         obvious case where attribute type is not in the current assembly -
13951         stupid me ;-)
13952
13953 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13956         definitions, instead of doing that afterwards.  
13957
13958         Also we use a nice little hack, depending on the constructor, we
13959         know if we are a "composed" name or a simple name.  Hence, we
13960         avoid the IndexOf test, and we avoid 
13961
13962         * codegen.cs: Add code to assist in a bug reporter to track down
13963         the source of a compiler crash. 
13964
13965 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13966
13967         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13968         types have been emitted for a given element and flag an error
13969         if something which does not have AllowMultiple set is used more
13970         than once.
13971
13972         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13973         attribute types and their corresponding AllowMultiple properties
13974
13975         (AreMultipleAllowed): Check the property for a given type.
13976
13977         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13978         property in the case we have a TypeContainer.
13979
13980         (Attributes.AddAttribute): Detect duplicates and just skip on
13981         adding them. This trivial fix catches a pretty gross error in our
13982         attribute emission - global attributes were being emitted twice!
13983
13984         Bugzilla bug #33187 is now fixed.
13985
13986 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13987
13988         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13989         instead of pp_and).
13990
13991         * expression.cs (Binary.ResolveOperator): I can only use the
13992         Concat (string, string, string) and Concat (string, string,
13993         string, string) if the child is actually a concatenation of
13994         strings. 
13995
13996 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13999         context where we need a 2-character lookahead.
14000
14001         * pending.cs (PendingImplementation): Rework so we can keep track
14002         of interface types all the time, and flag those which were
14003         implemented by parents as optional.
14004
14005 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14006
14007         * expression.cs (Binary.ResolveOperator): Use
14008         String.Concat(string,string,string) or
14009         String.Concat(string,string,string,string) when possible. 
14010
14011         * typemanager: More helper methods.
14012
14013
14014 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14015
14016         * pending.cs: remove the bogus return from GetMissingInterfaces()
14017         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14018
14019 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14020
14021         * namespace.cs: avoid duplicated 'using xxx' being added to
14022         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14023         when we get more than one 'using' statement for the same namespace.
14024         Report a CS0105 warning for it.
14025
14026 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14029         of calling getChar/putback, uses internal knowledge of it.    
14030
14031         (xtoken): Reorder tokenizer so most common patterns are checked
14032         first.  This reduces the compilation time in another 5% (from 8.11s
14033         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14034
14035         The parsing time is 22% of the compilation in mcs, and from that
14036         64% is spent on the tokenization process.  
14037
14038         I tried using a binary search for keywords, but this is slower
14039         than the hashtable.  Another option would be to do a couple of
14040         things:
14041
14042                 * Not use a StringBuilder, instead use an array of chars,
14043                   with a set value.  Notice that this way we could catch
14044                   the 645 error without having to do it *afterwards*.
14045
14046                 * We could write a hand-parser to avoid the hashtable
14047                   compares altogether.
14048
14049         The identifier consumption process takes 37% of the tokenization
14050         time.  Another 15% is spent on is_number.  56% of the time spent
14051         on is_number is spent on Int64.Parse:
14052
14053                 * We could probably choose based on the string length to
14054                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14055                   computations. 
14056
14057         Another 3% is spend on wrapping `xtoken' in the `token' function.
14058
14059         Handle 0xa0 as whitespace (#34752)
14060
14061 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * typemanager.cs (IsCLRType): New routine to tell whether a type
14064         is one of the builtin types.  
14065
14066         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14067         typecode in more places instead of doing pointer comparissions.
14068         We could leverage some knowledge about the way the typecodes are
14069         laid out.
14070
14071         New code to cache namespaces in assemblies, it is currently not
14072         invoked, to be used soon.
14073
14074         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14075
14076         * expression.cs (Binary.ResolveOperator): specially handle
14077         strings, and do not perform user-defined operator overloading for
14078         built-in types.
14079
14080 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14083         internalcall as it is a pretty simple operation;  Avoid whenever
14084         possible to call Char.IsLetter.
14085
14086         (consume_identifier): Cut by half the number of
14087         hashtable calls by merging the is_keyword and GetKeyword behavior.
14088
14089         Do not short-circuit, because if we do, we
14090         report errors (ie, #if false && true would produce an invalid
14091         directive error);
14092
14093
14094 2002-11-24  Martin Baulig  <martin@ximian.com>
14095
14096         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14097         check constant ranges and report a CS0221.  Fixes #33186.
14098
14099 2002-11-24  Martin Baulig  <martin@ximian.com>
14100
14101         * cs-parser.jay: Make this work for uninitialized variable
14102         declarations in the `for' initializer.  Fixes #32416.
14103
14104 2002-11-24  Martin Baulig  <martin@ximian.com>
14105
14106         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14107         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14108
14109 2002-11-24  Martin Baulig  <martin@ximian.com>
14110
14111         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14112         argument; if true, we also check for user-defined conversions.
14113         This is only needed if both arguments are of a user-defined type.
14114         Fixes #30443, added test-175.cs.
14115         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14116
14117         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14118
14119 2002-11-24  Martin Baulig  <martin@ximian.com>
14120
14121         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14122         function to get the store opcode.
14123         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14124         only emit the Ldelema if the store opcode is Stobj.  You must run
14125         both test-34 and test-167 to test this.  Fixes #34529.
14126
14127 2002-11-23  Martin Baulig  <martin@ximian.com>
14128
14129         * ecore.cs (Expression.MemberLookup): Added additional
14130         `qualifier_type' argument which is used when we're being called
14131         from MemberAccess.DoResolve() and null if we're called from a
14132         SimpleName lookup.
14133         (Expression.MemberLookupFailed): New method to report errors; this
14134         does the CS1540 check and reports the correct error message.
14135
14136         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14137         argument for the CS1540 check and redone the way how we're dealing
14138         with private members.  See the comment in the source code for details.
14139         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14140         `closure_start_type' to `closure_qualifier_type' and check whether
14141         it's not null.  It was not this filter being broken, it was just
14142         being called with the wrong arguments.
14143
14144         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14145         and pass it the correct `qualifier_type'; this also does the error
14146         handling for us.
14147
14148 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * expression.cs (Invocation.EmitParams): If the we are dealing
14151         with a non-built-in value type, load its address as well.
14152
14153         (ArrayCreation): Use a a pretty constant instead
14154         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14155         static initializers.  
14156
14157         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14158         because they are not really value types, just glorified integers. 
14159
14160         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14161
14162         * ecore.cs: Remove redundant code for enumerations, make them use
14163         the same code path as everything else, fixes the casting issue
14164         with enumerations in Windows.Forms.
14165
14166         * attribute.cs: Do only cast to string if it is a string, the
14167         validation happens later.
14168
14169         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14170         people upgrade their corlibs.
14171
14172         * ecore.cs: Oops, enumerations were not following the entire code path
14173
14174 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14175
14176         * typemanager.cs (FilterWithClosure): Commented out the test for
14177         1540 in typemanager.cs, as it has problems when accessing
14178         protected methods from a parent class (see test-174.cs). 
14179
14180         * attribute.cs (Attribute.ValidateGuid): new method.
14181         (Attribute.Resolve): Use above.
14182
14183 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14184
14185         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14186
14187         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14188         handling for enumerations, as we only needed the TypeContainer
14189         functionality to begin with (this is required for the fix below to
14190         work for enums that reference constants in a container class for
14191         example). 
14192
14193         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14194
14195         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14196         a valid TypeBuilder to perform lookups on.o
14197
14198         * class.cs (InheritableMemberSignatureCompare): Use true in the
14199         call to GetGetMethod and GetSetMethod, because we are comparing
14200         the signature, and we need to get the methods *even* if they are
14201         private. 
14202
14203         (PropertyBase.CheckBase): ditto.
14204
14205         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14206         GotoCase.Resolve): Use Peel on EmpytCasts.
14207
14208         * ecore.cs (EmptyCast): drop child, add Peel method.
14209
14210 2002-11-17  Martin Baulig  <martin@ximian.com>
14211
14212         * ecore.cs (EmptyCast.Child): New public property.
14213
14214         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14215         label resolved to an EmptyCast.  Fixes #34162.
14216         (GotoCase.Resolve): Likewise.
14217         (Block.EmitMeta): Likewise.
14218
14219 2002-11-17  Martin Baulig  <martin@ximian.com>
14220
14221         * expression.cs (Invocation.BetterConversion): Prefer int over
14222         uint; short over ushort; long over ulong for integer literals.
14223         Use ImplicitConversionExists instead of StandardConversionExists
14224         since we also need to check for user-defined implicit conversions.
14225         Fixes #34165.  Added test-173.cs.
14226
14227 2002-11-16  Martin Baulig  <martin@ximian.com>
14228
14229         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14230         with the `true' and `false' literals.  Fixes #33151.
14231
14232 2002-11-16  Martin Baulig  <martin@ximian.com>
14233
14234         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14235         October 22nd; don't do the cs1540 check for static members.
14236
14237         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14238         now using our own filter here and doing the cs1540 check again.
14239
14240 2002-11-16  Martin Baulig  <martin@ximian.com>
14241
14242         * support.cs (InternalParameters): Don't crash if we don't have
14243         any fixed parameters.  Fixes #33532.
14244
14245 2002-11-16  Martin Baulig  <martin@ximian.com>
14246
14247         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14248         when looking up static methods to make this work on Windows.
14249         Fixes #33773.
14250
14251 2002-11-16  Martin Baulig  <martin@ximian.com>
14252
14253         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14254         a setter rather than using PropertyInfo.CanWrite.
14255
14256 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14257
14258         * class.cs: Allow acces to block member by subclasses. Fixes build
14259         breaker.
14260
14261 2002-11-14  Martin Baulig  <martin@ximian.com>
14262
14263         * class.cs (Constructor.Emit): Added the extern/block check.
14264         Fixes bug #33678.
14265
14266 2002-11-14  Martin Baulig  <martin@ximian.com>
14267
14268         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14269         iteration while looking for indexers, this is needed because the
14270         indexer may have a different name in our base classes.  Fixed the
14271         error reporting (no indexers at all, not get accessor, no
14272         overloaded match).  Fixes bug #33089.
14273         (IndexerAccess.DoResolveLValue): Likewise.
14274
14275 2002-11-14  Martin Baulig  <martin@ximian.com>
14276
14277         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14278         indexers.  Fixes the first part of bug #33089.
14279         (MethodSignature.InheritableMemberSignatureCompare): Added support
14280         for properties.
14281
14282 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14283
14284         * attribute.cs (Attribute.Resolve): Catch the
14285         NullReferenceException and report it since it isn't supposed to
14286         happen. 
14287
14288 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14289
14290         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14291         LogicalOr and LogicalAnd that can benefit from recursively
14292         handling EmitBranchable.  The code now should be nice for Paolo.
14293
14294 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14297         the Type lookups, as we perform quite a number of lookups on
14298         non-Types.  This can be removed once we can deterministically tell
14299         whether we have a type or a namespace in advance.
14300
14301         But this might require special hacks from our corlib.
14302
14303         * TODO: updated.
14304
14305         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14306         and double which avoids a conversion from an integer to a double.
14307
14308         * expression.cs: tiny optimization, avoid calling IsConstant,
14309         because it effectively performs the lookup twice.
14310
14311 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14312
14313         But a bogus return here to keep the semantics of the old code
14314         until the Mono runtime is fixed.
14315
14316         * pending.cs (GetMissingInterfaces): New method used to remove all
14317         the interfaces that are already implemented by our parent
14318         classes from the list of pending methods. 
14319
14320         * interface.cs: Add checks for calls after ResolveTypeExpr.
14321
14322 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14323
14324         * class.cs (Class.Emit): Report warning 67: event not used if the
14325         warning level is beyond 3.
14326
14327         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14328         being a NullLiteral.
14329
14330         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14331         specifiers. 
14332
14333         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14334         path that might fail if a type can not be resolved.
14335
14336         * expression.cs (Binary.Emit): Emit unsigned versions of the
14337         operators. 
14338
14339         * driver.cs: use error 5.
14340
14341 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14342
14343         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14344
14345 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * cs-parser.jay (switch_section): A beautiful patch from Martin
14348         Baulig that fixed 33094.
14349
14350 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14353         Check whether the base is abstract and report an error if so.
14354
14355         * expression.cs (IndexerAccess.DoResolveLValue,
14356         IndexerAccess.DoResolve): ditto. 
14357
14358         (Invocation.DoResolve): ditto.
14359
14360         (Invocation.FullMethodDesc): Improve the report string.
14361
14362         * statement.cs (Block): Eliminate IsVariableDefined as it is
14363         basically just a wrapper for GetVariableInfo.
14364
14365         * ecore.cs (SimpleName): Use new 
14366
14367         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14368         type, as we return the actual parameter ref/unref state on a
14369         different call.
14370
14371 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14372
14373         * support.cs: Return proper flags REF/OUT fixing the previous
14374         commit.  
14375
14376         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14377         not used to mean `ref' but `ref or out' in ParameterReference
14378
14379         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14380         full type signature instead of calling TypeManger.CSharpName
14381         ourselves. 
14382
14383         * support.cs (InternalParameters.ParameterDesc): Do not compare
14384         directly to the modflags, because REF/OUT will actually be bitsets
14385         if set. 
14386
14387         * delegate.cs (VerifyMethod): Check also the modifiers.
14388
14389         * cs-tokenizer.cs: Fix bug where floating point values with an
14390         exponent where a sign was missing was ignored.
14391
14392         * driver.cs: Allow multiple assemblies to be specified in a single
14393         /r: argument
14394
14395 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14398         because identifiers after a parenthesis would end up in this kind
14399         of production, and we needed to desamiguate it for having casts
14400         like:
14401
14402                 (UserDefinedType *) xxx
14403
14404 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14405
14406         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14407         we should set on the Bindingflags.NonPublic, but not turn on
14408         private_ok.  private_ok controls whether a Private member is
14409         returned (this is chekced on the filter routine), while the
14410         BindingFlags.NonPublic just controls whether private/protected
14411         will be allowed.   This fixes the problem part of the problem of
14412         private properties being allowed to be used in derived classes.
14413
14414         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14415         so we can call the children DoResolveLValue method (this will
14416         properly signal errors on lvalue assignments to base properties)
14417
14418         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14419         getter are null, and we have a property info, we know that this
14420         happened because the lookup failed, so we report an error 122 for
14421         protection level violation.
14422
14423         We also silently return if setter and getter are null in the
14424         resolve functions, this condition only happens if we have flagged
14425         the error before.  This is the other half of the problem. 
14426
14427         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14428         not have accessibility information, that is why we were returning
14429         true in the filter function in typemanager.cs.
14430
14431         To properly report 122 (property is inaccessible because of its
14432         protection level) correctly, we report this error in ResolveAccess
14433         by failing if both the setter and the getter are lacking (ie, the
14434         lookup failed). 
14435
14436         DoResolve and DoLResolve have been modified to check for both
14437         setter/getter being null and returning silently, the reason being
14438         that I did not want to put the knowledge about this error in upper
14439         layers, like:
14440
14441         int old = Report.Errors;
14442         x = new PropertyExpr (...);
14443         if (old != Report.Errors)
14444                 return null;
14445         else
14446                 return x;
14447
14448         So the property expr is returned, but it is invalid, so the error
14449         will be flagged during the resolve process. 
14450
14451         * class.cs: Remove InheritablePropertySignatureCompare from the
14452         class, as we no longer depend on the property signature to compute
14453         whether it is possible to implement a method or not.
14454
14455         The reason is that calling PropertyInfo.GetGetMethod will return
14456         null (in .NET, in Mono it works, and we should change this), in
14457         cases where the Get Method does not exist in that particular
14458         class.
14459
14460         So this code:
14461
14462         class X { public virtual int A { get { return 1; } } }
14463         class Y : X { }
14464         class Z : Y { public override int A { get { return 2; } } }
14465
14466         Would fail in Z because the parent (Y) would not have the property
14467         defined.  So we avoid this completely now (because the alternative
14468         fix was ugly and slow), and we now depend exclusively on the
14469         method names.
14470
14471         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14472         reference method, instead of using the property.
14473
14474         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14475         routines are gone now.
14476
14477         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14478         names, they were incorrectly named.
14479
14480         * cs-tokenizer.cs: Return are more gentle token on failure. 
14481
14482         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14483         had an out-of-sync index variable, which caused it to remove from
14484         the list of pending methods the wrong method sometimes.
14485
14486 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14487
14488         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14489         CanWrite, because those refer to this particular instance of the
14490         property, and do not take into account the fact that we can
14491         override single members of a property.
14492
14493         Constructor requires an EmitContext.  The resolution process does
14494         not happen here, but we need to compute the accessors before,
14495         because the resolution does not always happen for properties.
14496
14497         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14498         subclass, before we did not update this flag, but we did update
14499         bindingflags. 
14500
14501         (GetAccessors): Drop this routine, as it did not work in the
14502         presence of partially overwritten set/get methods. 
14503
14504         Notice that this broke the cs1540 detection, but that will require
14505         more thinking. 
14506
14507 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14508
14509         * class.cs:
14510         * codegen.cs:
14511         * driver.cs: issue a warning instead of an error if we don't support
14512         debugging for the platform. Also ignore a couple of errors that may
14513         arise when trying to write the symbols. Undo my previous patch.
14514
14515 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14516
14517         * driver.cs: ignore /debug switch except for Unix platforms.
14518
14519 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14520
14521         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14522
14523 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14524
14525         * driver.cs: Do not make mcs-debug conditional, so we do not break
14526         builds that use it.
14527
14528         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14529         review this patch.  But basically after all the children variables
14530         have been merged, the value of "Breaks" was not being set to
14531         new_breaks for Switch blocks.  I think that it should be set after
14532         it has executed.  Currently I set this to the value of new_breaks,
14533         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14534         conservative, but I do not understand this code very well.
14535
14536         I did not break anything in the build, so that is good ;-)
14537
14538         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14539
14540 2002-10-20  Mark Crichton  <crichton@gimp.org>
14541
14542         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14543
14544 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14545
14546         * cfold.cs: Fixed compile blocker.
14547
14548 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14549
14550         * driver.cs: I was chekcing the key, not the file.
14551
14552 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14553
14554         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14555         message that we were generating - we just need to silently return
14556         a null.
14557
14558 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14559
14560         * class.cs (Event.Define): Change my previous commit, as this
14561         breaks the debugger.  This is a temporary hack, as it seems like
14562         the compiler is generating events incorrectly to begin with.
14563
14564         * expression.cs (Binary.ResolveOperator): Added support for 
14565         "U operator - (E x, E y)"
14566
14567         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14568         y)".
14569
14570         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14571         init-only variables, but this path did not take into account that
14572         there might be also instance readonly variables.  Correct this
14573         problem. 
14574
14575         This fixes bug 32253
14576
14577         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14578         delegates as well.
14579
14580         * driver.cs: Change the extension for modules to `netmodule'
14581
14582         * cs-parser.jay: Improved slightly the location tracking for
14583         the debugger symbols.
14584
14585         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14586         modifiers that were specified instead of the hardcoded value
14587         (FamAndAssem).  This was basically ignoring the static modifier,
14588         and others.  Fixes 32429.
14589
14590         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14591         fixed a bug in the process (32476)
14592
14593         * expression.cs (ArrayAccess.EmitAssign): Patch from
14594         hwang_rob@yahoo.ca that fixes bug 31834.3
14595
14596 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * driver.cs: Make the module extension .netmodule.
14599
14600 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14601
14602         * driver.cs: Report an error if the resource file is not found
14603         instead of crashing.
14604
14605         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14606         false, like Emit does.
14607
14608 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14609
14610         * typemanager.cs: Remove unused private member.  Also reported mcs
14611         bug to report this as a warning like csc.
14612
14613 2002-10-15  Martin Baulig  <martin@gnome.org>
14614
14615         * statement.cs (Statement.Emit): Made this a virtual method; emits
14616         the line number info and calls DoEmit().
14617         (Statement.DoEmit): New protected abstract method, formerly knows
14618         as Statement.Emit().
14619
14620         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14621
14622 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14623
14624         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14625         have fixed a remaining problem: not every AddXXXX was adding a
14626         fully qualified name.  
14627
14628         Now everyone registers a fully qualified name in the DeclSpace as
14629         being defined instead of the partial name.  
14630
14631         Downsides: we are slower than we need to be due to the excess
14632         copies and the names being registered this way.  
14633
14634         The reason for this is that we currently depend (on the corlib
14635         bootstrap for instance) that types are fully qualified, because
14636         we dump all the types in the namespace, and we should really have
14637         types inserted into the proper namespace, so we can only store the
14638         basenames in the defined_names array.
14639
14640 2002-10-10  Martin Baulig  <martin@gnome.org>
14641
14642         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14643         from bug #31834, see the bug report for a testcase which is
14644         miscompiled.
14645
14646 2002-10-10  Martin Baulig  <martin@gnome.org>
14647
14648         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14649         flow analysis code for this.
14650
14651         * statement.cs (Do, While, For): Tell the flow analysis code about
14652         infinite loops.
14653         (FlowBranching.UsageVector): Added support for infinite loops.
14654         (Block.Resolve): Moved the dead code elimination here and use flow
14655         analysis to do it.
14656
14657 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14658
14659         * class.cs (Field.Define): Catch cycles on struct type
14660         definitions. 
14661
14662         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14663         fields if the fields are static.  We only need to check instance
14664         fields. 
14665
14666         * expression.cs (As.DoResolve): Test for reference type.
14667
14668         * statement.cs (Using.ResolveExpression): Use
14669         ConvertImplicitRequired, not ConvertImplicit which reports an
14670         error on failture
14671         (Using.ResolveLocalVariableDecls): ditto.
14672
14673         * expression.cs (Binary.ResolveOperator): Report errors in a few
14674         places where we had to.
14675
14676         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14677
14678 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14679
14680         * expression.cs: Use StoreFromPtr instead of extracting the type
14681         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14682
14683         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14684         an enumeration value to a System.Enum, but System.Enum is not a
14685         value type, but an class type, so we need to box.
14686
14687         (Expression.ConvertExplicit): One codepath could return
14688         errors but not flag them.  Fix this.  Fixes #31853
14689
14690         * parameter.cs (Resolve): Do not allow void as a parameter type.
14691
14692 2002-10-06  Martin Baulig  <martin@gnome.org>
14693
14694         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14695         if it's a class type and not a struct.  Fixes #31815.
14696
14697 2002-10-06  Martin Baulig  <martin@gnome.org>
14698
14699         * statement.cs: Reworked the flow analysis code a bit to make it
14700         usable for dead code elimination.
14701
14702 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14703
14704         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14705
14706 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14707
14708         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14709         to fix the test 165, will investigate deeper.
14710
14711 2002-10-04  Martin Baulig  <martin@gnome.org>
14712
14713         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14714         finally blocks actually work.
14715         (Try.Resolve): We don't need to create a sibling for `finally' if
14716         there is no finally block.
14717
14718 2002-10-04  Martin Baulig  <martin@gnome.org>
14719
14720         * class.cs (Constructor.Define): The default accessibility for a
14721         non-default constructor is private, not public.
14722
14723 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14724
14725         * class.cs (Constructor): Make AllowedModifiers public, add
14726         EXTERN.
14727
14728         * cs-parser.jay: Perform the modifiers test here, as the
14729         constructor for the Constructor class usually receives a zero
14730         because of the way we create it (first we create, later we
14731         customize, and we were never checking the modifiers).
14732
14733         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14734         is a version of LookupTypeReflection that includes the type-name
14735         cache.  This can be used as a fast path for functions that know
14736         the fully qualified name and are only calling into *.GetType() to
14737         obtain a composed type.
14738
14739         This is also used by TypeManager.LookupType during its type
14740         composition.
14741
14742         (LookupType): We now also track the real type name, as sometimes
14743         we can get a quey for the real type name from things like
14744         ComposedCast.  This fixes bug 31422.
14745
14746         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14747         complete type fullname, it does not have to go through the type
14748         resolution system to obtain the composed version of the type (for
14749         obtaining arrays or pointers).
14750
14751         (Conditional.Emit): Use the EmitBoolExpression to
14752         generate nicer code, as requested by Paolo.
14753
14754         (ArrayCreation.CheckIndices): Use the patch from
14755         hwang_rob@yahoo.ca to validate the array initializers. 
14756
14757 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * class.cs (ConstructorInitializer.Emit): simplify code by using
14760         Invocation.EmitCall, and at the same time, fix the bugs in calling
14761         parent constructors that took variable arguments. 
14762
14763         * ecore.cs (Expression.ConvertNumericExplicit,
14764         Expression.ImplicitNumericConversion): Remove the code that
14765         manually wrapped decimal (InternalTypeConstructor call is now gone
14766         as well).
14767
14768         * expression.cs (Cast.TryReduce): Also handle decimal types when
14769         trying to perform a constant fold on the type.
14770
14771         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14772
14773         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14774         that only turned off an error report, and did nothing else. 
14775
14776 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * driver.cs: Handle and ignore /fullpaths
14779
14780 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * expression.cs (Binary.ResolveOperator): Catch the case where
14783         DoNumericPromotions returns true, 
14784
14785         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14786
14787 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14790         report error 70.
14791
14792 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14793
14794         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14795         conversion exists, but it is also required that the conversion be
14796         performed.  This manifested in "(Type64Enum) 2".  
14797
14798         * class.cs (TypeManager.AddMethod): The fix is not to change
14799         AddEnum, because that one was using a fully qualified name (every
14800         DeclSpace derivative does), but to change the AddMethod routine
14801         that was using an un-namespaced name.  This now correctly reports
14802         the duplicated name.
14803
14804         Revert patch until I can properly fix it.  The issue
14805         is that we have a shared Type space across all namespaces
14806         currently, which is wrong.
14807
14808         Options include making the Namespace a DeclSpace, and merge
14809         current_namespace/current_container in the parser.
14810
14811 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14812
14813         * cs-parser.jay: Improve error reporting when we get a different
14814         kind of expression in local_variable_type and
14815         local_variable_pointer_type. 
14816
14817         Propagate this to avoid missleading errors being reported.
14818
14819         * ecore.cs (ImplicitReferenceConversion): treat
14820         TypeManager.value_type as a target just like object_type.   As
14821         code like this:
14822
14823         ValueType v = 1;
14824
14825         Is valid, and needs to result in the int 1 being boxed before it
14826         is assigned to the value type v.
14827
14828         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14829         to validate the enumeration name.
14830
14831         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14832         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14833         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14834
14835         * ecore.cs (TryImplicitIntConversion): When doing an
14836         implicit-enumeration-conversion, check if the type is 64-bits and
14837         perform a conversion before passing to EnumConstant.
14838
14839 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14842         report ambiguous type references.  Unlike the MS version, we
14843         report what the ambiguity is.   Innovation at work ;-)
14844
14845         (DeclSpace.FindType): Require a location argument to
14846         display when we display an ambiguous error.
14847
14848         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14849
14850         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14851
14852         * expression.cs (EmitDynamicInitializers): Apply patch from
14853         hwang_rob@yahoo.ca that fixes the order in which we emit our
14854         initializers. 
14855
14856 2002-09-21  Martin Baulig  <martin@gnome.org>
14857
14858         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14859         delegate takes no arguments.
14860
14861 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14864         from integers.
14865
14866         * expression.cs: Extract the underlying type.
14867
14868         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14869
14870         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14871
14872 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14873
14874         * class.cs (TypeContainer.DefineType): We can not use the nice
14875         PackingSize with the size set to 1 DefineType method, because it
14876         will not allow us to define the interfaces that the struct
14877         implements.
14878
14879         This completes the fixing of bug 27287
14880
14881         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14882         means also structs.  This fixes part of the problem. 
14883         (Expresion.ImplicitReferenceConversionExists): ditto.
14884
14885         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14886         error if there were no errors reported during the type lookup
14887         process, to avoid duplicates or redundant errors.  Without this
14888         you would get an ambiguous errors plus a type not found.  We have
14889         beaten the user enough with the first error.  
14890
14891         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14892         reference. 
14893
14894         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14895         during the resolution process, stop the lookup, this avoids
14896         repeated error reports (same error twice).
14897
14898         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14899
14900         * typemanager.cs (LookupType): Redo the type lookup code to match
14901         the needs of System.Reflection.  
14902
14903         The issue is that System.Reflection requires references to nested
14904         types to begin with a "+" sign instead of a dot.  So toplevel
14905         types look like: "NameSpace.TopLevelClass", and nested ones look
14906         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14907         levels. 
14908
14909 2002-09-19  Martin Baulig  <martin@gnome.org>
14910
14911         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14912         says that a method always returns or always throws an exception,
14913         don't report the CS0161.
14914
14915         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14916         set `Returns = new_returns'.
14917
14918 2002-09-19  Martin Baulig  <martin@gnome.org>
14919
14920         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14921         to an enum constant, check for a CS0176.
14922
14923 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14926         for operators that must be in pairs and report errors.
14927
14928         * ecore.cs (SimpleName.DoResolveType): During the initial type
14929         resolution process, when we define types recursively, we must
14930         check first for types in our current scope before we perform
14931         lookups in the enclosing scopes.
14932
14933         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14934
14935         (Invocation.VerifyArgumentsCompat): Call
14936         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14937         I thought we were supposed to always call this, but there are a
14938         few places in the code where we dont do it.
14939
14940 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14941
14942         * driver.cs: Add support in -linkres and -resource to specify the
14943         name of the identifier.
14944
14945 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * ecore.cs (StandardConversionExists): Sync with the conversion
14948         code: allow anything-* to void* conversions.
14949
14950         (FindMostSpecificSource): Use an Expression argument
14951         instead of a Type, because we might be handed over a Literal which
14952         gets a few more implicit conversions that plain types do not.  So
14953         this information was being lost.
14954
14955         Also, we drop the temporary type-holder expression when not
14956         required.
14957
14958 2002-09-17  Martin Baulig  <martin@gnome.org>
14959
14960         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14961         this is an explicit interface implementation.
14962
14963 2002-09-17  Martin Baulig  <martin@gnome.org>
14964
14965         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14966         different `IndexerName' attributes.
14967
14968         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14969         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14970         virtual CommonResolve().
14971
14972 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14975         and convert that to the UnderlyingType.
14976
14977         * statement.cs (Foreach.Resolve): Indexers are just like variables
14978         or PropertyAccesses.
14979
14980         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14981         inside quoted strings, we were not doing this before.
14982
14983 2002-09-16  Martin Baulig  <martin@gnome.org>
14984
14985         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14986         resolve it.  This is needed for the definite assignment check of the
14987         instance expression, fixes bug #29846.
14988         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14989
14990 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14991
14992         * parameter.cs: Fix compile error.  Cannot reference static member
14993         from an instance object.  Is this an mcs bug?
14994
14995 2002-09-14  Martin Baulig  <martin@gnome.org>
14996
14997         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14998         multiple times.  Fixes bug #30295, added test-166.cs.
14999
15000 2002-09-14  Martin Baulig  <martin@gnome.org>
15001
15002         * statement.cs (Block.Emit): Don't emit unreachable code.
15003         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15004         `break' statements.
15005         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15006
15007 2002-09-14  Martin Baulig  <martin@gnome.org>
15008
15009         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15010         is set.
15011
15012 2002-09-14  Martin Baulig  <martin@gnome.org>
15013
15014         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15015         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15016         be false on the ms runtime.
15017
15018 2002-09-13  Martin Baulig  <martin@gnome.org>
15019
15020         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15021         the CS0038 error message.
15022
15023 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15026         constant inside, return it.
15027
15028 2002-09-12  Martin Baulig  <martin@gnome.org>
15029
15030         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15031         implicit conversion can be done between enum types.
15032
15033         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15034         check whether an implicit conversion to the current enum's UnderlyingType
15035         exists and report an error if not.
15036
15037         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15038         without debugging support.
15039
15040         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15041         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15042
15043 2002-09-12  Martin Baulig  <martin@gnome.org>
15044
15045         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15046
15047         * ecore.cs (IMemberExpr.DeclaringType): New property.
15048         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15049         nonstatic member of an outer type (CS0038).
15050
15051 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * driver.cs: Activate the using-error detector at warning level
15054         4 (at least for MS-compatible APIs).
15055
15056         * namespace.cs (VerifyUsing): Small buglett fix.
15057
15058         * pending.cs (PendingImplementation): pass the container pointer. 
15059
15060         * interface.cs (GetMethods): Allow for recursive definition.  Long
15061         term, I would like to move every type to support recursive
15062         definitions, not the current ordering mechanism that we have right
15063         now.
15064
15065         The situation is this: Attributes are handled before interfaces,
15066         so we can apply attributes to interfaces.  But some attributes
15067         implement interfaces, we will now handle the simple cases
15068         (recursive definitions will just get an error).  
15069
15070         * parameter.cs: Only invalidate types at the end if we fail to
15071         lookup all types.  
15072
15073 2002-09-09  Martin Baulig  <martin@gnome.org>
15074
15075         * ecore.cs (PropertyExpr.Emit): Also check for
15076         TypeManager.system_int_array_get_length so this'll also work when
15077         compiling corlib.  Fixes #30003.
15078
15079 2002-09-09  Martin Baulig  <martin@gnome.org>
15080
15081         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15082         and throw an exception if we can't get the type's size.  Fixed #30040,
15083         added test-165.cs.
15084
15085 2002-09-09  Martin Baulig  <martin@gnome.org>
15086
15087         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15088
15089         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15090         context.  Fixes bug #30027.
15091
15092         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15093         virtual functions.  Fixes bug #30043, added test-164.cs.
15094
15095 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15096
15097         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15098
15099 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15100
15101         * driver.cs: Use an object to get the windows codepage since it's not a
15102         static property.
15103
15104 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15105
15106         * statement.cs (For.Emit): for infinite loops (test == null)
15107         return whether there is a break inside, not always "true".
15108
15109         * namespace.cs (UsingEntry): New struct to hold the name of the
15110         using definition, the location where it is defined, and whether it
15111         has been used in a successful type lookup.
15112
15113         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15114         strings.
15115
15116         * decl.cs: ditto.
15117
15118 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15119
15120         * attribute.cs : Fix incorrect code which relied on catching
15121         a NullReferenceException to detect a null being passed in
15122         where an object was expected.
15123
15124 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15125
15126         * statement.cs (Try): flag the catch variable as assigned
15127
15128         * expression.cs (Cast): Simplified by using ResolveType instead of
15129         manually resolving.
15130
15131         * statement.cs (Catch): Fix bug by using ResolveType.
15132
15133 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15134
15135         * expression.cs (BetterConversion): Special case for when we have
15136         a NullLiteral as the argument and we have to choose between string
15137         and object types - we choose string the way csc does.
15138
15139         * attribute.cs (Attribute.Resolve): Catch the
15140         NullReferenceException and report error #182 since the Mono
15141         runtime no more has the bug and having this exception raised means
15142         we tried to select a constructor which takes an object and is
15143         passed a null.
15144
15145 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15146
15147         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15148         message (1502, 1503) when we can't locate a method after overload
15149         resolution. This is much more informative and closes the bug
15150         Miguel reported.
15151
15152         * interface.cs (PopulateMethod): Return if there are no argument
15153         types. Fixes a NullReferenceException bug.
15154
15155         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15156         expressions too. Previously we were checking only in one place for
15157         positional arguments leaving out named arguments.
15158
15159         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15160         type to the enum type is not allowed. Remove code corresponding to
15161         that.
15162
15163         (ConvertNumericExplicit): Allow explicit conversions from
15164         the underlying type to enum type. This precisely follows the spec
15165         and closes a bug filed by Gonzalo.
15166
15167 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15168
15169         * compiler.csproj:
15170         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15171
15172 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15175         it was important that we stored the right value after the
15176         reduction in `converted'.
15177
15178 2002-09-04  Martin Baulig  <martin@gnome.org>
15179
15180         * location.cs (Location.SymbolDocument): Use full pathnames for the
15181         source files.
15182
15183 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15186         of the expression resolve mechanism, because that will catch the
15187         SimpleName error failures.
15188
15189         (Conditional): If we can not resolve the
15190         expression, return, do not crash.
15191
15192 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15193
15194         * cs-tokenizer.cs:
15195         (location): display token name instead of its number.
15196
15197 2002-08-28  Martin Baulig  <martin@gnome.org>
15198
15199         * expression.cs (Binary.ResolveOperator): Don't silently return
15200         but return an error if an operator cannot be applied between two
15201         enum types.
15202
15203 2002-08-28  Martin Baulig  <martin@gnome.org>
15204
15205         * class.cs (Constructor.Define): Set the permission attributes
15206         correctly instead of making all constructors public.
15207
15208 2002-08-28  Martin Baulig  <martin@gnome.org>
15209
15210         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15211         for private members before reporting a CS0103; if we find anything,
15212         it's a CS0122.
15213
15214 2002-08-28  Martin Baulig  <martin@gnome.org>
15215
15216         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15217         to check whether `closure_start_type == closure_invocation_type',
15218         we also need to check whether `m.DeclaringType == closure_invocation_type'
15219         before bypassing the permission checks.  We might be accessing
15220         protected/private members from the base class.
15221         (TypeManager.RealMemberLookup): Only set private_ok if private
15222         members were requested via BindingFlags.NonPublic.
15223
15224         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15225
15226         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15227         MethodGroupExpr.IsExplicitImpl if appropriate.
15228         (Invocation.DoResolve): Don't report the CS0120 for explicit
15229         interface implementations.
15230
15231 2002-08-27  Martin Baulig  <martin@gnome.org>
15232
15233         * expression.cs (Invocation.DoResolve): If this is a static
15234         method and we don't have an InstanceExpression, we must report
15235         a CS0120.
15236
15237 2002-08-25  Martin Baulig  <martin@gnome.org>
15238
15239         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15240         `==' between a valuetype and an object.
15241
15242 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15243
15244         * ecore.cs (TypeExpr): Provide a ToString method.
15245
15246 2002-08-24  Martin Baulig  <martin@gnome.org>
15247
15248         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15249         now called proggie.dbg and it's a binary file.
15250
15251 2002-08-23  Martin Baulig  <martin@gnome.org>
15252
15253         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15254
15255 2002-08-23  Martin Baulig  <martin@gnome.org>
15256
15257         * struct.cs (MyStructInfo.ctor): Make this work with empty
15258         structs; it's not allowed to use foreach() on null.
15259
15260 2002-08-23  Martin Baulig  <martin@gnome.org>
15261
15262         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15263         writer the full pathname of the generated assembly.
15264
15265 2002-08-23  Martin Baulig  <martin@gnome.org>
15266
15267         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15268         A `finally' block never returns or breaks; improved handling of
15269         unreachable code.
15270
15271 2002-08-23  Martin Baulig  <martin@gnome.org>
15272
15273         * statement.cs (Throw.Resolve): Allow `throw null'.
15274
15275 2002-08-23  Martin Baulig  <martin@gnome.org>
15276
15277         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15278         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15279         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15280         MemberLookup would return a wrong event if this is an explicit
15281         interface implementation and the class has an event with the same
15282         name.
15283
15284 2002-08-23  Martin Baulig  <martin@gnome.org>
15285
15286         * statement.cs (Block.AddChildVariableNames): New public method.
15287         (Block.AddChildVariableName): Likewise.
15288         (Block.IsVariableNameUsedInChildBlock): Likewise.
15289         (Block.AddVariable): Check whether a variable name has already
15290         been used in a child block.
15291
15292         * cs-parser.jay (declare_local_variables): Mark all variable names
15293         from the current block as being used in a child block in the
15294         implicit block.
15295
15296 2002-08-23  Martin Baulig  <martin@gnome.org>
15297
15298         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15299         find the symbol writer.
15300
15301         * driver.cs: csc also allows the arguments to /define being
15302         separated by commas, not only by semicolons.
15303
15304 2002-08-23  Martin Baulig  <martin@gnome.org>
15305
15306         * interface.cs (Interface.GetMembers): Added static check for events.
15307
15308 2002-08-15  Martin Baulig  <martin@gnome.org>
15309
15310         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15311         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15312
15313         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15314         why the MethodData.EmitDestructor() change was necessary.
15315
15316 2002-08-20  Martin Baulig  <martin@gnome.org>
15317
15318         * class.cs (TypeContainer.FindMembers): Added static check for events.
15319
15320         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15321
15322         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15323         use Type.GetEvents(), not Type.FindMembers().
15324
15325 2002-08-20  Martin Baulig  <martin@gnome.org>
15326
15327         * decl.cs (MemberCache): Added a special method cache which will
15328         be used for method-only searched.  This ensures that a method
15329         search will return a MethodInfo with the correct ReflectedType for
15330         inherited methods.      
15331
15332 2002-08-20  Martin Baulig  <martin@gnome.org>
15333
15334         * decl.cs (DeclSpace.FindMembers): Made this public.
15335
15336 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15337
15338         * delegate.cs: fixed build on windows.
15339         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15340
15341 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15342
15343         * ecore.cs (StandardConversionExists): Return a false
15344         if we are trying to convert the void type to anything else
15345         since that is not allowed.
15346
15347         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15348         we flag error 70 in the event an event is trying to be accessed
15349         directly from outside the declaring type.
15350
15351 2002-08-20  Martin Baulig  <martin@gnome.org>
15352
15353         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15354         MemberCache from typemanager.cs to decl.cs.
15355
15356 2002-08-19  Martin Baulig  <martin@gnome.org>
15357
15358         * class.cs (TypeContainer): Implement IMemberContainer.
15359         (TypeContainer.DefineMembers): Create the MemberCache.
15360         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15361         return public members if BindingFlags.Public was given, check
15362         whether members are static.
15363
15364 2002-08-16  Martin Baulig  <martin@gnome.org>
15365
15366         * decl.cs (DeclSpace.Define): Splitted this in Define and
15367         DefineMembers.  DefineMembers is called first and initializes the
15368         MemberCache.
15369
15370         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15371         DefineMembers() on all our DeclSpaces.
15372
15373         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15374         but call DefineMembers() on all nested interfaces.  We call their
15375         Define() in our new Define() function.
15376
15377         * interface.cs (Interface): Implement IMemberContainer.
15378         (Interface.Define): Moved all code except the attribute stuf to
15379         DefineMembers().
15380         (Interface.DefineMembers): Initialize the member cache.
15381
15382         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15383         need this anymore since we can use MemberCache.FindMembers directly.
15384
15385 2002-08-19  Martin Baulig  <martin@gnome.org>
15386
15387         * typemanager.cs (MemberCache): When creating the cache for an
15388         interface type, add all inherited members.
15389         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15390         to `out bool used_cache' and documented it.
15391         (TypeManager.MemberLookup): If we already used the cache in the first
15392         iteration, we don't need to do the interfaces check.
15393
15394 2002-08-19  Martin Baulig  <martin@gnome.org>
15395
15396         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15397         here from IMemberFinder and don't implement this interface anymore.
15398         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15399
15400         * typemanager.cs (IMemberFinder): This interface is now only used by
15401         classes which actually support the member cache.
15402         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15403         since we only put DeclSpaces into this Hashtable.
15404         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15405         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15406
15407 2002-08-16  Martin Baulig  <martin@gnome.org>
15408
15409         * typemanager.cs (ICachingMemberFinder): Removed.
15410         (IMemberFinder.MemberCache): New property.
15411         (TypeManager.FindMembers): Merged this with RealFindMembers().
15412         This function will never be called from TypeManager.MemberLookup()
15413         so we can't use the cache here, just the IMemberFinder.
15414         (TypeManager.MemberLookup_FindMembers): Check whether the
15415         IMemberFinder has a MemberCache and call the cache's FindMembers
15416         function.
15417         (MemberCache): Rewrote larger parts of this yet another time and
15418         cleaned it up a bit.
15419
15420 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15421
15422         * driver.cs (LoadArgs): Support quoting.
15423
15424         (Usage): Show the CSC-like command line arguments.
15425
15426         Improved a few error messages.
15427
15428 2002-08-15  Martin Baulig  <martin@gnome.org>
15429
15430         * typemanager.cs (IMemberContainer.Type): New property.
15431         (IMemberContainer.IsInterface): New property.
15432
15433         The following changes are conditional to BROKEN_RUNTIME, which is
15434         defined at the top of the file.
15435
15436         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15437         class'es members, but add all members from TypeHandle.ObjectType
15438         if we're an interface.
15439         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15440         is the current type.
15441         (MemberCache.CacheEntry.Container): Removed this field.
15442         (TypeHandle.GetMembers): Include inherited members.
15443
15444 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15445
15446         * typemanager.cs: fixed compilation and added a comment on a field that
15447         is never used.
15448
15449 2002-08-15  Martin Baulig  <martin@gnome.org>
15450
15451         * class.cs (ConstructorInitializer.Resolve): In the
15452         Expression.MemberLookup call, use the queried_type as
15453         invocation_type.
15454
15455         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15456         declared' attribute, it's always true.
15457         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15458         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15459         temporary wrapper for FindMembers which tells MemberLookup whether
15460         members from the base classes are included in the return value.
15461         This will go away soon.
15462         (TypeManager.MemberLookup): Use this temporary hack here; once the
15463         new MemberCache is completed, we don't need to do the DeclaredOnly
15464         looping here anymore since the MemberCache will take care of this.
15465         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15466         (MemberCache): When creating the MemberCache for a class, get
15467         members from the current class and all its base classes.
15468         (MemberCache.CacheEntry.Container): New field.  This is a
15469         temporary hack until the Mono runtime is fixed to distinguish
15470         between ReflectedType and DeclaringType.  It allows us to use MCS
15471         with both the MS runtime and the unfixed Mono runtime without
15472         problems and without accecting performance.
15473         (MemberCache.SearchMembers): The DeclaredOnly looping from
15474         TypeManager.MemberLookup is now done here.      
15475
15476 2002-08-14  Martin Baulig  <martin@gnome.org>
15477
15478         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15479         Type.GetFields on dynamic types but get the fields from the
15480         corresponding TypeContainer.
15481         (MyStructInfo.GetStructInfo): Added check for enum types.
15482
15483         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15484         (MemberList.SyncRoot): Implemented.
15485         (TypeManager.FilterWithClosure): No need to check permissions if
15486         closure_start_type == closure_invocation_type, don't crash if
15487         closure_invocation_type is null.
15488
15489 2002-08-13  Martin Baulig  <martin@gnome.org>
15490
15491         Rewrote TypeContainer.FindMembers to use a member cache.  This
15492         gives us a speed increase of about 35% for the self-hosting MCS
15493         build and of about 15-20% for the class libs (both on GNU/Linux).
15494
15495         * report.cs (Timer): New class to get enhanced profiling.  This
15496         whole class is "TIMER" conditional since it remarkably slows down
15497         compilation speed.
15498
15499         * class.cs (MemberList): New class.  This is an IList wrapper
15500         which we're now using instead of passing MemberInfo[]'s around to
15501         avoid copying this array unnecessarily.
15502         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15503         (ICachingMemberFinder, IMemberContainer): New interface.
15504         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15505         has already been checked, otherwise use it for the name comparision.
15506         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15507         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15508         if possible.  Returns a MemberList, not a MemberInfo [].
15509         (TypeHandle): New class, implements IMemberContainer.  We create
15510         one instance of this class per type, it contains a MemberCache
15511         which is used to do the member lookups.
15512         (MemberCache): New class.  Each instance of this class contains
15513         all members of a type and a name-based hash table.
15514         (MemberCache.FindMembers): This is our new member lookup
15515         function.  First, it looks up all members of the requested name in
15516         the hash table.  Then, it walks this list and sorts out all
15517         applicable members and returns them.
15518
15519 2002-08-13  Martin Baulig  <martin@gnome.org>
15520
15521         In addition to a nice code cleanup, this gives us a performance
15522         increase of about 1.4% on GNU/Linux - not much, but it's already
15523         half a second for the self-hosting MCS compilation.
15524
15525         * typemanager.cs (IMemberFinder): New interface.  It is used by
15526         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15527         Enum, Delegate or Interface.
15528         (TypeManager.finder_to_member_finder): New PtrHashtable.
15529         (TypeManager.finder_to_container): Removed.
15530         (TypeManager.finder_to_delegate): Removed.
15531         (TypeManager.finder_to_interface): Removed.
15532         (TypeManager.finder_to_enum): Removed.
15533
15534         * interface.cs (Interface): Implement IMemberFinder.
15535
15536         * delegate.cs (Delegate): Implement IMemberFinder.
15537
15538         * enum.cs (Enum): Implement IMemberFinder.
15539
15540         * class.cs (TypeContainer): Implement IMemberFinder.
15541
15542 2002-08-12  Martin Baulig  <martin@gnome.org>
15543
15544         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15545
15546 2002-08-12  Martin Baulig  <martin@gnome.org>
15547
15548         * ecore.cs (ITypeExpression): New interface for expressions which
15549         resolve to a type.
15550         (TypeExpression): Renamed to TypeLookupExpression.
15551         (Expression.DoResolve): If we're doing a types-only lookup, the
15552         expression must implement the ITypeExpression interface and we
15553         call DoResolveType() on it.
15554         (SimpleName): Implement the new ITypeExpression interface.
15555         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15556         hack, the situation that we're only looking up types can't happen
15557         anymore when this method is called.  Moved the type lookup code to
15558         DoResolveType() and call it.
15559         (SimpleName.DoResolveType): This ITypeExpression interface method
15560         is now doing the types-only lookup.
15561         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15562         (ResolveFlags): Added MaskExprClass.
15563
15564         * expression.cs (MemberAccess): Implement the ITypeExpression
15565         interface.
15566         (MemberAccess.DoResolve): Added support for a types-only lookup
15567         when we're called via ITypeExpression.DoResolveType().
15568         (ComposedCast): Implement the ITypeExpression interface.
15569
15570         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15571         Expression.Resolve() with ResolveFlags.Type instead.
15572
15573 2002-08-12  Martin Baulig  <martin@gnome.org>
15574
15575         * interface.cs (Interface.Define): Apply attributes.
15576
15577         * attribute.cs (Attribute.ApplyAttributes): Added support for
15578         interface attributes.
15579
15580 2002-08-11  Martin Baulig  <martin@gnome.org>
15581
15582         * statement.cs (Block.Emit): Only check the "this" variable if we
15583         do not always throw an exception.
15584
15585         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15586         whether the property has a set accessor.
15587
15588 2002-08-11  Martin Baulig  <martin@gnome.org>
15589
15590         Added control flow analysis support for structs.
15591
15592         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15593         with control flow analysis turned off.
15594         (IVariable): New interface.
15595         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15596         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15597         (FieldExpr.DoResolve): Resolve the instance expression with flow
15598         analysis turned off and do the definite assignment check after the
15599         resolving when we know what the expression will resolve to.
15600
15601         * expression.cs (LocalVariableReference, ParameterReference):
15602         Implement the new IVariable interface, only call the flow analysis
15603         code if ec.DoFlowAnalysis is true.
15604         (This): Added constructor which takes a Block argument.  Implement
15605         the new IVariable interface.
15606         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15607         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15608         This does the definite assignment checks for struct members.
15609
15610         * class.cs (Constructor.Emit): If this is a non-static `struct'
15611         constructor which doesn't have any initializer, call
15612         Block.AddThisVariable() to tell the flow analysis code that all
15613         struct elements must be initialized before control returns from
15614         the constructor.
15615
15616         * statement.cs (MyStructInfo): New public class.
15617         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15618         argument to this indexer.  If non-zero, check an individual struct
15619         member, not the whole struct.
15620         (FlowBranching.CheckOutParameters): Check struct members.
15621         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15622         overloaded versions of these methods which take an additional
15623         `int field_idx' argument to check struct members.
15624         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15625         overloaded versions of these methods which take an additional
15626         `string field_name' argument to check struct member.s
15627         (VariableInfo): Implement the IVariable interface.
15628         (VariableInfo.StructInfo): New public property.  Returns the
15629         MyStructInfo instance of the variable if it's a struct or null.
15630         (Block.AddThisVariable): New public method.  This is called from
15631         Constructor.Emit() for non-static `struct' constructor which do
15632         not have any initializer.  It creates a special variable for the
15633         "this" instance variable which will be checked by the flow
15634         analysis code to ensure that all of the struct's fields are
15635         initialized before control returns from the constructor.
15636         (UsageVector): Added support for struct members.  If a
15637         variable/parameter is a struct with N members, we reserve a slot
15638         in the usage vector for each member.  A struct is considered fully
15639         initialized if either the struct itself (slot 0) or all its
15640         members are initialized.
15641
15642 2002-08-08  Martin Baulig  <martin@gnome.org>
15643
15644         * driver.cs (Driver.MainDriver): Only report an error CS5001
15645         if there were no compilation errors.
15646
15647         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15648         `UnsafeContext' property to determine whether the parent is in
15649         unsafe context rather than checking the parent's ModFlags:
15650         classes nested in an unsafe class are unsafe as well.
15651
15652 2002-08-08  Martin Baulig  <martin@gnome.org>
15653
15654         * statement.cs (UsageVector.MergeChildren): Distinguish between
15655         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15656         we return.  Added test17() and test18() to test-154.cs.
15657
15658 2002-08-08  Martin Baulig  <martin@gnome.org>
15659
15660         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15661         Family access, make sure the invoking type isn't a subclass of the
15662         queried type (that'd be a CS1540).
15663
15664         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15665         this method which takes an additional `Type invocation_type'.
15666
15667         * expression.cs (BaseAccess.DoResolve): Use the base type as
15668         invocation and query type.
15669         (MemberAccess.DoResolve): If the lookup failed and we're about to
15670         report a CS0122, try a lookup with the ec.ContainerType - if this
15671         succeeds, we must report a CS1540.
15672
15673 2002-08-08  Martin Baulig  <martin@gnome.org>
15674
15675         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15676         (MethodGroupExpr): Implement the IMemberExpr interface.
15677
15678         * expression (MemberAccess.ResolveMemberAccess): No need to have
15679         any special code for MethodGroupExprs anymore, they're now
15680         IMemberExprs.   
15681
15682 2002-08-08  Martin Baulig  <martin@gnome.org>
15683
15684         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15685         Family, FamANDAssem and FamORAssem permissions.
15686         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15687
15688 2002-08-08  Martin Baulig  <martin@gnome.org>
15689
15690         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15691         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15692         or loop block.
15693
15694 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15695
15696         * driver.cs: implemented /resource option to embed managed resources.
15697
15698 2002-08-07  Martin Baulig  <martin@gnome.org>
15699
15700         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15701         (FieldBase.HasFieldInitializer): New public property.
15702         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15703         returns the field initializer and makes sure it is only resolved once.
15704         (TypeContainer.EmitFieldInitializers): Call
15705         FieldBase.GetInitializerExpression to get the initializer, this ensures
15706         that it isn't resolved multiple times.
15707
15708         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15709         the resolving process (SimpleName/MemberLookup) that we're currently
15710         emitting a field initializer (which must not access any instance members,
15711         this is an error CS0236).
15712
15713         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15714         argument, if the `IsFieldInitializer' flag is set, we must report and
15715         error CS0236 and not an error CS0120.   
15716
15717 2002-08-07  Martin Baulig  <martin@gnome.org>
15718
15719         * ecore.cs (IMemberExpr): New public interface.
15720         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15721         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15722         if the expression is an IMemberExpr.
15723
15724         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15725         to be null, implicitly default to `this' if we're non-static in
15726         this case.  Simplified the code a lot by using the new IMemberExpr
15727         interface.  Also fixed bug #28176 here.
15728
15729 2002-08-06  Martin Baulig  <martin@gnome.org>
15730
15731         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15732         ParameterReferences during semantic analysis so that we can do a
15733         type-only search when resolving Cast, TypeOf and SizeOf.
15734         (block): Pass the `current_local_parameters' to the Block's
15735         constructor.
15736
15737         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15738         argument to the constructor.
15739         (ConstructorInitializer.Resolve): Create a temporary implicit
15740         block with the parameters.
15741
15742         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15743         references here if we aren't doing a type-only search.
15744
15745         * statement.cs (Block): Added constructor which takes a
15746         `Parameters parameters' argument.
15747         (Block.Parameters): New public property.
15748
15749         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15750         to `Parameters' and made it public readonly.
15751
15752 2002-08-06  Martin Baulig  <martin@gnome.org>
15753
15754         * ecore.cs (Expression.Warning): Made this public as well.
15755
15756         * report.cs (Report.Debug): Print the contents of collections.
15757
15758 2002-08-06  Martin Baulig  <martin@gnome.org>
15759
15760         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15761         used to tell Resolve() which kinds of expressions it may return.
15762         (Expression.Resolve): Added overloaded version of this method which
15763         takes a `ResolveFlags flags' argument.  This can be used to tell
15764         Resolve() which kinds of expressions it may return.  Reports a
15765         CS0118 on error.
15766         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15767         ResolveFlags.SimpleName.
15768         (Expression.Error118): Added overloaded version of this method which
15769         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15770         which kinds of expressions are allowed.
15771
15772         * expression.cs (Argument.ResolveMethodGroup): New public method.
15773         Resolves an argument, but allows a MethodGroup to be returned.
15774         This is used when invoking a delegate.
15775
15776         * TODO: Updated a bit.
15777
15778 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15779
15780         Fixed compilation with csc.
15781
15782         * ecore.cs: Expression.Error made public. Is this correct? Should
15783         Warning be made public too?
15784
15785         * expression.cs: use ea.Location instead of ea.loc.
15786         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15787
15788 2002-08-06  Martin Baulig  <martin@gnome.org>
15789
15790         * ecore.cs (Expression.loc): Moved the location here instead of
15791         duplicating it in all derived classes.
15792         (Expression.Location): New public property.
15793         (Expression.Error, Expression.Warning): Made them non-static and
15794         removed the location argument.
15795         (Expression.Warning): Added overloaded version which takes an
15796         `int level' argument.
15797         (Expression.Error118): Make this non-static and removed the
15798         expression and location arguments.
15799         (TypeExpr): Added location argument to the constructor.
15800
15801         * expression.cs (StaticCallExpr): Added location argument to
15802         the constructor.
15803         (Indirection, PointerArithmetic): Likewise.
15804         (CheckedExpr, UnCheckedExpr): Likewise.
15805         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15806         (StringPtr): Likewise.
15807
15808
15809 2002-08-05  Martin Baulig  <martin@gnome.org>
15810
15811         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15812
15813         * assign.cs (Assign.DoResolve): Check whether the source
15814         expression is a value or variable.
15815
15816         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15817         while resolving the corresponding blocks.
15818
15819         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15820         an error, don't silently return null.
15821
15822         * statement.cs (Block.AddVariable): Do the error reporting here
15823         and distinguish between CS0128 and CS0136.
15824         (Block.DoResolve): Report all unused labels (warning CS0164).
15825         (LabeledStatement): Pass the location to the constructor.
15826         (LabeledStatement.HasBeenReferenced): New property.
15827         (LabeledStatement.Resolve): Set it to true here.
15828
15829         * statement.cs (Return.Emit): Return success even after reporting
15830         a type mismatch error (CS0126 or CS0127), this is what csc does and
15831         it avoids confusing the users with any consecutive errors.
15832
15833 2002-08-05  Martin Baulig  <martin@gnome.org>
15834
15835         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15836
15837         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15838
15839         * expression.cs (MemberAccess.DoResolve): Silently return if an
15840         error has already been reported.
15841
15842         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15843         error has already been reported.
15844
15845 2002-08-05  Martin Baulig  <martin@gnome.org>
15846
15847         * statement.cs (UsageVector): Only initialize the `parameters'
15848         vector if we actually have any "out" parameters.
15849
15850 2002-08-05  Martin Baulig  <martin@gnome.org>
15851
15852         * expression.cs (Binary.ResolveOperator): When combining delegates,
15853         they must have the same type.
15854
15855 2002-08-05  Martin Baulig  <martin@gnome.org>
15856
15857         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15858         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15859         work with the ms runtime and we also don't need it: if we're a
15860         PropertyBuilder and not in the `indexer_arguments' hash, then we
15861         are a property and not an indexer.
15862
15863         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15864         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15865         since the latter one doesn't work with the ms runtime.
15866
15867 2002-08-03  Martin Baulig  <martin@gnome.org>
15868
15869         Fixed bugs #27998 and #22735.
15870
15871         * class.cs (Method.IsOperator): New public field.
15872         (Method.CheckBase): Report CS0111 if there's already a method
15873         with the same parameters in the current class.  Report CS0508 when
15874         attempting to change the return type of an inherited method.
15875         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15876         and it's not marked abstract or extern.
15877         (PropertyBase): New abstract base class for Property and Indexer.
15878         (PropertyBase.CheckBase): Moved here from Property and made it work
15879         for indexers.
15880         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15881         the same so we can reuse it there.
15882         (Property, Indexer): Derive from PropertyBase.
15883         (MethodSignature.inheritable_property_signature_filter): New delegate
15884         to find properties and indexers.
15885
15886         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15887         argument and improved error reporting.
15888
15889         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15890         EmptyReadOnlyParameters and made it a property.
15891
15892         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15893         version of this method which takes a `PropertyInfo indexer'.
15894         (TypeManager.RegisterIndexer): New method.
15895
15896         * class.cs: Added myself as author of this file :-)
15897
15898 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15899
15900         * class.cs: fixed compilation on windoze.
15901
15902 2002-08-03  Martin Baulig  <martin@gnome.org>
15903
15904         * interface.cs (Interface.GetInterfaceBases): Check whether all
15905         base interfaces are at least as accessible than the current one.
15906
15907         * class.cs (TypeContainer.GetClassBases): Check whether base types
15908         are at least as accessible than the current type.
15909         (TypeContainer.AsAccessible): Implemented and made non-static.
15910         (MemberBase.CheckParameters): Report errors if the accessibility
15911         checks fail.
15912
15913         * delegate.cs (Delegate.Delegate): The default visibility is
15914         internal for top-level types and private for nested types.
15915         (Delegate.Define): Report errors if the accessibility checks fail.
15916
15917         * enum.cs (Enum.Enum): The default visibility is internal for
15918         top-level types and private for nested types.
15919         (Enum.DefineType): Compute the correct visibility.
15920
15921         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15922         function which takes a `bool is_toplevel' instead of a TypeContainer.
15923
15924         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15925         builtin type.
15926
15927 2002-08-02  Martin Baulig  <martin@gnome.org>
15928
15929         * expression.cs (LocalVariableReferenc): Added constructor which
15930         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15931         (LocalVariableReference.IsReadOnly): New property.
15932         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15933         variable is readonly, use our own readonly flag to do this; you can
15934         use the new constructor to get a writable reference to a read-only
15935         variable.
15936
15937         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15938         reference to the local variable.
15939
15940 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * rootcontext.cs (ResolveCore): Also include System.Exception
15943
15944         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15945         we reach an EmptyStatement.
15946
15947         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15948         is also fine.
15949
15950         * expression.cs (Binary.ResolveOperator): Check error result in
15951         two places.
15952
15953         use brtrue/brfalse directly and avoid compares to null.
15954
15955 2002-08-02  Martin Baulig  <martin@gnome.org>
15956
15957         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15958         Fixes bug #28407, added test-155.cs.
15959
15960 2002-08-01  Martin Baulig  <martin@gnome.org>
15961
15962         * class.cs (Event.EmitDefaultMethod): Make this work with static
15963         events.  Fixes #28311, added verify-3.cs.
15964
15965 2002-08-01  Martin Baulig  <martin@gnome.org>
15966
15967         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15968         `is_disposable' fields.
15969         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15970         `hm.is_disposable' if we're using the collection pattern.
15971         (Foreach.EmitCollectionForeach): Use the correct type for the
15972         enumerator's local variable, only emit the try/finally block if
15973         necessary (fixes #27713).
15974
15975 2002-08-01  Martin Baulig  <martin@gnome.org>
15976
15977         * ecore.cs (Expression.report118): Renamed to Error118 and made
15978         it public static.
15979
15980         * statement.cs (Throw.Resolve): Check whether the expression is of
15981         the correct type (CS0118) and whether the type derives from
15982         System.Exception (CS0155).
15983         (Catch.Resolve): New method.  Do the type lookup here and check
15984         whether it derives from System.Exception (CS0155).
15985         (Catch.CatchType, Catch.IsGeneral): New public properties.
15986
15987         * typemanager.cs (TypeManager.exception_type): Added.
15988
15989 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * driver.cs: Updated About function.
15992
15993 2002-07-31  Martin Baulig  <martin@gnome.org>
15994
15995         Implemented Control Flow Analysis.
15996
15997         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15998         (EmitContext.CurrentBranching): Added.
15999         (EmitContext.StartFlowBranching): Added.
16000         (EmitContext.EndFlowBranching): Added.
16001         (EmitContext.KillFlowBranching): Added.
16002         (EmitContext.IsVariableAssigned): Added.
16003         (EmitContext.SetVariableAssigned): Added.
16004         (EmitContext.IsParameterAssigned): Added.
16005         (EmitContext.SetParameterAssigned): Added.
16006         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16007         Added control flow analysis stuff here.
16008
16009         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16010         resolve the expression as lvalue.
16011         (LocalVariableReference.DoResolve): Check whether the variable has
16012         already been assigned.
16013         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16014         the parameter as assigned here.
16015         (ParameterReference.DoResolve): Check whether the parameter has already
16016         been assigned.
16017         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16018         expression as lvalue.
16019
16020         * statement.cs (FlowBranching): New class for the flow analysis code.
16021         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16022         (LabeledStatement.IsDefined): New public property.
16023         (LabeledStatement.AddUsageVector): New public method to tell flow
16024         analyis that the label may be reached via a forward jump.
16025         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16026         flow analysis.
16027         (VariableInfo.Number): New public field.  This is used by flow analysis
16028         to number all locals of a block.
16029         (Block.CountVariables): New public property.  This is the number of
16030         local variables in this block (including the locals from all parent
16031         blocks).
16032         (Block.EmitMeta): Number all the variables.
16033
16034         * statement.cs: Added flow analysis support to all classes.
16035
16036 2002-07-31  Martin Baulig  <martin@gnome.org>
16037
16038         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16039         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16040         then use this argument.
16041
16042         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16043
16044         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16045         use this to specify /define options.
16046
16047 2002-07-29  Martin Baulig  <martin@gnome.org>
16048
16049         * statement.cs (Fixed): Moved all code that does variable lookups
16050         and resolvings from Emit to Resolve.
16051
16052         * statement.cs (For): Moved all code that does variable lookups
16053         and resolvings from Emit to Resolve.
16054
16055         * statement.cs (Using): Moved all code that does variable lookups
16056         and resolvings from Emit to Resolve.
16057
16058 2002-07-29  Martin Baulig  <martin@gnome.org>
16059
16060         * attribute.cs (Attribute.Resolve): Explicitly catch a
16061         System.NullReferenceException when creating the
16062         CustromAttributeBuilder and report a different warning message.
16063
16064 2002-07-29  Martin Baulig  <martin@gnome.org>
16065
16066         * support.cs (ParameterData.ParameterName): Added method to
16067         get the name of a parameter.
16068
16069         * typemanager.cs (TypeManager.IsValueType): New public method.
16070
16071 2002-07-29  Martin Baulig  <martin@gnome.org>
16072
16073         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16074         is a flag which specifies that it's either ref or out.
16075         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16076         the out parameter to `out Parameter.Modifier mod', also set the
16077         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16078
16079         * support.cs (InternalParameters.ParameterModifier): Distinguish
16080         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16081         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16082
16083         * expression.cs (Argument.GetParameterModifier): Distinguish
16084         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16085         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16086
16087 2002-07-29  Martin Baulig  <martin@gnome.org>
16088
16089         * expression.cs (ParameterReference.ParameterReference): Added
16090         `Location loc' argument to the constructor.
16091
16092         * cs-parser.jay: Pass location to ParameterReference.
16093
16094 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16095
16096         * statement.cs (Try): Initialize the location.
16097
16098         * cs-parser.jay: pass location to Try.
16099
16100         * expression.cs (Unary.Reduce): Change the prototype to return
16101         whether a constant fold could be performed or not.  The result is
16102         returned in an out parameters.  In the case of Indirection and
16103         AddressOf, we want to perform the full tests.
16104
16105 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * statement.cs (Statement.Emit): Flag dead code.
16108
16109 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16110
16111         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16112
16113 2002-07-27  Martin Baulig  <martin@gnome.org>
16114
16115         * class.cs (MethodData.Define): Put back call to
16116         TypeManager.AddMethod(), accidentally commented this out.
16117
16118         * report.cs (Debug): New public method to print debugging information,
16119         this is `[Conditional ("DEBUG")]'.
16120
16121 2002-07-26  Martin Baulig  <martin@gnome.org>
16122
16123         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16124         (switch_statement): Push the current_block to the switch_stack and
16125         pop it again when we're done with the switch.
16126         (switch_section): The new block is a child of the current_block.
16127         Fixes bug #24007, added test-152.cs.
16128
16129 2002-07-27  Martin Baulig  <martin@gnome.org>
16130
16131         * expression.cs (Invocation.EmitArguments): When calling a varargs
16132         function with only its fixed arguments, we need to pass an empty
16133         array.
16134
16135 2002-07-27  Martin Baulig  <martin@gnome.org>
16136
16137         Mono 0.13 has been released.
16138
16139 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16140
16141         * driver.cs: Rename --resource to --linkres, because that is what
16142         we do currently, we dont support --resource yet.
16143
16144         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16145
16146 2002-07-25  Martin Baulig  <martin@gnome.org>
16147
16148         * class.cs (MethodData): New public class.  This is a `method builder'
16149         class for a method or one accessor of a Property/Indexer/Event.
16150         (MethodData.GetMethodFlags): Moved here from MemberBase.
16151         (MethodData.ApplyAttributes): Likewise.
16152         (MethodData.ApplyObsoleteAttribute): Likewise.
16153         (MethodData.ApplyConditionalAttribute): Likewise.
16154         (MethodData.ApplyDllImportAttribute): Likewise.
16155         (MethodData.CheckAbstractAndExternal): Likewise.
16156         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16157         (MethodData.Emit): Formerly known as Method.Emit().
16158         (MemberBase): Moved everything which was specific to a single
16159         accessor/method to MethodData.
16160         (Method): Create a new MethodData and call Define() and Emit() on it.
16161         (Property, Indexer, Event): Create a new MethodData objects for each
16162         accessor and call Define() and Emit() on them.
16163
16164 2002-07-25  Martin Baulig  <martin@gnome.org>
16165
16166         Made MethodCore derive from MemberBase to reuse the code from there.
16167         MemberBase now also checks for attributes.
16168
16169         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16170         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16171         as virtual.
16172         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16173         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16174         (MemberBase.ApplyAttributes): New virtual method; applies the
16175         attributes to a method or accessor.
16176         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16177         (MemberBase.ApplyConditionalAttribute): Likewise.
16178         (MemberBase.ApplyDllImportAttribute): Likewise.
16179         (MemberBase.CheckAbstractAndExternal): Likewise.
16180         (MethodCore.ParameterTypes): This is now a property instead of a
16181         method, it's initialized from DoDefineParameters().
16182         (MethodCore.ParameterInfo): Removed the set accessor.
16183         (MethodCore.DoDefineParameters): New protected virtual method to
16184         initialize ParameterTypes and ParameterInfo.
16185         (Method.GetReturnType): We can now simply return the MemberType.
16186         (Method.GetMethodFlags): Override the MemberBase version and add
16187         the conditional flags.
16188         (Method.CheckBase): Moved some code from Define() here, call
16189         DoDefineParameters() here.
16190         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16191         here to avoid some larger code duplication.
16192         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16193         ensure that abstract and external accessors don't declare a body.
16194
16195         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16196         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16197         lookup in the attribute's parent classes, so we need to abort as soon
16198         as we found the first match.
16199         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16200         the attribute has no arguments.
16201
16202         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16203         of a Method.
16204
16205 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16206
16207         * cs-parser.jay: reverted previous patch.
16208
16209 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16210
16211         * cs-parser.jay: fixed bug #22119.
16212
16213 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16214
16215         * attribute.cs: fixed compilation. The error was:
16216         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16217         be assigned to before control leaves the current method."
16218         [FIXME:  Filed as bug #28186: MCS must report this error.]
16219
16220 2002-07-25  Martin Baulig  <martin@gnome.org>
16221
16222         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16223         method to pull the condition name ouf of a Conditional attribute.
16224         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16225         the obsolete message and error flag out of an Obsolete attribute.
16226
16227         * class.cs (Method.GetMethodFlags): New public method to get the
16228         TypeManager.MethodFlags for this method.
16229         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16230         private methods.
16231         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16232         if we're overriding a virtual function, set the new private variable
16233         `parent_method'; call the new TypeManager.AddMethod().
16234
16235         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16236         the MethodBuilder and the Method in a PtrHashtable.
16237         (TypeManager.builder_to_method): Added for this purpose.
16238         (TypeManager.MethodFlags): Added IsObsoleteError.
16239         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16240         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16241         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16242         the message from the attribute.
16243
16244 2002-07-24  Martin Baulig  <martin@gnome.org>
16245
16246         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16247         preprocessor directives, ensure that the argument to #define/#undef is
16248         exactly one identifier and that it's actually an identifier.
16249
16250         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16251         did not work ....
16252
16253 2002-07-24  Martin Baulig  <martin@gnome.org>
16254
16255         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16256         initialize it to TypeManager.object_type in the constructor.
16257         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16258         of the `hm.get_current' method if we're using the collection pattern.
16259         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16260         for the explicit conversion to make it work when we're using the collection
16261         pattern and the `Current' property has a different return type than `object'.
16262         Fixes #27713.
16263
16264 2002-07-24  Martin Baulig  <martin@gnome.org>
16265
16266         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16267         does not match, but don't report any errors.  This method is called in
16268         order for all methods in a MethodGroupExpr until a matching method is
16269         found, so we don't want to bail out if the first method doesn't match.
16270         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16271         matches, report the 123.  Fixes #28070.
16272
16273 2002-07-24  Martin Baulig  <martin@gnome.org>
16274
16275         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16276         TypeManager.TypeToCoreType() to the top of the method so the
16277         following equality checks will work.  Fixes #28107.
16278
16279 2002-07-24  Martin Baulig  <martin@gnome.org>
16280
16281         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16282         operand is of type uint, and the other operand is of type sbyte,
16283         short or int, the operands are converted to type long." -
16284         Actually do what this comment already told us.  Fixes bug #28106,
16285         added test-150.cs.
16286
16287 2002-07-24  Martin Baulig  <martin@gnome.org>
16288
16289         * class.cs (MethodBase): New abstract class.  This is now a base
16290         class for Property, Indexer and Event to avoid some code duplication
16291         in their Define() and DefineMethods() methods.
16292         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16293         generic methods for Define() and DefineMethods().
16294         (FieldBase): Derive from MemberBase, not MemberCore.
16295         (Property): Derive from MemberBase, not MemberCore.
16296         (Property.DefineMethod): Moved all the code from this method to the
16297         new MethodBase.DefineAccessor(), just call it with appropriate
16298         argumetnts.
16299         (Property.Define): Call the new Property.DoDefine(), this does some
16300         sanity checks and we don't need to duplicate the code everywhere.
16301         (Event): Derive from MemberBase, not MemberCore.
16302         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16303         accessors, this will also make them work with interface events.
16304         (Indexer): Derive from MemberBase, not MemberCore.
16305         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16306         (Indexer.Define): Use the new MethodBase functions.
16307
16308         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16309         argument to the constructor.
16310         (Interface.FindMembers): Added support for interface events.
16311         (Interface.PopluateEvent): Implemented.
16312
16313         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16314
16315 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16316
16317         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16318         but this is required to check for a method name being the same as
16319         the containing class.  
16320
16321         Handle this now.
16322
16323 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16324
16325         * interface.cs: initialize variable.
16326
16327 2002-07-23  Martin Baulig  <martin@gnome.org>
16328
16329         Implemented the IndexerName attribute in interfaces.
16330
16331         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16332         name if this is an explicit interface implementation.
16333         (Indexer.InterfaceIndexerName): New public variable.  If we're
16334         implementing an interface indexer, this is the IndexerName in that
16335         interface.  Otherwise, it's the IndexerName.
16336         (Indexer.DefineMethod): If we're implementing interface indexer,
16337         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16338         and Pending.ImplementIndexer methods.
16339         (Indexer.Define): Also define the PropertyBuilder if we're
16340         implementing an interface indexer and this is neither an explicit
16341         interface implementation nor do the IndexerName match the one in
16342         the interface.
16343
16344         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16345         If a method is defined here, then we always need to create a proxy
16346         for it.  This is used when implementing interface indexers.
16347         (Pending.IsInterfaceIndexer): New public method.
16348         (Pending.ImplementIndexer): New public method.
16349         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16350         This is used when implementing interface indexers to define a proxy
16351         if necessary.
16352         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16353         define a proxy if necessary.
16354
16355         * interface.cs (Interface.IndexerName): New public variable.
16356         (Interface.PopulateIndexer): Set the IndexerName.
16357         (Interface.DefineIndexers): New private method.  Populate all the
16358         indexers and make sure their IndexerNames match.
16359
16360         * typemanager.cs (IndexerPropertyName): Added support for interface
16361         indexers.
16362
16363 2002-07-22  Martin Baulig  <martin@gnome.org>
16364
16365         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16366         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16367         ret if HasReturnLabel.
16368         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16369         variables.
16370
16371         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16372         and set the ec.LoopBeginTryCatchLevel.
16373         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16374         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16375         the current ec.TryCatchLevel, the branch goes out of an exception
16376         block.  In this case, we need to use Leave and not Br.
16377
16378 2002-07-22  Martin Baulig  <martin@gnome.org>
16379
16380         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16381         block unless the block does not always return or it is contained in
16382         another try { ... } catch { ... } block.  Fixes bug #26506.
16383         Added verify-1.cs to the test suite.
16384
16385 2002-07-22  Martin Baulig  <martin@gnome.org>
16386
16387         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16388         then we do not always return.  Fixes bug #24985.
16389
16390 2002-07-22  Martin Baulig  <martin@gnome.org>
16391
16392         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16393         lookup on a per-class level; ie. walk up the class hierarchy until we
16394         found at least one applicable method, then choose the best among them.
16395         Fixes bug #24463 and test-29.cs.
16396
16397 2002-07-22  Martin Baulig  <martin@gnome.org>
16398
16399         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16400         return types of the methods.  The return type is not part of the
16401         signature and we must not check it to make the `new' modifier work.
16402         Fixes bug #27999, also added test-147.cs.
16403         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16404
16405         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16406         on the method's return type.
16407
16408 2002-07-21  Martin Baulig  <martin@gnome.org>
16409
16410         * assign.cs: Make this work if the rightmost source is a constant and
16411         we need to do an implicit type conversion.  Also adding a few more tests
16412         to test-38.cs which should have caught this.
16413
16414         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16415         target in the makefile for this.  The makefile.gnu is primarily intended
16416         for end-users who don't want to debug the compiler.
16417
16418 2002-07-21  Martin Baulig  <martin@gnome.org>
16419
16420         * assign.cs: Improved the Assign class so it can now handle embedded
16421         assignments (X = Y = Z = something).  As a side-effect this'll now also
16422         consume less local variables.  test-38.cs now passes with MCS, added
16423         a few new test cases to that test.
16424
16425 2002-07-20  Martin Baulig  <martin@gnome.org>
16426
16427         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16428         instructions.  Fixes bug #27977, also added test-146.cs.
16429
16430 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16431
16432         * cs-tokenizer.cs: fixed getHex ().
16433
16434 2002-07-19  Martin Baulig  <martin@gnome.org>
16435
16436         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16437         not Type.GetType() to lookup the array type.  This is needed when
16438         we're constructing an array of a user-defined type.
16439         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16440         single-dimensional arrays, but also for single-dimensial arrays of
16441         type decimal.
16442
16443 2002-07-19  Martin Baulig  <martin@gnome.org>
16444
16445         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16446         this function is called, it's not allowed to share LocalBuilders
16447         among ILGenerators.
16448
16449 2002-07-19  Martin Baulig  <martin@gnome.org>
16450
16451         * expression.cs (Argument.Resolve): Report an error 118 when trying
16452         to pass a type as argument.
16453
16454 2002-07-18  Martin Baulig  <martin@gnome.org>
16455
16456         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16457         Conv_R_Un for the signed `long' type.
16458
16459 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16462         `expr' for the temporary result, as that will fail if we do
16463         multiple resolves on the same expression.
16464
16465 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16466
16467         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16468         ec.TypeContainer for looking up aliases. 
16469
16470         * class.cs (TypeContainer): Remove LookupAlias from here.
16471
16472         * decl.cs (DeclSpace); Move here.
16473
16474 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * class.cs (FindMembers): Only call filter if the constructor
16477         bulider is not null.
16478
16479         Also handle delegates in `NestedTypes' now.  Now we will perform
16480         type lookups using the standard resolution process.  This also
16481         fixes a bug.
16482
16483         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16484         This uses Expressions (the limited kind that can be parsed by the
16485         tree) instead of strings.
16486
16487         * expression.cs (ComposedCast.ToString): Implement, used to flag
16488         errors since now we have to render expressions.
16489
16490         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16491         FormArrayType. 
16492
16493         * ecore.cs (SimpleName.ToString): ditto.
16494
16495         * cs-parser.jay: Instead of using strings to assemble types, use
16496         Expressions to assemble the type (using SimpleName, ComposedCast,
16497         MemberAccess).  This should fix the type lookups in declarations,
16498         because we were using a different code path for this.
16499
16500         * statement.cs (Block.Resolve): Continue processing statements
16501         even when there is an error.
16502
16503 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * class.cs (Event.Define): Also remove the `remove' method from
16506         the list of pending items.
16507
16508         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16509         generate more compact code. 
16510
16511 2002-07-17  Martin Baulig  <martin@gnome.org>
16512
16513         * const.cs (Const.LookupConstantValue): Add support for constant
16514         `unchecked' and `checked' expressions.
16515         Also adding test case test-140.cs for this.
16516
16517 2002-07-17  Martin Baulig  <martin@gnome.org>
16518
16519         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16520         check whether mi.ReturnType implements the IEnumerator interface; the
16521         `==' and the IsAssignableFrom() will fail in this situation.
16522
16523 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16524
16525         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16526         here too.
16527
16528 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16529
16530         * expression.cs: fixed bug #27811.
16531
16532 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16533
16534         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16535         Molaro: when we are a ref, the value already contains a pointer
16536         value, do not take the address of it.
16537
16538 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16539         * removed mb-parser.jay and mb-tokenizer.cs
16540
16541 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16542
16543         * expression.cs: check against the building corlib void type.
16544
16545 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16546
16547         * ecore.cs: fix for valuetype static readonly fields: when 
16548         initializing them, we need their address, not the address of a copy.
16549
16550 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16551
16552         * typemanager.cs: register also enum_type in corlib.
16553
16554 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16555
16556         * class.cs: allow calling this (but not base) initializers in structs.
16557
16558 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16559
16560         * ecore.cs: make sure we compare against the building base types
16561         in GetTypeSize ().
16562
16563 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16564
16565         * typemanager.cs: fix TypeToCoreType() to handle void and object
16566         (corlib gets no more typerefs after this change).
16567
16568 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * expression.cs (ArrayCreation.EmitArrayArguments): use
16571         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16572
16573         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16574         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16575         array indexes, the runtime actually forbids them.
16576
16577         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16578         for array arguments here.
16579
16580         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16581         instead of the default for ValueTypes.
16582
16583         (New.DoEmit): Use IsValueType instead of
16584         IsSubclassOf (value_type)
16585         (New.DoResolve): ditto.
16586         (Invocation.EmitCall): ditto.
16587
16588         * assign.cs (Assign): ditto.
16589
16590         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16591         Statements *are* currently doing part of their resolution during
16592         Emit.  
16593
16594         Expressions do always resolve during resolve, but statements are
16595         only required to propagate resolution to their children.
16596
16597 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16600
16601         (LoadAssembly): Do not add the dll if it is already specified
16602
16603         (MainDriver): Add the System directory to the link path at the end,
16604         after all the other -L arguments. 
16605
16606         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16607         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16608         ldelem.u1) and using the opposite for sbytes.
16609
16610         This fixes Digger, and we can finally run it.
16611
16612         * driver.cs (UnixParseOption): Move the option parsing here.  
16613         (CSCParseOption): Implement CSC-like parsing of options.
16614
16615         We now support both modes of operation, the old Unix way, and the
16616         new CSC-like way.  This should help those who wanted to make cross
16617         platform makefiles.
16618
16619         The only thing broken is that /r:, /reference: and /lib: are not
16620         implemented, because I want to make those have the same semantics
16621         as the CSC compiler has, and kill once and for all the confussion
16622         around this.   Will be doing this tomorrow.
16623
16624         * statement.cs (Unsafe.Resolve): The state is checked during
16625         resolve, not emit, so we have to set the flags for IsUnsfe here.
16626
16627 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16628
16629         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16630         not catch the Error_ObjectRefRequired in SimpleName (as it is
16631         possible to have a class/instance variable name that later gets
16632         deambiguated), we have to check this here.      
16633
16634 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16635
16636         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16637         make static and put into Expression.
16638
16639         (Event.Define): Register the private field of the event with the 
16640         TypeManager so that GetFieldFromEvent can get at it.
16641
16642         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16643         keep track of the private field associated with an event which
16644         has no accessors.
16645
16646         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16647         private field.
16648
16649         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16650
16651 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16652
16653         * expression.cs (Binary.EmitBranchable): this routine emits the
16654         Binary expression in a branchable context.  This basically means:
16655         we need to branch somewhere, not just get the value on the stack.
16656
16657         This works together with Statement.EmitBoolExpression.
16658
16659         * statement.cs (Statement.EmitBoolExpression): Use
16660         EmitBranchable. 
16661
16662 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16663
16664         * statement.cs (For): Reduce the number of jumps in loops.
16665
16666         (For): Implement loop inversion for the For statement.
16667
16668         (Break): We can be breaking out of a Try/Catch controlled section
16669         (foreach might have an implicit try/catch clause), so we need to
16670         use Leave instead of Br.
16671
16672         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16673         now).  If the instace expression supports IMemoryLocation, we use
16674         the AddressOf method from the IMemoryLocation to extract the
16675         address instead of emitting the instance.
16676
16677         This showed up with `This', as we were emitting the instance
16678         always (Emit) instead of the Address of This.  Particularly
16679         interesting when This is a value type, as we dont want the Emit
16680         effect (which was to load the object).
16681
16682 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16683
16684         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16685
16686         * statement.cs (Checked): Set the CheckedState during the resolve
16687         process too, as the ConvCast operations track the checked state on
16688         the resolve process, and not emit.
16689
16690         * cs-parser.jay (namespace_member_declaration): Flag that we have
16691         found a declaration when we do.  This is used to flag error 1529
16692
16693         * driver.cs: Report ok when we display the help only.
16694
16695 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16696
16697         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16698
16699 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * cs-tokenizer.cs (define): We also have to track locally the
16702         defines.  AllDefines is just used for the Conditional Attribute,
16703         but we also need the local defines for the current source code. 
16704
16705 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * statement.cs (While, For, Do): These loops can exit through a
16708         Break statement, use this information to tell whether the
16709         statement is the last piece of code.
16710
16711         (Break): Flag that we break.
16712
16713         * codegen.cs (EmitContexts): New `Breaks' state variable.
16714
16715 2002-07-03  Martin Baulig  <martin@gnome.org>
16716
16717         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16718         modifiers in method declarations in structs.  Otherwise, you won't
16719         be able to override things like Object.Equals().
16720
16721 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16722
16723         * class.cs (Method, Property, Indexer): Do not allow the public
16724         modifier to be used in explicit interface implementations.
16725
16726         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16727         override modifiers in method declarations in structs
16728
16729 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16730
16731         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16732         integer or real overflow, report an error
16733
16734 2002-07-02  Martin Baulig  <martin@gnome.org>
16735
16736         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16737         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16738         to tell the runtime about our newly created System.Object and
16739         System.ValueType types.
16740
16741 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16744         struct instead of Ldarg/Starg.
16745
16746 2002-07-02  Martin Baulig  <martin@gnome.org>
16747
16748         * expression.cs (Indirection.Indirection): Call
16749         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16750
16751 2002-07-02  Martin Baulig  <martin@gnome.org>
16752
16753         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16754         ValueType, call TypeManager.TypeToCoreType() on it.
16755         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16756         the OpCodes.Newarr argument.
16757
16758 2002-07-02  Martin Baulig  <martin@gnome.org>
16759
16760         * expression.cs (Invocation.EmitCall): When compiling corlib,
16761         replace all calls to the system's System.Array type to calls to
16762         the newly created one.
16763
16764         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16765         System.Array methods.
16766         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16767         from the system's System.Array type which must be replaced.
16768
16769 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16770
16771         * typemanager.cs: load unverifiable_code_ctor so we can build
16772         corlib using the correct type. Avoid using GetTypeCode() with
16773         TypeBuilders.
16774         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16775         TypeManager.object_type to allow building corlib.
16776
16777 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16778
16779         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16780
16781 2002-07-01  Martin Baulig  <martin@gnome.org>
16782
16783         * class.cs: Make the last change actually work, we need to check
16784         whether `ifaces != null' to avoid a crash.
16785
16786 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16787
16788         * class.cs: when we build structs without fields that implement
16789         interfaces, we need to add the interfaces separately, since there is
16790         no API to both set the size and add the interfaces at type creation
16791         time.
16792
16793 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16794
16795         * expression.cs: the dimension arguments to the array constructors
16796         need to be converted if they are a long.
16797
16798 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16799
16800         * class.cs: don't emit ldarg.0 if there is no parent constructor
16801         (fixes showstopper for corlib).
16802
16803 2002-06-29  Martin Baulig  <martin@gnome.org>
16804
16805         MCS now compiles corlib on GNU/Linux :-)
16806
16807         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16808         ie. check for MethodImplOptions.InternalCall.
16809
16810         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16811         and TypeManager.attribute_type are null, so we must explicitly check
16812         whether parent is not null to find out whether it's an attribute type.
16813         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16814         and SetBuilder, not only if the property is neither abstract nor external.
16815         This is necessary to set the MethodImplOptions on the accessor methods.
16816         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16817         SetBuilder, see Property.Emit().
16818
16819         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16820         populate "System.Object", "System.ValueType" and "System.Attribute" since
16821         they've already been populated from BootCorlib_PopulateCoreTypes().
16822
16823 2002-06-29  Martin Baulig  <martin@gnome.org>
16824
16825         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16826         is the NullLiteral, we also need to make sure that target_type is not
16827         an enum type.   
16828
16829 2002-06-29  Martin Baulig  <martin@gnome.org>
16830
16831         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16832         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16833         before calling BootstrapCorlib_ResolveDelegate ().
16834
16835 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16836
16837         * statement.cs: fixed build-breaker. All tests passed ok.
16838
16839 2002-06-27  Martin Baulig  <martin@gnome.org>
16840
16841         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16842         for System.Decimal when compiling corlib.
16843
16844 2002-06-27  Martin Baulig  <martin@gnome.org>
16845
16846         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16847         switch blocks which contain nothing but a default clause.
16848
16849 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16850
16851        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16852
16853 2002-06-27  Martin Baulig  <martin@gnome.org>
16854
16855         * ecore.cs (PropertyExpr.PropertyExpr): Call
16856         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16857
16858         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16859         is already a TypeBuilder.
16860
16861 2002-06-27  Martin Baulig  <martin@gnome.org>
16862
16863         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16864         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16865         the "from an array-type to System.Array" case.  This makes it work
16866         when compiling corlib.
16867
16868 2002-06-27  Martin Baulig  <martin@gnome.org>
16869
16870         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16871         non-static PropertyExpr, set its InstanceExpression.  This makes
16872         the `ICollection.Count' property work in System/Array.cs.
16873
16874 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16875
16876         * driver.cs: Made error handling more consistent.  Errors now
16877         tracked by Report class, so many methods which used to return int
16878         now return void.  Main() now prints success/failure and 
16879         errors/warnings message.
16880
16881         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16882         the magic number return values (123 and 124).  Now, if the
16883         expected error occurs, the compiler exits with success (exit value
16884         0).  If the compilation completes without seeing that particular
16885         error, the compiler exits with failure (exit value 1).  The
16886         makefile in mcs/errors has been changed to handle the new behaviour.
16887
16888         * report.cs: Made 'expected error' number a property and renamed
16889         it from 'Probe' to 'ExpectedError'.
16890
16891         * genericparser.cs: Removed error handling support, since it is
16892         now all done by Report class.
16893
16894         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16895         class, so parse() no longer returns an int.
16896
16897         * namespace.cs: Use Report.Error instead of GenericParser.error
16898
16899 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16902         TypeContainer.AddOperator): At the front of the list put the
16903         explicit implementations, so they get resolved/defined first. 
16904
16905 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16906
16907         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16908         interface type is implemented by this TypeContainer.  Used during
16909         explicit interface implementation.
16910
16911         (Property.Define, Indexer.Define, Method.Define): Validate that
16912         the given interface in the explicit implementation is one of the
16913         base classes for the containing type.
16914
16915         Also if we are explicitly implementing an interface, but there is
16916         no match in the pending implementation table, report an error.
16917
16918         (Property.Define): Only define the property if we are
16919         not explicitly implementing a property from an interface.  Use the
16920         correct name also for those properties (the same CSC uses,
16921         although that is really not needed).
16922
16923         (Property.Emit): Do not emit attributes for explicitly implemented
16924         properties, as there is no TypeBuilder.
16925
16926         (Indexer.Emit): ditto.
16927
16928         Hiding then means that we do not really *implement* a pending
16929         implementation, which makes code fail.
16930
16931 2002-06-22  Martin Baulig  <martin@gnome.org>
16932
16933         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16934         the return value of Object.GetType().  [FIXME: we need to do this whenever
16935         we get a type back from the reflection library].
16936
16937 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16938
16939         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16940
16941 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16942
16943         * attribute.cs: Return null if we can not look up the type.
16944
16945         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16946         the interface types found.
16947
16948         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16949         interface types found.
16950
16951         * typemanager.cs (GetInterfaces): Make this routine returns alll
16952         the interfaces and work around the lame differences between
16953         System.Type and System.Reflection.Emit.TypeBuilder in the results
16954         result for GetInterfaces.
16955
16956         (ExpandInterfaces): Given an array of interface types, expand and
16957         eliminate repeated ocurrences of an interface.  This expands in
16958         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16959         be IA, IB, IC.
16960
16961 2002-06-21  Martin Baulig  <martin@gnome.org>
16962
16963         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16964         on System.Enum.
16965
16966 2002-06-21  Martin Baulig  <martin@gnome.org>
16967
16968         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16969         and called with one of the core types, return the corresponding typebuilder for
16970         that type.
16971
16972         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16973         element type.
16974
16975 2002-06-21  Martin Baulig  <martin@gnome.org>
16976
16977         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16978         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16979         (Expression.ConvertReferenceExplicit): Likewise.
16980
16981         * expression.cs (ElementAccess.DoResolve): Likewise.
16982         (ElementAccess.DoResolveLValue): Likewise.
16983
16984 2002-06-10  Martin Baulig  <martin@gnome.org>
16985
16986         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16987         add the "value" parameter to the parameter list.
16988
16989         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16990         to our caller.
16991
16992 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16993
16994         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16995         the argument to an int, uint, long or ulong, per the spec.  Also
16996         catch negative constants in array creation.
16997
16998 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16999
17000         * class.cs: do not allow the same interface to appear twice in
17001         the definition list.
17002
17003 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17004
17005         * ecore.cs: don't use ldlen with System.Array.
17006
17007 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17008
17009         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17010
17011 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17012
17013         * modifiers.cs: produce correct field attributes for protected
17014         internal. Easy fix so miguel can work on ther harder stuff:-)
17015
17016 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17017
17018         * pending.cs: New file.  Move the code from class.cs here.
17019         Support clearning the pending flag for all methods (when not doing
17020         explicit interface implementation).
17021
17022 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17023
17024         * rootcontext.cs: added a couple more types needed to bootstrap.
17025
17026 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17027
17028         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17029         constructor in the type, instead of any constructor in the type
17030         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17031         a bug in the Mono runtime when applying the params attribute). 
17032
17033 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17034         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17035
17036 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17037
17038         * expression.cs (Unary.ResolveOperator): Use TypeManager
17039         to resolve the type.
17040
17041 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17042
17043         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17044         attached.
17045
17046         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17047         with each member too.
17048
17049         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17050         field builders too - this takes care of the enum member case.
17051
17052 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17053
17054         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17055         address-of operator on both value types and pointers.
17056
17057 2002-06-10  Martin Baulig  <martin@gnome.org>
17058
17059         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17060         PropertyBuilder to the `property_builders' list.
17061
17062         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17063         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17064         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17065         find any indexers which are inherited from an interface.
17066
17067 2002-06-09  Martin Baulig  <martin@gnome.org>
17068
17069         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17070         the same type as the constant if necessary.  There's also a test-130.cs
17071         for this.
17072
17073         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17074
17075         * typemanager.cs (TypeManager.ChangeType): Previously known as
17076         Enum.ChangeEnumType().
17077
17078 2002-06-09  Martin Baulig  <martin@gnome.org>
17079
17080         * expression.cs (Cast.TryReduce): Added support for consts.
17081
17082 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17083
17084         * class.cs (Accessor): Hold attributes information so we can pass
17085         it along.
17086
17087         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17088         Modify to pass in attributes attached to the methods.
17089
17090         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17091
17092         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17093         to handle the Accessor kind :-)
17094
17095         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17096
17097 2002-06-08  Martin Baulig  <martin@gnome.org>
17098
17099         * expression.cs (Unary.TryReduceNegative): Added support for
17100         ULongConstants.
17101
17102 2002-06-08  Martin Baulig  <martin@gnome.org>
17103
17104         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17105         name can't be found in the `defined_names' - the caller will do a
17106         MemberLookup in this case and thus find methods in System.Enum
17107         such as Enum.IsDefined().
17108
17109 2002-06-08  Martin Baulig  <martin@gnome.org>
17110
17111         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17112         Convert.ChangeType() which works with TypeBuilder created types.
17113         (Enum.LookupEnumValue, Enum.Define): Use it here.
17114
17115         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17116         `TypeBuilder.BaseType != null' check.
17117         (TypeContainer.FindMembers): Only lookup parent members if we
17118         actually have a parent.
17119         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17120         (ConstructorInitializer.Resolve): Likewise.
17121
17122         * interface.cs (Interface.FindMembers): Added
17123         `TypeBuilder.BaseType != null' check.
17124
17125         * rootcontext.cs (RootContext.ResolveCore): Added
17126         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17127         classes_second_stage.
17128
17129         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17130         debug_type and trace_type when compiling with --nostdlib.       
17131
17132 2002-06-07  Martin Baulig  <martin@gnome.org>
17133
17134         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17135         (AddField): Set it to true when adding a non-static field.
17136         (DefineType): Use `have_nonstatic_fields' to find out whether we
17137         have non-static fields, not `Fields != null'.
17138
17139 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17140
17141         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17142         dereferencing a null on the static-field code path)
17143
17144 2002-05-30  Martin Baulig  <martin@gnome.org>
17145
17146         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17147         to take command line arguments.  Use reflection to call the new
17148         custom `Initialize' function on the symbol writer and pass it the
17149         command line arguments.
17150
17151         * driver.cs (--debug-args): New command line argument to pass command
17152         line arguments to the symbol writer.
17153
17154 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17155
17156         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17157         the target type for indexers and properties.  Thanks to Joe for
17158         catching this.
17159
17160 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17161
17162         * typemanager.cs (MethodFlags): returns the method flags
17163         (Obsolete/ShouldIgnore) that control warning emission and whether
17164         the invocation should be made, or ignored. 
17165
17166         * expression.cs (Invocation.Emit): Remove previous hack, we should
17167         not do this on matching a base type, we should do this based on an attribute
17168
17169         Only emit calls to System.Diagnostics.Debug and
17170         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17171         on the command line.
17172
17173         * rootcontext.cs: Global settings for tracing and debugging.
17174
17175         * cs-tokenizer.cs (define): New utility function to track
17176         defines.   Set the global settings for TRACE and DEBUG if found.
17177
17178 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17179
17180         * interface.cs (Populate*): Pass in the TypeContainer as well as
17181         the DeclSpace as parameters so that we can create EmitContexts and
17182         then use that to apply attributes etc.
17183
17184         (PopulateMethod, PopulateEvent, PopulateProperty)
17185         (PopulateIndexer): Apply attributes everywhere.
17186
17187         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17188         etc.
17189
17190         (ApplyAttributes): Update accordingly.
17191
17192         We now apply interface attributes for all members too.
17193
17194 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * class.cs (Indexer.Define); Correctly check if we are explicit
17197         implementation (instead of checking the Name for a ".", we
17198         directly look up if the InterfaceType was specified).
17199
17200         Delay the creation of the PropertyBuilder.
17201
17202         Only create the PropertyBuilder if we are not an explicit
17203         interface implementation.   This means that explicit interface
17204         implementation members do not participate in regular function
17205         lookups, and hence fixes another major ambiguity problem in
17206         overload resolution (that was the visible effect).
17207
17208         (DefineMethod): Return whether we are doing an interface
17209         implementation. 
17210
17211         * typemanager.cs: Temporary hack until we get attributes in
17212         interfaces (Ravi is working on that) and we get IndexerName
17213         support in interfaces.
17214
17215         * interface.cs: Register the indexers as properties.
17216
17217         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17218         warning, I have verified that this is a bug in the .NET runtime
17219         (JavaScript suffers of the same problem).
17220
17221         * typemanager.cs (MemberLookup): When looking up members for
17222         interfaces, the parent of an interface is the implicit
17223         System.Object (so we succeed in searches of Object methods in an
17224         interface method invocation.  Example:  IEnumerable x;  x.ToString
17225         ()) 
17226
17227 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17228
17229         * class.cs (Event): Events should also register if they do
17230         implement the methods that an interface requires.
17231
17232         * typemanager.cs (MemberLookup); use the new GetInterfaces
17233         method. 
17234
17235         (GetInterfaces): The code used to lookup interfaces for a type is
17236         used in more than one place, factor it here. 
17237
17238         * driver.cs: Track the errors at the bottom of the file, we kept
17239         on going.
17240
17241         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17242         instance if the method we are calling is static!
17243
17244 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17245
17246         * attribute.cs (ApplyAttributes): Make this function filter out
17247         the IndexerName attribute (as that attribute in reality is never
17248         applied) and return the string constant for the IndexerName
17249         attribute. 
17250
17251         * class.cs (TypeContainer.Emit): Validate that all the indexers
17252         have the same IndexerName attribute, and if so, set the
17253         DefaultName attribute on the class. 
17254
17255         * typemanager.cs: The return value might contain other stuff (not
17256         only methods).  For instance, consider a method with an "Item"
17257         property and an Item method.
17258
17259         * class.cs: If there is a problem with the parameter types,
17260         return. 
17261
17262 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17263
17264         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17265         looks at user defined conversion after making a call to 
17266         StandardConversionExists - we need this for overload resolution.
17267
17268         * expression.cs : Update accordingly the various method calls.
17269
17270         This fixes 2 bugs filed against implicit user defined conversions 
17271
17272 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * statement.cs: Track the result of the assignment.
17275
17276 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * expression.cs (MemberAccess): Improved error reporting for
17279         inaccessible members.
17280
17281 2002-05-22  Martin Baulig  <martin@gnome.org>
17282
17283         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17284         itself with debugging support.
17285
17286 2002-05-22  Martin Baulig  <martin@gnome.org>
17287
17288         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17289         Removed, this isn't needed anymore.
17290
17291 2002-05-20  Martin Baulig  <martin@gnome.org>
17292
17293         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17294         be underlying type for an enum.
17295
17296 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17297
17298         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17299         that splits out the loading of just the core types.
17300
17301         * rootcontext.cs (ResolveCore): Split the struct resolution in
17302         two, so we can load the enumeration underlying types before any
17303         enums are used.
17304
17305         * expression.cs (Is): Bandaid until we fix properly Switch (see
17306         bug #24985 for details).
17307
17308         * typemanager.cs (ImplementsInterface): The hashtable will contain
17309         a null if there are no interfaces implemented.
17310
17311 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17312
17313         * cs-parser.jay (indexer_declarator): It is fine to have array
17314         parameters
17315
17316 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17317
17318         * typemanager.cs: (RegisterBuilder): New function used to register
17319         TypeBuilders that implement interfaces.  Since
17320         TypeBuilder.GetInterfaces (as usual) does not work with lame
17321         Reflection.Emit. 
17322         (AddUserType): register interfaces.
17323
17324         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17325         dealing with TypeBuilder.  Also, arrays are showing up as
17326         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17327         methods can not be invoked on them!
17328
17329         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17330         (ImplicitReferenceConversionExists): Split out from
17331         StandardConversionExists. 
17332
17333         * expression.cs (As): We were only implementing one of the three
17334         cases for the as operator.  We now implement them all.
17335         (Is): Implement the various other cases for Is as well.
17336
17337         * typemanager.cs (CACHE): New define used to control if we want or
17338         not the FindMembers cache.  Seems to have a negative impact on
17339         performance currently
17340
17341         (MemberLookup): Nested types have full acess to
17342         enclosing type members
17343
17344         Remove code that coped with instance/static returns for events, we
17345         now catch this in RealFindMembers.
17346
17347         (RealFindMembers): only perform static lookup if the instance
17348         lookup did not return a type or an event.  
17349
17350 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * assign.cs (CompoundAssign): We pass more semantic information
17353         now to Compound Assignments than we did before: now we have all
17354         the information at hand, and now we resolve the target *before* we
17355         do the expression expansion, which allows the "CacheValue" method
17356         to have the effect we intended (before, a [x] += 1 would generate
17357         two differen ArrayAccess expressions from the ElementAccess,
17358         during the resolution process).
17359
17360         (CompoundAssign.DoResolve): Resolve target and original_source here.
17361
17362 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17363
17364         * expression.cs (ArrayAccess): dropped debugging information. 
17365
17366         * typemanager.cs: Small bug fix: I was always returning i_members,
17367         instead of one of i_members or s_members (depending on which had
17368         the content).
17369
17370         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17371         method is invoked before any code generation takes place, and it
17372         is a mechanism to inform that the expression will be invoked more
17373         than once, and that the method should use temporary values to
17374         avoid having side effects
17375
17376         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17377
17378         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17379         implementation.
17380
17381         * expression.cs (Indirection, ArrayAccess): Add support for
17382         CacheTemporaries in these two bad boys. 
17383
17384         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17385         ldobj or ldind_ref.  
17386         (StoreFromPtr): Handle stobj as well.
17387
17388         * expression.cs (UnaryMutator): Share more code.
17389
17390         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17391         down: I was not tracking the Filter function as well, which
17392         was affecting the results of the cache.
17393
17394 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * attribute.cs: Remove the hack to handle the CharSet property on
17397         StructLayouts. 
17398
17399 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * attribute.cs (DoResolve): More uglyness, we now only try to
17402         resolve the attribute partially, to extract the CharSet
17403         information (only if we are a StructLayout attribute).  Otherwise 
17404
17405         (GetExtraTypeInfo): Add some code to conditionally kill in the
17406         future this.   I am more and more convinced that the .NET
17407         framework has special code to handle the attribute setting on
17408         certain elements.
17409
17410         * expression.cs (IsParamsMethodApplicable): Revert my previous
17411         foreach change here, it was wrong.
17412
17413 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17416         (pp_expr): do not abort on unknown input, just return.
17417         (eval): abort if there are pending chars.
17418
17419         * attribute.cs (Attribute.Resolve): Positional parameters are
17420         optional.  Deal with that case.
17421
17422         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17423         the Ansi/Unicode/Auto information for the type.
17424
17425         (TypeContainer.DefineType): instantiate the EmitContext here, as
17426         we will be using it during the type definition (to resolve
17427         attributes) and during the emit phase.
17428
17429         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17430         to pull type information out of the attributes
17431
17432         (Attribute.Resolve): track the constructor builder, and allow for
17433         multiple invocations (structs and classes will use this).
17434
17435         * ecore.cs (MemberLookupFinal): new version with all the
17436         parameters customizable.
17437
17438         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17439         constructors.  Return if the result value is null (as the error
17440         would have been flagged already by MemberLookupFinal)
17441
17442         Do not allow instances of abstract classes or interfaces to be
17443         created.
17444
17445         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17446         We have to compare the assembly property here when dealing with
17447         FamANDAssem and Assembly access modifiers, because we might be
17448         creating an assembly from *modules* (that means that we are not
17449         getting TypeBuilders for types defined in other modules that are
17450         part of this assembly).
17451
17452         (Method.Emit): If the method is marked abstract and has a body,
17453         emit an error. 
17454
17455         (TypeContainer.DefineMembers): If both the defined member and the
17456         parent name match are methods, then do not emit any warnings: let
17457         the Method.Define routine take care of flagging warnings.  But if
17458         there is a mismatch (method overrides something else, or method is
17459         overriwritten by something, then emit warning).
17460
17461         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17462         set to null, this means `do not check for the return type on the
17463         signature'. 
17464
17465         (Method.Define): set the return type for the method signature to
17466         null, so that we get methods with the same name and parameters and
17467         different return types.  This is used to flag warning 114 (you are
17468         hiding a method, and you probably want to use the new/override
17469         keywords instead).
17470
17471         * typemanager.cs (MemberLookup): Implemented proper access
17472         control, closing a long standing set of bug reports.  The problem
17473         was that the Framework only has two bits: Public and NonPublic,
17474         and NonPublic includes private and protected methods, but we need
17475         to enforce the FamANDAssem, FamOrAssem and Family. 
17476
17477 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17478
17479         * statement.cs (GotoCase): Return true: Ammounts to giving up
17480         knowledge on whether we return or not, and letting the other case
17481         be responsible for it.
17482
17483 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17484
17485         * driver.cs: Do not load directories for each file processed, only
17486         do it if there is a pattern.
17487
17488         * ecore.cs: Report readonly assigns here as well, as we might have
17489         been resolved only by MemberAccess.
17490
17491         (SimpleName.SimpleNameResolve): Also be useful for LValue
17492         resolution.   We need this to propagate assign to local readonly variables
17493
17494         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17495         do not want to reuse potential criteria memory.
17496
17497         * class.cs (MyEventBuilder): Set reflected_type;
17498
17499         * ecore.cs (Constantify): Added support for constifying bools.
17500
17501         (RootContext.LookupType): Added a cache for values looked up in
17502         the declaration space.
17503
17504         * typemanager.cs (FindMembers): Now is a front-end to
17505         RealFindMembers, and provides a two-level hashtable-based cache to
17506         the request.  
17507
17508         15% performance improvement: from 22.5 to 19.2 seconds.
17509
17510         * expression.cs (IsParamsMethodApplicable): use foreach.
17511         (Invocation.DoResolve): ditto.
17512         (New.DoResolve): ditto.
17513         (ArrayCreation.DoResolve): ditto.
17514
17515         * ecore.cs (FindMostEncompassingType): use foreach.
17516
17517         * delegate.cs (NewDelegate.DoResolve): Use foreach
17518
17519         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17520         (RemoveMethods): use foreach.
17521
17522         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17523         nested foreach statements instead of for, and also break out of
17524         the inner loop once a match is found.
17525
17526         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17527
17528 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17529
17530         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17531         we actually unwrap the expression to allow for extra information
17532         to be extracted. 
17533
17534         * expression.cs: Use Shr_Un on unsigned operations. 
17535
17536 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17537
17538         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17539         applicable operators was not being considered correctly. This closes
17540         the bug Miguel reported.
17541
17542 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17543
17544         * attribute.cs: check that the type derives from System.Attribute
17545         and report the correct error in that case (moved the duplicate code to
17546         its own method, too).
17547
17548 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17549
17550         * attribute.cs: lookup attribute type name as the spec says: first the
17551         bare attribute name and then name + "Attribute" (nant compiles with
17552         mcs after this fix).
17553
17554 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17557         Because of the way we parse things, we should try to see if a
17558         UIntConstant can fit in an integer.
17559
17560 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17561
17562         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17563         when we are in an explicit context.
17564
17565         (ConvertReferenceExplicit): When converting from Iface type S to Class
17566         T make sure the rules are implemented as an OR.
17567
17568         * parameter.cs (ParameterType): Make it a property for now although the
17569         purpose really isn't anything immediate.
17570
17571         * expression.cs (Is*Applicable): Do better checking on the parameter type
17572         of a ref/out parameter. The ones from the system assemblies are already 
17573         marked with the correct type so we don't need to do any correction.
17574
17575         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17576         the object type is standard too so include that.
17577
17578 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17579
17580         * ecore.cs (StandardConversionExists): Augment with missing code:
17581         deal with IntConstant, LongConstants and Enumerations.
17582
17583         * assign.cs: Report the error, instead of failing silently
17584
17585         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17586         typecontainer that they are declared, because the
17587         typecontainer/namespace will have the list of using clauses that
17588         need to be applied.
17589
17590         Assembly Attributes were escaping the normal registration
17591         mechanism. 
17592
17593         (EmitCode): Apply attributes within an EmitContext that represents
17594         the container they were declared on.
17595
17596         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17597
17598 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17599
17600         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17601         Revamp completely - make much cleaner as we now operate only
17602         on a set of Types.
17603
17604         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17605         to implement the logic detailed in the spec more correctly.
17606
17607         (UserDefinedConversion): Update accordingly.
17608
17609 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * statement.cs: Return flow analysis information up.
17612
17613         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17614         and the default.
17615
17616         (token): Do not consume an extra character before calling
17617         decimal_digits.
17618
17619 2002-05-06  Piers Haken <piersh@friskit.com>
17620
17621         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17622
17623 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17624
17625         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17626         EmitContext during the instance constructor initializer
17627         resolution, to stop access to instance variables.
17628
17629         This is mandated by the spec, last paragraph of the `constructor
17630         initializers' section. 
17631
17632 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17633
17634         * cs-parser.jay, class.cs (Accessor): new class used to represent
17635         an accessor (get or set).  In the past we used `null' to represent
17636         a missing accessor.  But this is ambiguous because there was no
17637         way to tell in abstract indexers/properties if one of them was
17638         specified.
17639
17640         Now there is a way of addressing that.
17641
17642         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17643         instead of FindMembers.
17644
17645         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17646         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17647
17648         * attribute.cs: Treat indexers and properties as the same in terms
17649         of applying attributes
17650
17651         * ecore.cs (FindMostEncompassedType): Use statically initialized
17652         EmptyExpressions()s like we do elsewhere to avoid creating useless
17653         objects (and we take this out of the tight loop).
17654
17655         (GetConversionOperators): Move the code to extract the actual
17656         operators to a separate routine to clean things up.
17657
17658 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17659
17660         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17661         events are always registered FieldBuilders.
17662
17663         * class.cs (FieldBase): New class shared by Fields 
17664
17665         * delegate.cs: If we are a toplevel delegate, use our full name.
17666         If we are a nested delegate, then only use our tail name.
17667
17668 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17669
17670         * expression.cs (IsApplicable): Ensure that we add the "&" to
17671         ref/out types before comparing it with the type of the argument.
17672
17673         (IsParamsMethodApplicable): Ditto.
17674
17675         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17676         silly me ;-)
17677
17678         * delegate.cs : Handle the case when we have more than one applicable
17679         method. Flag an error only when we finish checking all.
17680
17681 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * expression.cs: Add support for boolean static initializers.
17684
17685 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17688
17689         * parameter.cs (ComputeParameterTypes,
17690         ComputeAndDefineParameterTypes): Better error handling: now we
17691         clear the `types' cache if we fail during any of the type lookups.
17692         We also return the status code correctly to our caller
17693
17694         * delegate.cs: If we fail to define a delegate, abort the extra
17695         steps. 
17696
17697         * expression.cs (Binary.ResolveOperator): for
17698         operator==(object,object) and operator !=(object, object) we also
17699         have to verify that there is an implicit conversion from one to
17700         the other.
17701
17702         (ArrayAccess.DoResolve): Array Access can operate on
17703         non-variables. 
17704
17705 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17706
17707         * assign.cs (CompoundAssign): A new class used as a "flag" that
17708         the assignment actually is happening as part of a compound
17709         assignment operator.
17710
17711         During compound assignment, a few new rules exist to enable things
17712         like:
17713
17714         byte b |= 1 + 2
17715
17716         From the spec:
17717
17718         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17719         to the type of x) if y is implicitly convertible to the type of x,
17720         and the operator is a builtin operator and the return type of the
17721         operator is explicitly convertible to the type of x. 
17722
17723         * rootcontext.cs: Reset warning level to 2.  4 catches various
17724         "interesting" features in mcs, we must clean this up at some
17725         point, but currently am trying to kill other bugs ;-)
17726
17727         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17728         in container classes as well.  
17729
17730         * expression.cs (Binary.ResolveOperator): Handle string case
17731         before anything else (as operator overloading does emit an error
17732         before doing anything else).
17733
17734         This code could go away when we move to a table driven model, but
17735         i could not come up with a good plan last night.
17736
17737 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17738
17739         * typemanager.cs (CSharpName): reimplementation using regex.
17740         * class.cs: added null check for fields in Emit
17741         * rootcontext.cs: set warninglevel to 4
17742
17743 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * typemanager.cs (CSharpName): reimplemented with Lupus
17746         suggestion.
17747
17748 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17749
17750         * statement.cs (If): correclty implement Resolve, because we were
17751         not catching sem errors in there.  The same process is needed
17752         everywhere else. 
17753         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17754
17755
17756         (Statement.Warning_DeadCodeFound): Factorize code.
17757         (While): Report dead code here too.
17758
17759         (Statement): Added Resolve virtual method to allow
17760         for resolution split from the emit code.
17761
17762 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17763
17764         * statement.cs (EmitBoolExpression): No longer try to resolve the
17765         expression here.    
17766         (MakeBoolean): New utility function that resolve, implicitly
17767         converts to boolean and tags the expression. 
17768
17769
17770         (If, Do): Implement dead code elimination.
17771         (While): Implement loop inversion
17772
17773         (Do, While, For, If): Resolve the expression prior to calling our
17774         code generation.
17775
17776 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17777
17778         * class.cs:
17779           - added method Report28 (warning: program has more than one entry point)
17780           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17781           - modified method Method.Define, the part at the end of the method
17782
17783         * rootcontext.cs: added static public Location EntryPointLocation;
17784           
17785         * ../errors/cs0028.cs : Add test case for the above warning.              
17786
17787         * typemanager.cs:
17788           - modified method CSharpName to allow arrays of primitive type to
17789             be printed nicely (e.g. instead of System.Int32[][] it now prints
17790             int[][])
17791           - added method CSharpSignature: returns the signature of a method
17792             in string format to be used in reporting errors, warnings, etc.
17793
17794         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17795         with String.Empty.
17796
17797 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17798
17799         * delegate.cs (Define): Fix extremely silly bug where I was
17800         setting the type of the 'object' parameter of the BeginInvoke
17801         method to System.IAsyncResult instead of System.Object ;-)
17802
17803 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17804
17805         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17806         here. 
17807
17808         (Constructor.Emit): return if we fail to initialize the
17809         constructor.  Another door closed!  
17810
17811         * expression.cs (New.DoResolve): Improve error message (from -6 to
17812         1501).  Use DeclaredOnly lookup to find the exact constructor.
17813
17814         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17815         loop.  This is useful.
17816
17817         * cs-parser.jay: Adjust the default parameters so that destructors
17818         have the proper signature.
17819
17820 2002-04-26  Martin Baulig  <martin@gnome.org>
17821
17822         * driver.cs (LoadAssembly): If `assembly' contains any characters
17823         which are only valid in path names and not in assembly names
17824         (currently slash, backslash and point), use Assembly.LoadFrom ()
17825         instead of Assembly.Load () on the `assembly' (before iteration
17826         over the link_paths).
17827
17828 2002-04-26  Martin Baulig  <martin@gnome.org>
17829
17830         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17831
17832 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * class.cs (Property): use the new typemanager.MemberLookup
17835
17836         (TypeContainer.MemberLookup): Implement using the
17837         TypeManager.MemberLookup now. 
17838
17839         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17840         and return MemberInfos, so that these can be used without an
17841         EmitContext (what we had before).
17842
17843 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17844
17845         * expression.cs: Fix the case where the argument to params if the
17846         type of the params.  I omitted handling this before.   Fixed
17847
17848 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17849
17850         * driver.cs: Call BootCorlib_PopulateCoreType
17851
17852         * class.cs (Property.CheckBase): Check for properties only, not
17853         for all members. 
17854
17855         * interface.cs: Temporary hack: try/catch around the
17856         CustomAttributeBuilder, because I am getting an exception that I
17857         do not understand.
17858
17859         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17860         types whose definitions are required to be there (attributes are
17861         defined before standard types).
17862
17863         Compute definitions as we boot the various types, as they are used
17864         immediately (value_type class will need object_type, but if we do
17865         not initialize object_type, we will pass a null, which will let
17866         the runtime pick the System.Object from the existing corlib, which
17867         is not what we want).
17868
17869 2002-04-22  Patrik Torstensson <totte@labs2.com>
17870
17871         * cs-tokenizer.cs: fixed a number of trim() issues.
17872
17873 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17874
17875         * expression.cs (Argument.Type): Ensure that we return the correct
17876         type when we have out or ref parameters [in which case we 
17877         append a "&"].
17878
17879 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17880
17881         * class.cs (Property, Indexer): Allow extern modifier in there. 
17882
17883         * typemanager.cs (InitBaseTypes): Initializes object_type and
17884         value_type, since those will be used early on during the bootstrap
17885         process to compile corlib.
17886
17887         (InitCoreTypes): Move code from here to InitBaseTypes.
17888
17889 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17890
17891         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17892         single-dimension arrays as using the ldlen opcode.  
17893
17894         Daniel Lewis discovered this optimization.  
17895
17896         * typemanager.cs: Add signature for System.Array::get_Length
17897
17898 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17899
17900         * statement.cs: report the error when the foreach does not apply to an
17901         array nor a collection.
17902
17903 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17904
17905         * expression.cs: Add implicit conversions to the operator ~.
17906
17907         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17908
17909         * typemanager.cs: Locate the decimal constructor.
17910
17911 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17912
17913         * attribute.cs: use the new property of TypeOf.
17914         * expression.cs: added 'get' property around typearg.
17915
17916         These changes fix a build breaker reported by NickD. Is this the
17917         correct way to fix?  If not, please, revert my changes and make it
17918         work :-).
17919
17920 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * attribute.cs: Add support for typeof in attribute invocations.
17923         I am not sure that this is right though.
17924
17925 2002-04-14  Duncan Mak  <duncan@ximian.com>
17926
17927         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17928         Binary.Operator.Division case.
17929
17930 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17931
17932         * class.cs (DefineType): Ensure that we do a proper check on
17933         attribute types and also register it with the TypeManager.
17934
17935         (TypeContainer.Targets): The default for attribute types is
17936         AttributeTargets.All.
17937
17938         * attribute.cs (ApplyAttributes): Registering the attribute type
17939         is done elsewhere, not when we discover we have a Usage attribute.
17940
17941 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17942
17943         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17944         and get rid of is_delegate parameter.
17945
17946         * everywhere : update.
17947
17948 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17949
17950         * cs-parser.jay (compilation_unit): Revamp completely to use
17951         some new ideas that I got from Rhys' grammar to solve the problems
17952         with assembly level attributes.
17953
17954         (outer_declaration): New grammar production.
17955
17956         (attribute_sections): Add.
17957
17958         (opt_attributes): Base on attribute_sections
17959
17960         (namespace_declaration): Allow opt_attributes to tackle the case
17961         when we have assembly level attributes - we are clever in this
17962         regard now ;-)
17963
17964         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17965         attributes in the non-global context.
17966
17967         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17968         instead of SetGlobalAttributes.
17969
17970         * class.cs, rootcontext.cs : Ensure we define and generate 
17971         attribute types before anything else.
17972
17973         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17974         and flag the new error -20 for the case when the attribute type
17975         does not have valid targets specified. csc does not catch this.
17976
17977         * ../errors/errors.txt : update for error # -20
17978
17979 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17980
17981         * support.cs (InternalParameters.ParameterModifier): Do some null
17982         checking and return sane values.
17983
17984         * class.cs (Method.Define): If we are a PInvoke method, ensure
17985         that we are static and extern. Report error # 601
17986
17987         * ../errors/cs0601.cs : Add test case for the above error.
17988
17989 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17990
17991         * rootcontext.cs (attribute_types): We need to keep type of
17992         all attribute types separately and emit code for them first.
17993
17994         (RegisterAttribute) : Implement.
17995
17996         * class.cs (DefineType): Check if the current Type is a custom
17997         attribute type and register it accordingly.
17998
17999         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18000         adding the first attribute twice and rename to
18001
18002         (SetGlobalAttributes): this.
18003
18004         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18005         lookups.
18006
18007         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18008         if we are processing global arguments. Hmm, I am unsure of this.
18009
18010 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18011
18012         * expression.cs: added static array of strings to avoid calling
18013         Enum.ToString () for Operator in Binary. Significant recover of
18014         performance.
18015
18016 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18017
18018         * class.cs (FindMembers): Allow the Builders of the various
18019         members to be null.  If they are skip them.  This only happens
18020         during the PInvoke declaration.
18021
18022 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18023
18024         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18025         failure, so we do not keep going afterwards.
18026
18027         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18028         wanted to pass `false' as the `is_delegate' argument.  If this is
18029         the case, why not use delegate_type == null to mean `is_delegate =
18030         false' and anything else as is_delegate = true.
18031
18032 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18033
18034         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18035         code for the section, not the beginning of the tests.
18036
18037 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18038
18039         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18040
18041         * expression.cs (Binary): same.  Warn about errors where we have
18042         Enum/Enum in operator + as well.
18043
18044 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18045
18046         * statement.cs:
18047                 - added support for switch(bool)
18048                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18049                 - add TableSwitchEmit() to handle table-based switch statements
18050
18051 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18052
18053         * expression.cs (Invocation.OverloadResolve): Factor out code which
18054         does parameter compatibility checking with arguments so that we can 
18055         re-use the code even from Delegate.VerifyApplicability
18056
18057         (VerifyArgumentsCompat): Move above code here.
18058
18059         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18060         and instead make a call to the above method.
18061
18062 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18063
18064         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18065         We use it to keep track of classes which are attribute types.
18066
18067 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * delegate.cs (Delegate.Define): Correctly define the types in the
18070         presence of fixed and array parameters.
18071
18072         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18073         doing FindMembers.
18074
18075         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18076         include NonPublic after the first iteration.
18077
18078         * class.cs (Indexer.CheckBase): Only check if both parents are
18079         non-null. 
18080
18081         * cs-parser.jay (accessor_body): If empty, set to null.
18082
18083         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18084         same code path here to resolve constants names that we did have in
18085         MemberAccess.DoResolve.  There is too much code duplicated here.
18086
18087 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18088
18089         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18090
18091         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18092         to MakeUnionSet.
18093
18094         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18095         tokens, numbers and strings.
18096
18097         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18098         parenthesis.
18099
18100         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18101         asyncronous parameters and the regular parameters.  
18102
18103         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18104         specify the target directory.
18105
18106         * expression.cs: (This.DoResolve): Simplify
18107         (As.Emit): Optimize, do not generate IsInst if the expression is
18108         always of the given type.
18109
18110         (Is.DoResolve): Bug fix, we were reporting both always/never for
18111         the is expression.
18112
18113         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18114         creating too many unnecessary arrays.
18115
18116 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18117
18118         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18119         fields instead of rolling our own initializer.   Takes care of all
18120         implicit conversions, and drops unnecessary static checks/argument.
18121
18122 2002-03-31  Dick Porter  <dick@ximian.com>
18123
18124         * driver.cs: use the GetDirectories() return values properly, and
18125         use "/" as path separator.
18126
18127 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18128
18129         * expression.cs (Unary): Optimize - - expr into expr.
18130         (Binary): Optimize a + (-b) into a -b.
18131
18132         * codegen.cs (CodeGen): Made all methods static.
18133
18134 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18135
18136         * rootcontext.cs: 
18137
18138         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18139         TypeBuilder property.
18140
18141         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18142         instead. 
18143
18144         * tree.cs: Removed the various RecordXXXX, and replaced with a
18145         single RecordDecl.  Removed all the accessor methods, and just
18146         left a single access point Type 
18147
18148         * enum.cs: Rename DefineEnum to DefineType.
18149
18150         * decl.cs: New abstract method `DefineType' used to unify the
18151         Defines for Enumerations, Interfaces, TypeContainers and
18152         Delegates.
18153
18154         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18155         LookupBaseClasses method that used to live in class.cs and
18156         interface.cs here, and renamed to FindType.
18157
18158         * delegate.cs: Implement DefineType.  Take advantage of the
18159         refactored pattern for locating the parent builder without taking
18160         the parent_builder argument (which we know does not work if we are
18161         nested, and triggering a toplevel definition).
18162
18163 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18166         accessibility of a member has changed during override and report
18167         an error if so.
18168
18169         * class.cs (Method.Define, Property.Define): Only complain on
18170         overrides if the method is private, any other accessibility is
18171         fine (and since we just checked the permission is the same, we are
18172         good to go).
18173
18174         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18175         and elif are processed always.  The other pre-processing
18176         directives are only processed if we are "taking" the path
18177
18178 2002-03-29  Martin Baulig  <martin@gnome.org>
18179
18180         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18181         current location is not Null.
18182
18183         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18184         a separate method so we can profile it.
18185
18186         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18187         `span.Seconds' are just seconds, but no minutes or hours.
18188         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18189
18190 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18191
18192         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18193         Remove the gratuitous set of Final:
18194
18195                                 // If an interface implementation, then we can set Final.
18196                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18197                                     implementing.DeclaringType.IsInterface)
18198                                         flags |= MethodAttributes.Final;
18199
18200         I do not know what I was smoking when I used that.
18201
18202
18203         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18204         step into fixing the name resolution issues for delegates and
18205         unifying the toplevel name resolution.
18206
18207 2002-03-28  Martin Baulig  <martin@gnome.org>
18208
18209         * class.cs (Method.Emit): If we have a symbol writer, call its
18210         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18211         tell it about the current method.
18212
18213         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18214         writer that we're going to emit the first byte of IL code for a new
18215         statement (a new source line).
18216         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18217         EmitContext.Mark() before emitting any code.
18218
18219         * location.cs (SymbolDocument): Return null when we're Null.
18220
18221         * statement.cs (Statement): Moved the `Location loc' variable here.
18222         (Statement.EmitBoolExpression): If we have a symbol writer, call
18223         ec.Mark() before emitting any code to tell it that we're at the
18224         beginning of a new statement.
18225         (StatementExpression): Added `Location' argument to the constructor.
18226         (Block): Added public readonly variable `StartLocation' and public
18227         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18228         (Block): Added constructor which takes a start and end location.
18229         (Block.SetEndLocation): New method. This sets the end location.
18230         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18231         local variables we create.
18232         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18233         each statement and do also mark the begin and end of the block.
18234
18235         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18236         tell it the current lexer.Location, use Location.Null for the end of the
18237         block.
18238         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18239         current block, set its end location using SetEndLocation().
18240         (statement_expression): StatementExpression constructor now takes the
18241         lexer.Location as additional argument.
18242         (for_statement, declare_local_variables): Likewise.
18243         (declare_local_variables): When creating a new implicit block, use the
18244         new Block constructor and pass it the lexer.Location.
18245
18246 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18249         members also on the parent interfaces recursively.
18250
18251 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18252
18253         * report.cs: Use new formats, since Gonzalo finished the missing
18254         bits. 
18255
18256         * expression.cs (Binary.ResolveOperator): added missing operator|
18257         operator& and operator^ for bool/bool.
18258
18259         * cs-parser.jay: CheckDef now takes a Location argument that is
18260         used to report errors more precisly (instead of reporting the end
18261         of a definition, we try to track something which is a lot closer
18262         to the source of the problem).
18263
18264         * cs-tokenizer.cs: Track global token use, so we can properly flag
18265         the use of #define/#undef after the first token has been seen.
18266
18267         Also, rename the reportXXXX to Error_DescriptiveName
18268
18269         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18270         TypeContainer, so that Enum and Interface can use this too.
18271
18272         * class.cs (TypeContainer.LookupInterfaceOrClass,
18273         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18274         `builder' argument.  Typically this was used to pass the parent
18275         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18276         the definition).  
18277
18278         The problem is that a nested class could trigger the definition of
18279         a toplevel class, and the builder would be obviously wrong in that
18280         case. 
18281
18282         So we drop this argument, and we compute dynamically the
18283         TypeBuilder/ModuleBuilder (the correct information was available
18284         to us anyways from DeclSpace.Parent)
18285
18286         * interface.cs (Interface.DefineInterface): Drop builder
18287         parameter cleanup like class.cs
18288
18289         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18290         like class.cs
18291
18292         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18293         values. 
18294
18295         (Try.Emit): Propagate the returns value from the statement.
18296
18297         (Return.Emit): Even if we are leavning 
18298
18299         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18300
18301         * modifiers.cs: Fix the computation of MethodAttributes flags.
18302
18303 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18304
18305         * driver.cs: allow compilation of files that start with '/'.
18306         Add a default case when checking the argument of --target.
18307
18308 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18309
18310         * interface.cs: Implement the same search algorithm for types in
18311         the interface code.
18312
18313         * delegate.cs: Do not allow multiple definition.
18314
18315         * Recovered ChangeLog that got accidentally amputated
18316
18317         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18318
18319         * rootcontext.cs: Load manually enum to allow core classes to
18320         contain enumerations.
18321
18322         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18323         Update to new static methods in TypeManager.
18324
18325         * typemanager.cs (GetMethod, GetConstructor): Use our
18326         implementation of FindMembers to find the members, since during
18327         corlib compilation, the types are TypeBuilders and GetMethod and
18328         GetConstructor do not work.
18329
18330         Make all methods in TypeManager static.
18331
18332         (InitCodeHelpers): Split the functionality from
18333         the InitCodeTypes function.
18334
18335         * driver.cs: Call InitCodeHelpers after we have populated the
18336         types. 
18337
18338         * cs-parser.jay (delegate_declaration): we did not used to compute
18339         the delegate name correctly for void delegates.
18340
18341 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * rootcontext.cs (RootContext): Init the interface_resolve_order
18344         and type_container_resolve_order always.
18345
18346         (ResolveCore, BootstrapCorlib_ResolveClass,
18347         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18348         compiler when compiling with --nostdlib
18349
18350         * class.cs (TypeContainer.DefineType): Check that our parent is
18351         not null.  This test is most important when we are bootstraping
18352         the core types.
18353
18354         * codegen.cs: Split out the symbol writing code.
18355
18356 2002-03-25  Martin Baulig  <martin@gnome.org>
18357
18358         * driver.cs (-g): Made -g an alias for --debug.
18359
18360 2002-03-24  Martin Baulig  <martin@gnome.org>
18361
18362         * codegen.cs (SymbolWriter): New public variable. Returns the
18363         current symbol writer.
18364         (CodeGen): Added `bool want_debugging_support' argument to the
18365          constructor. If true, tell the ModuleBuild that we want debugging
18366         support and ask it for the ISymbolWriter.
18367         (Save): If we have a symbol writer, call it's Close() method after
18368         saving the assembly.
18369
18370         * driver.c (--debug): New command line argument to create a
18371         debugger information file.
18372
18373         * location.cs (SymbolDocument): New public property. Returns an
18374         ISymbolDocumentWriter object for the current source file or null
18375         if we don't have a symbol writer.
18376
18377 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18378
18379         * driver.cs (LoadAssembly): Correctly return when all the paths
18380         have been tried and not before.
18381
18382         * statement.cs (Switch.Emit): return the actual coverage for this
18383         statement (returns/not-returns)
18384
18385         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18386         switch of the statement if we are the last switch section.  That
18387         kills two problems: try/catch problems (we used to emit an empty
18388         nop at the end) and switch statements where all branches would
18389         return. 
18390
18391 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18392
18393         * driver.cs: Add default assemblies (the equivalent to the
18394         Microsoft CSC.RSP file)
18395
18396         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18397         also update tokens_seen and set it to false.
18398
18399         * driver.cs: Implement --recurse for Mike.
18400
18401         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18402         correctly splitting out the paths.
18403
18404 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * interface.cs (Interface.PopulateProperty): Instead of using
18407         `parent' as the declaration space for the set parameters, use
18408         `this' 
18409
18410         * support.cs (InternalParameters): InternalParameters constructor
18411         takes a DeclSpace instead of a TypeContainer.
18412
18413         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18414         types are being initialized, load the address of it before calling
18415         the function.  
18416
18417         (New): Provide a mechanism to disable the generation of local
18418         value type temporaries when the caller will be providing us with
18419         an address to store it.
18420
18421         (ArrayCreation.EmitDynamicInitializers): Use it.
18422
18423 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * expression.cs (Invocation.EmitArguments): Only probe for array
18426         property if there is more than one argument.  Sorry about that.
18427
18428         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18429         empty param arrays.
18430
18431         * class.cs (Method.LabelParameters): Fix incorrect code path that
18432         prevented the `ParamArrayAttribute' from being applied to the
18433         params attribute.
18434
18435 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18436
18437         * support.cs (ReflectionParameters): Correctly compute whether the
18438         last argument is a params array.  Fixes the problem with
18439         string.Split ('a')
18440
18441         * typemanager.cs: Make the assemblies array always be non-null
18442         (empty, but non-null)
18443
18444         * tree.cs (RecordDecl): New function that abstracts the recording
18445         of names.  This reports error 101, and provides a pointer to the
18446         previous declaration.  Fixes a crash in the compiler.
18447
18448         * cs-parser.jay (constructor_declaration): Update to new grammar,
18449         and provide a constructor_body that can be empty.
18450
18451 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * driver.cs: Add support for --resources.
18454
18455         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18456         Make all types for the various array helper methods be integer.
18457
18458         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18459         CheckState to ConvCast.
18460
18461         (ConvCast): Now it takes a `checked' state argument, to avoid
18462         depending on the emit context for the conversion, and just using
18463         the resolve time setting.
18464
18465         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18466         instead of Invocation.EmitArguments.  We do not emit the original
18467         arguments, instead we emit those which have been converted to
18468         unsigned int expressions.
18469
18470         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18471
18472         * codegen.cs: ditto.
18473
18474         * expression.cs (LocalVariableReference): Drop the use of the
18475         Store function that depended on the variable index.
18476
18477         * statement.cs (VariableInfo): Drop the `Idx' property from this
18478         class, as this is not taking into account the indexes for
18479         temporaries tat we generate during the execution, getting the
18480         indexes wrong.
18481
18482         * class.cs: First emit class initializers, then call the parent
18483         constructor. 
18484
18485         * expression.cs (Binary): Fix opcode emision.
18486         (UnaryMutator.EmitCode): Support checked code generation
18487
18488         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18489         matches for events for both the Static and Instance scans,
18490         pointing to the same element.   Fix that.
18491
18492 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * rootcontext.cs (ResolveTree): Always set the
18495         interface_resolve_order, because nested interfaces will be calling
18496         into us.
18497
18498         * class.cs (GetInterfaceOrClass): Track the same resolution
18499         process used by TypeManager.LookupType.  This fixes the nested
18500         type lookups in class declarations (separate path from
18501         LookupType). 
18502
18503         (TypeContainer.DefineType): Also define nested interfaces.
18504         (TypeContainer.RegisterOrder): New public function used to
18505         register the order in which child interfaces need to be closed.
18506
18507         Nested interfaces need to be closed after their parents have been
18508         created. 
18509
18510         * interface.cs (InterfaceAttr): Put all the logic for computing
18511         the interface attribute here. 
18512
18513         (DefineInterface): Register our interface order with the
18514         RootContext or with the TypeContainer depending on the case.
18515
18516 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18517
18518         * cs-parser.jay: rework foreach statement to work with the new
18519         changes to the policy on SimpleNames.
18520
18521         * report.cs: support Stacktrace on warnings as well.
18522
18523         * makefile: drop --unsafe and /unsafe from the compile.
18524
18525 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18526
18527         * ecore.cs (StandardConversionExists): Modify to take an Expression
18528         as the first parameter. Ensure we do null -> reference type conversion
18529         checking.
18530
18531         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18532         temporary Expression objects.
18533
18534 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18535
18536         * interface.cs: workaround bug in method overloading resolution
18537         (there is already a bugzilla bug for it).
18538
18539 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18540
18541         We could also solve this problem by having a separate path for
18542         performing type lookups, instead of DoResolve, we could have a
18543         ResolveType entry point, and only participating pieces of the
18544         production (simplename, deref, array) would implement this. 
18545
18546         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18547         signal SimpleName to only resolve type names and not attempt to
18548         resolve anything else.
18549
18550         * expression.cs (Cast): Set the flag.
18551
18552         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18553
18554         * class.cs: Only report 108 if there is no `new' modifier.
18555
18556         * cs-parser.jay: rework foreach statement to work with the new
18557         changes to the policy on SimpleNames.
18558
18559         * report.cs: support Stacktrace on warnings as well.
18560
18561         * makefile: drop --unsafe and /unsafe from the compile.
18562
18563 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18564
18565         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18566         lookups here, instead of doing that at parse time.  This means
18567         that our grammar will not introduce `LocalVariableReferences' as
18568         expressions at this point.  That solves the problem of code like
18569         this:
18570
18571         class X {
18572            static void Main ()
18573            { int X = 1;
18574             { X x = null }}}
18575
18576         This is only half the fix.  The full fix requires parameters to
18577         also be handled in this way.
18578
18579         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18580         makes the use more obvious of the DeclSpace.  The
18581         ec.TypeContainer.TypeBuilder is now only used to pull the
18582         TypeBuilder for it.
18583
18584         My theory is that I can get rid of the TypeBuilder completely from
18585         the EmitContext, and have typecasts where it is used (from
18586         DeclSpace to where it matters).  
18587
18588         The only pending problem is that the code that implements Aliases
18589         is on TypeContainer, and probably should go in DeclSpace.
18590
18591         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18592         lookups here, instead of doing that at parse time.  This means
18593         that our grammar will not introduce `LocalVariableReferences' as
18594         expressions at this point.  That solves the problem of code like
18595         this:
18596
18597         class X {
18598            static void Main ()
18599            { int X = 1;
18600             { X x = null }}}
18601
18602         This is only half the fix.  The full fix requires parameters to
18603         also be handled in this way.
18604
18605         * class.cs (Property.DefineMethod): When implementing an interface
18606         method, set newslot, when implementing an abstract method, do not
18607         set the flag (before we tried never setting it, or always setting
18608         it, which is the difference).
18609         (Indexer.DefineMethod): same.
18610         (Method.DefineMethod): same.
18611
18612         * ecore.cs: Only set the status used flag if we get back a Field.
18613
18614         * attribute.cs: Temporary hack, so Paolo can keep working.
18615
18616 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18617
18618         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18619         the unmanaged type in the case we have a MarshalAs attribute.
18620
18621         (Resolve): Handle the case when we are parsing the special MarshalAs
18622         attribute [we need to store the unmanaged type to use later]
18623
18624         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18625         MarshalAs Attribute.
18626
18627         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18628         on parameters and accordingly set the marshalling info.
18629
18630 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18631
18632         * class.cs: Optimizing slightly by removing redundant code after
18633         we switched to the `NoTypes' return value.
18634         (Property.DefineMethod): use NoTypes here too.
18635
18636         This fixes the bug I introduced in my last batch of changes.
18637
18638 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18639
18640         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18641
18642         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18643         Enums since those are types too. 
18644
18645         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18646
18647         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18648         thanks to a call during the lookup process.
18649
18650 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18651
18652         * statement.cs (Foreach): Lots of work to accomodate a particular
18653         kind of foreach statement that I had not kept in mind.  It is
18654         possible to have foreachs on classes that provide a GetEnumerator
18655         method that return objects that implement the "pattern" for using
18656         a foreach, there is no need to support GetEnumerator
18657         specifically. 
18658
18659         This is needed to compile nant.
18660
18661         * decl.cs: Only report 114 if the member is not `Finalize' and if
18662         the warning level is at least 2.
18663
18664         * class.cs: Moved the compare function from Method to
18665         MethodSignature. 
18666
18667         (MethodSignature.InheritableMemberSignatureCompare): Add new
18668         filter function that is used to extract inheritable methods from a
18669         class. 
18670
18671         (Method.Define): Use the new `inheritable_method_signature_filter'
18672         delegate
18673
18674         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18675         command. 
18676
18677 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18680
18681         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18682
18683         * expression.cs: Pass location information to
18684         ConvertImplicitStandard. 
18685
18686         * class.cs: Added debugging code to track return values from
18687         interfaces. 
18688
18689 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18690
18691         * expression.cs (Is.DoResolve): If either side of the `is' is an
18692         interface, do not flag the warning.
18693
18694         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18695         for interfaces
18696
18697         * report.cs: Allow for --fatal to be used with --probe.
18698
18699         * typemanager.cs (NoTypes): Move the definition for the empty Type
18700         array here. 
18701
18702         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18703         properties. 
18704         (TypeContainer.DefineProxy): New function used to proxy to parent
18705         implementations when implementing interfaces.
18706         (TypeContainer.ParentImplements): used to lookup if our parent
18707         implements a public function that is required by an interface.
18708         (TypeContainer.VerifyPendingMethods): Hook this up.
18709
18710         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18711         `modules' and `assemblies' arraylists into arrays.  We only grow
18712         these are the very early start up of the program, so this improves
18713         the speedof LookupType (nicely measured).
18714
18715         * expression.cs (MakeByteBlob): Replaced unsafe code with
18716         BitConverter, as suggested by Paolo.
18717
18718         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18719         folding of string concatenation, but if either side is a string,
18720         and the other is not, then return null, and let the runtime use
18721         the concatenation on the string plus the object (using
18722         `Object.ToString'). 
18723
18724 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18725
18726         Constant Folding has been implemented now.
18727
18728         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18729         the error instead on types that are not supported in one's
18730         complement. 
18731
18732         * constant.cs (Constant and all children): New set of functions to
18733         perform implict and explicit conversions.
18734
18735         * ecore.cs (EnumConstant): Implement the new functions to perform
18736         conversion by proxying to the child expression.
18737
18738         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18739         own separate setting that can not be turned off from the command
18740         line using --unchecked or --checked and is only controlled using
18741         the checked/unchecked statements and expressions.  This setting is
18742         used by the constant folder to flag errors.
18743
18744         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18745         ConstantCheckState as well.   
18746
18747         During Resolve, they also have to flag the state, because the
18748         constant folder runs completely in the Resolve phase.
18749
18750         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18751         well.
18752
18753 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * cfold.cs: New file, this file contains the constant folder.
18756
18757         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18758         argument to track whether we are using the resulting address to
18759         load or store a value and provide better error messages. 
18760
18761         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18762         new AddressOf arguments.
18763
18764         * statement.cs (Foreach.EmitCollectionForeach): Update
18765
18766         * expression.cs (Argument.Emit): Call AddressOf with proper
18767         arguments to track usage.
18768
18769         (New.DoEmit): Call AddressOf with new arguments.
18770
18771         (Unary.Emit): Adjust AddressOf call.
18772
18773 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18774
18775         * cs-parser.jay (member_access): Change the case for pre-defined types
18776         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18777         this suggestion.
18778
18779         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18780         a method body.
18781
18782         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18783         essentially like methods and apply attributes like MethodImplOptions to them too.
18784
18785         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18786         not being null.
18787
18788         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18789         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18790         is the DeclSpace.
18791
18792         * Update code everywhere accordingly.
18793
18794         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18795
18796         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18797
18798 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18799
18800         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18801         try performing lookups against those instead of jumping straight into using
18802         the 'using' clauses.
18803
18804         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18805
18806         (LookupType): Perform lookups in implicit parents too.
18807
18808         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18809         sequence as RootContext.LookupType. 
18810
18811         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18812         the various cases of namespace lookups into this method.
18813
18814 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18817         in positional arguments)
18818
18819         * class.cs (Operator): Update the AllowedModifiers to contain
18820         extern. 
18821
18822         * cs-parser.jay: Update operator declaration to allow for the
18823         operator body to be empty.
18824
18825         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18826         values. 
18827
18828 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18829
18830         * class.cs (Method.Emit): Label parameters.
18831
18832         * driver.cs: Return 1 or 0 as the program exit code.
18833
18834 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * expression.cs: Special case the `null' object when trying to
18837         auto-compute the type, as anything can be explicitly converted to
18838         that. 
18839
18840         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18841         spotting this Paolo.
18842
18843         (Expression.ImplicitNumericConversion): Perform comparissions of
18844         the type using the underlying type in the case of an enumeration
18845         rather than using the enumeration type for the compare.
18846
18847         Cope with the underlying == type case, which is not possible to
18848         catch before. 
18849
18850         (Expression.ConvertNumericExplicit): Perform comparissions of
18851         the type using the underlying type in the case of an enumeration
18852         rather than using the enumeration type for the compare.
18853
18854         * driver.cs: If the user does not supply an extension, assume .exe
18855
18856         * cs-parser.jay (if_statement): Rewrote so that we can track the
18857         location for the if statement.
18858
18859         * expression.cs (Binary.ConstantFold): Only concat strings when
18860         the operation is "+", not everything ;-)
18861
18862         * statement.cs (Statement.EmitBoolExpression): Take a location
18863         argument. 
18864         (If, While, Do): Track location.
18865
18866         * expression.cs (Binary.ResolveOperator): In the object + string
18867         case, I was missing a call to ConvertImplicit
18868
18869 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18870
18871         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18872         Location arguments. Ensure we use RootContext.LookupType to do our work
18873         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18874
18875         * interface.cs (PopulateMethod): Handle the type of the parameter being
18876         null gracefully.
18877
18878         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18879         have a params method with no fixed arguments and a call is made with no
18880         arguments.
18881
18882 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18883
18884         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18885         the verbatim-string-literal
18886
18887         * support.cs (InternalParameters.ParameterModifier): handle null
18888         fixed parameters.
18889         (InternalParameters.ParameterType): ditto.
18890
18891         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18892         duplicating the name of the variable parameter.
18893         (GetParameterByName): Fix bug where we were not looking up array
18894         paramters if they were the only present (thanks Paolo!).
18895         (GetParameterInfo): We only have an empty set of types if both
18896         fixed and array are set to null.
18897         (GetParameterInfo-idx): Handle FixedParameter == null
18898
18899         * cs-parser.jay: Handle the case where there is no catch
18900         statements (missing null test).
18901
18902 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18903
18904         * driver.cs (MainDriver): Be conservative on our command line
18905         handling.
18906
18907         Catch DirectoryNotFoundException when calling GetFiles.
18908
18909         (SplitPathAndPattern): Used to split the input specification into
18910         a path and a pattern that we can feed to Directory.GetFiles.
18911
18912 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18913
18914         * statement.cs (Fixed): Implement the last case of the Fixed
18915         statement (string handling).
18916
18917         * expression.cs (StringPtr): New class used to return a char * to
18918         a string;  Used by the Fixed statement.
18919
18920         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18921
18922         * expression.cs (Binary.ResolveOperator): Remove redundant
18923         MemberLookup pn parent type.
18924         Optimize union call, we do not need a union if the types are the same.
18925         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18926         type.
18927
18928         Specialize the use of MemberLookup everywhere, instead of using
18929         the default settings. 
18930
18931         (StackAlloc): Implement stackalloc keyword.
18932
18933         * cs-parser.jay: Add rule to parse stackalloc.
18934
18935         * driver.cs: Handle /h, /help, /?
18936
18937         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18938         before we supported unsafe code.
18939
18940         * makefile: add --unsafe to the self compilation of mcs.
18941
18942 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * expression.cs (PointerArithmetic): New class that is used to
18945         perform pointer arithmetic.
18946         (Binary.Resolve): Handle pointer arithmetic
18947         Handle pointer comparission.
18948         (ArrayPtr): Utility expression class that is used to take the
18949         address of an array.
18950
18951         (ElementAccess): Implement array access for pointers
18952
18953         * statement.cs (Fixed): Implement fixed statement for arrays, we
18954         are missing one more case before we are done.
18955
18956         * expression.cs (Indirection): Implement EmitAssign and set the
18957         ExprClass to Variable.  This allows pointer dereferences to be
18958         treated as variables, and to have values assigned to them.
18959
18960         * ecore.cs (Expression.StoreFromPtr): New utility function to
18961         store values dereferencing.
18962
18963 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18964
18965         * expression.cs (Binary.ResolveOperator): Ensure that we are
18966         not trying to operate on a void type - this fixes the reported
18967         bug.
18968
18969         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18970         the parent implementation is sealed.
18971
18972         * ../errors/cs0239.cs : Add.
18973
18974         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18975
18976         * typemanager.cs (unverifiable_code_type): Corresponds to 
18977         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18978         which have unsafe code in them.
18979
18980         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18981         unsafe context.
18982
18983 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18984
18985         * cs-tokenizer.cs: Add support for @"litreal strings"
18986
18987         Make tokenizer accept pre-processor directives
18988         on any column (remove the old C-like limitation). 
18989
18990         * rootcontext.cs (EmitCode): Emit any global attributes.
18991         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18992
18993         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18994
18995         * cs-parser.jay: Add support for global attributes.  
18996
18997 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18998
18999         * expression.cs (Indirection): New helper class.  Unary will
19000         create Indirection classes to be able to implement the
19001         IMemoryLocation interface on it.
19002
19003 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19004
19005         * cs-parser.jay (fixed_statement): reference the right statement.
19006
19007         * statement.cs (Fixed.Emit): Finish implementing the fixed
19008         statement for the &x case.
19009
19010 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19011
19012         * class.cs (Property.Define, Method.Define): Remove newslot when
19013         `implementing'.  
19014
19015         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19016         wrong.  NewSlot should only be used if the `new' keyword is present.
19017
19018         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19019         locating our system dir.  Sorry about this.
19020
19021 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19022
19023         * driver.cs (GetSystemDir): Compute correctly the location of our
19024         system assemblies.  I was using the compiler directory instead of
19025         the library directory.
19026
19027 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19028
19029         * expression.cs (BetterFunction): Put back in what Miguel commented out
19030         since it is the correct fix. The problem is elsewhere ;-)
19031
19032         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19033         parameters of the parms method are themselves compatible or not !
19034
19035         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19036         to check that a class implements an interface before saying that an implicit
19037         conversion was allowed. Use ImplementsInterface to do the checking.
19038
19039 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * class.cs (Method.Define): Track whether we are an explicit
19042         implementation or not.  And only call DefineMethodOverride if we
19043         are an explicit implementation.
19044
19045         (Property.DefineMethod): Ditto.
19046
19047 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19048
19049         * expression.cs (BetterFunction): Catch hideous bug which was
19050          preventing us from detecting ambiguous calls due to implicit casts i.e
19051         cs0121.
19052
19053 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19054
19055         * support.cs (Pair): Remove un-needed method.  I figured why I was
19056         getting the error in cs-parser.jay, the variable in a foreach loop
19057         is readonly, and the compiler does not really treat this as a variable.
19058
19059         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19060         instead of EQUALS in grammar.  
19061
19062         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19063
19064         * expression.cs (Unary.DoResolve): Check whether the argument is
19065         managed or not.
19066
19067 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * support.cs: Api for Pair to set a value.  Despite the fact that
19070         the variables are public the MS C# compiler refuses to compile
19071         code that accesses the field if the variable is part of a foreach
19072         statement. 
19073
19074         * statement.cs (Fixed): Begin implementation of the fixed
19075         statement.
19076
19077         (Block.AddVariable): Return the VariableInfo on success and null
19078         on failure instead of true/false. 
19079
19080         * cs-parser.jay (foreach): Catch errors on variables already
19081         defined (we were ignoring this value before) and properly unwind
19082         the block hierarchy
19083
19084         (fixed_statement): grammar for the fixed statement.
19085
19086 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19089         pointer types to be incretemented.
19090
19091         (SizeOf): Implement.
19092
19093         * cs-parser.jay (pointer_member_access): Implement
19094         expr->IDENTIFIER production.
19095
19096         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19097         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19098         on safe contexts.
19099
19100         (Unary): Implement indirection.
19101
19102         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19103         use in non-unsafe context).
19104
19105         (SimpleName.DoResolve): Check for pointers in field access on safe
19106         contexts. 
19107
19108         (Expression.LoadFromPtr): Factor the load-indirect code in this
19109         function.  This was duplicated in UnboxCast and ParameterReference
19110
19111 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19112
19113         * expression.cs (ComposedCast): report an error if a pointer cast
19114         is used in a safe region.
19115
19116         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19117         pointer type casts in unsafe context.
19118
19119         * codegen.cs (EmitContext): Set up IsUnsafe.
19120
19121         * cs-parser.jay (non_expression_type): Add productions for pointer
19122         casts. 
19123
19124         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19125         code.  We should not use force into static mode if the method is
19126         not virtual.  Fixes bug in MIS
19127
19128         * statement.cs (Do.Emit, While.Emit, For.Emit,
19129         Statement.EmitBoolExpression): Add support to Do and While to
19130         propagate infinite loop as `I do return' semantics.
19131
19132         Improve the For case to also test for boolean constants.
19133
19134         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19135         to the list of attributes we can add.
19136
19137         Remove `EmitContext' argument.
19138
19139         * class.cs (Method.Define): Apply parameter attributes.
19140         (Constructor.Define): Apply parameter attributes.
19141         (MethodCore.LabelParameters): Move here the core of labeling
19142         parameters. 
19143
19144         * support.cs (ReflectionParameters.ParameterModifier,
19145         InternalParameters.ParameterModifier): Use IsByRef on the type and
19146         only return the OUT bit for these parameters instead of in/out/ref
19147         flags.
19148
19149         This is because I miss-understood things.  The ParameterInfo.IsIn
19150         and IsOut represent whether the parameter has the [In] and [Out]
19151         attributes set.  
19152
19153 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19154
19155         * ecore.cs (FieldExpr.Emit): Release temporaries.
19156
19157         * assign.cs (LocalTemporary.Release): new function.
19158
19159         * codegen.cs (EmitContext.GetTemporaryStorage,
19160         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19161         temporary storage.  Now we can "put back" localbuilders when we
19162         are done with them
19163
19164 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19167         need to make a copy of the variable to generate verifiable code.
19168
19169 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * driver.cs: Compute dynamically the system directory.
19172
19173         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19174         Slower, but more generally useful.  Used by the abstract
19175         registering implementation. 
19176
19177         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19178         the rules for the special rule on Type/instances.  First check if
19179         we have the same name, and if so, try that special static path
19180         rather than the instance path.
19181
19182 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19183
19184         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19185         for, while and if.
19186
19187         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19188         Enum, ValueType, Delegate or Array for non-corlib compiles.
19189
19190         * cs-tokenizer.cs: Catch long identifiers (645)
19191
19192         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19193         piece of code.
19194
19195         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19196         fix, we were returning too early, so we were not registering
19197         pending methods from abstract classes.
19198
19199         Do not register pending methods if the class is abstract.
19200
19201         * expression.cs (Conditional.DoResolve): Report circular implicit
19202         conversions when we neecd to compute it for conditional
19203         expressions. 
19204
19205         (Is.DoResolve): If the expression is always of the provided type,
19206         flag warning 183.  If the expression can not ever be of the
19207         provided type flag warning 184.
19208
19209         * class.cs: Catch 169 as well.
19210
19211         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19212         read. 
19213
19214 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19215
19216         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19217
19218 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * interface.cs: (PopulateMethod): Check for pointers being defined
19221         only if the unsafe context is active.
19222         (PopulateProperty): ditto.
19223         (PopulateIndexer): ditto.
19224
19225         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19226         specified.  If pointers are present, make sure that they are
19227         present in an unsafe context.
19228         (Constructor, Constructor.Define): ditto.
19229         (Field, Field.Define): ditto.
19230         (Property, Property.Define): ditto.
19231         (Event, Event.Define): ditto.
19232
19233         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19234         hashtable if there are classes or structs defined.
19235
19236         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19237         code, as the constant resolution moved.
19238
19239         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19240         the metadata, so we can flag error 133. 
19241
19242         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19243         pointer is being declared in an unsafe context.
19244
19245 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19246
19247         * modifiers.cs (Modifiers.Check): Require a Location argument.
19248         Report error 227 for Unsafe use.
19249
19250         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19251
19252         * statement.cs (For.Emit): If the test is null, then report that
19253         we do `return', as we wont reach anything afterwards.
19254
19255         (Switch.SwitchGoverningType): Track the expression that matched
19256         the conversion.
19257
19258         * driver.cs: Allow negative numbers as an error code to flag.
19259
19260         * cs-parser.jay: Handle 1551.
19261
19262         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19263
19264 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * cs-parser.jay: Report 1518 (type declaration can only contain
19267         class, struct, interface, enum or delegate)
19268
19269         (switch_label): Report 1523 (keywords `case' or `default' must
19270         preced code)
19271
19272         (opt_switch_sections): Report 1522 (empty switch)
19273
19274         * driver.cs: Report 1515 (response file specified multiple times)
19275         Report 1516 (Source file specified multiple times).
19276
19277         * expression.cs (Argument.Resolve): Signal 1510
19278
19279         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19280         access not allowed in static code)
19281
19282 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19283
19284         * typemanager.cs (IsPointerType): Utility method which we are going
19285         to need a lot.
19286
19287         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19288         the object type, so we take care of that.
19289
19290         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19291
19292         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19293         added to non-params parameters :-)
19294
19295         * typemanager.cs (CSharpName): Include 'void' type too. 
19296
19297         (void_ptr_type): Include in the set of core types.
19298
19299         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19300         duplicating code.
19301
19302         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19303         an unsafe context.
19304
19305         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19306         completely forgotten about it.
19307
19308 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19309
19310         * cs-parser.jay (pointer_type): Add. This begins our implementation
19311         of parsing rules for unsafe code.
19312
19313         (unsafe_statement): Implement.
19314
19315         (embedded_statement): Modify to include the above.
19316
19317         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19318
19319         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19320         if the current context is an unsafe one.
19321
19322         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19323         are handled differently, we need separate rules for them.
19324
19325         (local_variable_declaration): Update to use local_variable_pointer_type
19326         to allow variable declarations of unmanaged pointer types.
19327
19328         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19329         in unsafe contexts.
19330
19331         * ../errors/cs0214.cs : Add.
19332
19333 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19334
19335         * makefile: remove 'response' file when cleaning.
19336
19337 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * cs-parser.jay: Report 1524.
19340
19341 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * typemanager.cs (RegisterMethod): drop checking if we have
19344         registered this from here
19345
19346 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * class.cs (Method.EmitDestructor): Implement calling our base
19349         destructor. 
19350
19351         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19352         value of InFinally.
19353
19354         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19355         this routine and will wrap the call in a try/catch block.  Deal
19356         with the case.
19357
19358 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19359
19360         * ecore.cs (Expression.MemberLookup): instead of taking a
19361         parameter `same_type' that was used to tell whether we could
19362         access private members we compute our containing type from the
19363         EmitContext.
19364
19365         (FieldExpr): Added partial support for volatile fields.  This does
19366         not work for volatile fields exposed from assemblies, as I can not
19367         figure out how to extract the modreq from it.
19368
19369         Updated all the source files to use this.
19370
19371         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19372         because it is referenced by MemberLookup very often. 
19373
19374 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19375
19376         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19377         TypeBuilder.GetCustomAttributes to retrieve what we need.
19378
19379         Get rid of redundant default_member_attr_type as this is the same as
19380         default_member_type which already exists.
19381
19382         * interface.cs, attribute.cs : Update accordingly.
19383
19384 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19385
19386         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19387         work for TYpeBuilders though.  Ravi, can you please fix this?
19388
19389         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19390
19391         * expression.cs (Argument.Emit): Handle the case of ref objects
19392         being passed to ref functions;  
19393
19394         (ParameterReference.EmitLoad): Loads the content of the pointer
19395         without dereferencing.
19396
19397 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19400
19401 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19402
19403         * class.cs (Indexer.DefineMethod): Incorporate the interface
19404         type in the name of the method if we are doing explicit interface
19405         implementation.
19406
19407         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19408
19409         (BetterConversion): Fix extremely trivial bug where we were referring to
19410         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19411         again !
19412
19413         * ../errors/bug16.cs : Add although we have fixed it.
19414
19415 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * expression.cs (BaseIndexer): Begin implementation.
19418
19419         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19420
19421         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19422         production directly to remove a shift/reduce, and implement
19423         explicit interface implementation.
19424
19425         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19426         after a floating point suffix.
19427
19428         * expression.cs (DoNumericPromotions): Improved the conversion for
19429         uint/uint.  If we have a constant, we avoid doing a typecast to a
19430         larger type.
19431
19432         * class.cs (Indexer): Implement explicit interface implementation
19433         for indexers.
19434
19435 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19436
19437         * class.cs: make the default instance constructor public and hidebysig.
19438
19439 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19440
19441         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19442         so we can call it from elsewhere.
19443
19444         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19445         we emit it internally if the class has a defined indexer; otherwise the user
19446         emits it by decorating the class definition with the DefaultMemberAttribute.
19447
19448         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19449         attribute is not used on a type which defines an indexer.
19450
19451         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19452         character when we skip whitespace.
19453
19454         * ../errors/cs0646.cs : Add.
19455
19456 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19457
19458         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19459         again. 
19460
19461         * makefile: Add practical target `mcs3.exe' which builds the third
19462         generation compiler. 
19463
19464         * expression.cs (New): Fix structures constructor calling.
19465
19466         * class.cs (Property, Method, Indexer): Emit Final flag on the
19467         method if we are an interface implementation and we are not
19468         abstract. 
19469
19470         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19471         whether this property is referencing a `base' method.
19472
19473         * expression.cs (Invocation.EmitCall): take an extra argument:
19474         is_base, this is used to determine whether the `call' or
19475         `callvirt' opcode should be used.
19476
19477
19478         * delegate.cs: update EmitCall.
19479
19480         * class.cs (Method.Define): Set NewSlot for the cases where we are
19481         not implementing an interface method.
19482
19483         (Property.Define): ditto.
19484
19485 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19488         'r'.  Allows mcs to parse itself fully.
19489
19490 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19491
19492         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19493         of the number of initializers that require the InitializeArray method.
19494
19495         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19496         update the above field where necessary.
19497
19498         (MakeByteBlob): Update accordingly.
19499
19500         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19501         greater than 2.
19502
19503         (EmitDynamicInitializers): Update in accordance with the new optimization.
19504
19505         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19506         same OpCode applies.
19507
19508         * cs-parser.jay : Fix some glaring errors I introduced.
19509
19510 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19511
19512         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19513         so that we can check for name clashes there too.
19514
19515         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19516         for interface indexers.
19517
19518         * interfaces.cs (Define): Emit the default member attribute.
19519
19520         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19521         variable was being referred to while setting the value ;-)
19522
19523 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19526         byte-by-byte information when we know the data is zero.
19527
19528         Make the block always a multiple of 4, because
19529         DefineInitializedData has a bug.
19530
19531         * assign.cs: Fix, we should assign from the temporary, not from
19532         the source. 
19533
19534         * expression.cs (MakeByteBlob): Fix my incorrect code.
19535
19536 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * typemanager.cs (EnumToUnderlying): This function is used to get
19539         the underlying type from an enumeration, because it does not
19540         always work. 
19541
19542         * constant.cs: Use the I4_S form for values between -128 and 127.
19543
19544         * statement.cs (Block.LookupLabel): Looks up a label.
19545         (Block): Drop support for labeled blocks.
19546
19547         (LabeledStatement): New kind of statement that represents a label
19548         only.
19549
19550         (Goto): Finally implement this bad boy.
19551
19552         * cs-parser.jay: Update to reflect new mechanism to implement
19553         labels.
19554
19555 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19556
19557         * codegen.cs (EmitContext.This): a codegen property that keeps the
19558         a single instance of this instead of creating many different this
19559         instances. 
19560
19561         * delegate.cs (Delegate.DoResolve): Update to use the property;
19562
19563         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19564
19565         * expression.cs (BaseAccess.DoResolve): Ditto.
19566
19567 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19568
19569         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19570         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19571
19572         (InitCoreTypes): Update accordingly.
19573
19574         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19575         so we can quickly store the state.
19576
19577         (ApplyAttributes): Set the correct implementation flags
19578         for InternalCall methods.
19579
19580 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * expression.cs (EmitCall): if a method is not virtual, then do
19583         not use callvirt on it.
19584
19585         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19586         user defined stuff) requires the use of stobj, which takes an
19587         address on the stack instead of an array and an index.  So emit
19588         the Ldelema operation for it.
19589
19590         (EmitStoreOpcode): Use stobj for valuetypes.
19591
19592         (UnaryMutator.EmitCode): Use the right 1 value depending on
19593         whether we are dealing with int64/uint64, float or doubles.
19594
19595         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19596         constructors that I implemented last night.
19597
19598         (Constructor.IsDefault): Fix to work properly for static
19599         constructors.
19600
19601         * cs-parser.jay (CheckDef): report method signature errors.
19602         Update error number 103 to be 132.
19603
19604         * decl.cs: New AdditionResult enumeration value: MethodExists.
19605         Although we do this check for methods later on in the semantic
19606         analysis, catching repeated default constructors is so easy that
19607         we catch these here. 
19608
19609         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19610         promotions code.
19611
19612         (ParameterReference.EmitAssign, Emit): handle
19613         bools as bytes.
19614
19615         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19616         (ArrayAccess.EmitStoreOpcode): ditto.
19617
19618         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19619
19620         * expression.cs (MakeByteBlob): Complete all the missing types
19621         (uint, short, ushort, byte, sbyte)
19622
19623         * class.cs: Only init instance field initializers on instance
19624         constructors. 
19625
19626         Rename `constructors' to instance_constructors. 
19627
19628         (TypeContainer.AddConstructor): Only add constructors to the list
19629         if it is not static.
19630
19631         Make sure that we handle default_static_constructor independently
19632         everywhere where we handle instance_constructors
19633
19634 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * class.cs: Do not lookup or create a base initializer for a
19637         static constructor.
19638
19639         (ConstructorInitializer.Resolve): use the proper type to lookup
19640         for constructors.
19641
19642         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19643
19644         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19645         in DeclSpace. 
19646
19647         * decl.cs: CloseType is now an virtual method, the default
19648         implementation just closes this type.
19649
19650 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19651
19652         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19653         to PreserveSig by default. Also emit HideBySig on such methods.
19654
19655         Basically, set the defaults to standard values.
19656
19657         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19658         argument, if candidate is better, it can't be worse than the best !
19659
19660         (Invocation): Re-write bits to differentiate between methods being
19661         applicable in their expanded form and their normal form - for params
19662         methods of course.
19663
19664         Get rid of use_standard everywhere as only standard conversions are allowed
19665         in overload resolution. 
19666
19667         More spec conformance.
19668
19669 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19670
19671         * driver.cs: Add --timestamp, to see where the compiler spends
19672         most of its time.
19673
19674         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19675         `this' in static code.
19676
19677         (SimpleName.DoResolve): Implement in terms of a helper function
19678         that allows static-references to be passed upstream to
19679         MemberAccess.
19680
19681         (Expression.ResolveWithSimpleName): Resolve specially simple
19682         names when called by MemberAccess to implement the special
19683         semantics. 
19684
19685         (Expression.ImplicitReferenceConversion): Handle conversions from
19686         Null to reference types before others, as Null's type is
19687         System.Object. 
19688
19689         * expression.cs (Invocation.EmitCall): Handle the special case of
19690         calling methods declared on a reference type from a ValueType
19691         (Base classes System.Object and System.Enum)
19692
19693         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19694         the left hand side is a TypeExpr, not on every enumeration. 
19695
19696         (Binary.Resolve): If types are reference types, then do a cast to
19697         object on operators != and == of both arguments.
19698
19699         * typemanager.cs (FindMembers): Extract instance and static
19700         members if requested.
19701
19702         * interface.cs (PopulateProperty): Use void_type instead of null
19703         as the return type for the setter method.
19704
19705         (PopulateIndexer): ditto.
19706
19707 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19708
19709         * support.cs (ReflectionParameters): Fix minor bug where we
19710         were examining the wrong parameter for the ParamArray attribute.
19711
19712         Cope with requests for the type of the parameter at position
19713         greater than the params parameter's. We now return the element
19714         type of the params array as that makes more sense.
19715
19716         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19717         accordingly as we no longer have to extract the element type
19718         ourselves.
19719
19720         (Invocation.OverloadResolve): Update.
19721
19722 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19725         against IEnumerator, test whether the return value is a descendant
19726         of the IEnumerator interface.
19727
19728         * class.cs (Indexer.Define): Use an auxiliary method to implement
19729         the other bits of the method definition.  Begin support for
19730         explicit interface implementation.
19731
19732         (Property.DefineMethod): Use TypeManager.void_type instead of null
19733         for an empty return value.
19734
19735 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19738         dealing with a FieldExpr which is composed of a FieldBuilder, in
19739         the code path we did extract the constant, but we should have
19740         obtained the underlying value to be able to cast it (otherwise we
19741         end up in an infinite loop, this is what Ravi was running into).
19742
19743         (ArrayCreation.UpdateIndices): Arrays might be empty.
19744
19745         (MemberAccess.ResolveMemberAccess): Add support for section
19746         14.5.4.1 that deals with the special case of E.I when E is a type
19747         and something else, that I can be a reference to a static member.
19748
19749         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19750         handle a particular array type to create byte blobs, it is just
19751         something we dont generate byteblobs for.
19752
19753         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19754         arguments. 
19755
19756         * location.cs (Push): remove the key from the hashtable that we
19757         are about to add.   This happens for empty files.
19758
19759         * driver.cs: Dispose files after we have parsed them.
19760
19761         (tokenize): new function that only runs the tokenizer on its
19762         input, for speed testing.
19763
19764 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19765
19766         * class.cs (Event.Define): Define the private field only if there
19767         are no accessors defined.
19768
19769         * expression.cs (ResolveMemberAccess): If there is no associated
19770         field with the event, that means we have an event defined with its
19771         own accessors and we should flag error cs0070 since transforming
19772         ourselves into a field is not valid in that case.
19773
19774         * ecore.cs (SimpleName.DoResolve): Same as above.
19775
19776         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19777         and charset to sane values.
19778
19779 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19780
19781         * assign.cs (DoResolve): Perform check on events only if they 
19782         are being accessed outside the declaring type.
19783
19784         * cs-parser.jay (event_declarations): Update rules to correctly
19785         set the type of the implicit parameter etc.
19786
19787         (add_accessor, remove_accessor): Set current local parameters.
19788
19789         * expression.cs (Binary): For delegate addition and subtraction,
19790         cast the return value from the method into the appropriate delegate
19791         type.
19792
19793 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19794
19795         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19796         of these as the workaround is unnecessary.
19797
19798         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19799         delegate data - none of that is needed at all.
19800
19801         Re-write bits to extract the instance expression and the delegate method
19802         correctly.
19803
19804         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19805         on delegates too.
19806
19807         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19808         of attaching attributes instead of duplicating code everywhere.
19809
19810         * everywhere : Update code to do attribute emission using the above method.
19811
19812 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19813
19814         * expression.cs (IsParamsMethodApplicable): if there are not
19815         parameters, return immediately.
19816
19817         * ecore.cs: The 0 literal can be implicity converted to an enum
19818         type. 
19819
19820         (SimpleName.DoResolve): First lookup the type, then lookup the
19821         members. 
19822
19823         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19824         want to get its address.  If the InstanceExpression is not
19825         addressable, store the result in a temporary variable, then get
19826         the address of it.
19827
19828         * codegen.cs: Only display 219 errors on warning level or above. 
19829
19830         * expression.cs (ArrayAccess): Make it implement the
19831         IMemoryLocation interface.
19832
19833         (Binary.DoResolve): handle the operator == (object a, object b)
19834         and operator != (object a, object b) without incurring into a
19835         BoxedCast (because 5 != o should never be performed).
19836
19837         Handle binary enumerator operators.
19838
19839         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19840         value type, otherwise use Ldelem_ref.
19841
19842         Use precomputed names;
19843
19844         (AddressOf): Implement address of
19845
19846         * cs-parser.jay (labeled_statement): Fix recursive block
19847         addition by reworking the production.
19848
19849         * expression.cs (New.DoEmit): New has a special case:
19850                 
19851                  If we are dealing with a ValueType, we have a few
19852                  situations to deal with:
19853                 
19854                     * The target of New is a ValueType variable, that is
19855                       easy, we just pass this as the variable reference
19856                 
19857                     * The target of New is being passed as an argument,
19858                       to a boxing operation or a function that takes a
19859                       ValueType.
19860                 
19861                       In this case, we need to create a temporary variable
19862                       that is the argument of New.
19863
19864
19865 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19866
19867         * rootcontext.cs (LookupType): Check that current_type is not null before
19868         going about looking at nested types.
19869
19870         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19871         not implement the IAssignMethod interface any more.
19872
19873         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19874         where we tranform them into FieldExprs if they are being resolved from within
19875         the declaring type.
19876
19877         * ecore.cs (SimpleName.DoResolve): Do the same here.
19878
19879         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19880
19881         * ../errors/bug10.cs : Add.
19882
19883         * ../errors/cs0070.cs : Add.
19884
19885         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19886
19887         * assign.cs : Get rid of EventIsLocal everywhere.
19888
19889 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19890
19891         * ecore.cs (ConvertIntLiteral): finished the implementation.
19892
19893         * statement.cs (SwitchLabel): Convert the value we are using as a
19894         key before looking up the table.
19895
19896 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19897
19898         * codegen.cs (EmitTopBlock): Require a Location argument now.
19899
19900         * cs-parser.jay (constructor_declarator): We need to setup
19901         current_local_parameters before we parse the
19902         opt_constructor_initializer, to allow the variables to be bound
19903         to the constructor arguments.
19904
19905         * rootcontext.cs (LookupType): First lookup nested classes in our
19906         class and our parents before we go looking outside our class.
19907
19908         * expression.cs (ConstantFold): Extract/debox the values at the
19909         beginnning. 
19910
19911         * rootcontext.cs (EmitCode): Resolve the constants first before we
19912         resolve the types.  This is not really needed, but it helps debugging.
19913
19914         * statement.cs: report location.
19915
19916         * cs-parser.jay: pass location to throw statement.
19917
19918         * driver.cs: Small bug fix.
19919
19920         * report.cs: Updated format to be 4-zero filled digits.
19921
19922 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19923
19924         * expression.cs (CheckIndices): Fix minor bug where the wrong
19925         variable was being referred to ;-)
19926
19927         (DoEmit): Do not call EmitStaticInitializers when the 
19928         underlying type is System.Object.
19929
19930 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19931
19932         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19933         and do the usual workaround for SRE.
19934
19935         * class.cs (MyEventBuilder.EventType): New member to get at the type
19936         of the event, quickly.
19937
19938         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19939
19940         * assign.cs (Assign.DoResolve): Handle the case when the target
19941         is an EventExpr and perform the necessary checks.
19942
19943         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19944         interface.
19945
19946         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19947
19948         (EventExpr): Set the type in the constructor itself since we 
19949         are meant to be born fully resolved.
19950
19951         (EventExpr.Define): Revert code I wrote earlier.
19952                 
19953         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19954         instance expression is null. The instance expression is a This in that case
19955         or a null, depending on whether it is a static method or not.
19956
19957         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19958         refers to more than one method.
19959
19960         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19961         and accordingly flag errors.
19962
19963 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19964
19965         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19966
19967 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19968
19969         * location.cs (ToString): Provide useful rutine.
19970
19971 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19972
19973         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19974         objects, return the actual integral boxed.
19975
19976         * statement.cs (SwitchLabel): define an ILLabel for each
19977         SwitchLabel. 
19978
19979         (Switch.CheckSwitch): If the value is a Literal, extract
19980         the underlying literal.
19981
19982         Also in the unused hashtable we had, add the SwitchLabel so we can
19983         quickly look this value up.
19984
19985         * constant.cs: Implement a bunch of new constants.  Rewrite
19986         Literal based on this.  Made changes everywhere to adapt to this.
19987
19988         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19989         dereferencing array only once, and also copes with enumrations.
19990
19991         bytes are two bytes wide, not one.
19992
19993         (Cast): Perform constant conversions.
19994
19995         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19996         wrappers to the literals here.
19997
19998         * expression.cs (DoNumericPromotions): long literals can converted
19999         to ulong implicity (this is taken care of elsewhere, but I was
20000         missing this spot).
20001
20002         * ecore.cs (Expression.Literalize): Make the return type Literal,
20003         to improve type checking.
20004
20005         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20006
20007 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20008
20009         * literal.cs: Revert code from ravi that checked the bounds.  The
20010         bounds are sane by the definition of the type itself. 
20011
20012         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20013         need to actually look up in our parent hierarchy for interfaces
20014         implemented. 
20015
20016         * const.cs: Use the underlying type for enumerations
20017
20018         * delegate.cs: Compute the basename for the delegate creation,
20019         that should fix the delegate test case, and restore the correct
20020         Type Lookup semantics in rootcontext
20021
20022         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20023         referencing a nested type with the Reflection API is using the "+"
20024         sign. 
20025
20026         * cs-parser.jay: Do not require EOF token at the end.
20027
20028 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20029
20030         * rootcontext.cs (LookupType): Concatenate type names with
20031         a '.' instead of a '+' The test suite passes again.
20032
20033         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20034         field of the enumeration.
20035
20036         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20037         the case when the member is an EventExpr.
20038
20039         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20040         static has an associated instance expression.
20041
20042         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20043
20044         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20045
20046         * class.cs (Event.Define): Register event and perform appropriate checks
20047         for error #111.
20048
20049         We define the Add and Remove methods even if the use provides none because
20050         in that case, we provide default implementations ourselves.
20051
20052         Define a private field of the type of the event. This is done by the CSC compiler
20053         and we should be doing it too ;-)
20054
20055         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20056         More methods we use in code we generate.
20057
20058         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20059         is important.
20060
20061         (InitCoreTypes): Update accordingly for the above.
20062
20063         * class.cs (Event.Emit): Generate code for default accessors that we provide
20064
20065         (EmitDefaultMethod): Do the job in the above.
20066
20067         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20068         appropriate place.
20069
20070 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20071
20072         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20073         builders even if we were missing one.
20074
20075         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20076         pass the Basename as our class name instead of the Name.  The
20077         basename will be correctly composed for us.
20078
20079         * parameter.cs (Paramters): Now takes a Location argument.
20080
20081         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20082         make all the code call directly LookupType in RootContext and take
20083         this chance to pass the Location information everywhere.
20084
20085         * Everywhere: pass Location information.
20086
20087 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * class.cs (Constructor.Define): Updated way of detecting the
20090         length of the parameters.
20091
20092         (TypeContainer.DefineType): Use basename as the type name for
20093         nested types.
20094
20095         (TypeContainer.Define): Do not recursively define types here, as
20096         definition is taken care in order by the RootContext.
20097
20098         * tree.cs: Keep track of namespaces in a per-file basis.
20099
20100         * parameter.cs (Parameter.ComputeSignature): Update to use
20101         DeclSpace. 
20102
20103         (Parameters.GetSignature): ditto.
20104
20105         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20106         instead of a TypeContainer.
20107
20108         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20109         resolve names.  Because we need to be resolve in our context, not
20110         our parents.
20111
20112         * driver.cs: Implement response files.
20113
20114         * class.cs (TypeContainer.DefineType): If we are defined, do not
20115         redefine ourselves.
20116
20117         (Event.Emit): Emit the code for add/remove handlers.
20118         (Event.Define): Save the MethodBuilders for add/remove.
20119
20120         * typemanager.cs: Use pair here too.
20121
20122         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20123         DictionaryEntry requires the first argument to be non-null.  
20124
20125         (enum_declaration): Compute full name for registering the
20126         enumeration.
20127
20128         (delegate_declaration): Instead of using
20129         formal_parameter_list, use opt_formal_parameter_list as the list
20130         can be empty.
20131
20132         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20133         (EventParsing): New property that controls whether `add' and
20134         `remove' are returned as tokens or identifiers (for events);
20135
20136 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20137
20138         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20139         use MyEventBuilder only and let it wrap the real builder for us.
20140
20141         (MyEventBuilder): Revamp constructor etc.
20142
20143         Implement all operations that we perform on EventBuilder in precisely the same
20144         way here too.
20145
20146         (FindMembers): Update to use the EventBuilder member.
20147
20148         (Event.Emit): Update accordingly.
20149
20150 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20151
20152         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20153         by calling the appropriate methods.
20154
20155         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20156         useful.
20157
20158         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20159
20160 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20161
20162         * delegate.cs (Delegate.Populate): Check that the return type
20163         and various parameters types are indeed accessible.
20164
20165         * class.cs (Constructor.Define): Same here.
20166
20167         (Field.Define): Ditto.
20168
20169         (Event.Define): Ditto.
20170
20171         (Operator.Define): Check that the underlying Method defined itself
20172         correctly - so it's MethodBuilder should not be null.
20173
20174         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20175         expression happens to be null.
20176
20177         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20178         members but as of now we don't seem to be able to do anything really useful with it.
20179
20180         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20181         not the EventBuilder.
20182
20183 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20184
20185         * cs-tokenizer.cs: Add support for defines.
20186         Add support for #if, #elif, #else, #endif
20187
20188         (eval_var): evaluates a variable.
20189         (eval): stubbed for evaluating functions.
20190
20191         * cs-parser.jay: Pass the defines information
20192
20193         * driver.cs: Add --define command line option.
20194
20195         * decl.cs: Move MemberCore here.
20196
20197         Make it the base class for DeclSpace.  This allows us to catch and
20198         report 108 and 109 for everything now.
20199
20200         * class.cs (TypeContainer.Define): Extract all the members
20201         before populating and emit the warning 108 (new keyword required
20202         to override) instead of having each member implement this.
20203
20204         (MemberCore.Define): New abstract method, we will be using this in
20205         the warning reporting engine in Populate.
20206
20207         (Operator.Define): Adjust to new MemberCore protocol. 
20208
20209         * const.cs (Const): This does not derive from Expression, it is a
20210         temporary object we use to create fields, it is a MemberCore. 
20211
20212         * class.cs (Method.Define): Allow the entry point to be in a
20213         specific class.
20214
20215         * driver.cs: Rewrite the argument handler to clean it up a bit.
20216
20217         * rootcontext.cs: Made it just an auxiliary namespace feature by
20218         making everything static.
20219
20220         * driver.cs: Adapt code to use RootContext type name instead of
20221         instance variable.
20222
20223         * delegate.cs: Remove RootContext argument.
20224
20225         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20226         argument. 
20227
20228         * class.cs (Event.Define): The lookup can fail.
20229
20230         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20231
20232         * expression.cs: Resolve the this instance before invoking the code.
20233
20234 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20235
20236         * cs-parser.jay: Add a production in element_access that allows
20237         the thing to become a "type" reference.  This way we can parse
20238         things like "(string [])" as a type.
20239
20240         Note that this still does not handle the more complex rules of
20241         casts. 
20242
20243
20244         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20245
20246         * ecore.cs: (CopyNewMethods): new utility function used to
20247         assemble the list of methods from running FindMembers.
20248
20249         (MemberLookup): Rework FindMembers so that 
20250
20251 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * class.cs (TypeContainer): Remove Delegates who fail to be
20254         defined.
20255
20256         * delegate.cs (Populate): Verify that we dont get null return
20257         values.   TODO: Check for AsAccessible.
20258
20259         * cs-parser.jay: Use basename to emit error 574 (destructor should
20260         have the same name as container class), not the full name.
20261
20262         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20263         possible representation.  
20264
20265         Also implements integer type suffixes U and L.
20266
20267 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * expression.cs (ArrayCreation.DoResolve): We need to do the
20270         argument resolution *always*.
20271
20272         * decl.cs: Make this hold the namespace.  Hold the root context as
20273         well.
20274         (LookupType): Move here.
20275
20276         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20277
20278         * location.cs (Row, Name): Fixed the code, it was always returning
20279         references to the first file.
20280
20281         * interface.cs: Register properties defined through interfaces.
20282
20283         * driver.cs: Add support for globbing on the command line
20284
20285         * class.cs (Field): Make it derive from MemberCore as well.
20286         (Event): ditto.
20287
20288 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20289
20290         * class.cs (Event::Define): Check that the type of the event is a delegate
20291         type else flag error #66.
20292
20293         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20294         same.
20295
20296         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20297         values of EntryPoint, CharSet etc etc.
20298
20299         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20300
20301         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20302         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20303         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20304         which needs this to do its work.
20305
20306         * ../errors/cs0066.cs : Add.
20307
20308 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20309
20310         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20311         helper functions.
20312
20313         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20314         clears out the parameters field.
20315         (MemberSignatureCompare): Cleanup
20316
20317         (MemberCore): New base class used to share code between MethodCore
20318         and Property.
20319
20320         (RegisterRequiredImplementations) BindingFlags.Public requires
20321         either BindingFlags.Instace or Static.  Use instance here.
20322
20323         (Property): Refactored code to cope better with the full spec.
20324
20325         * parameter.cs (GetParameterInfo): Return an empty array instead
20326         of null on error.
20327
20328         * class.cs (Property): Abstract or extern properties have no bodies.
20329
20330         * parameter.cs (GetParameterInfo): return a zero-sized array.
20331
20332         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20333         method modifier validation to the typecontainer so we can reuse
20334         this on properties.
20335
20336         (MethodCore.ParameterTypes): return an empty sized array of types.
20337
20338         (Property.Define): Test property modifier validity.
20339
20340         Add tests for sealed/override too.
20341
20342         (Method.Emit): abstract or extern methods have no bodies.
20343
20344 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20345
20346         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20347         thing.
20348
20349         (Method::Define, ::Emit): Modify accordingly.
20350
20351         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20352
20353         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20354
20355         * makefile: Pass in /unsafe.
20356
20357 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20358
20359         * class.cs (MakeKey): Kill routine.
20360
20361         * class.cs (TypeContainer.Define): Correctly define explicit
20362         method implementations (they require the full interface name plus
20363         the method name).
20364
20365         * typemanager.cs: Deply the PtrHashtable here and stop using the
20366         lame keys.  Things work so much better.
20367
20368         This of course broke everyone who depended on `RegisterMethod' to
20369         do the `test for existance' test.  This has to be done elsewhere.
20370
20371         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20372         the object stupid Equals method (because, that like fails all over
20373         the place).  We still do not use it.
20374
20375         * class.cs (TypeContainer.SetRequiredInterface,
20376         TypeContainer.RequireMethods): Killed these two routines and moved
20377         all the functionality to RegisterRequiredImplementations.
20378
20379         (TypeContainer.RegisterRequiredImplementations): This routine now
20380         registers all the implementations required in an array for the
20381         interfaces and abstract methods.  We use an array of structures
20382         which can be computed ahead of time to reduce memory usage and we
20383         also assume that lookups are cheap as most classes will not
20384         implement too many interfaces.
20385
20386         We also avoid creating too many MethodSignatures.
20387
20388         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20389         clear the "pending" bit if we find that there are problems with
20390         the declaration.
20391
20392         (TypeContainer.VerifyPendingMethods): Update to report errors of
20393         methods that look like implementations but are not.
20394
20395         (TypeContainer.Define): Add support for explicit interface method
20396         implementation. 
20397
20398 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * typemanager.cs: Keep track of the parameters here instead of
20401         being a feature of the TypeContainer.
20402
20403         * class.cs: Drop the registration of parameters here, as
20404         InterfaceMethods are also interface declarations.
20405
20406         * delegate.cs: Register methods with the TypeManager not only with
20407         the TypeContainer.  This code was buggy.
20408
20409         * interface.cs: Full registation here.
20410
20411 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * expression.cs: Remove reducer for binary expressions, it can not
20414         be done this way.
20415
20416         * const.cs: Put here the code that used to go into constant.cs
20417
20418         * constant.cs: Put here the code for constants, this is a new base
20419         class for Literals.
20420
20421         * literal.cs: Make Literal derive from Constant.
20422
20423 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20424
20425         * statement.cs (Return.Emit): Report error 157 if the user
20426         attempts to return from a finally block.
20427
20428         (Return.Emit): Instead of emitting a return, jump to the end of
20429         the function.
20430
20431         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20432         LocalBuilder to store the result of the function.  ReturnLabel is
20433         the target where we jump.
20434
20435
20436 2001-12-09  Radek Doulik  <rodo@ximian.com>
20437
20438         * cs-parser.jay: remember alias in current namespace
20439
20440         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20441         namespaces
20442
20443         * class.cs (LookupAlias): lookup alias in my_namespace
20444
20445         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20446         aliases hashtable
20447         (LookupAlias): lookup alias in this and if needed in parent
20448         namespaces
20449
20450 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20451
20452         * support.cs: 
20453
20454         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20455         making things static.  I need this to avoid passing the
20456         TypeContainer when calling ParameterType.
20457
20458         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20459         that did string manipulation to compute the type and then call
20460         GetType.  Use Parameter.ParameterType instead.
20461
20462         * cs-tokenizer.cs: Consume the suffix for floating values.
20463
20464         * expression.cs (ParameterReference): figure out whether this is a
20465         reference parameter or not.  Kill an extra variable by computing
20466         the arg_idx during emission.
20467
20468         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20469         function that returns whether a parameter is an out/ref value or not.
20470
20471         (Parameter.ParameterType): The type of the parameter (base,
20472         without ref/out applied).
20473
20474         (Parameter.Resolve): Perform resolution here.
20475         (Parameter.ExternalType): The full type (with ref/out applied).
20476
20477         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20478         support for expressions on the using statement.
20479
20480 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * statement.cs (Using.EmitLocalVariableDecls): Split the
20483         localvariable handling of the using statement.
20484
20485         (Block.EmitMeta): Keep track of variable count across blocks.  We
20486         were reusing slots on separate branches of blocks.
20487
20488         (Try.Emit): Emit the general code block, we were not emitting it. 
20489
20490         Check the type of the declaration to be an IDisposable or
20491         something that can be implicity converted to it. 
20492
20493         Emit conversions if required.
20494
20495         * ecore.cs (EmptyExpression): New utility class.
20496         (Expression.ImplicitConversionExists): New utility function.
20497
20498 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20499
20500         * statement.cs (Using): Implement.
20501
20502         * expression.cs (LocalVariableReference): Support read only variables.
20503
20504         * statement.cs: Remove the explicit emit for the Leave opcode.
20505         (VariableInfo): Add a readonly field.
20506
20507 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20508
20509         * ecore.cs (ConvCast): new class used to encapsulate the various
20510         explicit integer conversions that works in both checked and
20511         unchecked contexts.
20512
20513         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20514         properly generate the overflow opcodes.
20515
20516 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * statement.cs: The correct type for the EmptyExpression is the
20519         element_type, not the variable type.  Ravi pointed this out.
20520
20521 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20522
20523         * class.cs (Method::Define): Handle PInvoke methods specially
20524         by using DefinePInvokeMethod instead of the usual one.
20525
20526         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20527         above to do the task of extracting information and defining the method.
20528
20529 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20530
20531         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20532         of the condition for string type.
20533
20534         (Emit): Move that here. 
20535
20536         (ArrayCreation::CheckIndices): Keep string literals in their expression
20537         form.
20538
20539         (EmitDynamicInitializers): Handle strings appropriately.
20540
20541 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * codegen.cs (EmitContext): Replace multiple variables with a
20544         single pointer to the current Switch statement.
20545
20546         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20547         EmitContext.
20548
20549 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20550
20551         * statement.cs 
20552
20553         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20554         default'.
20555
20556         (Foreach.Emit): Foreach on arrays was not setting
20557         up the loop variables (for break/continue).
20558
20559         (GotoCase): Semi-implented.
20560
20561 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20562
20563         * attribute.cs (CheckAttribute): Handle system attributes by using
20564         Attribute.GetAttributes to examine information we need.
20565
20566         (GetValidPlaces): Same here.
20567
20568         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20569
20570         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20571
20572         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20573
20574         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20575
20576         (Method::Emit): Handle the case when we are a PInvoke method.
20577
20578 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20579
20580         * expression.cs: Use ResolveWithSimpleName on compound names.
20581
20582 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20583
20584         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20585         before trying to reduce it.
20586
20587         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20588
20589         * constant.cs (LookupConstantValue): Implement.
20590
20591         (EmitConstant): Use the above in emitting the constant.
20592
20593         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20594         that are user-defined by doing a LookupConstantValue on them.
20595
20596         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20597         too, like above.
20598
20599 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20600
20601         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20602
20603         (BaseAccess.DoResolve): Implement.
20604
20605         (MemberAccess.DoResolve): Split this routine into a
20606         ResolveMemberAccess routine that can be used independently
20607
20608 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20609
20610         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20611         As that share bits of the implementation.  Is returns a boolean,
20612         while As returns the Type that is being probed.
20613
20614 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20615
20616         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20617         instead of a Literal - much easier.
20618
20619         (EnumInTransit): Remove - utterly useless :-)
20620
20621         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20622
20623         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20624
20625         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20626         chain when we have no associated expression.
20627
20628 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20629
20630         * constant.cs (Define): Use Location while reporting the errror.
20631
20632         Also emit a warning when 'new' is used and there is no inherited
20633         member to hide.
20634
20635         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20636         populated.
20637
20638         (LookupEnumValue): Implement to lookup an enum member's value and define it
20639         if necessary.
20640
20641         (Populate): Re-write accordingly to use the above routine.
20642
20643 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20644
20645         * expression.cs (This): Fix prototype for DoResolveLValue to
20646         override the base class DoResolveLValue.
20647
20648         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20649         declarations) 
20650
20651         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20652         (we need to load the address of the field here).  This fixes
20653         test-22. 
20654
20655         (FieldExpr.DoResolveLValue): Call the DoResolve
20656         function to initialize the Instance expression.
20657
20658         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20659         correctly the GetEnumerator operation on a value type.
20660
20661         * cs-parser.jay: Add more simple parsing error catches.
20662
20663         * statement.cs (Switch): Add support for string switches.
20664         Handle null specially.
20665
20666         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20667
20668 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20669
20670         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20671
20672         (declare_local_constant): New helper function.
20673
20674         * statement.cs (AddConstant): Keep a separate record of constants
20675
20676         (IsConstant): Implement to determine if a variable is a constant.
20677
20678         (GetConstantExpression): Implement.
20679
20680         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20681
20682         * statement.cs (IsVariableDefined): Re-write.
20683
20684 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20685
20686         * class.cs (TypeContainer::FindMembers): Look for constants
20687         in the case when we are looking for MemberTypes.Field
20688
20689         * expression.cs (MemberAccess::DoResolve): Check that in the
20690         case we are a FieldExpr and a Literal, we are not being accessed
20691         by an instance reference.
20692
20693         * cs-parser.jay (local_constant_declaration): Implement.
20694
20695         (declaration_statement): Implement for constant declarations.
20696
20697 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * statement.cs (Switch): Catch double defaults.
20700
20701         (Switch): More work on the switch() statement
20702         implementation.  It works for integral values now, need to finish
20703         string support.
20704
20705
20706 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20707
20708         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20709         integer literals into other integer literals.  To be used by
20710         switch. 
20711
20712 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20713
20714         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20715         some memory.
20716
20717         (EmitDynamicInitializers): Cope with the above since we extract data
20718         directly from ArrayData now.
20719
20720         (ExpectInitializers): Keep track of whether initializers are mandatory
20721         or not.
20722
20723         (Bounds): Make it a hashtable to prevent the same dimension being 
20724         recorded for every element in that dimension.
20725
20726         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20727         from being found.
20728
20729         Also fix bug which was causing the indices to be emitted in the reverse
20730         order.
20731
20732 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20733
20734         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20735         unfinished.  They do not work, because the underlying code is
20736         sloppy.
20737
20738 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * cs-parser.jay: Remove bogus fixme.
20741
20742         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20743         on Switch statement.
20744
20745 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20746
20747         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20748         the same. 
20749
20750         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20751         parameter. Apparently, any expression is allowed. 
20752
20753         (ValidateInitializers): Update accordingly.
20754
20755         (CheckIndices): Fix some tricky bugs thanks to recursion.
20756
20757         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20758         I was being completely brain-dead.
20759
20760         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20761         and re-write acordingly.
20762
20763         (DelegateInvocation): Re-write accordingly.
20764
20765         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20766
20767         (MakeByteBlob): Handle types more correctly.
20768
20769         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20770         initialization from expressions but it is incomplete because I am a complete
20771         Dodo :-|
20772
20773 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20774
20775         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20776         on If.  Basically, we have to return `true' (ie, we do return to
20777         our caller) only if both branches of the if return.
20778
20779         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20780         short-circuit operators, handle them as short circuit operators. 
20781
20782         (Cast.DoResolve): Resolve type.
20783         (Cast.Cast): Take an expression as the target type.
20784
20785         * cs-parser.jay (cast_expression): Remove old hack that only
20786         allowed a limited set of types to be handled.  Now we take a
20787         unary_expression and we resolve to a type during semantic
20788         analysis.
20789
20790         Use the grammar productions from Rhys to handle casts (this is
20791         not complete like Rhys syntax yet, we fail to handle that corner
20792         case that C# has regarding (-x), but we will get there.
20793
20794 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20795
20796         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20797         field which is an array type.
20798
20799         * cs-parser.jay (declare_local_variables): Support array initialization too.
20800
20801         * typemanager.cs (MakeKey): Implement.
20802
20803         (everywhere): Use the above appropriately.
20804
20805         * cs-parser.jay (for_statement): Update for array initialization while
20806         declaring variables.
20807
20808         * ecore.cs : The error message was correct, it's the variable's names that
20809         were misleading ;-) Make the code more readable.
20810
20811         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20812         the correct type etc.
20813
20814         (ConvertExplicit): Handle Enum types by examining the underlying type.
20815
20816 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20817
20818         * parameter.cs (GetCallingConvention): Always return
20819         CallingConventions.Standard for now.
20820
20821 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20824         and `r' after calling DoNumericPromotions.
20825
20826         * ecore.cs: Fix error message (the types were in the wrong order).
20827
20828         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20829         BindingFlags.Instance as well 
20830
20831         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20832         implicit int literal conversion in an empty cast so that we
20833         propagate the right type upstream.
20834
20835         (UnboxCast): new class used to unbox value types.
20836         (Expression.ConvertExplicit): Add explicit type conversions done
20837         by unboxing.
20838
20839         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20840         the target type before applying the implicit LongLiterals to ULong
20841         literal cast.
20842
20843 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20844
20845         * cs-parser.jay (for_statement): Reworked the way For works: now
20846         we declare manually any variables that are introduced in
20847         for_initializer to solve the problem of having out-of-band code
20848         emition (that is what got for broken).
20849
20850         (declaration_statement): Perform the actual variable declaration
20851         that used to be done in local_variable_declaration here.
20852
20853         (local_variable_declaration): Do not declare anything, just pass
20854         the information on a DictionaryEntry
20855
20856 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20857
20858         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20859         re-write of the logic to now make it recursive.
20860
20861         (UpdateIndices): Re-write accordingly.
20862
20863         Store element data in a separate ArrayData list in the above methods.
20864
20865         (MakeByteBlob): Implement to dump the array data into a byte array.
20866
20867 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20868
20869         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20870         into CheckIndices.
20871
20872         * constant.cs (Define): Implement.
20873
20874         (EmitConstant): Re-write fully.
20875
20876         Pass in location info.
20877
20878         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20879         respectively.
20880
20881         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20882         DictionaryEntry since we need location info too.
20883
20884         (constant_declaration): Update accordingly.
20885
20886         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20887         code into another method : UpdateIndices.
20888
20889 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20890
20891         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20892         some type checking etc.
20893
20894 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20895
20896         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20897         bits to provide dimension info if the user skips doing that.
20898
20899         Update second constructor to store the rank correctly.
20900
20901 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20902
20903         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20904         and try to implement.
20905
20906         * ../errors/cs0150.cs : Add.
20907
20908         * ../errors/cs0178.cs : Add.
20909
20910 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20911
20912         * statement.cs: Implement foreach on multi-dimensional arrays. 
20913
20914         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20915         name of the params argument.
20916
20917         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20918         initializing the array.
20919
20920         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20921         we can use this elsewhere.
20922
20923         * statement.cs: Finish implementation of foreach for single
20924         dimension arrays.
20925
20926         * cs-parser.jay: Use an out-of-band stack to pass information
20927         around, I wonder why I need this.
20928
20929         foreach_block: Make the new foreach_block the current_block.
20930
20931         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20932         function used to return a static Parameters structure.  Used for
20933         empty parameters, as those are created very frequently.
20934
20935         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20936
20937 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20938
20939         * interface.cs : Default modifier is private, not public. The
20940         make verify test passes again.
20941
20942 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20943
20944         * support.cs (ReflectionParameters): Fix logic to determine
20945         whether the last parameter is a params one. Test 9 passes again.
20946
20947         * delegate.cs (Populate): Register the builders we define with
20948         RegisterParameterForBuilder. Test 19 passes again.
20949
20950         * cs-parser.jay (property_declaration): Reference $6 instead
20951         of $$ to get at the location.
20952
20953         (indexer_declaration): Similar stuff.
20954
20955         (attribute): Ditto.
20956
20957         * class.cs (Property): Register parameters for the Get and Set methods
20958         if they exist. Test 23 passes again.
20959
20960         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20961         call to EmitArguments as we are sure there aren't any params arguments. 
20962         Test 32 passes again.
20963
20964         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20965         IndexOutOfRangeException. 
20966
20967         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20968         Test 33 now passes again.
20969
20970 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20973         broke a bunch of things.  Will have to come up with a better way
20974         of tracking locations.
20975
20976         * statement.cs: Implemented foreach for single dimension arrays.
20977
20978 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20979
20980         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20981         an error.  This removes the lookup from the critical path.
20982
20983         * cs-parser.jay: Removed use of temporary_loc, which is completely
20984         broken. 
20985
20986 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * support.cs (ReflectionParameters.ParameterModifier): Report
20989         whether the argument is a PARAMS argument or not.
20990
20991         * class.cs: Set the attribute `ParamArrayAttribute' on the
20992         parameter argument.
20993
20994         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20995         and cons_param_array_attribute (ConstructorInfo for
20996         ParamArrayAttribute)., 
20997
20998         * codegen.cs: Emit the return using the `Return' statement, that
20999         way we can report the error correctly for missing return values. 
21000
21001         * class.cs (Method.Emit): Clean up.
21002
21003         * expression.cs (Argument.Resolve): Take another argument: the
21004         location where this argument is used.  Notice that this is not
21005         part of the "Argument" class as to reduce the size of the
21006         structure (we know the approximate location anyways).
21007
21008         Test if the argument is a variable-reference, if not, then
21009         complain with a 206.
21010
21011         (Argument.Emit): Emit addresses of variables.
21012
21013         (Argument.FullDesc): Simplify.
21014
21015         (Invocation.DoResolve): Update for Argument.Resolve.
21016
21017         (ElementAccess.DoResolve): ditto.
21018
21019         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21020         method should be virtual, as this method is always virtual.
21021
21022         (NewDelegate.DoResolve): Update for Argument.Resolve.
21023
21024         * class.cs (ConstructorInitializer.DoResolve): ditto.
21025
21026         * attribute.cs (Attribute.Resolve): ditto.
21027
21028 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21031
21032         * expression.cs (ParameterReference): Drop IStackStorage and implement
21033         IAssignMethod instead. 
21034
21035         (LocalVariableReference): ditto.
21036
21037         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21038         IAssignMethod instead. 
21039
21040 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21041
21042         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21043         enumerations that are used in heavily used structures derive from
21044         byte in a laughable and pathetic attempt to reduce memory usage.
21045         This is the kind of pre-optimzations that you should not do at
21046         home without adult supervision.
21047
21048         * expression.cs (UnaryMutator): New class, used to handle ++ and
21049         -- separatedly from the other unary operators.  Cleans up the
21050         code, and kills the ExpressionStatement dependency in Unary.
21051
21052         (Unary): Removed `method' and `Arguments' from this class, making
21053         it smaller, and moving it all to SimpleCall, so I can reuse this
21054         code in other locations and avoid creating a lot of transient data
21055         strucutres when not required.
21056
21057         * cs-parser.jay: Adjust for new changes.
21058
21059 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21060
21061         * enum.cs (Enum.Populate): If there is a failure during
21062         definition, return
21063
21064         * cs-parser.jay (opt_enum_base): we used to catch type errors
21065         here, but this is really incorrect.  The type error should be
21066         catched during semantic analysis.
21067
21068 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21069
21070         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21071         current_local_parameters as expected since I, in my stupidity, had forgotten
21072         to do this :-)
21073
21074         * attribute.cs (GetValidPlaces): Fix stupid bug.
21075
21076         * class.cs (Method::Emit): Perform check on applicability of attributes.
21077
21078         (Constructor::Emit): Ditto.
21079
21080         (Field::Emit): Ditto.
21081
21082         (Field.Location): Store location information.
21083
21084         (Property, Event, Indexer, Operator): Ditto.
21085
21086         * cs-parser.jay (field_declaration): Pass in location for each field.
21087
21088         * ../errors/cs0592.cs : Add.
21089
21090 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21091
21092         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21093
21094         (InitCoreTypes): Update accordingly.
21095
21096         (RegisterAttrType, LookupAttr): Implement.
21097
21098         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21099         info about the same.
21100
21101         (Resolve): Update to populate the above as necessary.
21102
21103         (Error592): Helper.
21104
21105         (GetValidPlaces): Helper to the above.
21106
21107         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21108
21109         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21110
21111 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21112
21113         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21114
21115         * ../errors/cs0617.cs : Add.
21116
21117 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21118
21119         * enum.cs (Emit): Rename to Populate to be more consistent with what
21120         we expect it to do and when exactly it is called.
21121
21122         * class.cs, rootcontext.cs : Update accordingly.
21123
21124         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21125         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21126
21127         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21128
21129         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21130         of a fieldinfo using the above, when dealing with a FieldBuilder.
21131
21132 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21133
21134         * ../errors/cs0031.cs : Add.
21135
21136         * ../errors/cs1008.cs : Add.
21137
21138         * ../errrors/cs0543.cs : Add.
21139
21140         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21141         enum type.
21142
21143         (FindMembers): Implement.
21144
21145         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21146         enums and delegates too.
21147
21148         (enum_types): Rename to builder_to_enum.
21149
21150         (delegate_types): Rename to builder_to_delegate.
21151
21152         * delegate.cs (FindMembers): Implement.
21153
21154 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21155
21156         * typemanager.cs (IsEnumType): Implement.
21157
21158         * enum.cs (Emit): Re-write parts to account for the underlying type
21159         better and perform checking etc.
21160
21161         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21162         of the underlying type.
21163
21164         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21165         value
21166
21167         * enum.cs (error31): Helper to report error #31.
21168
21169         * cs-parser.jay (enum_declaration): Store location of each member too.
21170
21171         * enum.cs (member_to_location): New hashtable. 
21172
21173         (AddEnumMember): Update location hashtable.
21174
21175         (Emit): Use the location of each member while reporting errors.
21176
21177 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * cs-parser.jay: A for_initializer if is a
21180         local_variable_declaration really ammount to have an implicit
21181         block with the variable declaration and no initializer for for.
21182
21183         * statement.cs (For.Emit): Cope with null initializers.
21184
21185         This fixes the infinite loop on for initializers.
21186
21187 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21188
21189         * enum.cs: More cleanup.
21190
21191         * ecore.cs: Remove dead code.
21192
21193         * class.cs (Property.Emit): More simplification.
21194         (Event.Emit): ditto.
21195
21196         Reworked to have less levels of indentation.
21197
21198 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21199
21200         * class.cs (Property): Emit attributes.
21201
21202         (Field): Ditto.
21203
21204         (Event): Ditto.
21205
21206         (Indexer): Ditto.
21207
21208         (Operator): Ditto.
21209
21210         * enum.cs (Emit): Ditto.
21211
21212         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21213         Enums too.
21214
21215         * class.cs (Field, Event, etc.): Move attribute generation into the
21216         Emit method everywhere.
21217
21218         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21219         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21220         as we had no way of defining nested enums !
21221
21222         * rootcontext.cs : Adjust code accordingly.
21223
21224         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21225
21226 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21227
21228         * expression.cs (EvalConstantExpression): Move into ecore.cs
21229
21230         * enum.cs (Enum): Rename some members and make them public and readonly
21231         according to our convention.
21232
21233         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21234         nothing else.
21235
21236         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21237
21238         (Enum::Emit): Write a simple version for now which doesn't try to compute
21239         expressions. I shall modify this to be more robust in just a while.
21240
21241         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21242
21243         (TypeContainer::CloseType): Create the Enum types too.
21244
21245         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21246
21247         * expression.cs (EvalConstantExpression): Get rid of completely.
21248
21249         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21250         user-defined values and other cases.
21251
21252         (IsValidEnumLiteral): Helper function.
21253
21254         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21255         out there in the case we had a literal FieldExpr.
21256
21257         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21258
21259         (Literalize): Revamp a bit to take two arguments.
21260
21261         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21262
21263 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21264
21265         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21266
21267         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21268
21269         (Resolve): Use the above to ensure we have proper initializers.
21270
21271 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21272
21273         * expression.cs (Expression::EvalConstantExpression): New method to 
21274         evaluate constant expressions.
21275
21276         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21277
21278 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21279
21280         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21281         in an array.
21282
21283         (Binary.ResolveOperator): Handle operator != (object a, object b)
21284         and operator == (object a, object b);
21285
21286         (Binary.DoNumericPromotions): Indicate whether the numeric
21287         promotion was possible.
21288
21289         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21290         Implement.  
21291
21292         Made the ArrayAccess implement interface IAssignMethod instead of
21293         IStackStore as the order in which arguments are passed reflects
21294         this.
21295
21296         * assign.cs: Instead of using expr.ExprClass to select the way of
21297         assinging, probe for the IStackStore/IAssignMethod interfaces.
21298
21299         * typemanager.cs: Load InitializeArray definition.
21300
21301         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21302         static data that can be used to initialize arrays. 
21303
21304 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21305
21306         * expression.cs: Handle operator== and operator!= for booleans.
21307
21308         (Conditioal.Reduce): Implement reducer for the ?: operator.
21309
21310         (Conditional.Resolve): Implement dead code elimination.
21311
21312         (Binary.Resolve): Catch string literals and return a new
21313         concatenated string.
21314
21315         (Unary.Reduce): Implement reduction of unary expressions.
21316
21317         * ecore.cs: Split out the expression core handling here.
21318
21319         (Expression.Reduce): New method used to perform constant folding
21320         and CSE.  This is needed to support constant-expressions. 
21321
21322         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21323         targets, and optimize for !x.
21324
21325 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21326
21327         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21328         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21329         set custom atttributes.
21330
21331         * literal.cs (Literal::GetValue): New abstract method to return the actual
21332         value of the literal, cast as an object.
21333
21334         (*Literal): Implement GetValue method.
21335
21336         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21337         expressions to the arraylist but objects of type Argument.
21338
21339         * class.cs (TypeContainer::Emit): Emit our attributes too.
21340
21341         (Method::Emit, Constructor::Emit): Ditto.
21342
21343         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21344         to be ignoring earlier.
21345
21346 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21347
21348         * attribute.cs (AttributeSection::Define): Implement to do the business
21349         of constructing a CustomAttributeBuilder.
21350
21351         (Attribute): New trivial class. Increases readability of code.  
21352
21353         * cs-parser.jay : Update accordingly.
21354
21355         (positional_argument_list, named_argument_list, named_argument): New rules
21356
21357         (attribute_arguments): Use the above so that we are more correct.
21358
21359 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21360
21361         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21362         to perform all checks for a method with a params parameter.
21363
21364         (Invocation::OverloadResolve): Update to use the above method and therefore
21365         cope correctly with params method invocations.
21366
21367         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21368         params too.
21369
21370         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21371         constructors in our parent too because we can't afford to miss out on 
21372         protected ones ;-)
21373
21374         * attribute.cs (AttributeSection): New name for the class Attribute
21375
21376         Other trivial changes to improve readability.
21377
21378         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21379         use the new class names.
21380
21381 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21382
21383         * class.cs (Method::Define): Complete definition for params types too
21384
21385         (Indexer::Define): Ditto.
21386
21387         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21388         Cope everywhere with a request for info about the array parameter.
21389
21390 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21391
21392         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21393
21394         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21395         local_variable_type to extract the string corresponding to the type.
21396
21397         (local_variable_type): Fixup the action to use the new helper method.
21398
21399         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21400         go.
21401
21402         * expression.cs : Clean out code which uses the above.
21403
21404 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21405
21406         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21407         and bale out if necessary by returning a false.
21408
21409         (RegisterProperty): Ditto.
21410
21411         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21412         and print out appropriate error messages.
21413
21414         * interface.cs (everywhere): Ditto.
21415
21416         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21417         location to constructor.
21418
21419         * class.cs (Property, Event, Indexer): Update accordingly.
21420
21421         * ../errors/cs111.cs : Added.
21422
21423         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21424         of a method, as laid down by the spec.
21425
21426         (Invocation::OverloadResolve): Use the above method.
21427
21428 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21429
21430         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21431         now take a TypeContainer and a Parameters object.
21432
21433         (ParameterData): Modify return type of ParameterModifier method to be 
21434         Parameter.Modifier and not a string.
21435
21436         (ReflectionParameters, InternalParameters): Update accordingly.
21437
21438         * expression.cs (Argument::GetParameterModifier): Same here.
21439
21440         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21441         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21442         symbol in it at all so maybe this is only for now.
21443
21444 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21445
21446         * support.cs (InternalParameters): Constructor now takes an extra argument 
21447         which is the actual Parameters class.
21448
21449         (ParameterDesc): Update to provide info on ref/out modifiers.
21450
21451         * class.cs (everywhere): Update call to InternalParameters to pass in
21452         the second argument too.
21453
21454         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21455         to return the modifier info [ref/out etc]
21456
21457         (InternalParameters, ReflectionParameters): Implement the above.
21458
21459         * expression.cs (Argument::ParameterModifier): Similar function to return
21460         info about the argument's modifiers.
21461
21462         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21463         too.
21464
21465         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21466         a new SetFormalParameters object which we pass to InternalParameters.
21467
21468 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21469
21470         * expression.cs (NewArray): Merge into the ArrayCreation class.
21471
21472 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21473
21474         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21475         NewUserdefinedArray into one as there wasn't much of a use in having
21476         two separate ones.
21477
21478         * expression.cs (Argument): Change field's name to ArgType from Type.
21479
21480         (Type): New readonly property which returns the proper type, taking into 
21481         account ref/out modifiers.
21482
21483         (everywhere): Adjust code accordingly for the above.
21484
21485         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21486         whether we are emitting for a ref or out parameter.
21487
21488         * expression.cs (Argument::Emit): Use the above field to set the state.
21489
21490         (LocalVariableReference::Emit): Update to honour the flag and emit the
21491         right stuff.
21492
21493         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21494
21495         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21496
21497         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21498
21499         (ReflectionParameters, InternalParameters): Implement the above method.
21500
21501         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21502         reporting errors.
21503
21504         (Invocation::FullMethodDesc): Ditto. 
21505
21506 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * cs-parser.jay: Add extra production for the second form of array
21509         creation. 
21510
21511         * expression.cs (ArrayCreation): Update to reflect the above
21512         change. 
21513
21514         * Small changes to prepare for Array initialization.
21515
21516 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21517
21518         * typemanager.cs (ImplementsInterface): interface might be null;
21519         Deal with this problem;
21520
21521         Also, we do store negative hits on the cache (null values), so use
21522         this instead of calling t.GetInterfaces on the type everytime.
21523
21524 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21525
21526         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21527
21528         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21529         split functionality out into different classes.
21530
21531         (New::FormArrayType): Move into NewBuiltinArray.
21532
21533         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21534         quite useless.
21535
21536         (NewBuiltinArray): New class to handle creation of built-in arrays.
21537
21538         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21539         account creation of one-dimensional arrays.
21540
21541         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21542
21543         (NewUserdefinedArray::DoResolve): Implement.
21544
21545         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21546
21547         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21548         we maintain inside the TypeManager. This is necessary to perform lookups on the
21549         module builder.
21550
21551         (LookupType): Update to perform GetType on the module builders too.     
21552
21553         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21554
21555         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21556
21557 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21558
21559         * expression.cs (New::DoResolve): Implement guts of array creation.
21560
21561         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21562
21563 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21564
21565         * expression.cs: Fix bug I introduced lsat night that broke
21566         Delegates. 
21567
21568         (Expression.Resolve): Report a 246 error (can not resolve name)
21569         if we find a SimpleName in the stream.
21570
21571         (Expression.ResolveLValue): Ditto.
21572
21573         (Expression.ResolveWithSimpleName): This function is a variant of
21574         ResolveName, this one allows SimpleNames to be returned without a
21575         warning.  The only consumer of SimpleNames is MemberAccess
21576
21577 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21580         might arrive here.  I have my doubts that this is correct.
21581
21582         * statement.cs (Lock): Implement lock statement.
21583
21584         * cs-parser.jay: Small fixes to support `lock' and `using'
21585
21586         * cs-tokenizer.cs: Remove extra space
21587
21588         * driver.cs: New flag --checked, allows to turn on integer math
21589         checking. 
21590
21591         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21592         Threading.Monitor.Exit 
21593
21594 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21595
21596         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21597         Expression Class to be IndexerAccess.
21598
21599         Notice that Indexer::DoResolve sets the eclass to Value.
21600
21601 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21602
21603         * class.cs (TypeContainer::Emit): Emit code for indexers.
21604
21605         * assign.cs (IAssignMethod): New interface implemented by Indexers
21606         and Properties for handling assignment.
21607
21608         (Assign::Emit): Simplify and reuse code. 
21609
21610         * expression.cs (IndexerAccess, PropertyExpr): Implement
21611         IAssignMethod, clean up old code. 
21612
21613 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21614
21615         * typemanager.cs (ImplementsInterface): New method to determine if a type
21616         implements a given interface. Provides a nice cache too.
21617
21618         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21619         method.
21620
21621         (ConvertReferenceExplicit): Ditto.
21622
21623         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21624         various methods, with correct names etc.
21625
21626         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21627         Operator.UnaryNegation.
21628
21629         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21630         we have a unary plus or minus operator.
21631
21632         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21633         UnaryMinus.
21634
21635         * everywhere : update accordingly.
21636
21637         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21638         respectively.
21639
21640         * class.cs (Method::Define): For the case where we are implementing a method
21641         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21642         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21643
21644 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21645
21646         * interface.cs (FindMembers): Implement to work around S.R.E
21647         lameness.
21648
21649         * typemanager.cs (IsInterfaceType): Implement.
21650
21651         (FindMembers): Update to handle interface types too.
21652
21653         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21654         use IsAssignableFrom as that is not correct - it doesn't work.
21655
21656         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21657         and accordingly override EmitStatement.
21658
21659         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21660         using the correct logic :-)
21661
21662 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21663
21664         * ../errors/cs-11.cs : Add to demonstrate error -11 
21665
21666 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21667
21668         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21669         then pass this as a hint to ResolveLValue.
21670
21671         * expression.cs (FieldExpr): Add Location information
21672
21673         (FieldExpr::LValueResolve): Report assignment to readonly
21674         variable. 
21675
21676         (Expression::ExprClassFromMemberInfo): Pass location information.
21677
21678         (Expression::ResolveLValue): Add new method that resolves an
21679         LValue. 
21680
21681         (Expression::DoResolveLValue): Default invocation calls
21682         DoResolve. 
21683
21684         (Indexers): New class used to keep track of indexers in a given
21685         Type. 
21686
21687         (IStackStore): Renamed from LValue, as it did not really describe
21688         what this did.  Also ResolveLValue is gone from this interface and
21689         now is part of Expression.
21690
21691         (ElementAccess): Depending on the element access type
21692
21693         * typemanager.cs: Add `indexer_name_type' as a Core type
21694         (System.Runtime.CompilerServices.IndexerNameAttribute)
21695
21696         * statement.cs (Goto): Take a location.
21697
21698 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21699
21700         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21701         if two delegates are compatible.
21702
21703         (NewDelegate::DoResolve): Update to take care of the case when
21704         we instantiate a delegate from another delegate.
21705
21706         * typemanager.cs (FindMembers): Don't even try to look up members
21707         of Delegate types for now.
21708
21709 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21710
21711         * delegate.cs (NewDelegate): New class to take care of delegate
21712         instantiation.
21713
21714         * expression.cs (New): Split the delegate related code out into 
21715         the NewDelegate class.
21716
21717         * delegate.cs (DelegateInvocation): New class to handle delegate 
21718         invocation.
21719
21720         * expression.cs (Invocation): Split out delegate related code into
21721         the DelegateInvocation class.
21722
21723 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21724
21725         * expression.cs (New::DoResolve): Implement delegate creation fully
21726         and according to the spec.
21727
21728         (New::DoEmit): Update to handle delegates differently.
21729
21730         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21731         because of which we were printing out arguments in reverse order !
21732
21733         * delegate.cs (VerifyMethod): Implement to check if the given method
21734         matches the delegate.
21735
21736         (FullDelegateDesc): Implement.
21737
21738         (VerifyApplicability): Implement.
21739
21740         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21741         delegate invocations too.
21742
21743         (Invocation::Emit): Ditto.
21744
21745         * ../errors/cs1593.cs : Added.
21746
21747         * ../errors/cs1594.cs : Added.
21748
21749         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21750
21751 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21752
21753         * typemanager.cs (intptr_type): Core type for System.IntPtr
21754
21755         (InitCoreTypes): Update for the same.
21756
21757         (iasyncresult_type, asynccallback_type): Ditto.
21758
21759         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21760         correct.
21761
21762         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21763         too.
21764
21765         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21766         the builders for the 4 members of a delegate type :-)
21767
21768         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21769         type.
21770
21771         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21772
21773         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21774
21775 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21776
21777         * statement.cs (Break::Emit): Implement.   
21778         (Continue::Emit): Implement.
21779
21780         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21781         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21782         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21783         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21784         end loop
21785
21786         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21787         properties that track the label for the current loop (begin of the
21788         loop and end of the loop).
21789
21790 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21791
21792         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21793         use of emitting anything at all.
21794
21795         * class.cs, rootcontext.cs : Get rid of calls to the same.
21796
21797         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21798
21799         (Populate): Define the constructor correctly and set the implementation
21800         attributes.
21801
21802         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21803         have been defined.
21804
21805         (AddDelegateType): Implement.
21806
21807         (IsDelegateType): Implement helper method.
21808
21809         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21810
21811         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21812         and accordingly handle it.
21813
21814         * delegate.cs (Populate): Take TypeContainer argument.
21815         Implement bits to define the Invoke method. However, I still haven't figured out
21816         how to take care of the native int bit :-(
21817
21818         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21819         Qualify the name of the delegate, not its return type !
21820
21821         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21822         conversion.
21823
21824         (StandardConversionExists): Checking for array types turns out to be recursive.
21825
21826         (ConvertReferenceExplicit): Implement array conversion.
21827
21828         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21829
21830 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21831
21832         * cs-parser.jay (delegate_declaration): Store the fully qualified
21833         name as it is a type declaration.
21834
21835         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21836         readonly.
21837
21838         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21839         as TypeContainer::DefineType.
21840
21841         (Populate): Method in which all the definition of the various methods (Invoke)
21842         etc is done.
21843
21844         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21845         see.
21846
21847         (CloseDelegate): Finally creates the delegate.
21848
21849         * class.cs (TypeContainer::DefineType): Update to define delegates.
21850         (Populate, Emit and CloseType): Do the same thing here too.
21851
21852         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21853         delegates in all these operations.
21854
21855 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * expression.cs: LocalTemporary: a new expression used to
21858         reference a temporary that has been created.
21859
21860         * assign.cs: Handle PropertyAccess back here, so that we can
21861         provide the proper semantic access to properties.
21862
21863         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21864         a few more explicit conversions. 
21865
21866         * modifiers.cs: `NEW' modifier maps to HideBySig.
21867
21868         * expression.cs (PropertyExpr): Make this into an
21869         ExpressionStatement, and support the EmitStatement code path. 
21870
21871         Perform get/set error checking, clean up the interface.
21872
21873         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21874         them into toplevel access objects.
21875
21876 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21877
21878         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21879         SRE.
21880
21881         * typemanager.cs: Keep track here of our PropertyBuilders again to
21882         work around lameness in SRE.
21883
21884 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21885
21886         * expression.cs (LValue::LValueResolve): New method in the
21887         interface, used to perform a second resolution pass for LValues. 
21888
21889         (This::DoResolve): Catch the use of this in static methods.
21890
21891         (This::LValueResolve): Implement.
21892
21893         (This::Store): Remove warning, assigning to `this' in structures
21894         is 
21895
21896         (Invocation::Emit): Deal with invocation of
21897         methods on value types.  We need to pass the address to structure
21898         methods rather than the object itself.  (The equivalent code to
21899         emit "this" for structures leaves the entire structure on the
21900         stack instead of a pointer to it). 
21901
21902         (ParameterReference::DoResolve): Compute the real index for the
21903         argument based on whether the method takes or not a `this' pointer
21904         (ie, the method is static).
21905
21906         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21907         value types returned from functions when we need to invoke a
21908         method on the sturcture.
21909
21910
21911 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21912
21913         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21914         defining the type in the Modulebuilder or Typebuilder. This is to take
21915         care of nested types which need to be defined on the TypeBuilder using
21916         DefineNestedMethod.
21917
21918         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21919         methods in RootContext, only ported to be part of TypeContainer.
21920
21921         (TypeContainer::GetInterfaceOrClass): Ditto.
21922
21923         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21924
21925         * interface.cs (Interface::DefineInterface): New method. Does exactly
21926         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21927         too.
21928
21929         (Interface::GetInterfaces): Move from RootContext here and port.
21930
21931         (Interface::GetInterfaceByName): Same here.
21932
21933         * rootcontext.cs (ResolveTree): Re-write.
21934
21935         (PopulateTypes): Re-write.
21936
21937         * class.cs (TypeContainer::Populate): Populate nested types too.
21938         (TypeContainer::Emit): Emit nested members too.
21939
21940         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21941         instead just use the name argument passed in as it is already fully
21942         qualified.
21943
21944         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21945         to TypeContainer mapping to see if a type is user-defined.
21946
21947         * class.cs (TypeContainer::CloseType): Implement. 
21948
21949         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21950         the default constructor.
21951
21952         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21953         twice.
21954
21955         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21956
21957         * interface.cs (CloseType): Create the type here.
21958
21959         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21960         the hierarchy.
21961
21962         Remove all the methods which are now in TypeContainer.
21963
21964 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21965
21966         * delegate.cs (Define): Re-write bits to define the delegate
21967         correctly.
21968
21969 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21970
21971         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21972
21973         * expression.cs (ImplicitReferenceConversion): handle null as well
21974         as a source to convert to any reference type.
21975
21976         * statement.cs (Return): Perform any implicit conversions to
21977         expected return type.  
21978
21979         Validate use of return statement.  
21980
21981         * codegen.cs (EmitContext): Pass the expected return type here.
21982
21983         * class.cs (Method, Constructor, Property): Pass expected return
21984         type to EmitContext.
21985
21986 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21987
21988         * expression.cs: Make DoResolve take an EmitContext instead of a
21989         TypeContainer.
21990
21991         Replaced `l' and `location' for `loc', for consistency.
21992
21993         (Error, Warning): Remove unneeded Tc argument.
21994
21995         * assign.cs, literal.cs, constant.cs: Update to new calling
21996         convention. 
21997
21998         * codegen.cs: EmitContext now contains a flag indicating whether
21999         code is being generated in a static method or not.
22000
22001         * cs-parser.jay: DecomposeQI, new function that replaces the old
22002         QualifiedIdentifier.  Now we always decompose the assembled
22003         strings from qualified_identifier productions into a group of
22004         memberaccesses.
22005
22006 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22007
22008         * rootcontext.cs: Deal with field-less struct types correctly now
22009         by passing the size option to Define Type.
22010
22011         * class.cs: Removed hack that created one static field. 
22012
22013 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * statement.cs: Moved most of the code generation here. 
22016
22017 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22018
22019         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22020         seem very right.
22021
22022         (ElementAccess): Remove useless bits for now - keep checks as the spec
22023         says.
22024
22025 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22026
22027         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22028         and start performing checks according to the spec.
22029
22030 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22031
22032         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22033         rank_specifiers instead.
22034
22035         (rank_specifiers): Change the order in which the rank specifiers are stored
22036
22037         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22038
22039         * expression.cs (ElementAccess): Implement the LValue interface too.
22040
22041 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22042
22043         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22044         except that user defined conversions are not included.
22045
22046         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22047         perform the conversion of the return type, if necessary.
22048
22049         (New::DoResolve): Check whether we are creating an array or an object
22050         and accordingly do the needful.
22051
22052         (New::Emit): Same here.
22053
22054         (New::DoResolve): Implement guts of array creation.
22055
22056         (New::FormLookupType): Helper function.
22057
22058 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22059
22060         * codegen.cs: Removed most of the code generation here, and move the
22061         corresponding code generation bits to the statement classes. 
22062
22063         Added support for try/catch/finalize and throw.
22064
22065         * cs-parser.jay: Added support for try/catch/finalize.
22066
22067         * class.cs: Catch static methods having the flags override,
22068         virtual or abstract.
22069
22070         * expression.cs (UserCast): This user cast was not really doing
22071         what it was supposed to do.  Which is to be born in fully resolved
22072         state.  Parts of the resolution were being performed at Emit time! 
22073
22074         Fixed this code.
22075
22076 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22077
22078         * expression.cs: Implicity convert the result from UserCast.
22079
22080 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22081
22082         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22083         prevented it from working correctly. 
22084
22085         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22086         merely ConvertImplicit.
22087
22088 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22089
22090         * typemanager.cs: Make the LookupTypeContainer function static,
22091         and not per-instance.  
22092
22093         * class.cs: Make static FindMembers (the one that takes a Type
22094         argument). 
22095
22096         * codegen.cs: Add EmitForeach here.
22097
22098         * cs-parser.jay: Make foreach a toplevel object instead of the
22099         inline expansion, as we need to perform semantic analysis on it. 
22100
22101 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22102
22103         * expression.cs (Expression::ImplicitUserConversion): Rename to
22104         UserDefinedConversion.
22105
22106         (Expression::UserDefinedConversion): Take an extra argument specifying 
22107         whether we look for explicit user conversions too.
22108
22109         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22110
22111         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22112
22113         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22114         with the appropriate arguments.
22115
22116         * cs-parser.jay (cast_expression): Record location too.
22117
22118         * expression.cs (Cast): Record location info.
22119
22120         (Expression::ConvertExplicit): Take location argument.
22121
22122         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22123         to determine if we are doing explicit conversions.
22124
22125         (UserCast::Emit): Update accordingly.
22126
22127         (Expression::ConvertExplicit): Report an error if everything fails.
22128
22129         * ../errors/cs0030.cs : Add.
22130
22131 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22132
22133         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22134         virtual and newslot bits. 
22135
22136         * class.cs (TypeContainer::RegisterRequiredImplementations):
22137         Record methods we need.
22138
22139         (TypeContainer::MakeKey): Helper function to make keys for
22140         MethodBases, since the Methodbase key is useless.
22141
22142         (TypeContainer::Populate): Call RegisterRequiredImplementations
22143         before defining the methods.   
22144
22145         Create a mapping for method_builders_to_methods ahead of time
22146         instead of inside a tight loop.
22147
22148         (::RequireMethods):  Accept an object as the data to set into the
22149         hashtable so we can report interface vs abstract method mismatch.
22150
22151 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22152
22153         * report.cs: Make all of it static.
22154
22155         * rootcontext.cs: Drop object_type and value_type computations, as
22156         we have those in the TypeManager anyways.
22157
22158         Drop report instance variable too, now it is a global.
22159
22160         * driver.cs: Use try/catch on command line handling.
22161
22162         Add --probe option to debug the error reporting system with a test
22163         suite. 
22164
22165         * report.cs: Add support for exiting program when a probe
22166         condition is reached.
22167
22168 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22169
22170         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22171         we do a forcible conversion regardless of type, to check if 
22172         ForceConversion returns a null.
22173
22174         (Binary::error19): Use location to report error.
22175
22176         (Unary::error23): Use location here too.
22177
22178         * ../errors/cs0019.cs : Check in.
22179
22180         * ../errors/cs0023.cs : Check in.
22181
22182         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22183         case of a non-null MethodInfo object with a length of 0 !
22184
22185         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22186         an applicable member - according to the spec :-)
22187         Also fix logic to find members in base types.
22188
22189         (Unary::ResolveOperator): Same here.
22190
22191         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22192         as I was getting thoroughly confused between this and error19 :-)
22193
22194         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22195         (::FindMostEncompassedType): Implement.
22196         (::FindMostEncompassingType): Implement.
22197         (::StandardConversionExists): Implement.
22198
22199         (UserImplicitCast): Re-vamp. We now need info about most specific
22200         source and target types so that we can do the necessary conversions.
22201
22202         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22203         mathematical union with no duplicates.
22204
22205 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22206
22207         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22208         in order from base classes to child classes, so that we can in
22209         child classes look up in our parent for method names and
22210         attributes (required for handling abstract, virtual, new, override
22211         constructs: we need to instrospect our base class, and if we dont
22212         populate the classes in order, the introspection might be
22213         incorrect.  For example, a method could query its parent before
22214         the parent has any methods and would determine that the parent has
22215         no abstract methods (while it could have had them)).
22216
22217         (RootContext::CreateType): Record the order in which we define the
22218         classes.
22219
22220 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22221
22222         * class.cs (TypeContainer::Populate): Also method definitions can
22223         fail now, keep track of this.
22224
22225         (TypeContainer::FindMembers): Implement support for
22226         DeclaredOnly/noDeclaredOnly flag.
22227
22228         (Constructor::Emit) Return the ConstructorBuilder.
22229
22230         (Method::Emit) Return the MethodBuilder. 
22231         Check for abstract or virtual methods to be public.
22232
22233         * rootcontext.cs (RootContext::CreateType): Register all the
22234         abstract methods required for the class to be complete and the
22235         interface methods that must be implemented. 
22236
22237         * cs-parser.jay: Report error 501 (method requires body if it is
22238         not marked abstract or extern).
22239
22240         * expression.cs (TypeOf::Emit): Implement.
22241
22242         * typemanager.cs: runtime_handle_type, new global type.
22243
22244         * class.cs (Property::Emit): Generate code for properties.
22245
22246 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22247
22248         * expression.cs (Unary::ResolveOperator): Find operators on base type
22249         too - we now conform exactly to the spec.
22250
22251         (Binary::ResolveOperator): Same here.
22252
22253         * class.cs (Operator::Define): Fix minor quirk in the tests.
22254
22255         * ../errors/cs0215.cs : Added.
22256
22257         * ../errors/cs0556.cs : Added.
22258
22259         * ../errors/cs0555.cs : Added.
22260
22261 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22264         single integer which is really efficient
22265
22266 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22267
22268         *  expression.cs (Expression::ImplicitUserConversion): Use location
22269         even in the case when we are examining True operators.
22270  
22271         * class.cs (Operator::Define): Perform extensive checks to conform
22272         with the rules for operator overloading in the spec.
22273
22274         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22275         some of the other conversions mentioned in the spec.
22276
22277         * typemanager.cs (array_type): New static member for the System.Array built-in
22278         type.
22279
22280         (cloneable_interface): For System.ICloneable interface.
22281
22282         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22283         we start resolving the tree and populating types.
22284
22285         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22286  
22287 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22288
22289         * expression.cs (Expression::ExprClassFromMemberInfo,
22290         Expression::Literalize): Create literal expressions from
22291         FieldInfos which are literals.
22292
22293         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22294         type casts, because they were wrong.  The test suite in tests
22295         caught these ones.
22296
22297         (ImplicitNumericConversion): ushort to ulong requires a widening
22298         cast. 
22299
22300         Int32 constant to long requires widening cast as well.
22301
22302         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22303         for integers because the type on the stack is not i4.
22304
22305 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22306
22307         * expression.cs (report118): require location argument. 
22308
22309         * parameter.cs: Do not dereference potential null value.
22310
22311         * class.cs: Catch methods that lack the `new' keyword when
22312         overriding a name.  Report warnings when `new' is used without
22313         anything being there to override.
22314
22315         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22316
22317         * class.cs: Only add constructor to hashtable if it is non-null
22318         (as now constructors can fail on define).
22319
22320         (TypeManager, Class, Struct): Take location arguments.
22321
22322         Catch field instance initialization in structs as errors.
22323
22324         accepting_filter: a new filter for FindMembers that is static so
22325         that we dont create an instance per invocation.
22326
22327         (Constructor::Define): Catch errors where a struct constructor is
22328         parameterless 
22329
22330         * cs-parser.jay: Pass location information for various new
22331         constructs. 
22332
22333         * delegate.cs (Delegate): take a location argument.
22334
22335         * driver.cs: Do not call EmitCode if there were problesm in the
22336         Definition of the types, as many Builders wont be there. 
22337
22338         * decl.cs (Decl::Decl): Require a location argument.
22339
22340         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22341         into integers, and find the most appropiate integer for it.
22342
22343         * literal.cs: Implement ULongLiteral.
22344
22345         * rootcontext.cs: Provide better information about the location of
22346         failure when CreateType fails.
22347
22348 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22349
22350         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22351         as well.
22352
22353         * expression.cs (Binary::CheckShiftArguments): Add missing type
22354         computation.
22355         (Binary::ResolveOperator): Add type to the logical and and logical
22356         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22357         before.
22358
22359         (Binary::DoNumericPromotions): In the case where either argument
22360         is ulong (and most signed types combined with ulong cause an
22361         error) perform implicit integer constant conversions as well.
22362
22363 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22364
22365         * expression.cs (UserImplicitCast): Method should always be
22366         non-null. 
22367         (Invocation::BetterConversion): Simplified test for IntLiteral.
22368
22369         (Expression::ImplicitNumericConversion): Split this routine out.
22370         Put the code that performs implicit constant integer conversions
22371         here. 
22372
22373         (Expression::Resolve): Become a wrapper around DoResolve so we can
22374         check eclass and type being set after resolve.
22375
22376         (Invocation::Badness): Remove this dead function
22377
22378         (Binary::ResolveOperator): Do not compute the expensive argumnets
22379         unless we have a union for it.
22380
22381         (Probe::Emit): Is needs to do an isinst and then
22382         compare against null.
22383
22384         (::CanConvert): Added Location argument.  If the Location argument
22385         is null (Location.Null), then we do not report errors.  This is
22386         used by the `probe' mechanism of the Explicit conversion.  We do
22387         not want to generate an error for something that the user
22388         explicitly requested to be casted.  But the pipeline for an
22389         explicit cast first tests for potential implicit casts.
22390
22391         So for now, if the Location is null, it means `Probe only' to
22392         avoid adding another argument.   Might have to revise this
22393         strategy later.
22394
22395         (ClassCast): New class used to type cast objects into arbitrary
22396         classes (used in Explicit Reference Conversions).
22397
22398         Implement `as' as well.
22399
22400         Reverted all the patches from Ravi below: they were broken:
22401
22402                 * The use of `level' as a mechanism to stop recursive
22403                   invocations is wrong.  That was there just to catch the
22404                   bug with a strack trace but not as a way of addressing
22405                   the problem.
22406
22407                   To fix the problem we have to *understand* what is going
22408                   on and the interactions and come up with a plan, not
22409                   just get things going.
22410
22411                 * The use of the type conversion cache that I proposed
22412                   last night had an open topic: How does this work across
22413                   protection domains.  A user defined conversion might not
22414                   be public in the location where we are applying the
22415                   conversion, a different conversion might be selected
22416                   (ie, private A->B (better) but public B->A (worse),
22417                   inside A, A->B applies, but outside it, B->A will
22418                   apply).
22419
22420                 * On top of that (ie, even if the above is solved),
22421                   conversions in a cache need to be abstract.  Ie, `To
22422                   convert from an Int to a Short use an OpcodeCast', not
22423                   `To convert from an Int to a Short use the OpcodeCast on
22424                   the variable 5' (which is what this patch was doing).
22425
22426 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22427
22428         * expression.cs (Invocation::ConversionExists): Re-write to use
22429         the conversion cache
22430
22431         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22432         cache all conversions done, not just user-defined ones.
22433
22434         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22435         to determine if a conversion exists instead of acutually trying to 
22436         perform the conversion. It's faster too.
22437
22438         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22439         and only then attempt the implicit conversion.
22440
22441 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22442
22443         * expression.cs (ConvertImplicit): Use a cache for conversions
22444         already found. Check level of recursion and bail out if necessary.
22445
22446 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22447
22448         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22449         Export standard methods that we expect for string operations.
22450
22451         * statement.cs (Block::UsageWarning): Track usage of variables and
22452         report the errors for not used variables.
22453
22454         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22455         operator. 
22456
22457 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22458
22459         * codegen.cs: remove unnneded code 
22460
22461         * expression.cs: Removed BuiltinTypeAccess class
22462
22463         Fix the order in which implicit conversions are
22464         done.  
22465
22466         The previous fixed dropped support for boxed conversions (adding a
22467         test to the test suite now)
22468
22469         (UserImplicitCast::CanConvert): Remove test for source being null,
22470         that code is broken.  We should not feed a null to begin with, if
22471         we do, then we should track the bug where the problem originates
22472         and not try to cover it up here.
22473
22474         Return a resolved expression of type UserImplicitCast on success
22475         rather than true/false.  Ravi: this is what I was talking about,
22476         the pattern is to use a static method as a "constructor" for
22477         objects. 
22478
22479         Also, do not create arguments until the very last minute,
22480         otherwise we always create the arguments even for lookups that
22481         will never be performed. 
22482
22483         (UserImplicitCast::Resolve): Eliminate, objects of type
22484         UserImplicitCast are born in a fully resolved state. 
22485
22486         * typemanager.cs (InitCoreTypes): Init also value_type
22487         (System.ValueType). 
22488
22489         * expression.cs (Cast::Resolve): First resolve the child expression.
22490
22491         (LValue): Add new method AddressOf to be used by
22492         the `&' operator.  
22493
22494         Change the argument of Store to take an EmitContext instead of an
22495         ILGenerator, because things like FieldExpr need to be able to call
22496         their children expression to generate the instance code. 
22497
22498         (Expression::Error, Expression::Warning): Sugar functions for
22499         reporting errors.
22500
22501         (Expression::MemberLookup): Accept a TypeContainer instead of a
22502         Report as the first argument.
22503
22504         (Expression::ResolvePrimary): Killed.  I still want to improve
22505         this as currently the code is just not right.
22506
22507         (Expression::ResolveMemberAccess): Simplify, but it is still
22508         wrong. 
22509
22510         (Unary::Resolve): Catch errors in AddressOf operators.
22511
22512         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22513         index to a byte for the short-version, or the compiler will choose
22514         the wrong Emit call, which generates the wrong data.
22515
22516         (ParameterReference::Emit, ::Store): same.
22517
22518         (FieldExpr::AddressOf): Implement.
22519
22520         * typemanager.cs: TypeManager: made public variable instead of
22521         property.
22522
22523         * driver.cs: document --fatal.
22524
22525         * report.cs (ErrorMessage, WarningMessage): new names for the old
22526         Error and Warning classes.
22527
22528         * cs-parser.jay (member_access): Turn built-in access to types
22529         into a normal simplename
22530
22531 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22532
22533         * expression.cs (Invocation::BetterConversion): Fix to cope
22534         with q being null, since this was introducing a bug.
22535
22536         * expression.cs (ConvertImplicit): Do built-in conversions first.
22537
22538 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22539
22540         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22541
22542 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22543
22544         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22545         I had introduced long ago (what's new ?).
22546
22547         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22548         the work of all the checking. 
22549         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22550         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22551
22552         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22553         that is the right way. 
22554
22555         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22556         overloading resolution. Use everywhere instead of cutting and pasting code.
22557
22558         (Binary::ResolveOperator): Use MakeUnionSet.
22559
22560         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22561         we have to convert to bool types. Not complete yet.
22562
22563 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22564
22565         * typemanager.cs (TypeManager::CSharpName): support ushort.
22566
22567         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22568         to provide an expression that performsn an implicit constant int
22569         conversion (section 6.1.6).
22570         (Expression::ConvertImplicitRequired): Reworked to include
22571         implicit constant expression conversions.
22572
22573         (Expression::ConvertNumericExplicit): Finished.
22574
22575         (Invocation::Emit): If InstanceExpression is null, then it means
22576         that we perform a call on this.
22577
22578 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22579
22580         * expression.cs (Unary::Emit): Remove some dead code.
22581         (Probe): Implement Resolve and Emit for `is'.
22582         (Expression::ConvertImplicitRequired): Attempt to do constant
22583         expression conversions here.  Maybe should be moved to
22584         ConvertImplicit, but I am not sure.
22585         (Expression::ImplicitLongConstantConversionPossible,
22586         Expression::ImplicitIntConstantConversionPossible): New functions
22587         that tell whether is it possible to apply an implicit constant
22588         expression conversion.
22589
22590         (ConvertNumericExplicit): Started work on explicit numeric
22591         conversions.
22592
22593         * cs-parser.jay: Update operator constants.
22594
22595         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22596         (Parameters::GetSignature): Hook up VerifyArgs here.
22597         (Parameters::VerifyArgs): Verifies that no two arguments have the
22598         same name. 
22599
22600         * class.cs (Operator): Update the operator names to reflect the
22601         ones that the spec expects (as we are just stringizing the
22602         operator names).
22603
22604         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22605         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22606         previous usage did only work for our methods.
22607         (Expression::ConvertImplicit): Handle decimal implicit numeric
22608         conversions as well.
22609         (Expression::InternalTypeConstructor): Used to invoke constructors
22610         on internal types for default promotions.
22611
22612         (Unary::Emit): Implement special handling for the pre/post
22613         increment/decrement for overloaded operators, as they need to have
22614         the same semantics as the other operators.
22615
22616         (Binary::ResolveOperator): ditto.
22617         (Invocation::ConversionExists): ditto.
22618         (UserImplicitCast::Resolve): ditto.
22619
22620 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22621
22622         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22623         operator, return after emitting body. Regression tests pass again !
22624
22625         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22626         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22627         (Invocation::OverloadResolve): Ditto.
22628         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22629
22630         * everywhere : update calls to the above methods accordingly.
22631
22632 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22633
22634         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22635
22636         * expression.cs (ExpressionStatement): New base class used for
22637         expressions that can appear in statements, so that we can provide
22638         an alternate path to generate expression that do not leave a value
22639         on the stack.
22640
22641         (Expression::Emit, and all the derivatives): We no longer return
22642         whether a value is left on the stack or not.  Every expression
22643         after being emitted leaves a single value on the stack.
22644
22645         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22646         facilties of ExpressionStatement if possible.
22647
22648         * cs-parser.jay: Update statement_expression.
22649
22650 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22651
22652         * driver.cs: Change the wording of message
22653
22654 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22655
22656         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22657         the type of the expression to the return type of the method if
22658         we have an overloaded operator match ! The regression tests pass again !
22659         (Unary::ResolveOperator): Ditto.
22660
22661         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22662         to find "op_Implicit", not "implicit" ;-)
22663         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22664         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22665
22666         * everywhere : Correct calls to the above accordingly.
22667
22668         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22669         (ConvertImplicit): Do user-defined conversion if it exists.
22670
22671 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22672
22673         * assign.cs: track location.
22674         (Resolve): Use implicit conversions on assignment.
22675
22676         * literal.cs: Oops.  Not good, Emit of short access values should
22677         pass (Bytes) or the wrong argument will be selected.
22678
22679         * expression.cs (Unary::Emit): Emit code for -expr.
22680
22681         (Unary::ResolveOperator): Handle `Substract' for non-constants
22682         (substract from zero from the non-constants).
22683         Deal with Doubles as well. 
22684
22685         (Expression::ConvertImplicitRequired): New routine that reports an
22686         error if no implicit conversion exists. 
22687
22688         (Invocation::OverloadResolve): Store the converted implicit
22689         expressions if we make them
22690
22691 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22692
22693         * class.cs (ConstructorInitializer): Take a Location argument.
22694         (ConstructorBaseInitializer): Same here.
22695         (ConstructorThisInitializer): Same here.
22696
22697         * cs-parser.jay : Update all calls accordingly.
22698
22699         * expression.cs (Unary, Binary, New): Take location argument.
22700         Update accordingly everywhere.
22701
22702         * cs-parser.jay : Update all calls to the above to take a location
22703         argument.
22704
22705         * class.cs : Ditto.
22706
22707 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22708
22709         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22710         (Invocation::BetterConversion): Same here
22711         (Invocation::ConversionExists): Ditto.
22712
22713         (Invocation::ConversionExists): Implement.
22714
22715 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22716
22717         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22718         Also take an additional TypeContainer argument.
22719
22720         * All over : Pass in TypeContainer as argument to OverloadResolve.
22721
22722         * typemanager.cs (CSharpName): Update to check for the string type and return
22723         that too.
22724
22725         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22726         a given method.
22727
22728 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22729
22730         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22731         (Invocation::BetterFunction): Implement.
22732         (Invocation::BetterConversion): Implement.
22733         (Invocation::ConversionExists): Skeleton, no implementation yet.
22734
22735         Okay, things work fine !
22736
22737 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22738
22739         * typemanager.cs: declare and load enum_type, delegate_type and
22740         void_type. 
22741
22742         * expression.cs (Expression::Emit): Now emit returns a value that
22743         tells whether a value is left on the stack or not.  This strategy
22744         might be reveted tomorrow with a mechanism that would address
22745         multiple assignments.
22746         (Expression::report118): Utility routine to report mismatches on
22747         the ExprClass.
22748
22749         (Unary::Report23): Report impossible type/operator combination
22750         utility function.
22751
22752         (Unary::IsIncrementableNumber): Whether the type can be
22753         incremented or decremented with add.
22754         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22755         complemented. 
22756         (Unary::ResolveOperator): Implement ++, !, ~,
22757
22758         (Invocation::Emit): Deal with new Emit convetion.
22759
22760         * All Expression derivatives: Updated their Emit method to return
22761         whether they leave values on the stack or not.
22762
22763         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22764         stack for expressions that are statements. 
22765
22766 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22767
22768         * expression.cs (LValue): New interface.  Must be implemented by
22769         LValue objects.
22770         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22771         LValue interface.
22772
22773         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22774         interface for generating code, simplifies the code.
22775
22776 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22777
22778         * expression.cs (everywhere): Comment out return statements in ::Resolve
22779         methods to avoid the warnings.
22780
22781 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22782
22783         * driver.cs (parse): Report error 2001 if we can not open the
22784         source file.
22785
22786         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22787         not resolve it.
22788
22789         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22790         object. 
22791
22792         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22793         otherwise nested blocks end up with the same index.
22794
22795         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22796
22797         * expression.cs:  Instead of having FIXMEs in the Resolve
22798         functions, throw exceptions so it is obvious that we are facing a
22799         bug. 
22800
22801         * cs-parser.jay (invocation_expression): Pass Location information.
22802
22803         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22804         Use a basename for those routines because .NET does not like paths
22805         on them. 
22806
22807         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22808         already defined.
22809
22810 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22813         are loading the correct data types (throws an exception if not).
22814         (TypeManager::InitCoreTypes): Use CoreLookupType
22815
22816         * expression.cs (Unary::ResolveOperator): return the child
22817         expression for expressions which are just +expr.
22818         (Unary::ResolveOperator): Return negative literals for -LITERAL
22819         expressions (otherwise they are Unary {Literal}).
22820         (Invocation::Badness): Take into account `Implicit constant
22821         expression conversions'.
22822
22823         * literal.cs (LongLiteral): Implement long literal class.
22824         (IntLiteral): export the `Value' of the intliteral. 
22825
22826 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22827
22828         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22829
22830         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22831         instead of 'Operator'
22832
22833         * expression.cs (Binary::ResolveOperator): Update accordingly.
22834         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22835         and 'Minus'
22836
22837         * cs-parser.jay (unary_expression): Update to use the new names.
22838
22839         * gen-treedump.cs (GetUnary): Same here.
22840
22841         * expression.cs (Unary::Resolve): Implement.
22842         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22843         operators are found instead of making noise ;-)
22844         (Unary::ResolveOperator): New method to do precisely the same thing which
22845         Binary::ResolveOperator does for Binary expressions.
22846         (Unary.method, .Arguments): Add.
22847         (Unary::OperName): Implement.   
22848         (Unary::ForceConversion): Copy and Paste !
22849
22850         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22851         a unary operator.
22852
22853         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22854         for the inbuilt operators. Only overloading works for now ;-)
22855
22856 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22857
22858         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22859         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22860
22861         * expression.cs (This::Emit): Implement. 
22862         (This::Resolve): Implement.
22863         (TypeOf:Resolve): Implement.
22864         (Expression::ResolveSimpleName): Add an implicit this to instance
22865         field references. 
22866         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22867         Bind instance variable to Field expressions.
22868         (FieldExpr::Instance): New field used to track the expression that
22869         represents the object instance.
22870         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22871         binding 
22872         (FieldExpr::Emit): Implement.
22873
22874         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22875         the last instruction contains a return opcode to avoid generating
22876         the last `ret' instruction (this generates correct code, and it is
22877         nice to pass the peverify output).
22878
22879         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22880         initializer for static and instance variables.
22881         (Constructor::Emit): Allow initializer to be null in the case of
22882         static constructors.  Only emit initializer for instance
22883         constructors. 
22884
22885         (TypeContainer::FindMembers): Return a null array if there are no
22886         matches.
22887
22888         Also fix the code for the MemberTypes.Method branch, as it was not
22889         scanning that for operators (or tried to access null variables before).
22890
22891         * assign.cs (Assign::Emit): Handle instance and static fields. 
22892
22893         * TODO: Updated.
22894
22895         * driver.cs: Stop compilation if there are parse errors.
22896
22897         * cs-parser.jay (constructor_declaration): Provide default base
22898         initializer for non-static constructors.
22899         (constructor_declarator): Do not provide a default base
22900         initializers if none was specified.
22901         Catch the fact that constructors should not have parameters.
22902
22903         * class.cs: Do not emit parent class initializers for static
22904         constructors, that should be flagged as an error.
22905
22906 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22907
22908         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22909         Move back code into TypeContainer::Populate.
22910
22911 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22912
22913         * class.cs (TypeContainer::AddConstructor): Fix the check to
22914         compare against Name, not Basename. 
22915         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22916
22917         * cs-parser.jay : Update accordingly.
22918
22919         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22920         for methods, don't forget to look into the operators too.
22921         (RegisterMethodBuilder): Helper method to take care of this for
22922         methods, constructors and operators.
22923         (Operator::Define): Completely revamp.
22924         (Operator.OperatorMethod, MethodName): New fields.
22925         (TypeContainer::Populate): Move the registering of builders into
22926         RegisterMethodBuilder.
22927         (Operator::Emit): Re-write.
22928
22929         * expression.cs (Binary::Emit): Comment out code path to emit method
22930         invocation stuff for the case when we have a user defined operator. I am
22931         just not able to get it right !
22932
22933 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22934
22935         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22936         argument. 
22937
22938         (Expression::MemberLookup): Provide a version that allows to
22939         specify the MemberTypes and BindingFlags. 
22940
22941         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22942         so it was not fetching variable information from outer blocks.
22943
22944         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22945         Beforefieldinit as it was buggy.
22946
22947         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22948         that Ravi put here.  
22949
22950         * class.cs (Constructor::Emit): Only emit if block is not null.
22951         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22952         deal with this by semantically definining it as if the user had
22953         done it.
22954
22955         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22956         constructors as we now "emit" them at a higher level.
22957
22958         (TypeContainer::DefineDefaultConstructor): Used to define the
22959         default constructors if none was provided.
22960
22961         (ConstructorInitializer): Add methods Resolve and Emit. 
22962
22963         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22964
22965 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22966
22967         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22968         the default constructor builder with our hashtable for methodbuilders
22969         to methodcores.
22970
22971         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22972         and argument_count is 0 in which case we have a match.
22973         (Binary::ResolveOperator): More null checking and miscellaneous coding
22974         style cleanup.
22975
22976 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22977
22978         * rootcontext.cs (IsNameSpace): Compare against null.
22979
22980         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22981
22982         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22983         and Unary::Operator.
22984
22985         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22986         accordingly.
22987
22988         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22989         we have overloaded operators.
22990         (Binary::ResolveOperator): Implement the part which does the operator overload
22991         resolution.
22992
22993         * class.cs (Operator::Emit): Implement.
22994         (TypeContainer::Emit): Emit the operators we have too.
22995
22996         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22997         the case when we have a user-defined operator.
22998
22999 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23000
23001         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23002
23003 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23004
23005         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23006         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23007         (Constructor::Emit): Implement.
23008         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23009         if we have no work to do. 
23010         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23011         Emit method.
23012
23013         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23014         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23015
23016         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23017         of parent.parent.
23018
23019 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23020
23021         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23022         in the source.
23023         (Tree::RecordNamespace): Method to do what the name says ;-)
23024         (Tree::Namespaces): Property to get at the namespaces hashtable.
23025
23026         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23027         keep track.
23028
23029         * rootcontext.cs (IsNamespace): Fixed it :-)
23030
23031 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23032
23033         * class.cs (TypeContainer::FindMembers): Add support for
23034         constructors. 
23035         (MethodCore): New class that encapsulates both the shared aspects
23036         of a Constructor and a Method.  
23037         (Method, Constructor): Factored pieces into MethodCore.
23038
23039         * driver.cs: Added --fatal which makes errors throw exceptions.
23040         Load System assembly as well as part of the standard library.
23041
23042         * report.cs: Allow throwing exceptions on errors for debugging.
23043
23044         * modifiers.cs: Do not use `parent', instead use the real type
23045         container to evaluate permission settings.
23046
23047         * class.cs: Put Ravi's patch back in.  He is right, and we will
23048         have to cope with the
23049
23050 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23051
23052         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23053         FamORAssem, not FamANDAssem.
23054
23055 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23056
23057         * driver.cs: Added --parse option that only parses its input files
23058         and terminates.
23059
23060         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23061         incorrect.  IsTopLevel is not used to tell whether an object is
23062         root_types or not (that can be achieved by testing this ==
23063         root_types).  But to see if this is a top-level *class* (not
23064         necessarly our "toplevel" container). 
23065
23066 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23067
23068         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23069         parent instead of a direct call to GetType.
23070
23071 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23072
23073         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23074         Modifiers.TypeAttr. This should just be a call to that method.
23075
23076         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23077         object so that we can determine if we are top-level or not.
23078
23079         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23080         TypeContainer too.
23081
23082         * enum.cs (Enum::Define): Ditto.
23083
23084         * modifiers.cs (FieldAttr): Re-write.
23085
23086         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23087         (TypeContainer::HaveStaticConstructor): New property to provide access
23088         to precisely that info.
23089
23090         * modifiers.cs (MethodAttr): Re-write.
23091         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23092
23093         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23094         of top-level types as claimed.
23095
23096 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23097
23098         * expression.cs (MemberLookup): Fruitless attempt to lookup
23099         constructors.  Maybe I need to emit default constructors?  That
23100         might be it (currently .NET emits this for me automatically).
23101         (Invocation::OverloadResolve): Cope with Arguments == null.
23102         (Invocation::EmitArguments): new function, shared by the new
23103         constructor and us.
23104         (Invocation::Emit): Handle static and instance methods.  Emit
23105         proper call instruction for virtual or non-virtual invocations.
23106         (New::Emit): Implement.
23107         (New::Resolve): Implement.
23108         (MemberAccess:Resolve): Implement.
23109         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23110         to track instances.
23111         (FieldExpr::Resolve): Set type.
23112
23113         * support.cs: Handle empty arguments.
23114                 
23115         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23116         SimpleLookup): Auxiliary routines to help parse a qualifier
23117         identifier.  
23118
23119         Update qualifier_identifier rule.
23120
23121         * codegen.cs: Removed debugging messages.
23122
23123         * class.cs: Make this a global thing, this acts just as a "key" to
23124         objects that we might have around.
23125
23126         (Populate): Only initialize method_builders_to_methods once.
23127
23128         * expression.cs (PropertyExpr): Initialize type from the
23129         PropertyType. 
23130
23131         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23132         Resolve pattern.  Attempt to implicitly convert value to boolean.
23133         Emit code.
23134
23135         * expression.cs: Set the type for the int32/int32 argument case.
23136         (Binary::ResolveOperator): Set the return type to boolean for
23137         comparission operators
23138
23139         * typemanager.cs: Remove debugging print code.
23140
23141         (Invocation::Resolve): resolve type.
23142
23143         * class.cs: Allocate a MemberInfo of the correct size, as the code
23144         elsewhere depends on the test to reflect the correct contents.
23145
23146         (Method::) Keep track of parameters, due to System.Reflection holes
23147
23148         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23149         mapping here.
23150
23151         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23152         of the exact size and return that.
23153
23154         (Class::LookupMethodByBuilder): New function that maps
23155         MethodBuilders to its methods.  Required to locate the information
23156         on methods because System.Reflection bit us again.
23157
23158         * support.cs: New file, contains an interface ParameterData and
23159         two implementations: ReflectionParameters and InternalParameters
23160         used to access Parameter information.  We will need to grow this
23161         as required.
23162
23163         * expression.cs (Invocation::GetParameterData): implement a cache
23164         and a wrapper around the ParameterData creation for methods. 
23165         (Invocation::OverloadResolve): Use new code.
23166
23167 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23168
23169         * class.cs (TypeContainer::EmitField): Remove and move into 
23170         (Field::Define): here and modify accordingly.
23171         (Field.FieldBuilder): New member.
23172         (TypeContainer::Populate): Update accordingly.
23173         (TypeContainer::FindMembers): Implement.
23174
23175 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23176
23177         * statement.cs: (VariableInfo::VariableType): New field to be
23178         initialized with the full type once it is resolved. 
23179
23180 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * parameter.cs (GetParameterInfo): Use a type cache to compute
23183         things only once, and to reuse this information
23184
23185         * expression.cs (LocalVariableReference::Emit): Implement.
23186         (OpcodeCast::Emit): fix.
23187
23188         (ParameterReference::Resolve): Implement.
23189         (ParameterReference::Emit): Implement.
23190
23191         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23192         that are expressions need to stay as Expressions.
23193
23194         * typemanager.cs (CSharpName): Returns the C# name of a type if
23195         possible. 
23196
23197         * expression.cs (Expression::ConvertImplicit): New function that
23198         implements implicit type conversions.
23199
23200         (Expression::ImplicitReferenceConversion): Implements implicit
23201         reference conversions.
23202
23203         (EmptyCast): New type for transparent casts.
23204
23205         (OpcodeCast): New type for casts of types that are performed with
23206         a sequence of bytecodes.
23207
23208         (BoxedCast): New type used for casting value types into reference
23209         types.  Emits a box opcode.
23210
23211         (Binary::DoNumericPromotions): Implements numeric promotions of
23212         and computation of the Binary::Type.
23213
23214         (Binary::EmitBranchable): Optimization.
23215
23216         (Binary::Emit): Implement code emission for expressions.
23217
23218         * typemanager.cs (TypeManager): Added two new core types: sbyte
23219         and byte.
23220
23221 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23222
23223         * class.cs (TypeContainer::FindMembers): Method which does exactly
23224         what Type.FindMembers does, only we don't have to use reflection. No
23225         implementation yet.
23226
23227         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23228         typecontainer objects as we need to get at them.
23229         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23230
23231         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23232         typecontainer object.
23233
23234         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23235         of just a Report object.
23236
23237 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23238
23239         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23240         "remove_"
23241         (TypeContainer::Populate): Now define the delegates of the type too.
23242         (TypeContainer.Delegates): Property to access the list of delegates defined
23243         in the type.
23244
23245         * delegates.cs (Delegate::Define): Implement partially.
23246
23247         * modifiers.cs (TypeAttr): Handle more flags.
23248
23249 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23250
23251         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23252         and not <=
23253         (Operator::Define): Re-write logic to get types by using the LookupType method
23254         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23255         (Indexer::Define): Ditto.
23256         (Event::Define): Ditto.
23257         (Property::Define): Ditto.
23258
23259 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23260
23261         * class.cs (TypeContainer::Populate): Now define operators too. 
23262         (TypeContainer.Operators): New property to access the list of operators
23263         in a type.
23264         (Operator.OperatorMethodBuilder): New member to hold the method builder
23265         for the operator we are defining.
23266         (Operator::Define): Implement.
23267
23268 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23269
23270         * class.cs (Event::Define): Make the prefixes of the accessor methods
23271         addOn_ and removeOn_ 
23272
23273         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23274         of the location being passed in too. Ideally, this should go later since all
23275         error reporting should be done through the Report object.
23276
23277         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23278         (Populate): Iterate thru the indexers we have and define them too.
23279         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23280         for the get and set accessors.
23281         (Indexer::Define): Implement.
23282
23283 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23284
23285         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23286         my previous implementation, did not work.
23287
23288         * typemanager.cs: Add a couple of missing types (the longs).
23289
23290         * literal.cs: Use TypeManager.bool_type instead of getting it.
23291
23292         * expression.cs (EventExpr): New kind of expressions.
23293         (Expressio::ExprClassFromMemberInfo): finish
23294
23295 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23296
23297         * assign.cs: Emit stores to static fields differently.
23298
23299 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23300
23301         * Merge in changes and adjust code to tackle conflicts. Backed out my
23302         code in Assign::Resolve ;-) 
23303
23304 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23305
23306         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23307         instead Report.Error and also pass in the location.
23308         (CSharpParser::Lexer): New readonly property to return the reference
23309         to the Tokenizer object.
23310         (declare_local_variables): Use Report.Error with location instead of plain 
23311         old error.
23312         (CheckDef): Ditto.
23313
23314         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23315         (Operator.CheckBinaryOperator): Ditto.
23316
23317         * cs-parser.jay (operator_declarator): Update accordingly.
23318
23319         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23320         (CheckBinaryOperator): Same here.
23321
23322         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23323         on the name without any prefixes of namespace names etc. This is because we
23324         already might have something already fully qualified like 
23325         'System.Console.WriteLine'
23326
23327         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23328
23329 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23330
23331         * cs-tokenizer.cs (location): Return a string which also contains
23332         the file name.
23333
23334         * expression.cs (ElementAccess): New class for expressions of the
23335         type 'element access.'
23336         (BaseAccess): New class for expressions of the type 'base access.'
23337         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23338         respectively.
23339
23340         * cs-parser.jay (element_access): Implement action.
23341         (base_access): Implement actions.
23342         (checked_expression, unchecked_expression): Implement.
23343
23344         * cs-parser.jay (local_variable_type): Correct and implement.
23345         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23346
23347         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23348
23349         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23350         name and the specifiers.
23351
23352         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23353
23354         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23355         making them all public ;-)
23356
23357         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23358         class anyways.
23359
23360 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23361
23362         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23363         PropertyExprs.
23364         (FieldExpr, PropertyExprs): New resolved expressions.
23365         (SimpleName::MemberStaticCheck): Perform static checks for access
23366         to non-static fields on static methods. Maybe this should be
23367         generalized for MemberAccesses. 
23368         (SimpleName::ResolveSimpleName): More work on simple name
23369         resolution. 
23370
23371         * cs-parser.jay (primary_expression/qualified_identifier): track
23372         the parameter index.
23373
23374         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23375         (EmitContext::EmitBoolExpression): Chain to expression generation
23376         instead of temporary hack.
23377         (::EmitStatementExpression): Put generic expression code generation.
23378
23379         * assign.cs (Assign::Emit): Implement variable assignments to
23380         local variables, parameters and fields.
23381
23382 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23383
23384         * statement.cs (Block::GetVariableInfo): New method, returns the
23385         VariableInfo for a variable name in a block.
23386         (Block::GetVariableType): Implement in terms of GetVariableInfo
23387
23388         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23389         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23390
23391 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23392
23393         * cs-parser.jay (operator_declaration): Continue on my quest : update
23394         to take attributes argument.
23395         (event_declaration): Ditto.
23396         (enum_declaration): Ditto.
23397         (indexer_declaration): Ditto.
23398
23399         * class.cs (Operator::Operator): Update constructor accordingly.
23400         (Event::Event): Ditto.
23401
23402         * delegate.cs (Delegate::Delegate): Same here.
23403
23404         * enum.cs (Enum::Enum): Same here.
23405
23406 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23407
23408         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23409
23410         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23411
23412         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23413         being passed around as an arraylist.
23414         (Attributes::AddAttribute): Method to add attribute sections.
23415
23416         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23417         (struct_declaration): Update accordingly.
23418         (constant_declaration): Update.
23419         (field_declaration): Update.
23420         (method_header): Update.
23421         (fixed_parameter): Update.
23422         (parameter_array): Ditto.
23423         (property_declaration): Ditto.
23424         (destructor_declaration): Ditto.
23425
23426         * class.cs (Struct::Struct): Update constructors accordingly.
23427         (Class::Class): Ditto.
23428         (Field::Field): Ditto.
23429         (Method::Method): Ditto.
23430         (Property::Property): Ditto.
23431         (TypeContainer::OptAttribute): update property's return type.
23432
23433         * interface.cs (Interface.opt_attributes): New member.
23434         (Interface::Interface): Update to take the extra Attributes argument.
23435
23436         * parameter.cs (Parameter::Parameter): Ditto.
23437
23438         * constant.cs (Constant::Constant): Ditto.
23439
23440         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23441         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23442         the attributes as a parameter.
23443         (InterfaceProperty): Update constructor call.
23444         (InterfaceEvent): Ditto.
23445         (InterfaceMethod): Ditto.
23446         (InterfaceIndexer): Ditto.
23447
23448         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23449         pass the attributes too.
23450         (interface_event_declaration): Ditto.
23451         (interface_property_declaration): Ditto.
23452         (interface_method_declaration): Ditto.
23453         (interface_declaration): Ditto.
23454
23455 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23456
23457         * class.cs (Method::Define): Track the "static Main" definition to
23458         create an entry point. 
23459
23460         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23461         EntryPoint if we find it. 
23462
23463         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23464         (EmitContext::ig): Make this variable public.
23465
23466         * driver.cs: Make the default output file be the first file name
23467         with the .exe extension.  
23468
23469         Detect empty compilations
23470
23471         Handle various kinds of output targets.  Handle --target and
23472         rename -t to --dumper.
23473
23474         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23475         methods inherited from Expression return now an Expression.  This
23476         will is used during the tree rewriting as we resolve them during
23477         semantic analysis.
23478
23479         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23480         the spec.  Missing entirely is the information about
23481         accessability of elements of it.
23482
23483         (Expression::ExprClassFromMemberInfo): New constructor for
23484         Expressions that creates a fully initialized Expression based on
23485         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23486         a Type.
23487
23488         (Invocation::Resolve): Begin implementing resolution of invocations.
23489
23490         * literal.cs (StringLiteral):  Implement Emit.
23491
23492 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23493
23494         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23495         member.
23496
23497 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23498
23499         * cs-parser.jay (attribute_arguments): Implement actions.
23500         (attribute): Fix bug in production. Implement action.
23501         (attribute_list): Implement.
23502         (attribute_target): Implement.
23503         (attribute_target_specifier, opt_target_specifier): Implement
23504         (CheckAttributeTarget): New method to check if the attribute target
23505         is valid.
23506         (attribute_section): Implement.
23507         (opt_attributes): Implement.
23508
23509         * attribute.cs : New file to handle attributes.
23510         (Attribute): Class to hold attribute info.
23511
23512         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23513         (attribute_section): Modify production to use 2 different rules to 
23514         achieve the same thing. 1 s/r conflict down !
23515         Clean out commented, useless, non-reducing dimension_separator rules.
23516
23517         * class.cs (TypeContainer.attributes): New member to hold list
23518         of attributes for a type.
23519         (Struct::Struct): Modify to take one more argument, the attribute list.
23520         (Class::Class): Ditto.
23521         (Field::Field): Ditto.
23522         (Method::Method): Ditto.
23523         (Property::Property): Ditto.
23524
23525         * cs-parser.jay (struct_declaration): Update constructor call to
23526         pass in the attributes too.
23527         (class_declaration): Ditto.
23528         (constant_declaration): Ditto.
23529         (field_declaration): Ditto.
23530         (method_header): Ditto.
23531         (fixed_parameter): Ditto.
23532         (parameter_array): Ditto.
23533         (property_declaration): Ditto.
23534
23535         * constant.cs (Constant::Constant): Update constructor similarly.
23536         Use System.Collections.
23537
23538         * parameter.cs (Parameter::Parameter): Update as above.
23539
23540 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23541
23542         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23543         (TypeContainer.delegates): New member to hold list of delegates.
23544
23545         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23546         this time as I seem to be on crack ;-)
23547
23548 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23549
23550         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23551         tell whether an identifier represents a namespace.
23552
23553         * expression.cs (NamespaceExpr): A namespace expression, used only
23554         temporarly during expression resolution.
23555         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23556         utility functions to resolve names on expressions.
23557
23558 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23559
23560         * codegen.cs: Add hook for StatementExpressions. 
23561
23562         * class.cs: Fix inverted test for static flag in methods.
23563
23564 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23565
23566         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23567         to make it coincide with MS' number.
23568         (Operator::CheckBinaryOperator): Ditto.
23569
23570         * ../errors/errors.txt : Remove error numbers added earlier.
23571
23572         * ../errors/cs1019.cs : Test case for error # 1019
23573
23574         * ../errros/cs1020.cs : Test case for error # 1020
23575
23576         * cs-parser.jay : Clean out commented cruft.
23577         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23578         used anywhere - non-reducing rule.
23579         (namespace_declarations): Non-reducing rule - comment out.
23580
23581         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23582         with TypeContainer::AddEnum.
23583
23584         * delegate.cs : New file for delegate handling classes.
23585         (Delegate): Class for declaring delegates.
23586
23587         * makefile : Update.
23588
23589         * cs-parser.jay (delegate_declaration): Implement.
23590
23591 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23592
23593         * class.cs (Event::Define): Implement.
23594         (Event.EventBuilder): New member.
23595
23596         * class.cs (TypeContainer::Populate): Update to define all enums and events
23597         we have.
23598         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23599         readonly fields for all these cases ?
23600
23601 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23602
23603         * class.cs (Property): Revamp to use the convention of making fields readonly.
23604         Accordingly modify code elsewhere.
23605
23606         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23607         the Define method of the Property class.
23608
23609         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23610         trivial bug.
23611         (TypeContainer::Populate): Update to define all the properties we have. Also
23612         define all enumerations.
23613
23614         * enum.cs (Define): Implement.
23615
23616 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23617
23618         * cs-parser.jay (overloadable_operator): The semantic value is an
23619         enum of the Operator class.
23620         (operator_declarator): Implement actions.
23621         (operator_declaration): Implement.
23622
23623         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23624         validity of definitions.
23625         (Operator::CheckBinaryOperator): Static method to check for binary operators
23626         (TypeContainer::AddOperator): New method to add an operator to a type.
23627
23628         * cs-parser.jay (indexer_declaration): Added line to actually call the
23629         AddIndexer method so it gets added ;-)
23630
23631         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23632         already taken care of by the MS compiler ?  
23633
23634 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23635
23636         * class.cs (Operator): New class for operator declarations.
23637         (Operator::OpType): Enum for the various operators.
23638
23639 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23640
23641         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23642         ostensibly handle this in semantic analysis.
23643
23644         * cs-parser.jay (general_catch_clause): Comment out
23645         (specific_catch_clauses, specific_catch_clause): Ditto.
23646         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23647         (catch_args, opt_catch_args): New productions.
23648         (catch_clause): Rewrite to use the new productions above
23649         (catch_clauses): Modify accordingly.
23650         (opt_catch_clauses): New production to use in try_statement
23651         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23652         and re-write the code in the actions to extract the specific and
23653         general catch clauses by being a little smart ;-)
23654
23655         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23656         Hooray, try and catch statements parse fine !
23657
23658 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23659
23660         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23661         string from the hashtable of variables.
23662
23663         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23664         I end up making that mistake ;-)
23665         (catch_clauses): Fixed gross error which made Key and Value of the 
23666         DictionaryEntry the same : $1 !!
23667
23668 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23669
23670         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23671
23672         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23673         when the add and remove accessors are specified. 
23674
23675 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23676
23677         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23678         information about indexer_declarator.
23679         (indexer_declarator): Implement actions.
23680         (parsing_indexer): New local boolean used to keep track of whether
23681         we are parsing indexers or properties. This is necessary because 
23682         implicit_parameters come into picture even for the get accessor in the 
23683         case of an indexer.
23684         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23685
23686         * class.cs (Indexer): New class for indexer declarations.
23687         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23688         (TypeContainer::indexers): New member to hold list of indexers for the
23689         type.
23690
23691 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23692
23693         * cs-parser.jay (add_accessor_declaration): Implement action.
23694         (remove_accessor_declaration): Implement action.
23695         (event_accessors_declaration): Implement
23696         (variable_declarators): swap statements for first rule - trivial.
23697
23698         * class.cs (Event): New class to hold information about event
23699         declarations.
23700         (TypeContainer::AddEvent): New method to add an event to a type
23701         (TypeContainer::events): New member to hold list of events.
23702
23703         * cs-parser.jay (event_declaration): Implement actions.
23704
23705 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23706
23707         * cs-parser.jay (dim_separators): Implement. Make it a string
23708         concatenating all the commas together, just as they appear.
23709         (opt_dim_separators): Modify accordingly
23710         (rank_specifiers): Update accordingly. Basically do the same
23711         thing - instead, collect the brackets here.
23712         (opt_rank_sepcifiers): Modify accordingly.
23713         (array_type): Modify to actually return the complete type string
23714         instead of ignoring the rank_specifiers.
23715         (expression_list): Implement to collect the expressions
23716         (variable_initializer): Implement. We make it a list of expressions
23717         essentially so that we can handle the array_initializer case neatly too.
23718         (variable_initializer_list): Implement.
23719         (array_initializer): Make it a list of variable_initializers
23720         (opt_array_initializer): Modify accordingly.
23721
23722         * expression.cs (New::NType): Add enumeration to help us
23723         keep track of whether we have an object/delegate creation
23724         or an array creation.
23725         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23726         members to hold data about array creation.
23727         (New:New): Modify to update NewType
23728         (New:New): New Overloaded contructor for the array creation
23729         case.
23730
23731         * cs-parser.jay (array_creation_expression): Implement to call
23732         the overloaded New constructor.
23733
23734 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23735
23736         * class.cs (TypeContainer::Constructors): Return member
23737         constructors instead of returning null.
23738
23739 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23740
23741         * typemanager.cs (InitCoreTypes): Initialize the various core
23742         types after we have populated the type manager with the user
23743         defined types (this distinction will be important later while
23744         compiling corlib.dll)
23745
23746         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23747         on Expression Classification.  Now all expressions have a method
23748         `Resolve' and a method `Emit'.
23749
23750         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23751         generation from working.     Also add some temporary debugging
23752         code. 
23753
23754 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23755
23756         * codegen.cs: Lots of code generation pieces.  This is only the
23757         beginning, will continue tomorrow with more touches of polish.  We
23758         handle the fundamentals of if, while, do, for, return.  Others are
23759         trickier and I need to start working on invocations soon.
23760
23761         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23762         s.InitStatement. 
23763
23764         * codegen.cs (EmitContext): New struct, used during code
23765         emission to keep a context.   Most of the code generation will be
23766         here. 
23767
23768         * cs-parser.jay: Add embedded blocks to the list of statements of
23769         this block.  So code generation proceeds in a top down fashion.
23770
23771 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23772
23773         * statement.cs: Add support for multiple child blocks.
23774
23775 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23776
23777         * codegen.cs (EmitCode): New function, will emit the code for a
23778         Block of code given a TypeContainer and its ILGenerator. 
23779
23780         * statement.cs (Block): Standard public readonly optimization.
23781         (Block::Block constructors): Link children. 
23782         (Block::Child): Child Linker.
23783         (Block::EmitVariables): Emits IL variable declarations.
23784
23785         * class.cs: Drop support for MethodGroups here, delay until
23786         Semantic Analysis.
23787         (Method::): Applied the same simplification that I did before, and
23788         move from Properties to public readonly fields.
23789         (Method::ParameterTypes): Returns the parameter types for the
23790         function, and implements a cache that will be useful later when I
23791         do error checking and the semantic analysis on the methods is
23792         performed.
23793         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23794         and made a method, optional argument tells whether this is a class
23795         or a structure to apply the `has-this' bit.
23796         (Method::GetCallingConvention): Implement, returns the calling
23797         convention. 
23798         (Method::Define): Defines the type, a second pass is performed
23799         later to populate the methods.
23800
23801         (Constructor::ParameterTypes): implement a cache similar to the
23802         one on Method::ParameterTypes, useful later when we do semantic
23803         analysis. 
23804
23805         (TypeContainer::EmitMethod):  New method.  Emits methods.
23806
23807         * expression.cs: Removed MethodGroup class from here.
23808
23809         * parameter.cs (Parameters::GetCallingConvention): new method.
23810
23811 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23812
23813         * class.cs (TypeContainer::Populate): Drop RootContext from the
23814         argument. 
23815
23816         (Constructor::CallingConvention): Returns the calling convention.
23817         (Constructor::ParameterTypes): Returns the constructor parameter
23818         types. 
23819
23820         (TypeContainer::AddConstructor): Keep track of default constructor
23821         and the default static constructor.
23822
23823         (Constructor::) Another class that starts using `public readonly'
23824         instead of properties. 
23825
23826         (Constructor::IsDefault): Whether this is a default constructor. 
23827
23828         (Field::) use readonly public fields instead of properties also.
23829
23830         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23831         track of static constructors;  If none is used, turn on
23832         BeforeFieldInit in the TypeAttributes. 
23833
23834         * cs-parser.jay (opt_argument_list): now the return can be null
23835         for the cases where there are no arguments. 
23836
23837         (constructor_declarator): If there is no implicit `base' or
23838         `this', then invoke the default parent constructor. 
23839
23840         * modifiers.cs (MethodAttr): New static function maps a set of
23841         modifiers flags into a MethodAttributes enum
23842         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23843         MethodAttr, TypeAttr to represent the various mappings where the
23844         modifiers are used.
23845         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23846
23847 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23848
23849         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23850         method arguments.
23851
23852         * interface.cs (PopulateIndexer): Implemented the code generator
23853         for interface indexers.
23854
23855 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23856
23857         * interface.cs (InterfaceMemberBase): Now we track the new status
23858         here.  
23859
23860         (PopulateProperty): Implement property population.  Woohoo!  Got
23861         Methods and Properties going today. 
23862
23863         Removed all the properties for interfaces, and replaced them with
23864         `public readonly' fields. 
23865
23866 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23867
23868         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23869         initialize their hashtables/arraylists only when they are needed
23870         instead of doing this always.
23871
23872         * parameter.cs: Handle refs and out parameters.
23873
23874         * cs-parser.jay: Use an ArrayList to construct the arguments
23875         instead of the ParameterCollection, and then cast that to a
23876         Parameter[] array.
23877
23878         * parameter.cs: Drop the use of ParameterCollection and use
23879         instead arrays of Parameters.
23880
23881         (GetParameterInfo): Use the Type, not the Name when resolving
23882         types. 
23883
23884 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23885
23886         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23887         and instead use public readonly fields.
23888
23889         * class.cs: Put back walking code for type containers.
23890
23891 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23892
23893         * class.cs (MakeConstant): Code to define constants.
23894
23895         * rootcontext.cs (LookupType): New function.  Used to locate types 
23896
23897
23898 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23899
23900         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23901         this System.Reflection code is.  Kudos to Microsoft
23902
23903         * typemanager.cs: Implement a type cache and avoid loading all
23904         types at boot time.  Wrap in LookupType the internals.  This made
23905         the compiler so much faster.  Wow.  I rule!
23906
23907         * driver.cs: Make sure we always load mscorlib first (for
23908         debugging purposes, nothing really important).
23909
23910         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23911         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23912
23913         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23914         on namespaces that have been imported using the `using' keyword.
23915
23916         * class.cs (TypeContainer::TypeAttr): Virtualize.
23917         (Class::TypeAttr): Return attributes suitable for this bad boy.
23918         (Struct::TypeAttr): ditto.
23919         Handle nested classes.
23920         (TypeContainer::) Remove all the type visiting code, it is now
23921         replaced with the rootcontext.cs code
23922
23923         * rootcontext.cs (GetClassBases): Added support for structs. 
23924
23925 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23926
23927         * interface.cs, statement.cs, class.cs, parameter.cs,
23928         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23929         Drop use of TypeRefs, and use strings instead.
23930
23931 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23932
23933         * rootcontext.cs: 
23934
23935         * class.cs (Struct::Struct): set the SEALED flags after
23936         checking the modifiers.
23937         (TypeContainer::TypeAttr): new property, returns the
23938         TypeAttributes for a class.  
23939
23940         * cs-parser.jay (type_list): Oops, list production was creating a
23941         new list of base types.
23942
23943         * rootcontext.cs (StdLib): New property.
23944         (GetInterfaceTypeByName): returns an interface by type name, and
23945         encapsulates error handling here.
23946         (GetInterfaces): simplified.
23947         (ResolveTree): Encapsulated all the tree resolution here.
23948         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23949         types. 
23950
23951         * driver.cs: Add support for --nostdlib, to avoid loading the
23952         default assemblies.
23953         (Main): Do not put tree resolution here. 
23954
23955         * rootcontext.cs: Beginning of the class resolution.
23956
23957 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23958
23959         * rootcontext.cs: Provide better error reporting. 
23960
23961         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23962
23963         * rootcontext.cs (CreateInterface): Handle the case where there
23964         are no parent interfaces.
23965
23966         (CloseTypes): Routine to flush types at the end.
23967         (CreateInterface): Track types.
23968         (GetInterfaces): Returns an array of Types from the list of
23969         defined interfaces.
23970
23971         * typemanager.c (AddUserType): Mechanism to track user types (puts
23972         the type on the global type hash, and allows us to close it at the
23973         end). 
23974
23975 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23976
23977         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23978         RecordInterface instead.
23979
23980         * cs-parser.jay: Updated to reflect changes above.
23981
23982         * decl.cs (Definition): Keep track of the TypeBuilder type that
23983         represents this type here.  Not sure we will use it in the long
23984         run, but wont hurt for now.
23985
23986         * driver.cs: Smaller changes to accomodate the new code.
23987
23988         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23989         when done. 
23990
23991         * rootcontext.cs (CreateInterface):  New method, used to create
23992         the System.TypeBuilder type for interfaces.
23993         (ResolveInterfaces): new entry point to resolve the interface
23994         hierarchy. 
23995         (CodeGen): Property, used to keep track of the code generator.
23996
23997 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23998
23999         * cs-parser.jay: Add a second production for delegate_declaration
24000         with `VOID'.
24001
24002         (enum_body): Put an opt_comma here instead of putting it on
24003         enum_body or enum_member_declarations so we can handle trailing
24004         commas on enumeration members.  Gets rid of a shift/reduce.
24005
24006         (type_list): Need a COMMA in the middle.
24007
24008         (indexer_declaration): Tell tokenizer to recognize get/set
24009
24010         * Remove old targets.
24011
24012         * Re-add the parser target.
24013
24014 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24015
24016         * cs-parser.jay: Add precendence rules for a number of operators
24017         ot reduce the number of shift/reduce conflicts in the grammar.
24018
24019 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24020
24021         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24022         and put it here.
24023
24024         Get rid of old crufty code.
24025
24026         * rootcontext.cs: Use this to keep track of the parsed
24027         representation and the defined types available to the program. 
24028
24029         * gen-treedump.cs: adjust for new convention.
24030
24031         * type.cs: Split out the type manager, and the assembly builder
24032         from here. 
24033
24034         * typemanager.cs: the type manager will live here now.
24035
24036         * cil-codegen.cs: And the code generator here. 
24037
24038 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24039
24040         * makefile: Fixed up for easy making.
24041
24042 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24043
24044         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24045         the 
24046
24047         (unary_expression): Expand pre_increment_expression and
24048         post_decrement_expression to reduce a shift/reduce.
24049
24050 2001-07-11  Simon Cozens
24051
24052         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24053
24054         Improve allow_keyword_as_indent name.
24055
24056 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24057
24058         * Adjustments for Beta2. 
24059
24060 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24061
24062         * decl.cs: Added `Define' abstract method.
24063         (InTransit): new property, used to catch recursive definitions. 
24064
24065         * interface.cs: Implement `Define'. 
24066
24067         * modifiers.cs: Map Modifiers.constants to
24068         System.Reflection.TypeAttribute flags.
24069
24070         * class.cs: Keep track of types and user-defined types.
24071         (BuilderInit): New method for creating an assembly
24072         (ResolveType): New function to launch the resolution process, only
24073         used by interfaces for now.
24074
24075         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24076         that are inserted into the name space. 
24077
24078 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24079
24080         * ARGH.  I have screwed up my tree so many times due to the use of
24081         rsync rather than using CVS.  Going to fix this at once. 
24082
24083         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24084         load types.
24085
24086 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24087
24088         * Experiment successful: Use System.Type rather that our own
24089         version of Type.  
24090
24091 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24092
24093         * cs-parser.jay: Removed nsAliases from here.
24094
24095         Use new namespaces, handle `using XXX;' 
24096
24097         * namespace.cs: Reimplemented namespace handling, use a recursive
24098         definition of the class.  Now we can keep track of using clauses
24099         and catch invalid using clauses.
24100
24101 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * gen-treedump.cs: Adapted for all the renaming.
24104
24105         * expression.cs (Expression): this class now has a Type property
24106         which returns an expression Type.
24107
24108         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24109         `Type', as this has a different meaning now in the base
24110
24111 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24112
24113         * interface.cs, class.cs: Removed from all the sources the
24114         references to signature computation, as we can not do method
24115         signature computation during the parsing time, as we are not
24116         trying to solve at that point distinguishing:
24117
24118         class X {
24119                 void a (Blah x) {}
24120                 void a (NS.Blah x) {}
24121         }
24122
24123         Which depending on the context might be valid or not, as we do not
24124         know if Blah is the same thing as NS.Blah at that point.
24125
24126         * Redid everything so the code uses TypeRefs now instead of
24127         Types.  TypeRefs are just temporary type placeholders, that need
24128         to be resolved.  They initially have a pointer to a string and the
24129         current scope in which they are used.  This is used later by the
24130         compiler to resolve the reference to an actual Type. 
24131
24132         * DeclSpace is no longer a CIR.Type, and neither are
24133         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24134         are all DeclSpaces, but no Types. 
24135
24136         * type.cs (TypeRefManager): This implements the TypeRef manager,
24137         which keeps track of all the types that need to be resolved after
24138         the parsing has finished. 
24139
24140 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24141
24142         * ARGH.  We are going to have to store `foreach' as a class rather
24143         than resolving it, as we need to verify error 1579 after name
24144         resolution.   *OR* we could keep a flag that says `This request to
24145         IEnumerator comes from a foreach statement' which we can then use
24146         to generate the error.
24147
24148 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24149
24150         * class.cs (TypeContainer.AddMethod): we now add methods to the
24151         MethodGroup instead of the method hashtable.  
24152
24153         * expression.cs: Add MethodGroup abstraction, which gets us one
24154         step closer to the specification in the way we handle method
24155         declarations.  
24156
24157         * cs-parser.jay (primary_expression): qualified_identifier now
24158         tried to match up an identifier to a local variable reference or
24159         to a parameter reference.
24160
24161         current_local_parameters is now a parser global variable that
24162         points to the current parameters for the block, used during name
24163         lookup.
24164
24165         (property_declaration): Now creates an implicit `value' argument to
24166         the set accessor.
24167
24168 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24169
24170         * parameter.cs: Do not use `param' arguments as part of the
24171         signature, per the spec.
24172
24173 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24174
24175         * decl.cs: Base class for classes, structs and interfaces.  This
24176         is the "Declaration Space" 
24177
24178         * cs-parser.jay: Use CheckDef for checking declaration errors
24179         instead of having one on each function.
24180
24181         * class.cs: Factor out some code for handling error handling in
24182         accordance to the "Declarations" section in the "Basic Concepts"
24183         chapter in the ECMA C# spec.
24184
24185         * interface.cs: Make all interface member classes derive from
24186         InterfaceMemberBase.
24187
24188 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24189
24190         * Many things: all interfaces are parsed and generated in
24191         gen-treedump.  Support for member variables, constructors,
24192         destructors, properties, constants is there.
24193
24194         Beginning of the IL backend, but very little done, just there for
24195         testing purposes. 
24196
24197 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24198
24199         * cs-parser.jay: Fix labeled statement.
24200
24201         * cs-tokenizer.cs (escape): Escape " and ' always.
24202         ref_line, ref_name: keep track of the line/filename as instructed
24203         by #line by the compiler.
24204         Parse #line.
24205
24206 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24207
24208         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24209         to match the values in System.CodeDOM.
24210
24211         Divid renamed to Divide.
24212
24213         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24214         statements. 
24215         (Statements.set): remove.
24216
24217         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24218         statements. 
24219
24220         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24221         falseStatements always have valid values. 
24222
24223         * cs-parser.jay: Use System.CodeDOM now.
24224