2007-02-26 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2
3         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4
5 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6
7         A fix for bug #80650
8         * cs-parser.jay: Anonymous container starts at constructor declaration
9         and not at block beginning because it has to be usable in constructor
10         initializer.
11
12 2007-02-18  Marek Safar  <marek.safar@gmail.com>
13
14         A fix for bug #80493 by Atsushi Enomoto
15         * cs-parser.jay: Ignore invalid attribute target.
16
17 2007-02-15  Miguel de Icaza  <miguel@novell.com>
18
19         * Remove the call to SetExpression for lambda expressions, we do
20         not actually need it.
21
22         Remove expression tracking code as its not needed.
23
24 2007-02-11  Miguel de Icaza  <miguel@novell.com>
25
26         * cs-parser.jay (lambda_expression_body): when the body is an
27         expression add a statement of the form:
28
29                 contextual-return expression.
30
31         Where `contextual-return' is similar to `return', the difference
32         being that if the delegate that the lambda will be converted to
33         has a void return type, it will check that the result is a
34         ExpressionStatement and the result is a plain ret (no return
35         values on the stack).  If the return type of the delegate is of a
36         given type, this turns into a return with a value and does the
37         regular checking to check that the computed value can be
38         implicitly converted to the delegate return.
39
40 2007-01-30  Miguel de Icaza  <miguel@novell.com>
41
42         * cs-parser.jay (anonymous_method_expression): move the
43         before/after productions to the start_anonymous and end_anonymous
44         methods so the code can be reused for lambda functions.
45
46         (lambda_expression_body): wrap expressions implicitly into a
47         block.
48
49         (block): factor out the setup/teardown of parsing a block so we
50         can reuse that in lambda_expression_body
51
52         (lambda_expression): use new anonymous method helper methods.
53
54 2007-01-29  Miguel de Icaza  <miguel@novell.com>
55
56         * cs-parser.jay: oob_stack make it static (am guessing that is why
57         we no longer initialize it anymore) and reuse it across
58         instances.
59
60 2007-01-28  Miguel de Icaza  <miguel@novell.com>
61
62         * cs-parser.jay (open_parens): Introduce new non-terminal that
63         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
64         be returned in places where types are followed by identifiers
65         (this is expected in declaration, fixed, using, foreach and catch
66         clauses). 
67
68         Use open_parens in those places, keep OPEN_PARENS in the
69         expressions.  
70
71         cs-parser.jay: New grammar bits for parsing lambda expressions. 
72
73 2007-01-28  Raja R Harinath  <rharinath@novell.com>
74
75         Fix #80534, gtest-309.cs
76         * generic.cs (UnifyType): Rename from InferType.  Make unification
77         of generic insts simpler and don't insist on inferring all generic
78         parameters in a single generic inst unification.
79         (UnifyTypes): New.
80         (InferGenericInstance): Remove.
81         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
82
83 2007-01-20  Marek Safar  <marek.safar@gmail.com>
84
85         * cs-parser.jay: Better parameter error handling.
86
87 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
88             Raja R Harinath  <rharinath@novell.com>
89
90         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
91         Note the order in which accessors are declared in the source.
92
93 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
94
95         * generic.cs (TypeParameter.FindMembers): Use the generic
96         constraints, not the constraints to check for methods (first fix
97         of 80518).
98
99 2006-12-30  Marek Safar  <marek.safar@gmail.com>
100
101         * cs-parser.jay: Better syntax errors handling.
102
103 2006-11-21  Marek Safar  <marek.safar@gmail.com>
104
105         * cs-parser.jay: Tiny change to work with mcs tokenizer.
106
107         * cs-tokenizer.cs: Remove after unification with mcs.
108
109 2006-10-28  Marek Safar  <marek.safar@gmail.com>
110
111         A fix for bug #78998
112         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
113         arguments as well.
114
115 2006-10-26  Marek Safar  <marek.safar@gmail.com>
116
117         A fix for bug #76591
118         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
119
120 2006-10-25  Brian Crowell  <brian@fluggo.com>
121
122         Fix #79703
123         * generic.cs (CheckConstraints): Allow generic parameters with
124         inheritance constraints to satisfy reference type constraints.
125
126 2006-10-09  Martin Baulig  <martin@ximian.com>
127
128         * generic.cs
129         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
130
131 2006-09-25  Martin Baulig  <martin@ximian.com>
132
133         * class.cs: Remove after unification with mcs source.
134
135 2006-09-24  Raja R Harinath  <harinath@gmail.com>
136
137         * convert.cs: Remove after unification with mcs source.
138
139 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
140
141         * class.cs (MemberBase.VerifyClsCompliance): When method has type
142         parameters verify them as well.
143
144         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
145         the type parameter constraints.
146         (Generics.VerifyClsCompliance): Ditto.
147
148 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
149
150         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
151         for anonymous block with out argument.
152
153 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
154
155         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
156         not used private events only.
157
158 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
159
160         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
161
162         * cs-parser.jay: Parse correctly cast of default (T).
163
164         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
165         Store original type via EmptyConstantCast.
166
167 2006-09-22  Martin Baulig  <martin@ximian.com>
168
169         * delegate.cs: Removed; this file is now shared with mcs.
170
171         * attribute.cs: Removed; this file is now shared with mcs.
172
173 2006-09-22  Martin Baulig  <martin@ximian.com>
174
175         * ecore.cs: Removed; this file is now shared with mcs.
176
177 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
178
179         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
180
181         * ecore.cs (NullCast): Derives from NullConstant.
182
183         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
184         results.
185
186 2006-09-21  Martin Baulig  <martin@ximian.com>
187
188         * decl.cs: Removed; this file is now shared with mcs.
189
190 2006-09-21  Raja R Harinath  <rharinath@novell.com>
191
192         * rootcontext.cs: Remove after unification with mcs source.
193
194         * report.cs: Remove after unification with mcs source.
195         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
196         mcs/typemanager.cs.
197         (InitGenerics, CleanUpGenerics): Remove.
198
199         * support.cs: Remove after unification with mcs source.
200
201 2006-09-20  Raja R Harinath  <rharinath@novell.com>
202
203         * codegen.cs: Remove after unification with mcs source.
204
205 2006-09-19  Martin Baulig  <martin@ximian.com>
206
207         * expression.cs: Removed; this file is now shared with mcs.
208
209 2006-09-19  Martin Baulig  <martin@ximian.com>
210
211         * generic.cs
212         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
213         (TypeManager.DropGenericTypeArguments): Likewise.
214         (TypeManager.DropGenericMethodArguments): Likewise.
215         (TypeManager.GetTypeArguments): Likewise.
216         (TypeManager.HasGenericArguments): Likewise.
217
218 2006-09-19  Martin Baulig  <martin@ximian.com>
219
220         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
221
222 2006-09-19  Martin Baulig  <martin@ximian.com>
223
224         * typemanager.cs: Removed; this file is now shared with mcs.
225
226 2006-09-16  Raja R Harinath  <rharinath@novell.com>
227
228         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
229         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
230
231 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
232
233         A fix for #79401
234         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
235         only if parent type is class.
236         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
237         update.
238
239 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
240
241         * cs-parser.jay,
242         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
243         keywords are used.
244         * typemanager.cs(CSharpName): Converts NullType to null.
245
246 2006-09-15  Martin Baulig  <martin@ximian.com>
247
248         * pending.cs: Removed; this file is now shared with mcs.
249
250 2006-09-15  Martin Baulig  <martin@ximian.com>
251
252         * statement.cs: Removed; this file is now shared with mcs.
253
254 2006-09-15  Martin Baulig  <martin@ximian.com>
255
256         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
257
258         * driver.cs: Removed the `--broken-cycles' argument.
259
260 2006-09-15  Martin Baulig  <martin@ximian.com>
261
262         * namespace.cs: Removed; this file is now shared with mcs.
263
264 2006-09-15  Martin Baulig  <martin@ximian.com>
265
266         * decl.cs (MemberName): Minor code cleanups.
267
268 2006-09-15  Martin Baulig  <martin@ximian.com>
269
270         * parameter.cs: Removed; this file is now shared with mcs.
271
272 2006-09-15  Martin Baulig  <martin@ximian.com>
273
274         * enum.cs: Removed; this file is now shared with mcs.
275
276 2006-09-15  Martin Baulig  <martin@ximian.com>
277
278         * Makefile: Define `GMCS_SOURCE'.
279
280         * flowanalysis.cs: Removed; this file is now shared with mcs.
281
282 2006-09-15  Martin Baulig  <martin@ximian.com>
283
284         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
285         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
286         doc.cs - they are now shared with mcs.
287
288         * gmcs.exe.sources: Include these files from ../mcs/.
289
290 2006-09-15  Martin Baulig  <martin@ximian.com>
291
292         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
293         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
294
295 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
296
297         * assign.cs, ecore.cs, expression.cs: Share error message text.
298         * class.cs (FieldMember.Define): Check for variable of static type.
299         * decl.cs (check_type_parameter): Report correct type name.
300         * driver.cs (LoadAssembly): Uses error output for errors.
301         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
302         (TypeArguments.Resolve): Static class cannot be used as an argument.
303         * statement.cs (ResolveMeta): Constants cannot be generic types.
304
305 2006-09-12  Martin Baulig  <martin@ximian.com>
306
307         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
308
309         * convert.cs (Convert.Array_To_IList): Moved here and correctly
310         implement it; fixes #79345.
311
312 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
313
314         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
315         parameter.
316         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
317         types.
318         * generic.cs: Improved error messages.
319         * typemanager.cs (RemoveGenericArity): Made public.
320
321 2006-09-08  Martin Baulig  <martin@ximian.com>
322
323         * typemanager.cs (TypeManager.interlocked_type): New public field.
324         (TypeManager.int_interlocked_compare-exchange): New public field.
325         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
326         enumerator types here and call InitGenericCoreTypes().
327         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
328         after calling InitEnumUnderlyingTypes().
329
330         * rootcontext.cs
331         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
332         `classes_second_stage'. 
333
334 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
335  
336         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
337         collisions.
338         * statement.cs (Block.Variables): Made public.
339
340 2006-09-07  Martin Baulig  <martin@ximian.com>
341
342         * driver.cs
343         (MainDriver): Revert r62663 from Marek; see #70506 for details.
344
345 2006-09-01  Martin Baulig  <martin@ximian.com>
346
347         * generic.cs
348         (TypeManager.IsIList): Also handle base classes and interfaces. 
349
350 2006-09-01  Raja R Harinath  <rharinath@novell.com>
351
352         Fix #79238
353         * expression.cs (Invocation.MoreSpecific): Check for reference
354         types earlier.
355
356 2006-08-29  Miguel de Icaza  <miguel@novell.com>
357
358         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
359
360 2006-08-17  Miguel de Icaza  <miguel@novell.com>
361
362         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
363         #52019 and #79064, the use of the \uXXXX sequence in source code
364         to represent unicode characters.
365
366 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
367  
368         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
369         support.
370         * class.cs, ecore.cs, statement.cs: Merged to one error message.
371
372 2006-08-14  Raja R Harinath  <rharinath@novell.com>
373
374         Fix #79067
375         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
376         parameter too.  This only avoids a parse error -- the semantic
377         error is caught elsewhere.
378
379 2006-08-13  Miguel de Icaza  <miguel@novell.com>
380
381         * assign.cs: Catch attempts to assign to a method groups in += and
382         report as 1656
383
384 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
385
386         A fix for #79056
387         * cs-parser.jay: Don't destroy current array type by typeof of array's.
388
389 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
390
391         * cs-parser.jay: Check whether a constraint clause has already been
392         specified for type parameter.
393         * generic.cs (Constraints): Exposed location.
394
395 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
396
397         * class.cs (Method.Define): Issue a warning when generic method looks like
398         an entry point.
399         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
400         as well.
401         * report.cs: New warning number.
402
403 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
404  
405         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
406         looking for ctor.
407         * decl.cs (MemberCache.FindMembers): When container is interface we need to
408         search all base interfaces as a member can be ambiguous.
409         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
410         Constructor member type filter. 
411         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
412         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
413         reporting for returned memberinfos.
414         * report.cs: Updated.
415         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
416         version to work on all runtimes.
417         (TypeManager.RealMemberLookup): Removed members filtering.
418
419 2006-08-08  Raja R Harinath  <rharinath@novell.com>
420
421         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
422         (PropertyExpr.EmitAssign): Likewise.
423         * expression.cs (Indirection.EmitAssign): Likewise.
424         (LocalVariableReference.EmitAssign): Likewise.
425         (ParameterReference.EmitAssign): Likewise.
426         (Invocation.EmitArguments): Likewise.
427         (ArrayAccess.EmitAssign): Likewise.
428         (IndexerAccess.EmitAssign): Likewise.
429         (This.EmitAssign): Likewise.
430         (ConditionalLogicalOperator.Emit): Likewise.
431
432         Fix #79026
433         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
434         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
435         leave it in after returning it.
436         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
437
438 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
439
440         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
441         message.
442
443 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
444
445         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
446         with different type names.
447         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
448
449 2006-08-03  Raja R Harinath  <rharinath@novell.com>
450
451         Fix cs0146-3.cs and cs0146-4.cs.
452         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
453         enclosing types don't depend on the current type.
454
455 2006-08-02  Raja R Harinath  <rharinath@novell.com>
456
457         Fix #77963
458         * class.cs (TypeContainer.DoDefineMembers): Use
459         FindBaseMemberWithSameName on Parent, since we're interested in
460         whether we hide inherited members or not.
461         (FindBaseMemberWithSameName): Make slightly more robust.
462
463         Fix #77396
464         * codegen.cs (IResolveContext.GenericDeclContainer): New.
465         (EmitContext): Implement new interface requirement.
466         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
467         * decl.cs (MemberCore): Likewise.
468         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
469         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
470         ec.GenericDeclContainer to check for generic parameters.
471         (SimpleName.DoSimpleNameResolve): Likewise.
472         * generic.cs (TypeParameter.DeclContainer): Remove override.
473
474         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
475         declspaces for doppelgangers too.
476         (UsingEntry): Implement IResolveContext.
477         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
478         'this' as the resolve context.
479         (LocalAliasEntry): Likewise.
480
481         Implement parts of #77403
482         * roottypes.cs (RootDeclSpace): New.  Used to represent the
483         toplevel declaration space.  Each namespace declaration introduces
484         a "partial" root declaretion space.
485         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
486         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
487         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
488         from 'current_namespace.SlaveDeclSpace'.
489         (namespace_declaration): Likewise.
490         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
491         check.  It can't happen now.
492         * decl.cs (DeclSpace.LookupType): Likewise.
493         * driver.cs (MainDriver): Sanity check.
494
495 2006-08-01  Raja R Harinath  <rharinath@novell.com>
496
497         * decl.cs (DeclSpace.FindNestedType): Remove.
498         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
499         LookupTypeContainer to get the container of the nested type.
500         * class.cs (TypeContainer.FindNestedType): Make non-override.
501
502 2006-07-31  Raja R Harinath  <rharinath@novell.com>
503
504         * decl.cs (DeclSpace.PartialContainer): Move field from ...
505         * class.cs (TypeContainer.PartialContainer): ... here.
506         (TypeContainer.AddBasesForPart): New helper.
507         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
508         instead.
509         * cs-parser.jay (current_class): Convert to DeclSpace.
510         (struct_declaration, interface_declaration, class_declaration):
511         Use AddBasesForPart instead of .Bases directly.
512         * const.cs, iterators.cs: Update to changes.
513
514 2006-07-28  Raja R Harinath  <rharinath@novell.com>
515
516         * class.cs (TypeContainer.AddMemberType): Rename from
517         AddToTypeContainer.
518         (TypeContainer.AddMember): Rename from AddToMemberContainer.
519         (AddTypeContainer): New.  Combine AddClassOrStruct and
520         AddInterface.
521         (AddPartial): Update.  Add 'is_partial' argument.
522         * roottypes.cs: Update to changes.
523         * cs-parser.jay (push_current_class): New helper for handling
524         current_container and current_class.
525         (struct_declaration, interface_declaration, class_declaration):
526         Use it.
527
528 2006-07-26  Raja R Harinath  <rharinath@novell.com>
529
530         * roottypes.cs: Rename from tree.cs.
531
532         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
533         * tree.cs (Tree, ITreeDump): Remove types.
534         * rootcontext.cs (tree, Tree): Remove fields.
535         (root, ToplevelTypes): New.
536         * *.cs: Update to rename.
537
538         * tree.cs (Tree.RecordDecl): Remove.
539         (RootTypes.AddToTypeContainer): Record the toplevel type in its
540         namespace here.
541         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
542
543 2006-07-23  Raja R Harinath  <harinath@gmail.com>
544
545         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
546         DoFlowAnalysis and OmitStructFlowAnalysis here.
547         (ec.With): Rename from WithUnsafe and generalize.
548         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
549         (ec.WithFlowAnalyis): New.
550         * ecore.cs, expression.cs, statement.cs: Update.
551
552 2006-07-22  Raja R Harinath  <harinath@gmail.com>
553
554         * statement.cs (Block.ResolveMeta): Simplify slightly.
555
556         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
557         multiple boolean fields.  Convert InUnsafe, constant_check_state,
558         check_state to flags.
559         (CheckState, ConstantCheckState): Update.
560         (InUnsafe): New read-only property.
561         (FlagsHandle): Rename from CheckStateHandle and convert to handle
562         arbitrary flags.
563         (WithUnsafe): New helper similar to WithCheckState.
564         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
565         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
566
567 2006-07-21  Raja R Harinath  <rharinath@novell.com>
568
569         Make comparisons use the same IL irrespective of whether they're
570         in a 'checked' or 'unchecked' context: one of the issues in #78899
571         * codegen.cs (EmitContext.CheckState): Make read-only property.
572         (EmitContext.ConstantCheckState): Likewise.
573         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
574         helper that implement a save/restore stack for CheckState
575         values.  This is the only way to change check-state.
576         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
577         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
578         (CheckedExpr.EmitBranchable): New forwarding method.
579         (UnCheckedExpr): Likewise.
580         * statement.cs (Block.ResolveMeta): Use WithCheckState.
581         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
582         (Checked.Resolve, checked.DoEmit): Likewise.
583
584 2006-07-21  Martin Baulig  <martin@ximian.com>
585
586         * generic.cs (TypeManager.InferType): When inferring an array
587         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
588
589 2006-07-21  Martin Baulig  <martin@ximian.com>
590
591         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
592         and allow IList`1 and all its base interfaces.
593
594         * convert.cs (Convert.ImplicitReferenceConversion): Allow
595         converting from an array-type of T to IList<T>.
596
597 2006-07-21  Martin Baulig  <martin@ximian.com>
598
599         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
600
601 2006-07-20  Miguel de Icaza  <miguel@novell.com>
602
603         * anonymous.cs: Cache the resolved anonymous delegate, and return
604         this so that the ResolveTopBlock is only triggered once, not
605         twice.
606
607         Currently we trigger ResolvetopBlock twice due to a first pass of
608         argument check compatibility, and a second pass that does the
609         actual resolution.   
610
611 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
612
613         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
614         modifiers.
615         * rootcontext.cs (Reset): Add helper_classes.
616
617 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
618
619         A fix for #78860
620         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
621         correctly.
622
623 2006-07-13  Miguel de Icaza  <miguel@novell.com>
624
625         * statement.cs (Lock): Handle expressions of type
626         TypeManager.null_type specially.  Fixes #78770
627
628 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
629
630         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
631         to an event.
632
633 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
634
635         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
636         for accessors as well.
637         * ecore.cs (EventExpr): Add AccessorTable.
638
639 2006-07-03  Martin Baulig  <martin@ximian.com>
640
641         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
642         instances of value types.
643
644         * convert.cs (Convert.ExplicitConversion): Correctly handle
645         object->nullable conversions.   
646
647 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
648
649         A fix for #78738
650         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
651         for CS0122 where appropriate.
652         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
653         level attributes.
654         (Filter): Assembly can be null in the case of top level attributes.
655
656 2006-06-28  Raja R Harinath  <rharinath@novell.com>
657
658         Fix #78716
659         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
660         no arguments, return 'false': nothing can be inferred.
661
662 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
663
664         A fix for #78690
665
666         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
667         is done at global level.
668
669 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
670
671         A fix for #77002, Implemented TypeForwarder support.
672
673         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
674         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
675         attribute handling.
676         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
677         * typemanager.cs (): Add type_forwarder_attr_type.
678
679 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
680
681         * report.cs: Add CS0469 warning.
682
683 2006-06-22  Martin Baulig  <martin@ximian.com>
684
685         * class.cs
686         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
687         for interfaces; fixes #78686, which is a modification of #78380
688         with interfaces instead of classes.
689
690 2006-06-21  Martin Baulig  <martin@ximian.com>
691
692         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
693         the `try'-block, so we also report CS0016 etc. there.
694
695 2006-06-21  Martin Baulig  <martin@ximian.com>
696
697         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
698         handle SetAssigned() and SetMemberIsUsed() for generic types;
699         fixes #77545.
700
701 2006-06-21  Martin Baulig  <martin@ximian.com>
702
703         * delegate.cs
704         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
705
706 2006-06-21  Martin Baulig  <martin@ximian.com>
707
708         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
709         also report CS1686 for parameters.
710
711 2006-06-21  Martin Baulig  <martin@ximian.com>
712
713         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
714         instead of an error if the value is not implicitly convertible to
715         the switch types; fixes #77964.
716
717 2006-06-21  Raja R Harinath  <rharinath@novell.com>
718
719         Fix #78673
720         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
721         FieldBuilder is null.
722
723         Fix #78662
724         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
725         'left' and 'right' before error-checking.
726
727 2006-06-19  Martin Baulig  <martin@ximian.com>
728
729         * convert.cs
730         (Convert.ImplicitConversionStandard): Cleanup and correctly
731         implement nullable conversions.
732         (Convert.ImplicitStandardConversionExists): Likewise.
733         (Convert.ExplicitConversion): Likewise.
734
735 2006-06-19  Martin Baulig  <martin@ximian.com>
736
737         * generic.cs
738         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
739         methods; make the ctors protected.
740
741 2006-06-19  Martin Baulig  <martin@ximian.com>
742
743         Fixed #78380; added gtest-273.cs.
744
745         * ecore.cs
746         (Expression.ResolveAsBaseTerminal): Move the constraint checking
747         into ResolveAsTypeTerminal().
748
749         * generic.cs
750         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
751         TypeManager.FindMembers() to check for the default ctor.
752
753 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
754
755         * generic.cs: Fixed NullableInfo accessibility.
756
757 2006-06-16  Martin Baulig  <martin@ximian.com>
758
759         * generic.cs
760         (Constraints.InflatedConstraints.inflate): Correctly inflate
761         generic types; fixes #78400.
762
763 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
764
765         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
766         Fixed bug #78601.
767         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
768         (FieldExpr.DoResolve): likewise.
769         (PropertyExpr.InstanceResolve): likewise.
770         (EventExpr.InstanceResolve): likewise. 
771
772 2006-06-15  Martin Baulig  <martin@ximian.com>
773
774         * statement.cs
775         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
776         argument; always allow a `null' label if true.
777         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
778         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
779         we have a `null' label and mark the new `null_target' label;
780         default to the `default' label.
781         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
782
783 2006-06-15  Martin Baulig  <martin@ximian.com>
784
785         * class.cs (Operator.Define): Allow an implicit/explicit operator
786         to convert to/from a nullable value of the enclosing type.
787
788         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
789         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
790
791         * convert.cs
792         (Convert.ImplicitStandardConversionExists): Add support for lifted
793         implicit/explicit conversions.
794         (Convert.ImplicitConversionStandard): Likewise.
795
796 2006-06-13  Martin Baulig  <martin@ximian.com>
797
798         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
799         type arguments and create a ConstructedType if necessary.  Fixes #78400.
800
801 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
802
803         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
804         attribute applicable tests for attribute argument.
805
806 2006-06-02  Raja R Harinath  <rharinath@novell.com>
807
808         Fix #78079
809         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
810         (Binary.OverloadResolve_PredefinedIntegral): New.
811         (Binary.OverloadResolve_PredefinedFloating): New.
812         (Binary.OverloadResolve_PredefinedString): New.
813         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
814         Follow the standard more closely, and treat numeric promotions in
815         terms of overload resolution.
816         (Binary.CheckShiftArguments): Simplify.
817
818 2006-06-01  Raja R Harinath  <rharinath@novell.com>
819
820         * flowanalysis.cs (MyBitVector): Simplify representation.
821         (MyBitVector.Clone): Avoid allocating BitArray.
822         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
823         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
824         (*): Update.  Change all references to MyBitVector.And and
825         MyBitVector.Or to &= and |=.
826
827 2006-05-31  Raja R Harinath  <rharinath@novell.com>
828
829         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
830         Use bne.un instead of ceq+brfalse.
831
832         Fix cs0208-[23].cs
833         * typemanager.cs (IsUnmanagedType): Disallow generic types and
834         generic parameters.
835
836 2006-05-29  Raja R Harinath  <rharinath@novell.com>
837
838         Fix cs0231-[34].cs.
839         * cs-parser.jay (formal_parameter_list): Extend the pattern below
840         to param arguments too.
841
842 2006-05-26  Miguel de Icaza  <miguel@novell.com>
843
844         * cs-parser.jay: Catch another parsing form for arglist being
845         followed by other arguments.  Fixes #78313.
846
847 2006-05-25  Raja R Harinath  <rharinath@novell.com>
848
849         Fix #78324
850         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
851         also when one of the operands is a null literal.
852         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
853         to improve clarity, and generate slightly better code.
854
855 2006-05-24  Raja R Harinath  <rharinath@novell.com>
856
857         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
858         checking of out parameters to ...
859         (FlowBranchingToplevel.Merge): ... here.
860         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
861         set, propagate the origin upward, and only complain if there was
862         no other error.
863         (FlowBranchingException.AddContinueOrigin): Likewise.
864         (FlowBranchingException.AddReturnOrigin): Likewise.
865         (FlowBranchingException.AddGotoOrigin): Likewise.       
866
867 2006-05-23  Raja R Harinath  <rharinath@novell.com>
868
869         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
870         unreachable, skip it.
871         (FlowBranchingException.Merge): Always propagate jumps, even if
872         the finally block renders subsequent code unreachable.
873
874 2006-05-18  Raja R Harinath  <rharinath@novell.com>
875
876         Fix #77601
877         * statement.cs (Goto.Resolve): Move responsibility for resolving
878         'goto' to FlowBranching.AddGotoOrigin.
879         (Goto.SetResolvedTarget): New.  Callback to set the
880         LabeledStatement that's the target of the goto.
881         (Goto.DoEmit): Use Leave instead of Br when crossing an
882         unwind-protect boundary.
883         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
884         LookupLabel and adjust to new semantics.
885         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
886         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
887         Goto.SetResolvedTarget to update target.
888         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
889         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
890         AddBreakOrigin & co.  Delay propagation until ...
891         (FlowBranchingException.Merge): ... this.
892
893         * statement.cs (Block.Resolve): Always depend on flow-branching to
894         determine unreachability.  Kill workaround that originally emitted
895         only one statement after an "unreachable" label (see infloop in
896         test-515.cs).
897
898         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
899         This is still "wrong", but anything better would probably need a
900         multi-pass algorithm.
901         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
902         usage vector.  Force current usage vector to be reachable, to
903         optimistically signify backward jumps.
904         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
905         detected.
906         (FlowBranchingLabeled.Merge): New.  If no backward jump was
907         detected, return the original salted-away usage vector instead,
908         updated with appropriate changes.  Print unreachable warning if
909         necessary.
910         * statement.cs (Block.Resolve): Don't print unreachable warning on
911         a labeled statement.
912
913 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
914
915         * driver.cs: Pass filename without path to AssemblyBuilder's
916         AddResourceFile. Fixes bug #78407.
917
918 2006-05-17  Raja R Harinath  <rharinath@novell.com>
919
920         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
921         * flowanalysis.cs (FlowBranchingLabeled): ... here.
922         (FlowBranching.MergeChild): Overwrite
923         reachability information from Labeled branchings too.
924
925 2006-05-16  Raja R Harinath  <rharinath@novell.com>
926
927         * statement.cs (Goto.Resolve): Merge jump origins here ...
928         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
929
930         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
931         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
932         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
933         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
934         here, ...
935         * statement.cs (Goto.Resolve): ... not here.
936         (Goto.Emit): Remove CS1632 check.
937
938 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
939
940         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
941         error message.
942
943 2006-05-11  Raja R Harinath  <rharinath@novell.com>
944
945         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
946         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
947         (FlowBranchingException.Label): Likewise.
948
949         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
950         given value.
951         (MyBitVector.Or): Use it to avoid losing information (Count).
952         (FlowBranching.MergeOrigins): Likewise.
953
954         * flowanalysis.cs (UsageVector.IsDirty): Remove.
955         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
956         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
957         (UsageVector.ToString): Simplify.
958         (UsageVector.MergeSiblings): Move here from ...
959         (FlowBranching.Merge): ... here.
960         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
961         not a MyBitVector.
962
963 2006-05-10  Raja R Harinath  <rharinath@novell.com>
964
965         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
966         null bitvector is treated as all-true.
967
968         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
969         (MyBitVector): Rationalize invariants.  'vector != null' implies
970         that we have our own copy of the bitvector.  Otherwise,
971         'InheritsFrom == null' implies all inherited bits are true.
972
973 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
974
975         * statement.cs (LocalInfo): Add IsConstant.
976         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
977         local variable for constants.
978
979 2006-05-09  Raja R Harinath  <rharinath@novell.com>
980
981         * flowanalysis.cs (MyBitVector.Empty): New.
982         (MyBitVector): Don't allow InheritedFrom to be null.
983         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
984         (UsageVector, FlowBranching): Update to changes.
985
986         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
987         recursion.  The 'Parent == null' condition isn't sufficient for
988         anonymous methods.
989         (FlowBranching.AddBreakOrigin): Likewise.
990         (FlowBranching.AddContinueOrigin): Likewise.
991         (FlowBranching.AddReturnOrigin): Likewise.
992         (FlowBranching.StealFinallyClauses): Likewise.
993         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
994         (FlowBranching.CheckOutParameters): Likewise.
995         (FlowBranchingToplevel): Terminate all the above recursions here.
996         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
997         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
998
999         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1000         toplevel block.
1001         (FlowBranchingToplevel): New.  Empty for now.
1002         (FlowBranching.MergeTopBlock): Update.
1003         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1004         branching for the anonymous delegate.
1005         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1006
1007         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1008         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1009         information at the start of the merge.  Reorganize.
1010
1011 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1012
1013         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1014
1015 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1016
1017         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1018         to newly introduced ctor.
1019
1020         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1021         message to one place.
1022         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1023         global namespace.
1024
1025 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1026
1027         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1028
1029         * ecore.cs (Expression.ResolveAsConstant): Updated.
1030
1031         * statement.cs (ResolveMeta): Updated.
1032
1033 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1034
1035         * cs-parser.jay: __arglist cannot be used in initializer.
1036
1037 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1038
1039         A fix for #77879
1040         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1041         private types.
1042
1043 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1044
1045         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1046         (LabeledStatement): Add 'name' parameter.
1047         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1048         (Block.AddLabel): Update to changes.
1049         * cs-parser.jay (labeled_statement): Likewise.
1050
1051         * flowanalysis.cs (BranchingType.Labeled): New.
1052         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1053         (FlowBranchingLabeled): New.  Does nothing for now, but will
1054         eventually handle 'goto' flows.
1055         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1056         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1057         that's terminated ...
1058         (Block.Resolve): ... here.
1059
1060         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1061         (UsageVector.MergeFinallyOrigins): Likewise.
1062         (FlowBranching.InTryOrCatch): Likewise.
1063         (FlowBranching.AddFinallyVector): Likewise.
1064         (FlowBranchingException): Update to changes.
1065
1066         Fix #78290
1067         * statement.cs (Return.Resolve): Move error checking to ...
1068         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1069         (FlowBranchingException): Handle return origins like break and
1070         continue origins.
1071         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1072
1073 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1074
1075         A fix for #76122
1076         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1077         filter.
1078
1079 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1080
1081         A fix for #77543
1082         * class.cs (MethodData.Define): Do public accessor check only when method
1083         implements an interface.
1084
1085 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1086
1087         Remove special handling of 'break'
1088         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1089         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1090         (UsageVector.Break): Remove.
1091         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1092         reachability.
1093         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1094
1095         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1096         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1097
1098 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1099
1100         A fix for #75726
1101         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1102         be the interface member.
1103
1104 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1105
1106         A fix for #60069
1107         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1108         for emitting small (int) values.
1109
1110 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1111
1112         Fix #59427
1113         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1114         control-flow passes through the 'finally' after merging-in all the
1115         control-flows from 'try' and the 'catch' clauses.
1116
1117         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1118         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1119         always true at the only non-recursive entry point.
1120         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1121         FlowBranchingBreakable.
1122         (FlowBranchingLoop): Remove.
1123         * statement.cs (Return.DoResolve): Update to changes.
1124
1125         Fix #76471, #76665
1126         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1127         (FlowBranching.CreateBranching): Handle it: create a
1128         FlowBranchingContinuable.
1129         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1130         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1131         except that it handles the 'continue' command.
1132         (FlowBranching.UsageVector.MergeOrigins): Rename from
1133         MergeBreakOrigins.
1134         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1135         except that it overrides AddContinueOrigin.
1136         (FlowBranchingException): Override AddContinueOrigin, similar to
1137         AddBreakOrigin.
1138         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1139         Create a new branching around the embedded statement.
1140         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1141         control flow after the embedded statement.
1142         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1143
1144         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1145         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1146         FlowBranchingBreakable.
1147         (FlowBranchingSwitch): Remove.
1148
1149         Fix test-503.cs
1150         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1151         error reporting to ...
1152         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1153         Rename from 'AddBreakVector'.  Add new location argument.  Return
1154         a bool indicating whether the 'break' crosses an unwind-protect.
1155         (FlowBranchingException.AddBreakOrigin): Add.
1156         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1157         flowbranching after updating with the effects of the 'finally'
1158         clause.
1159         (FlowBranchingBreakable): New common base class for
1160         FlowBranchingLoop and FlowBranchingSwitch.
1161
1162         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1163         embedded statement.
1164         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1165
1166 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1167
1168         * statement.cs (Do.Resolve): If the loop is infinite, set the
1169         barrier.
1170         (While.Resolve, For.Resolve): Set a barrier after the embedded
1171         statement.  There's no direct control flow that goes from the end
1172         of the embedded statement to the end of the loop.
1173         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1174         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1175         above ensure that the reachability is correctly computed.
1176
1177         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1178         (UsageVector.MergeBreakOrigins): If the current path is
1179         unreachable, treat it as if all parameters/locals are initialized.
1180         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1181         infinite loops before merging-in break origins.
1182
1183         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1184         (Reachability.Reachable): Split part into ...
1185         (Reachability.Unreachable): ... this.  Simplify.
1186         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1187
1188         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1189         (Reachability.SetThrowsSometimes): Likewise.
1190         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1191         TriState.Always, use corresponding property.
1192         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1193         (Block.Resolve): Likewise.  Remove some redundant checks.
1194
1195 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1196
1197         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1198         (Reachability.Meet): Don't bother checking AlwaysThrows --
1199         barrier is always set.
1200         (FlowBranchingBlock.Merge): Likewise.
1201
1202 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1203
1204         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1205         defined, so it's references should also compile only for NET_2_0
1206         (as occurs in mcs version)
1207
1208 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1209
1210         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1211         checks for unreachable.
1212
1213 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1214
1215         A fix for #77980
1216         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1217
1218         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1219         whether field is really assigned.
1220
1221 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1222
1223         * flowanalysis.cs (Reachability): Make 4-argument constructor
1224         private.
1225         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1226         (Reachability.Always): Rename from the highly misleading
1227         'Reachability.Never'.
1228         (FlowBranching.Merge): Update to changes.  Mark an impossible
1229         situation with a 'throw'.
1230         (*): Update to changes.
1231
1232 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1233
1234         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1235         Remove 'Undefined'.
1236         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1237         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1238         (*): Update to changes.
1239         * statement.cs: Update to changes.
1240
1241 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1242
1243         A fix for #78049
1244         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1245
1246 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1247
1248         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1249         dummy UsageVector.
1250
1251         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1252         argument to two arguments: an usage-vector and a bool.  Move call
1253         to FlowBranching.Merge () ...
1254         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1255
1256         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1257         handling of loop and switch reachability to ...
1258         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1259
1260 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1261
1262         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1263         handling to FlowBranchingLoop.InLoop.
1264         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1265
1266 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1267
1268         A fix for #78115
1269         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1270         anonymous method is allowed from AnonymousContainer here.
1271
1272         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1273
1274 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1275
1276         Fix #78156
1277         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1278
1279 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1280
1281         A fix for #49011.
1282         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1283         (DoubleConstant.Reduce): Ditto.
1284
1285 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1286
1287         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1288         Remove 'lvalue_right_side' argument.  Move parts to ...
1289         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1290         (LocalVariable.DoResolveLValue): ... these.
1291
1292 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1293
1294         Fix cs1655.cs
1295         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1296         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1297         (LocalVariableReference.DoResolveBase): Use it to implement new
1298         CS1655 check.
1299         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1300         (Argument.Resolve): Simplify.  Move CS1510 check ...
1301         * ecore.cs (Expression.ResolveLValue): ... here.
1302         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1303         (PropertyExpr.DoResolveLValue): Likewise.
1304         (FieldExpr.Report_AssignToReadonly): Likewise.
1305         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1306         LValueMemberAccess or LValueMemberOutAccess on instance depending
1307         on it.
1308         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1309         DoResolve as appropriate.
1310
1311 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1312
1313         Fix #75800
1314         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1315         implicit conversions on 'out' and 'ref' arguments.
1316
1317         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1318         improve clarity.  Remove dead code.
1319
1320         Fix #66031
1321         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1322         (Catch.Resolve): Resolve VarBlock if it exists.
1323
1324 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1325
1326         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1327         twice, this was some residual code, the enumerator was emitted
1328         properly in the two branche of if later.
1329
1330         Fixes #78031
1331         
1332         Thanks to Martin for finding the source of the problem
1333         
1334 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1335
1336         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1337         cast is never an lvalue.
1338         (Cast.DoResolve, Cast.ResolveRest): Combine.
1339         (Argument.Emit): Simplify slightly.  Move 'Expr is
1340         IMemoryLocation' check ...
1341         (Argument.Resolve): ... here.
1342         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1343
1344         Simplifications.  Fix cs0191-2.cs
1345         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1346         CS1649 and CS1651 to ...
1347         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1348         the actual selection of the error code and message to a lookup
1349         table.  Add a dummy return value to simplify callsites.
1350         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1351         readonly fields of other instances of the same type.  Move CS0197
1352         warning from ...
1353         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1354         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1355         resolution of an out or ref argument.  The code simplification
1356         above uses this invariant.
1357
1358 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1359
1360         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1361         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1362         CheckMarshallByRefAccess.  Drop parameter.
1363         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1364         warning.
1365         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1366         InstanceExpression.
1367         * report.cs (AllWarnings): Add CS1690.
1368         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1369         for ref access too.
1370         (LocalVariableReference.DoResolveBase): Update.
1371
1372 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1373
1374         * class.cs (MethodOrOperator): Moved common parts from method class.
1375         detect obsolete attributes.
1376         (Method.Define): Simplified as it reuses code from base.
1377         (Constructor.ValidAttributeTargets): Fixed issue found during
1378         refactoring.
1379         (Destructor.ValidAttributeTargets): Fixed issue found during
1380         refactoring.
1381         (Operator): Finished refactoring set off by #78020. Operator class is now
1382         ordinary method class.
1383
1384         * anonymous.cs: Updated.
1385
1386 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1387
1388         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1389
1390 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1391
1392         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1393         detect obsolete attributes.
1394         (Method.CreateEmitContext): Moved to MethodOrOperator.
1395
1396 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1397
1398         A fix for #78048.
1399         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1400         customized exception to make crash detection easier.
1401         (MethodOrOperator): Started to work on new base class for methods and
1402         operators.
1403         (Method): Derives from MethodOrOperator.
1404         (Constructor.Emit): Emits its own attributes.
1405         (AbstractPropertyEventMethod.Emit): Ditto.
1406         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1407         patch.
1408         (Operator.Emit): It's temporary more tricky than should be.
1409         
1410         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1411
1412         * report.cs (InternalErrorException): Add ctor with inner exception.
1413
1414 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1415
1416         A fix for #76744.
1417         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1418         only not visible.
1419
1420 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1421
1422         A fix for #77916.
1423         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1424         array.
1425
1426 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1427
1428         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1429         attribute is present and Guid not.
1430         (Interface.ApplyAttributeBuilder): Ditto.
1431
1432         * attribute.cs: Add error message.
1433
1434 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1435
1436         A fix for #78020.
1437
1438         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1439         sources (it's composite) so hold them in extra array as they are used in
1440         Emit phase only. It worked in the previous versions by mistake.
1441         (Attribute.Emit): Emit attribute for more owners when exist.
1442
1443         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1444         it has now different behaviour.
1445
1446 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1447
1448         * constant.cs (Constant.IsDefaultInitializer): New method.
1449
1450         * class.cs: Updated.
1451
1452         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1453         re-initialize default values. It saves KBs almost for every assembly.
1454         Thanks Zoltan for the idea.
1455         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1456         (ArrayCreation.DoResolve): Resolve only once.
1457         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1458         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1459
1460 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1461
1462         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1463         From #77961.
1464
1465 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1466
1467         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1468         in an embedded statement too.
1469
1470 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1471
1472         Fix #77929
1473         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1474         testing.
1475
1476         Fix #77958
1477         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1478
1479         Fix #77962
1480         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1481         arguments before checking whether a type is reflected or not.
1482
1483         Fix #77954
1484         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1485         definition doesn't take part in overload resolution.
1486         (Invocation.IsParamsMethodApplicable): Likewise.
1487         (Invocation.OverloadResolve): When replacing a reflected override
1488         method with its base definition, ensure that type arguments are
1489         applied.
1490
1491 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1492
1493         A fix for #77966.
1494
1495         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1496         was not specified.
1497
1498         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1499
1500 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1503         phase.
1504
1505         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1506         LocalTemporary change.
1507
1508         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1509         TypeContainer.
1510         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1511         initializers optimization.
1512         (ClassOrStruct.TypeAttr): Moved from modifiers.
1513         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1514         (FieldBase.ResolveInitializer): Resolves initializer.
1515         (FieldBase.HasDefaultInitializer): New property.
1516
1517         * cs-parser.jay: Removed message.
1518
1519         * expression.cs (CompilerGeneratedThis): New specialization.
1520
1521         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1522
1523 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1524
1525         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1526
1527 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1528
1529         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1530         be now EnumConstants only.
1531
1532 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1533
1534         * attribute.cs, driver.cs: Reset more caches.
1535
1536 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1537
1538         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1539
1540 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1541
1542         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1543         for easier reuse. Updated all overrides.
1544         (IntegralConstant): New base class for all integral constants.
1545         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1546         of the constant range, report custom error.
1547         (UIntConstant.Reduce): Fixed uint conversion.
1548
1549         * ecore.cs, literal.cs: Reduce updates.
1550
1551 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1552
1553         A fix for #75813.
1554
1555         * class.cs (Constructor.Define): Removed extra if for default ctors.
1556         A patch from Atsushi Enomoto.
1557
1558 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1559
1560         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1561         GetAttributableValue.
1562
1563         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1564         when required.
1565
1566         * convert.cs (ImplicitConversionRequired): Error message moved to
1567         DoubleLiteral.
1568
1569         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1570         automatic implicit conversion of an output value.
1571         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1572
1573         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1574         conversion.
1575         (TypeOf.GetAttributableValue): Add extra handling for object type.
1576
1577         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1578         special error message.
1579
1580 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1581
1582         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1583         InternalCall.
1584         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1585         compatible with MS runtime.
1586
1587 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1588
1589         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1590         attribute arguments here.
1591
1592         * class.cs (Indexer.Define): The check was moved to attribute class.
1593
1594 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1595
1596         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1597
1598 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1599
1600         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1601
1602         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1603         the blocks too.
1604
1605 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1606
1607         * doc-bootstrap.cs : fix build.
1608
1609 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1610
1611         * expression.cs (StringConcat.Append): Issue a warning when empty string
1612         is going to append.
1613
1614 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1615
1616         * assign.cs (CompoundAssign.ResolveSource): Removed.
1617
1618         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1619         clean up.
1620
1621         * class.cs (TypeContainer.FindMethods): Removed.
1622         (TypeContainer.CheckMemberUsage): Made static.
1623
1624         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1625
1626         * constant.cs (CheckRange): Removed unused type argument.
1627         (CheckUnsigned): Removed unused type argument.
1628
1629         * cs-parser.jay: Updated after MemberAccess clean up.
1630         Uses Length for empty string test.
1631
1632         * cs-tokenizer.cs: Uses Length for empty string test.
1633         (IsCastToken): Made static.
1634         (is_hex): Made static.
1635         (real_type_suffix): Made static.
1636
1637         * decl.cs (SetupCache): Made static.
1638         (OnGenerateDocComment): Removed unused ds argument.
1639
1640         * delegate.cs (VerifyDelegate): Removed unused argument.
1641
1642         * doc.cs: Uses Length for empty string test.
1643
1644         * driver.cs: Uses Length for empty string test.
1645
1646         * enum.cs (IsValidEnumType): Made static
1647
1648         * expression.cs (EnumLiftUp): Removed unused argument.
1649         (ResolveMethodGroup): Ditto.
1650         (BetterConversion): Ditto.
1651         (GetVarargsTypes): Ditto.
1652         (UpdateIndices): Ditto.
1653         (ValidateInitializers): Ditto.
1654         (MemberAccess.ctor): Ditto.
1655         (GetIndexersForType): Ditto.
1656
1657         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1658
1659         * iterators.cs: Updated after MemberAccess clean up.
1660
1661         * location.cs: Uses Length for empty string test.
1662
1663         * namespace.cs: Uses Length for empty string test.
1664
1665          * report.cs (CheckWarningCode): Made static.
1666
1667         * statement.cs (LabeledStatement): Removed unused argument.
1668
1669         * typemanager.cs (FilterNone): Removed.
1670
1671 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1672
1673         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1674         obsolete.
1675
1676         * class.cs: Updated.
1677
1678 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1679
1680         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1681
1682 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1683
1684         A fix for #77816.
1685
1686         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1687         host container.
1688         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1689         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1690         Add more error reporting; Fixed issue with params.
1691
1692         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1693
1694         * cs-parser.jay: AnonymousMethod requires host container.
1695
1696         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1697
1698 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1699
1700         * class.cs: Change 'TypeContainer ds' constructor argument to
1701         'DeclSpace parent'.  Some classes were missed below due to
1702         different naming convention.
1703
1704         * class.cs (MemberCore.Parent): Delete.  This makes the
1705         ParentContainer changes below enforceable by the compiler.
1706
1707         Treat pointers to enclosing declaration space as 'DeclSpace', not
1708         'TypeContainer'.
1709         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1710         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1711
1712         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1713         of TypeContainer.
1714         (Block.AddThisVariable): Likewise.
1715         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1716         (AbstractPropertyEventMethod.Emit): Likewise.
1717         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1718         (GetMethod.Define, SetMethod.Define): Likewise.
1719         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1720         (DelegateMethod.EmitMethod): Likewise.
1721
1722         Fix regression test-partial-13.cs.
1723         Rationalize use of PartialContainer.  Ensure that the partial
1724         class semantics can be tied to type-correctness, i.e., any
1725         violation will cause a compile error.
1726         * class.cs, const.cs: Access all fields that belong to class
1727         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1728         Resolve()-like functions still use 'Parent'.
1729
1730         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1731         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1732         (PropertyMethod.CheckModifiers): Remove unused argument.
1733         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1734         DeclSpace.
1735
1736 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1737
1738         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1739
1740 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1741
1742         Make semantics of PartialContainer simpler.
1743         * decl.cs (DeclSpace.IsPartial): Remove.
1744         * class.cs (TypeContainer.IsPartial): Likewise.
1745         (TypeContainer..ctor): Set PartialContainer to point to self.
1746         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1747         (TypeContainer.FindNestedType): Likewise.
1748         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1749
1750 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1751
1752         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1753
1754 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1755
1756         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1757         classes.
1758
1759 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1760
1761         * class.cs (Operator.Define): An error for base conversion was not
1762         reported correctly.
1763
1764 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1765
1766         A fix for #77593, #77574.
1767
1768         * class.cs (MethodCore.CheckBase): Another if for operator.
1769
1770 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1771
1772         A fix for #77822.
1773
1774         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1775         reporting, it's more tricky than I thought.
1776
1777 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1778
1779         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1780         were not resolved
1781
1782         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1783         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1784         conversion test.
1785         
1786         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1787         not needed.
1788
1789 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1790
1791         A fix for #77353.
1792
1793         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1794         (Event.Define): ditto
1795         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1796
1797         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1798         Removed redundant code and set NewSlot for Invoke method too.
1799
1800         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1801         (Parameters.MergeGenerated): New method. Use this method when you merge
1802         compiler generated argument with user arguments.
1803
1804 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1805
1806         * attribute.cs (ResolveAsTypeTerminal): Removed.
1807
1808         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1809         specialization for predefined types; 30% speed up.
1810         Finally placed obsolete check to right place.
1811         (Expression.ResolveType): Removed.
1812
1813         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1814         Updated after ResolveType was removed.
1815
1816         * expression.cs (Cast.ctor): Check void cast.
1817         (Binary.ResolveAsTypeTerminal): Is never type.
1818         (Conditional.ResolveAsTypeTerminal): Is never type.
1819
1820         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1821
1822 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1823
1824         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1825
1826 2006-03-23  Martin Baulig  <martin@ximian.com>
1827
1828         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1829         type check if either of the types is an open generic type.
1830
1831 2006-03-23  Martin Baulig  <martin@ximian.com>
1832
1833         * convert.cs
1834         (Convert.ExplicitTypeParameterConversion): New method; implement
1835         explicit type parameter conversions.
1836
1837 2006-03-23  Martin Baulig  <martin@ximian.com>
1838
1839         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1840         blindly allow all conversions if we do not have any constraints.
1841
1842 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1843
1844         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1845         these two separated members to simplify the code.
1846         (Attribute.Resolve): Refactored to use new fields and methods.
1847         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1848         implemented obsolete attribute checking.
1849         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1850         implemented obsolete checking again. It look line never ending quest ;-)
1851         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1852
1853         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1854
1855         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1856
1857         *class.cs (Property.Define): Add RegisterProperty call.
1858
1859         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1860         argument groups (only 2).
1861
1862         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1863         encoding expression to arguments.
1864         (Expression.ExprClassToResolveFlags): Just turned to property.
1865
1866         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1867         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1868         optimized as well as implemented support for zero-length attributes.
1869
1870         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1871         Add caching of PropertyInfo's.
1872
1873 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1874
1875         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1876         error multiple times.
1877
1878 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1879
1880         New partial class implementation.
1881         A fix for #77027, #77029, #77403
1882
1883         * attribute.cs (Attributable): Made attributes protected.
1884
1885         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1886         the replacements of ClassPart and PartialContainer.
1887         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1888         (TypeContainer.AddInterface): Ditto.
1889         (TypeContainer.AddPartial): The main method for partial classes. It checks
1890         for errors and merges ModFlags and attributes. At the end class is added to
1891         partial_parts list.
1892         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1893         required here.
1894         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1895         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1896         from the rest of partial classes.
1897         (TypeContainer.GetClassBases): Simplified.
1898         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1899         DefineType.
1900         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1901         (TypeContainer.HasExplicitLayout): Uses Flags now.
1902         (PartialContainer): Removed.
1903         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1904         (StaticClass): Was merged with Class.
1905         (Class.GetClassBases): class and static class bases are verified here.
1906         (Class.TypeAttr): Added static attributes when class is static.
1907         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1908         (MemberBase): In some cases we need to call parent container for partial
1909         class. It should be eliminated but it's not easy now.
1910
1911         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1912
1913         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1914         partial classed to accumulate class comments.
1915         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1916
1917         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1918
1919         * driver.cs (MainDriver): Tree.GetDecl was removed.
1920
1921         * modifiers.cs (Modifiers): Add partial modifier.
1922
1923         * tree.cs (Tree.decl): Removed.
1924         (RootTypes): Started to use this class more often for root types
1925         specializations.
1926
1927 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1928
1929         * generic.cs (TypeParameter.UpdateConstraints): Update
1930         'constraints' if null.
1931
1932 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1933
1934         A fix for #77615
1935
1936         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1937         external interface does not have an attribute.
1938
1939 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1940
1941         Another prerequisites for new partial classs implementation.
1942         
1943         * attribute.cs (Attribute.Equal): Implemented.
1944         (Attribute.Emit): Changed as attributes can be applied more than twice.
1945         (Attributes.Emit): Check for duplicate attributes here.
1946
1947         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1948         as a parameter, clean-up.
1949
1950 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1951
1952         A fix for #77485
1953
1954         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1955         contains obsolete attribute check which can in some cases look for base
1956         type of current class which is not initialized yet.
1957         (TypeContainer.BaseType): Replacement of ptype.
1958
1959         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1960
1961 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1962
1963         First of prerequisites for new partial classs implemention.
1964         
1965         * attribute.cs (Attributable): Extended by ResolveContext;
1966         Attributes finally have correct context for resolving in all cases.
1967         (AttachTo): Attribute owner is assigned here.
1968
1969         * codegen.cs (IResolveContext): Introduce new interface to hold
1970         all information needed in resolving phase.
1971         (EmitContext): Implements IResolveContext; more clean-up needed here.
1972         
1973         * decl.cs (MemberCore): Implemented IResolveContext.
1974
1975         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1976         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1977         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1978         Refactored to use new IResolveContext instead of EmitContext; cleanup
1979
1980 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1981
1982         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1983         mcs to keep code differences small.
1984         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1985         * typemanager.cs (parameter_default_value_attribute_type): New.
1986         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1987         CS1908 check.
1988
1989 2006-03-22  Martin Baulig  <martin@ximian.com>
1990
1991         * generic.cs
1992         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1993
1994         * convert.cs
1995         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1996         instead of the normal `NullLiteral'.
1997
1998 2006-03-21  Martin Baulig  <martin@ximian.com>
1999
2000         Fix #77583.
2001         * generic.cs (TypeManager.InferType): If `pt' is a generic
2002         parameter, don't check whether `pt == at'.
2003
2004 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2005
2006         Fix #77852
2007         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2008         (TypeParameter.Resolve): Update to change.
2009         (ConstraintChecker.CheckConstraints): Resolve type-argument
2010         constraints before use.
2011
2012 2006-03-16  Martin Baulig  <martin@ximian.com>
2013
2014         * generic.cs
2015         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2016         and don't have any instance constructors, also lookup in the base class.
2017         (TypeManager.IsNullableValueType): New public method.
2018
2019         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2020         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2021         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2022
2023         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2024         instead of just TypeManager.IsNullableType() to determine whether
2025         a lifted operator exists.
2026         (UnaryMutator.DoResolve): Likewise.
2027         (Conditional.DoResolve): Likewise.
2028         (Binary.DoResolve): A lifted operator only exists if both operands
2029         are valuetypes and at least one of them is a nullable type.
2030
2031 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2032
2033         * iterator.cs : yield break is allowed in try statement which has
2034           catch clauses. Fixed bug #77767.
2035
2036 2006-03-12  Martin Baulig  <martin@ximian.com>
2037
2038         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2039         private IsSignatureEqual() to compare types; see the comment in
2040         that method; fixes #77674.
2041
2042 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2043
2044         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2045         (Expression.ResolveAsTypeTerminal): Likewise.
2046         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2047         * expression.cs, generic.cs, iterators.cs: Likewise.
2048         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2049
2050 2006-03-09  Martin Baulig  <martin@ximian.com>
2051
2052         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2053         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2054
2055 2006-03-09  Martin Baulig  <martin@ximian.com>
2056
2057         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2058         `prepared' flag is set.
2059
2060         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2061         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2062         issues; see gtest-254.cs.
2063
2064 2006-03-07  Martin Baulig  <martin@ximian.com>
2065
2066         * generic.cs (TypeManager.InferType): Allow infering
2067         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2068
2069 2006-03-06  Martin Baulig  <martin@ximian.com>
2070
2071         * generic.cs
2072         (TypeManager.InferType): Fix gtest-250.cs.
2073
2074         * typemanager.cs
2075         (TypeManager.IsSubclassOf): Also check the base class.
2076
2077         * expression.cs
2078         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2079         fixes gtest-249.cs.
2080
2081 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2082
2083         Fix #77679.
2084         * expression.cs (ParameterReference.DoResolveBase): Change return
2085         type to bool.
2086         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2087         Update.
2088
2089         Fix #77628.
2090         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2091
2092         Fix #77642.
2093         * typemanager.cs (GetFullNameSignature): Don't nullref on
2094         protected accessors.
2095
2096 2006-02-16  Martin Baulig  <martin@ximian.com>
2097
2098         * generic.cs
2099         (TypeManager.GetGenericFieldDefinition): New public method; use it
2100         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2101
2102 2006-02-14  Martin Baulig  <martin@ximian.com>
2103
2104         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2105
2106 2006-02-14  Martin Baulig  <martin@ximian.com>
2107
2108         * generic.cs
2109         (TypeManager.DropGenericMethodArguments): New public method; don't
2110         use GetGenericMethodDefinition() on something which is not a
2111         generic method.
2112
2113 2006-02-14  Martin Baulig  <martin@ximian.com>
2114
2115         * generic.cs
2116         (ConstraintChecker.CheckConstraints): If a type parameter has the
2117         `struct' constraint, the type must be a non-nullable valuetype.
2118
2119 2006-02-10  Martin Baulig  <martin@ximian.com>
2120
2121         * typemanager.cs
2122         (TypeManager.IsOverride): Make this work for instantiated methods
2123         in a generic class; fixes #77509.
2124         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2125         rather than calling it directly; fixes #77488.  
2126
2127 2006-02-08  Martin Baulig  <martin@ximian.com>
2128
2129         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2130         reporting into CheckConstraint() so we can use the correctly
2131         instantiated type.
2132
2133 2006-02-08  Martin Baulig  <martin@ximian.com>
2134
2135         * expression.cs (BaseAccess): Add support for generic methods.
2136
2137         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2138         the new MethodGroupExpr.
2139
2140 2006-02-07  Martin Baulig  <martin@ximian.com>
2141
2142         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2143         also reference types; fixes #77483.
2144
2145 2006-02-07  Martin Baulig  <martin@ximian.com>
2146
2147         * generic.cs
2148         (TypeManager.IsGenericMethod): We now return whether something is
2149         an instantiated generic method (and not a generic method def).
2150         (TypeManager.IsGenericMethodDefinition): New public method.
2151
2152         * typemanager.cs
2153         (TypeManager.CSharpSignature): Only include type arguments for
2154         "real" generic methods, not for any instantiated method.
2155         (TypeManager.GetMethodName): Likewise, but also allow generic
2156         method definitions here.
2157
2158 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2159
2160         * codegen.cs (EmitScopeInitFromBlock): check here the
2161         capture_context, there is no need to make two calls to the
2162         EmitContext. 
2163
2164         * anonymous.cs: Add some debugging messages that might help me
2165         track other instances of this problem in the future (the
2166         regression of test 467).
2167
2168         * cs-parser.jay: track the variable block, as we need to initalize
2169         any captured variables declared in this block for the "catch"
2170         portion of the "Try" statement.
2171
2172         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2173         scope initialization for captured variables. 
2174
2175         Also, move the emit for the variables after the block location has
2176         been marked.
2177
2178 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2179
2180        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2181         
2182 2006-02-06  Martin Baulig  <martin@ximian.com>
2183
2184         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2185         `TypeManager.value_type' as parent type to
2186         ModuleBuilder.DefineType().  Fixes #77358.      
2187
2188 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2189
2190         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2191         commit yesterday, the initialization for the roots is necessary.
2192         What is not necessary is the scope activation.
2193
2194 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2195
2196         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2197         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2198         CS0206 checks.
2199         (Argument.Resolve): Remove CS0206 checks.
2200
2201 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2202
2203         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2204         scopes for all the roots, the scopes will now be emitted when the
2205         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2206
2207         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2208         code.  This reduces a lot of existing cruft.
2209         
2210         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2211         that the ScopeInfo is generated as we enter the scope, not at the
2212         time of use, which is what we used to do before.
2213
2214         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2215         every time a Block is about to be emitted if we have a
2216         CaptureContext. 
2217
2218 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2219
2220         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2221         attribute for mscorlib too.
2222
2223         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2224         (Reset): Update.
2225         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2226
2227         * typemanager.cs (cons_param_array_attribute): Make private.
2228         (Reset): Set it to null.
2229         (InitCoreHelpers): Don't initialize it.
2230         (ConsParamArrayAttribute): New.  Initialize it as needed.
2231         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2232
2233 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2234
2235         * expression.cs: There might be errors reported during the
2236         selection of applicable methods.  If there are errors, do not
2237         continue execution as it will lead the compiler to crash.
2238
2239 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2240
2241         * expression.cs: Member access is not allowed on anonymous
2242         methods.  Fixes #77402.
2243
2244 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2245
2246         Fix #77401
2247         * cs-parser.jay (VariableDeclaration): Don't set
2248         current_array_type to null.
2249         (field_declaration, event_declaration, declaration_statement):
2250         Set it to null here.
2251
2252 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2253
2254         Fix part of #77397
2255         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2256
2257 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2258
2259         * typemanager.cs (GenericParameterPosition): New.
2260         * doc.cs: Use it.
2261
2262 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2263
2264         * doc.cs : To process "include" elements, first we should create
2265           another list than XmlNodeList, because it could result in node
2266           removal, which could result in that the XmlNodeList gives up
2267           yielding next node.
2268
2269 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2270
2271         * expression.cs: Introduce an error report that we were not
2272         catching before.   Gonzalo ran into it.
2273
2274 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2275
2276         A fix for bug: #76957
2277         
2278         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2279         ComputeMethodHost before creating the method, this is a new
2280         requirement. 
2281
2282         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2283         that this method references (RegisterScope).  The actual scope
2284         where the method is hosted is computed with the ComputeMethodHost
2285         before we create the method.
2286
2287         Moved the Deepest routine here.
2288
2289         (AnonymousContainer.ComputeMethodHost): New routine used to
2290         compute the proper ScopeInfo that will host the anonymous method.
2291
2292         (ScopeInfo): Deal with multiple roots.  The problem was that we
2293         did not have a unique root where all ScopeInfos could be hanged
2294         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2295         of roots.  
2296
2297         Remove AdjustMethodScope which is now computed at the end.  Remove
2298         LinkScope which did a partial link, instead link all ScopeInfos
2299         before code generation from the new "LinkScopes" routine. 
2300
2301         Simplify all the Add* routines as they no longer need to maintain
2302         the tree, they just need to record that they are using variables
2303         from a ScopeInfo.
2304
2305         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2306         routines to produce the forest of ScopeInfo trees.
2307
2308         * class.cs (TypeContainer.AppendMethod): This is just like
2309         AddMethod, but ensures that an interface implementation method
2310         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2311         methods, but at the end.
2312
2313         We use this functionality to ensure that the generated MoveNext
2314         method in the iterator class is resolved/emitted before the
2315         enumerator methods created.   
2316
2317         This is required because the MoveNext method computes the right
2318         ScopeInfo for the method.  And the other methods will eventually
2319         need to resolve and fetch information computed from the anonymous
2320         method. 
2321
2322         
2323 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2324
2325         Improve implementation of section 14.4.2.2 (Better function member).
2326         * expression.cs (Invocation.MoreSpecific): Compare all type
2327         arguments before deciding if one type is more specific than
2328         another.  Handle array types too.  Return the more specific type.
2329         (Invocation.BetterFunction): Add more tie-breaking rules from
2330         section 14.4.2.2.  Perform "more specific" check after
2331         other tie-breaking rules.  Compare all parameter types before
2332         choosing the "more specific" method.
2333
2334 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2335             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2336
2337         Fix rest of #76995.
2338         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2339         the 'aliases' hash.
2340         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2341         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2342
2343 2006-01-18  Martin Baulig  <martin@ximian.com>
2344
2345         * class.cs (TypeContainer.AddToMemberContainer): Use
2346         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2347         fixes #77124.
2348
2349 2006-01-18  Martin Baulig  <martin@ximian.com>
2350
2351         Fix #76417: a generic class may now have methods which may unify
2352         for some type parameter substitutions.
2353
2354         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2355         for methods which may unify anymore.
2356
2357         * expression.cs (Invocation.MoreSpecific): New private static
2358         method; checks whether one method is more specific than another
2359         according to 14.4.2.2 of the spec.
2360         (Invocation.BetterFunction): Implement the tie-breaking rules from
2361         14.4.2.2 of the spec: if two methods unify for some type parameter
2362         substitution, we need to pick the more specific one.
2363
2364 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2365
2366         Fix #76656, cs0231-2.cs.
2367         * cs-parser.jay (formal_parameter_list): Make error case catch
2368         more issues.
2369         (parenthesized_expression_0): Add CS1026 check.
2370         (invocation_expression): Remove unused { $$ = lexer.Location }.
2371
2372 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2373
2374         Fix #76824.
2375         * cs-parser.jay (statement_expression): Don't list out the
2376         individual statement-expressions.  Convert syntax error into
2377         CS0201 check.
2378
2379 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2380
2381         Fix #76874.
2382         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2383         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2384         CheckIntermediateModification.
2385         (FieldExpr.DoResolve): Add new two-argument version that
2386         allows us to resolve the InstanceExpression as an lvalue.
2387         The one-argument variant is now just a wrapper.
2388         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2389         Resolve the lhs as an lvalue if the it has a value type.
2390         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2391         from Assign.DoResolve.
2392         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2393         resolved as an lvalue.
2394         (PropertyExpr.DoResolve): Update.
2395         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2396         has a value type.  Move CS1612 check here from
2397         CheckIntermediateModification.
2398         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2399         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2400         'right_side' of a ResolveLValue on an 'out' argument.
2401         (EmptyExpression.LValueMemberAccess): New.  Used as the
2402         'right_side' of a propagated ResolveLValue on a value type.
2403         (LocalVariableReference.DoResolveBase): Recognize
2404         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2405         Add CS1654 check.
2406         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2407         EmptyExpression.Null.
2408
2409 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2410
2411         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2412           Type.IsGenericParameter(). Fixed bug #77183.
2413         * doc.cs : it is now identical to doc.cs in mcs.
2414
2415 2006-01-16  Martin Baulig  <martin@ximian.com>
2416
2417         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2418
2419 2006-01-16  Martin Baulig  <martin@ximian.com>
2420
2421         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2422         ctors; fixes #77250.
2423
2424 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2425
2426         This fixes the problem where we used ldfld instead of ldflda to
2427         load the "THIS" pointer on captured parameters, when THIS is a
2428         value type.  See bug #77205.
2429         
2430         * iterators.cs (CapturedThisReference.Emit): Pass false to
2431         EmitThis (we do not need the address).
2432
2433         * codegen.cs (EmitThis): it needs to know whether we need the
2434         address of `this' or not.  This is used by value types.  
2435
2436         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2437         every other call passes false.
2438
2439 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2440
2441         Fix #77221.
2442         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2443         GetOverride.
2444         * expression.cs (Invocation.OverloadResolve): Update.
2445         (Invocation.DoResolve): Avoid double resolution of invocation.
2446
2447 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2448
2449         Fix #77180.
2450         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2451         unary negation of floating point types as 0-expr; negation cannot
2452         overflow in floating point types.
2453
2454         Fix #77204.
2455         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2456         on operands of 'void' type.
2457
2458         Fix #77200.
2459         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2460         and ExclusiveOr for boolean constants too.
2461
2462 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2463
2464         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2465
2466 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2467
2468         * cs-tokenizer.cs (Position): New class used to save and restore
2469         the position state in the tokenizer.  Before this patch the save
2470         and restore was not complete enough so the line and columns would
2471         start to drift and the debugger and stack traces will get the
2472         wrong data.
2473
2474 2006-01-10  Martin Baulig  <martin@ximian.com>
2475
2476         * generic.cs
2477         (TypeParameter.InflateConstraints): New public method.
2478
2479         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2480         constraints; fixes #77042.
2481
2482 2006-01-10  Martin Baulig  <martin@ximian.com>
2483
2484         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2485         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2486         #77061. 
2487
2488 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2489
2490         Fix #75636.
2491         * expression.cs (Invocation.OverloadResolve): Replace reflected
2492         override methods with their base virtual methods, rather than
2493         skipping over them.
2494         * typemanager.cs (TypeManager.GetOverride): New.
2495
2496 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2497
2498         * driver.cs: Report the case of no source files and no -out:
2499         argument provided.
2500
2501 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2502
2503         Fix #77035.
2504         * expression.cs (ComposedCast.GetSignatureForError): Define.
2505
2506 2006-01-05  Jb Evain  <jbevain@gmail.com>
2507
2508         * class.cs (Property.Define, Indexer.Define): do not tag the
2509         properties as SpecialName | RTSpecialName.
2510
2511 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2512
2513         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2514         doing a low-level comparission of parameter types.  It was lacking
2515         a check for __argslist. 
2516
2517 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2518
2519         * expression.cs (ParameterReference.DoResolveBase): Allow
2520         reference parameters if they are local to this block. 
2521
2522         This allows the ref and out parameters of a delegate to be used in
2523         an anonymous method, for example:
2524
2525         delegate void set (out int x);
2526
2527         set s = delegate (out int x){
2528                 x = 0;
2529         };
2530
2531         This is used by functionality introduced late in the C# language.
2532         
2533         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2534         method that take ref and out parameters. 
2535
2536         Fixes #77119 which was a late change in the spec.
2537
2538 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2539
2540         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2541         parent if its the same scope.  Fixes #77060.
2542
2543 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2544
2545         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2546
2547 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2548
2549         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2550         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2551         that doesn't contain the full public key. This is a update of the
2552         friend assemblies in .Net 2.0 release.
2553         
2554 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2555
2556         Fix #76995
2557
2558         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2559         ListDictionary, to contain the ExternAliasEntry entries (in
2560         addition to the NamespaceEntry.aliases hashtable). This field is
2561         shared between the original entry and its doppelganger (bodyless 
2562         copy of it).
2563         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2564         extern_aliases field.
2565         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2566         lookup in extern_aliases.
2567
2568 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2569
2570         Fix #77006.
2571         * class.cs (TypeContainer.Mark_HasEquals): New.
2572         (TypeContainer.Mark_HasGetHashCode): New.
2573         (ClassPart): Override them.
2574         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2575
2576         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2577         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2578         DeclSpace.
2579
2580         Fix #77008.
2581         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2582         'parent' argument to the base constructor.
2583
2584         Remove all mention of TypeContainer from decl.cs.
2585         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2586         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2587         (DeclSpace.DeclSpace): Likewise.
2588         (DeclSpace.DefineMembers): Remove unused argument.
2589         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2590         debugging check -- we don't care if the debug code throws an
2591         InvalidCastException instead of an InternalErrorException.
2592         * class.cs (TypeContainer.DefineMembers): Update to changes.
2593         (TypeContainer.DoDefineMembers): Likewise.
2594         (TypeContainer.GetMethods): Likewise.
2595         (PropertyMember.Define): Likewise.
2596         (MemberBase.Parent): New property that forwards to
2597         MemberCore.Parent, but ensures that we get a TypeContainer.
2598         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2599         (RootContext.PopulateTypes): Likewise.  Remove special case code
2600         for !RootContext.StdLib: DefineMembers is idempotent.
2601
2602 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2603
2604         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2605
2606 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2607
2608         * doc.cs : The search for referenced namespace was insufficient to
2609           get global one as it used to do. Fixed bug #76965.
2610
2611 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2612
2613         * doc.cs : check name in cref in the last phase that whether it is
2614           namespace or not.
2615
2616 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2617
2618         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2619           Mono.C5.
2620
2621 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2622
2623         * doc.cs : so it turned out that we cannot skip override check for 
2624           interface members. Fixed bug #76954.
2625
2626 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2627
2628         * cs-tokenizer.cs : fixed bug #75984:
2629           - #warning and #error should not be handled when the source line
2630             is disabled.
2631           - #line is not checked strictly when the source line is disabled.
2632           - #define and #undef is on the other hand checked strictly at any
2633             state.
2634
2635 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2636
2637         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2638           CS1027 report.
2639
2640 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2641
2642         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2643
2644         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2645         nested types.
2646
2647 2005-12-14  Martin Baulig  <martin@ximian.com>
2648
2649         * typemanager.cs (TypeManager.GetFullName): Make this public;
2650         `Type.Fullname' now never returns null.
2651
2652         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2653         explicit interface implementations; we're now using the same
2654         naming convention than csc does.
2655
2656 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2657
2658         * convert.cs (ExplicitConversionCore): Check the return value from
2659         ExplicitConversionCore which can return null on failure.  Fixes #76914
2660
2661 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2662
2663         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2664         instead of IsGenericInstance.
2665         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2666         code that's now covered by the more general test.
2667         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2668
2669         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2670         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2671         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2672         * generic.cs, report.cs, typemanager.cs: Likewise.
2673
2674 2005-12-08  Martin Baulig  <martin@ximian.com>
2675
2676         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2677
2678         * typemanager.cs (TypeManager.CSharpSignature): Include type
2679         arguments in the signature of a generic method.
2680
2681 2005-12-07  Martin Baulig  <martin@ximian.com>
2682
2683         Add support for custom attributes on type parameters.
2684
2685         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2686
2687         * generic.cs (TypeParameterName): New public class; we use this
2688         instead of a `string' to store the name of a type parameter, so we
2689         can also have `Attributes'.
2690         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2691         array instead of a `string[]' array.
2692         (TypeParameter.ctor): We now also take an `Attributes' argument.
2693         (TypeParameter.EmitAttributes): New public method; emit our
2694         `OptAttributes' here.
2695         (GenericMethod.EmitAttributes): New public method; emit the custom
2696         attributes on all our type parameters.
2697
2698         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2699         our type parameters.
2700         (MethodData.Define): If we're a generic method, call
2701         EmitAttributes() on it.
2702
2703 2005-12-07  Martin Baulig  <martin@ximian.com>
2704
2705         * generic.cs
2706         (ConstraintChecker): New public abstract class; move the
2707         constraint checking here from `ConstructedType' and also do
2708         constraint checking for generic methods here.
2709
2710         * expression.cs (Invocation.OverloadResolve): Use
2711         ConstraintChecker.CheckConstraints() if we resolved to a generic
2712         method.  Fix #76806.
2713
2714 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2715
2716         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2717
2718         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2719         event initializers.
2720         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2721         (FieldBase.Initializer): Initializer is now optional.
2722         (EventField.Define): Only event field can have initializer.
2723
2724         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2725
2726         * const.cs (Const): Reuse initializer.
2727
2728         * cs-parser.jay: Updated after FieldBase changes.
2729         Added current_array_type to simplify array initializers.
2730
2731         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2732
2733         * expression.cs, iterators.cs: Updated.
2734
2735         * namespace.cs (NamespaceEntry): Made UsingFound private.
2736
2737 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2738
2739         * parameterCollection.cs: Obsolete, removed.
2740         * parser.cs: Obsolete, removed.
2741
2742 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2743
2744         Fix #76849.
2745         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2746
2747         * enum.cs (Enum.Define): Set obsolete context here.
2748
2749 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2750
2751         * doc.cs :
2752           - FindDocumentedMember() now expects 1) paramList as null
2753             when "we don't have to check the number of parameters" and
2754             2) Type.EmptyTypes when "there is no arguments".
2755           - Introduced FoundMember struct to hold the exact type which was
2756             used to find the documented member (the above change broke
2757             test-xml-044; it might be better just to use DeclaringType than
2758             what MS does, like this change does, but it depends on usage.)
2759
2760 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2761
2762         * doc.cs : documented member might be from DeclaringType for nested
2763           types. Fixed bug #76782.
2764
2765 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2766
2767         * anonymous.cs: Have the param code handle leaving copies on the
2768         stack etc. Allows anonymous params to take part in the assignment
2769         code (++, +=, etc). Fixes bug #76550
2770
2771         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2772         it down to the anon code.
2773
2774         * iterators.cs: Use dummy var here
2775
2776         * codegen.cs: Handle new vars
2777
2778 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2779
2780         Fix #76849.
2781         * class.cs (MethodData.Define): Set proper Obsolete context.
2782
2783         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2784         obsolete context.
2785         (FieldExpr.DoResolve): Ditto.
2786
2787 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2788
2789         Fix #76849.
2790         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2791         parent is not obsolete.
2792
2793 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2794
2795         * doc.cs : (FindDocumentedMember) find parameterless members first
2796           and get CS0419 in the early stage. Fixed first case of bug #76727.
2797
2798 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2799
2800         Fix #76859.
2801         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2802         no error was reported.
2803
2804         *expression.cs (Binary.DoResolve): left can be null.
2805
2806 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2807
2808         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2809         abstract method and all overrides.
2810         * support.cs (ParameterData.GenericConstraints): Delete.
2811         (ReflectionParameters.type_params): Delete.
2812         (ReflectionParameters.ReflectionParameters): Make private.
2813         (ReflectionParameters.GetConstaints): New factory method.
2814         * generic.cs (TypeParameterDefineType): Use it.
2815         (TypeManager.GetTypeParameterConstraints): Likewise.
2816
2817 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2818
2819         Fix #76783.
2820         * class.cs (MethodData.Emit): Parameters should be labeled first.
2821
2822 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2823
2824         Fix #76761.
2825         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2826
2827 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2828
2829         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2830
2831         * class.cs (MethodCore): Parameter clean up.
2832         (IMethodData): Added ParameterInfo.
2833         (MethodData): Parameter clean up.
2834         (Indexer.Define): Parameter clean up.
2835
2836         * anonymous.cs,
2837         * codegen.cs,
2838         * cs-parser.jay,
2839         * decl.cs,
2840         * doc.cs,
2841         * ecore.cs,
2842         * flowanalysis.cs,
2843         * iterators.cs,
2844         * pending.cs,
2845         * statement.cs,
2846         * typemanager.cs: Parameter clean up.
2847
2848         * delegate.cs (Define): Get rid of duplicated code.
2849
2850         * expression.cs (ParameterReference): Removed useless parameters
2851         and simplified.
2852         (Invocation): Ditto.
2853
2854         * parameter.cs (ParamsParameter): New class, params specialization.
2855         (ArglistParameter): Attemp to separate arglist.
2856         (Parameter): Refactored to be reusable and faster.
2857         (Parameter.Modifier): Made understandable.
2858         (Parameters): Changed to be used as a class for `this' assembly
2859         parameters. Refactored to use new specialized classes.
2860
2861         * support.cs (ParameterData): Added Types property.
2862         (InternalParameters): Deleted.
2863
2864 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2865
2866         * doc.cs : the previous patch does not actually fix the bug.
2867           PropertyInfo override check is now implemented and really fixed it.
2868         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2869
2870 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2871
2872         * doc.cs : apply "override filter" also to properties.
2873           Fixed bug #76730.
2874
2875 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2876
2877         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2878           no need to check overrides. For classes, omit those results from 
2879           interfaces since they must exist in the class. Fixed bug #76726.
2880
2881 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2882
2883         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2884           with different parameters. Fixed the second problem in #76685.
2885
2886 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2887
2888         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2889           get expected 'protected' access in CheckValidFamilyAccess()).
2890           Fixed bug #76692.
2891
2892 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2893
2894         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2895           Fixed bug #76705.  CS1569 was incorrectly commented out.
2896
2897 2005-11-23  Martin Baulig  <martin@ximian.com>
2898
2899         * generic.cs (Constraints.Define): Removed.
2900         (TypeParameter.DefineConstraints): Removed.
2901         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2902         on the GenericTypeParameterBuilder here.
2903
2904 2005-11-23  Martin Baulig  <martin@ximian.com>
2905
2906         * typemanager.cs (TypeManager.GetProperty): Make this public.
2907
2908         * generic.cs (Nullable.NullableInfo.ctor): Use
2909         TypeManager.GetProperty() rather than using reflection directly.
2910
2911 2005-11-17  Martin Baulig  <martin@ximian.com>
2912
2913         * expression.cs (Indexers.GetIndexersForType): Added support for
2914         generic parameters; fixes #76587.
2915
2916 2005-11-17  Martin Baulig  <martin@ximian.com>
2917
2918         * anonymous.cs
2919         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2920         inherit the scope from our parent.  Fixes #76653.
2921
2922 2005-11-15  Martin Baulig  <martin@ximian.com>
2923
2924         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2925         instead of `ScopeTypeBuilder' to refer to the "current" type.
2926         (AnonymousMethod.CreateScopeType): Correctly create the helper
2927         class if we're inside a generic type definition.
2928
2929 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2930
2931         * doc.cs : use Invocation.IsOverride() to do real override check.
2932         * expression.cs : made Invocation.IsOverride() internal.
2933
2934 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2935
2936         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2937           TypeBuilder.FindMembers() and filter overriden base members out.
2938           Fixed bug #76990.
2939
2940 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2941
2942         * doc.cs : ref/out parameters are represented as '@' (instead of
2943           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2944
2945 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2946
2947         * doc.cs : when there was no '.' in cref to methods in doc comment,
2948           then parameters were missing in the output. Fixed bug #76691.
2949
2950 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2951
2952         * driver.cs : don't output docs when there is an error.
2953           Fixed bug #76693.
2954
2955 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2956
2957         * doc.cs :
2958           Now it should detect indexers. Fixed primary concern in bug #76685.
2959           Fixed CS0419 message to not show the identical member signature in
2960           the message.
2961
2962 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2963
2964         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2965           instead of Type.FindMembers() since it does not handle events.
2966           Fixed bug #71604.
2967
2968 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2969
2970         * codegen.cs: Fixed typo (speficied -> specified).
2971
2972 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2973
2974         Fix #76369.
2975         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2976
2977 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2978
2979         * attribute.cs: Changed error message.
2980
2981         * cs-tokenizer.cs: One more check.
2982
2983 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2984
2985         * statement.cs (Block.Resolve): Ignore empty statement.
2986
2987 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * report.cs: Made error/warning methods more strict to avoid
2990         their misuse.
2991
2992         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2993         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2994         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2995         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2996
2997 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2998
2999         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3000         Use the more explicit AssemblyName.FullName instead of 
3001         AssemblyName.Name to report errors.
3002         
3003 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3004
3005         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3006         with mcs.
3007
3008 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3009
3010         * class.cs,
3011         * convert.cs,
3012         * cs-parser.jay,
3013         * decl.cs,
3014         * enum.cs,
3015         * expression.cs,
3016         * generic.cs,
3017         * pending.cs,
3018         * report.cs: Fixed error reporting and typos.
3019
3020         * generic.cs (TypeParameter.GetSignatureForError): New method.
3021         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3022
3023         * typemanager.cs (GetFullName): Refactored.
3024
3025 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3026
3027         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3028         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3029
3030         * class.cs (TypeContainer.IsComImport): New property.
3031         (Constructor.Define): Create proper ctor for ComImport types.
3032
3033         * expression.cs (New.CheckComImport): Fixed.
3034
3035 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3036
3037         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3038         that a parameter has been captured does not mean that we do not
3039         have to do the rest of the processing.  This fixes the second part
3040         of #76592.  If there was another anonymous method capturing
3041         values in the past, the Scope would never be set for the second
3042         method that captured the same parameter.
3043
3044         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3045         properly manipulate the stack.   Second part of fix for #76592.
3046
3047         * expression.cs (New): Add support for invoking "new" on
3048         interfaces that have been flagged with the ComImport attribute and
3049         the CoClass.  Fixes #76637 
3050
3051         * statement.cs (Try.DoEmit): When a variable is captured, do not
3052         try to emit the vi.LocalBuilder variable as it has been captured.
3053         Create a temporary variable and store the results on the
3054         FieldBuilder.  Fixes #76642
3055
3056 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3057
3058         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3059
3060         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3061
3062         * expression.cs (Binary.DoResolve): Added && optimalization.
3063     
3064         * typemanager.cs (AddUserType): Removed useless argument.
3065
3066 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3067
3068         * statement.cs (Block.variables): Uses ListDictionary.
3069
3070 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3071
3072         Fix #75969.
3073         * class.cs (PartialContainer.EmitType): Customized to emit
3074         security attributes.
3075         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3076         for partial classes.
3077
3078 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3079
3080         Fix #76599.
3081         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3082         access has to be fixed.
3083         
3084         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3085
3086 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3087
3088         Fix #76590.
3089         * ecore.cs (NullCast.Reduce): Implemented.
3090
3091         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3092         constant type.
3093         
3094         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3095         properly.
3096         (Foreach.Resolve): Catch null properly.
3097
3098 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3099  
3100         * cs-tokenizer.cs: Warning text fix.
3101
3102         * driver.cs: AllWarningNumbers exposed on public interface.
3103
3104         * report.cs (): Reviewed warning numbers.
3105         (IsValidWarning): Use binary search.
3106
3107 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3108  
3109         * driver.cs: Implemeted resource visibility.
3110         (Resources): New class for code sharing between /res: and
3111         /linkres:
3112  
3113 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3114
3115         decl.cs (CurrentTypeParameters): Fixed to be public.
3116
3117 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3118
3119         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3120
3121 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3122
3123         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3124
3125 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3126
3127         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3128
3129 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3130
3131         Add friend assembly access support.
3132         * typemanager.cs: assembly_internals_vis_attrs
3133         cache for friend assembly access. 
3134         (TypeManager.IsFriendAssembly): New method for
3135         checking friend assembly access.
3136         (TypeManager.Error_FriendAccessNameNotMatching): New
3137         helper method.
3138         (TypeManager.CompareKeyTokens): Likewise.
3139         (TypeManager.Filter): Handle friend accessible
3140         members.
3141
3142         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3143         friend accessible types.
3144
3145         * ecore.cs (Expression.IsAccessorAccessible): Handle
3146         friend accessible properties.
3147
3148         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3149         accessible types.
3150         
3151 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3152
3153         Fix #76568.
3154         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3155         folding.
3156         
3157         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3158         contants only.
3159         
3160         * ecore.cs (NullCast): Child is contant only.
3161         
3162         * literal.cs (NullLiteral.Reduce): null can be converted to any
3163         reference type.
3164
3165 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3166
3167         * driver.cs: Use Encoding.Default as default code page instead
3168           of ISO-28591.
3169
3170 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3171
3172         Fix #76085.
3173         * expression.cs (Invocation.Error_InvalidArguments): Handle
3174         __arglist parameters.
3175         (Invocation.VerifyArgumentsCompat): Likewise.
3176         * support.cs (ReflectionParameters.GetSignatureForError): Print
3177         __arglist parameters.
3178         (InternalParamters.GetSignatureForError): Likewise.
3179         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3180
3181 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3182
3183         * attribute.cs (GetPropertyValue): Made public.
3184
3185         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3186         Resolve.
3187         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3188         attribute.
3189         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3190         is not defined.
3191         
3192         * driver.cs: Reflect method name change.
3193         
3194         * statement.cs (Try.Resolve): Warn when try has both general
3195         exception handlers.
3196         
3197         * typemanager.cs: runtime_compatibility_attr_type new predefined
3198         type.
3199
3200 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3201
3202         Fix #76419.
3203         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3204         treat it as an empty parameter list.
3205
3206 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3207
3208         Fix #76271.     
3209         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3210         ResolveAsTypeStep silent.
3211         * statement.cs (Block.AddConstant): Mark block as used.
3212         (Block.ResolveMeta): Avoid piling on error messages
3213         if a constant initializer resolution fails.
3214
3215 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3216
3217         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3218         Remove.
3219         (NamespaceEntry.VerifyAllUsing): New.
3220         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3221         behaviour.  Delegates actual resolution of alias to ...
3222         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3223         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3224         Update.
3225         * driver.cs (Driver.MainDriver): Update.
3226         
3227         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3228         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3229         property.
3230         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3231         Remove.
3232         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3233         RootNamespace.DefineNamespacesForAll.
3234
3235 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3236
3237         * typemanager.cs (assemblies, external_aliases, modules)
3238         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3239         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3240         overhead.  Move resposibility ...
3241         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3242         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3243
3244 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3245
3246         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3247         cached_namespaces.  Improve usage.
3248         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3249         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3250         Move from GlobalRootNamespace and simplify.
3251         (RootNamespace.Global): Make instance variable.
3252         (RootNamespace.RootNamespace): Add "alias name" parameter.
3253         (GlobalRootNamespace): Simplify drastically.
3254         (Namespace.Lookup): Don't use GetNamespace.
3255         * typemanager.cs (GetRootNamespace): Rename from
3256         ComputeNamespaceForAlias.
3257         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3258
3259 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3260
3261         * anonymous.cs (AnonymousContainer): Don't crash when container
3262         doesn't exist.
3263
3264 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3265
3266         * expression.cs (Binary.DoResolve): Warn when comparing same
3267         values.
3268
3269 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3270
3271         Fix #76486.
3272         * expression.cs (Binary.DoResolve): It looks like there are no
3273         convetsion rules in enum context.
3274
3275 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3276
3277         Add support for extern alias qualifiers.
3278         * typemanager.cs: Move some LookupTypeReflection code
3279         to namespace.cs, to have cleaner code. Added some methods
3280         to help us keep track of the extern aliased references.
3281         * driver.cs: Add suport for extern alias assemblies on command
3282         line and check for their warnings/errors. Also keep track of the
3283         extern aliased assemblies.
3284         * namespace.cs: Move the global functionality of Namespace
3285         to GlobalRootNamespace/RootNamespace. Now the global namespace
3286         is GlobalRootNamespace.Globa. Also the code moved from 
3287         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3288         Finally added LocalAliasEntry (AliasEntry before) and
3289         ExternAliasEntry, to handle alias statements.
3290         * cs-parser.jay: Add support in the grammar for extern alias
3291         statement.
3292         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3293         Update callings to Namespace (now in GlobalRootNamespace).
3294
3295 2005-10-25  Martin Baulig  <martin@ximian.com>
3296
3297         * convert.cs (ImplicitTypeParameterConversion): Make base
3298         interfaces actually work; fixes #76557.
3299
3300 2005-10-25  Martin Baulig  <martin@ximian.com>
3301
3302         * generic.cs
3303         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3304         all the type parameters; fixes #76551.
3305
3306 2005-10-25  Martin Baulig  <martin@ximian.com>
3307
3308         Fix #76472.
3309
3310         * generic.cs
3311         (GenericMethod.ctor): Added `Expression return_type' and
3312         `Parameters parameters' arguments.
3313         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3314         parameter and return types to check their constraints if they're
3315         generic types.
3316
3317         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3318         boolean field.
3319
3320         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3321         constraints of a generic type if `ec.ResolvingGenericMethod'.
3322
3323         * class.cs (MethodCore.DoDefineParameters): Set
3324         `ec.ResolvingGenericMethod' if we're a generic method.
3325         (MemberBase.MemberType): Likewise.
3326
3327 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3328
3329         * typemanager.cs (TypeManager): Added 
3330         TypeManager.internals_visible_attr_type to cache
3331         S.R.CompilerServices.InternalsVisibleToAttribute.
3332
3333         * codegen.cs (AssemblyClass): Added checks for 
3334         InternalsVisibleToAttribute in new method 
3335         CheckInternalsVisibleAttribute () and also cache the
3336         AssemblyName in AssemblyClass.Name.
3337         
3338 2005-10-24  Martin Baulig  <martin@ximian.com>
3339
3340         * typemanager.cs
3341         (TypeManager.ExpandInterfaces): Added overloaded version which
3342         just takes a `Type[]' array.
3343
3344         * generic.cs
3345         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3346         just use the interfaces which were explicitly specified and not
3347         the interfaces they inherit.  Fixes #76482.
3348         (TypeParameter.FindMembers): Expand the interfaces here.
3349
3350 2005-10-21  Martin Baulig  <martin@ximian.com>
3351
3352         * generic.cs
3353         (Constraints.Resolve): Also resolve the actual types here.
3354         (Constraints.ResolveTypes): Just check the constraints here.
3355         Fixes #76363; see gtest-218.cs.
3356
3357 2005-10-21  Martin Baulig  <martin@ximian.com>
3358
3359         * convert.cs
3360         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3361         instead of a `BoxedCast'; fixes gtest-217.cs.
3362
3363 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3364
3365         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3366           1) "new()" is specified as generic parameter constraint and 2) the
3367           type is TypeBuilder and 3) the type is abstract even if it has a
3368           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3369
3370 2005-10-20  Martin Baulig  <martin@ximian.com>
3371
3372         * generic.cs
3373         (GenericConstraints.TypeParameter): New public property.
3374         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3375         (TypeParameter.DeclSpace): New public property.
3376         (TypeParameter.DefineType): Inflate the constraints if our
3377         `DeclSpace' is an `Iterator'.   
3378
3379 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3380
3381         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3382           GenericMethod argument to compare methods' generic type arguments.
3383           Fixed bug #76382.
3384
3385 2005-10-19  Martin Baulig  <martin@ximian.com>
3386
3387         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3388         not ResolveType() when resolving the base type, so we're not
3389         checking the constraints here.
3390         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3391         if we have any.
3392
3393 2005-10-19  Martin Baulig  <martin@ximian.com>
3394
3395         * generic.cs (ConstructedType.CheckConstraints): Committing
3396         untested fix for #76441.
3397
3398 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3399
3400         Fix #76371.
3401         * class.cs (TypeContainer.DefineType): Move updating of
3402         topological sort earlier in the code.
3403         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3404
3405 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3406
3407         Fix #76273.
3408         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3409         
3410         * constant.cs (Constant.TryReduce): Moved from Cast class.
3411         (Reduce): Made little bit more OO and fixed missing conversions.
3412         
3413         * ecore.cs (Reduce): Implemented.
3414         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3415         
3416         * literal.cs (Reduce): Implemented.
3417         
3418         * class.cs: Reverted Miguel's wrong commit.
3419
3420 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3421
3422         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3423
3424 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3425
3426         * cs-parser.jay, expression.cs : CS0214 was missing error location
3427           for constants. Fixed bug #76404.
3428
3429 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3430
3431         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3432         InstanceExpression.
3433         (PropertyExpr.EmitCall): Likewise.
3434         * expression.cs (Invocation.EmitArguments): Handle case where
3435         arguments == null.
3436         (Invocation.EmitCall): Avoid allocating temporary variable if
3437         there are no arguments.
3438
3439 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3440
3441         Fix #76370.
3442         * convert.cs (ExplicitConversionCore): Fixed object->enum
3443         conversion.
3444
3445 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3446
3447         Fix #76323.
3448         * convert.cs (ImplicitConversionStandard): Move conversion of
3449         void* to arbitrary pointer types ...
3450         (ExplicitConversionStandard): .. here.
3451         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3452         error to always print typenames.
3453
3454 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3455
3456         * convert.cs (GetConversionOperator): Rename from
3457         GetConversionOperators.  Move operator selection code from ...
3458         (UserDefinedConversion): ... here.
3459
3460 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3461
3462         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3463         conversion.
3464
3465 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3466
3467         * assign.cs (Assign.DoResolve): Error method changed.
3468
3469         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3470         
3471         * const.cs (ResolveValue): Reset in_transit immediately.
3472         
3473         * constant.cs: Error method changed.
3474         
3475         * convert.cs: Removed useless location parameter.
3476         (ExplicitNumericConversion): Don't do double enum check.
3477         (ExplicitConversionCore): Renamed from ExplicitConversion.
3478         (ExplicitUnsafe): Extracted from ExplicitConversion.
3479         (ExplicitConversion): Uses for error reporting.
3480         
3481         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3482         error messages.
3483         (ResolveBoolean): Uses common error method.
3484         (CastToDecimal): Get rid of ec.
3485         (CastFromDecimal): Optimized.
3486         (ConvCast): Get rid of ec.
3487         
3488         * enum.cs (ResolveValue): Reset in_transit immediately.
3489         (Emit): Return after first error.
3490         
3491         * expression.cs: Convert changes.
3492         
3493         * literal.cs: Error method changed.
3494         
3495         * statement.cs: Error method changed.
3496
3497 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3498
3499         Fix gtest-131.cs and gtest-211.cs.
3500         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3501         Only emit code for a label if it is used.  Unreachable code can
3502         violate ECMA evaluation stack invariants.
3503
3504 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3505
3506         * anonymous.cs: Implemented ExprClassName.
3507         
3508         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3509         delegate.
3510         
3511         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3512         check.
3513         
3514         * class.cs (StaticClass.DefineContainerMembers): Report protected
3515         members as error.
3516         
3517         * codegen.cs: if(ed) PRODUCTION.
3518         
3519         * convert.cs (Error_CannotImplicitConversion): Better error
3520         distinction.
3521         
3522         * cs-parser.jay: More error checks.
3523         
3524         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3525         
3526         * driver.cs (CSCParseOption): Enabled wrong option check.
3527         
3528         * ecore.cs (Expression.ExprClassName): Turned to property.
3529         (MemberExpr.CheckIntermediateModification): For checking boxed
3530         value types     modification.
3531         
3532         * statement.cs (Fixed.Resolve): Expression type must be
3533         convertible to fixed type.
3534         (CollectionForeach.GetEnumeratorFilter,TryType):
3535         Small refactoring for easier error checking.
3536
3537 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3538
3539         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3540         attributes.
3541         
3542         * class.cs (GeneratedBaseInitializer): New class for customization
3543         compiler generated initializers.
3544         (MemberBase.DoDefine): Check Obsolete attribute here.
3545         (FieldMember.DoDefine): Ditto.
3546         
3547         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3548         constants.
3549         
3550         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3551         (MemberCore.GetObsoleteAttribute): Removed argument.
3552         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3553         (MemberCore.CheckObsoleteType): New helper.
3554         
3555         * delegate.cs,
3556         * enum.cs,
3557         * statement.cs: Updates after MemberCore changes.
3558         
3559         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3560         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3561         
3562         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3563         obsolete attribute for compiler construct.
3564         (As.DoResolve): Cache result.
3565         
3566         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3567
3568 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3569
3570         * expression.cs (Probe): instead of having a "Type probe_type"
3571         keep the extra information as a TypeExpr probe_type_expr since the
3572         "As" operator needs to perform some type checks.
3573
3574         * (As.DoResolve): If the type is a type parameter, ensure that it
3575         is constrained by a class.
3576
3577 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3578
3579         * statement.cs (Lock): Use the TemporaryVariable class instead of
3580         manually using local variables as those do not work when variables
3581         are captured.
3582
3583         * ecore.cs: Moved the TemporaryVariable class from being a nested
3584         class inside Foreach to be a public class that can be employed in
3585         other places. 
3586
3587 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3588
3589         * cs-parser.jay: interface_accessors replaced by
3590         accessor_declarations.
3591
3592         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3593         location.
3594         
3595         * statement.cs (GotoCase.Resolve): Convert null constant to
3596         null case.
3597         (SwitchLabel.ResolveAndReduce): Ditto.
3598         (SwitchLabel.NullStringCase): Custom null stamp.
3599         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3600         
3601         typemanager.cs (CSharpSignature): Don't skip first argument
3602         for full names.
3603
3604 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3605
3606         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3607         expression.cs, iterators.cs, literal.cs: Store constants and
3608         literals location.
3609         
3610         * class.cs (MemberBase.ShortName): Pass location.
3611         
3612         * cs-parser.jay: Some location fixes.
3613         
3614         * ecore.cs (Expression.Location): Made virtual.
3615
3616 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3617
3618         Fix #72930.
3619         * const.cs (Const.ResolveValue): Check for assigning non-null
3620         value to reference type.
3621
3622 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3623
3624         Fix #76133.
3625         * expression.cs (This.VerifyFixed): In a value type T, the type of
3626         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3627         value type R, 'this' is treated as a value parameter.
3628
3629 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3630
3631         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3632         if the underlying types are the same, otherwise we need to produce
3633         code that will do the proper cast.
3634
3635         This was exposed by Marek's constant rewrite which produced
3636         invalid code for the call site:
3637
3638         enum X : long { a }
3639         void Method (X v) {}
3640
3641         Method ((X) 5)
3642
3643         This fixes test-49.cs
3644
3645 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3646
3647         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3648           Type/Object should be allowed as well. Fixed bug #75968.
3649
3650 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3651
3652         * expression.cs : (Binary.DoResolve): when one is enum constant and
3653           another is constant 0, then return enum one *as enum type*.
3654           Fixed bug 74846.
3655
3656 2005-10-04  Martin Baulig  <martin@ximian.com>
3657
3658         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3659         `SetMemberIsUsed()' work for generics, too.
3660
3661 2005-10-04  Martin Baulig  <martin@ximian.com>
3662
3663         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3664         for corlib.  Fixes #75691.
3665
3666 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3667
3668         Fix #76255.
3669         * driver.cs: Fix compilation files with full root path.
3670
3671 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3672
3673         * report.cs (SymbolRelatedToPreviousError): Format the output so
3674         it does not use an open parenthesis that is never closed. 
3675
3676         * driver.cs: Follow coding guidelines
3677
3678 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3679
3680         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3681
3682         * location.cs (InEmacs): in this mode, do not report column
3683         location as it confuses Emacs.
3684
3685 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3686
3687         * support.cs (SeekableStreamReader.Position): Don't error out when
3688         the requested position is just beyond the end of the current
3689         buffered data.
3690
3691 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3692
3693         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3694         try to keep in sync with the byte count of the underlying Stream.
3695         However, this limits us to a window size of 2048 characters: i.e.,
3696         the maximum lookahead of our lexer/parser can be 2048 characters.
3697
3698 2005-09-22  Martin Baulig  <martin@ximian.com>
3699
3700         * driver.cs: Removed a debugging FIXME.
3701
3702 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3703
3704         * cs-parser.jay (type_arguments): Add CS1644 check.
3705         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3706
3707 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3708
3709         * Makefile (PROGRAM): Make profile specific.
3710         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3711         the current directory.
3712
3713         Fix test-455.cs.
3714         * expression.cs (Invocation.EmitCall): Remove optimization on
3715         this_call since it doesn't handle 'this' being a value type.
3716
3717 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3718
3719         * driver.cs: Ensure file handles are closed after parsing
3720
3721 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3722
3723         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3724         if the underlying types are the same, otherwise we need to produce
3725         code that will do the proper cast.
3726
3727         This was exposed by Marek's constant rewrite which produced
3728         invalid code for the call site:
3729
3730         enum X : long { a }
3731         void Method (X v) {}
3732
3733         Method ((X) 5)
3734
3735         This fixes test-49.cs
3736
3737 2005-09-05  Martin Baulig  <martin@ximian.com>
3738
3739         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3740         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3741
3742         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3743
3744 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3745
3746         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3747           to be a pointer type due to the spec 25.2, so check if declaring
3748           type is generic type definition. Fixed bug #75772.
3749
3750 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3751
3752         Fixed bug #75957.
3753         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3754           both types are not defined by methods.
3755         * expression.cs : (Invocation.IsApplicable): it should work when
3756           the argument type is equal to the parameter type, not only when
3757           ImplicitConversionExists() returns true.
3758
3759 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3760
3761         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3762         internal.
3763
3764         Fix #75941.
3765         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3766         flow-branching for LocalVariableReferences in case we were invoked
3767         from a MemberAccess.
3768         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3769         Carved out of ...
3770         (LocalVariableReference.DoResolveBase): ... this.
3771         (MemberAccess.Resolve): Do the check that was disabled during
3772         SimpleNameResolve.
3773
3774 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3775
3776         * class.cs :
3777           (PartialContainer.Create): check abstract/sealed/static strictly
3778           but abstract/sealed can exist only at one side. Fixed bug #75883.
3779
3780 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3781
3782         Fix #75945.
3783         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3784         specified, don't default to UnmanagedType.I4.
3785
3786 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3787
3788         * expression.cs : conditional operator should check possibly
3789           incorrect assign expression. Fixed bug #75946.
3790
3791 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3792
3793         Fix #75934.
3794         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3795         (ScopeInfo.EmitScopeType): Use it to construct field names from
3796         names of captured locals.
3797
3798         Fix #75929.
3799         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3800         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3801         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3802         (ExplicitConversion): Remove enum cases already handled by
3803         implicit conversion.  Move implicit conversion check to the beginning.
3804         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3805         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3806         Don't treat System.Enum as a struct.
3807
3808 2005-08-30  Jb Evain  <jbevain@gmail.com>
3809
3810         * attribute.cs: handles as expression in parameters.
3811
3812 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3813
3814         Fix #75802.
3815         * class.cs (TypeContainer.VerifyClsName): Don't use a
3816         PartialContainer when verifying CLS compliance.
3817         (AbstractPropertyEventMethod): Set Parent here, ...
3818         (PropertyMethod): ... not here.
3819
3820 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3821
3822         * attribute.cs : escaped attribute name should not be allowed to be
3823           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3824
3825 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3826
3827         Fix #75927.
3828         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3829         when converting a long constant to unsigned long.
3830         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3831         detect where IsApplicable and VerifyArgumentsCompat disagree.
3832
3833 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3834         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3835
3836         Fix #75848.
3837         * class.cs (TypeContainer.CanElideInitializer): New helper.
3838         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3839         can safely emitting the initializer of a field.
3840
3841 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3842
3843         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3844           allowed inside a switch (without loop). Fixed bug #75433.
3845
3846 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3847
3848         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3849         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3850
3851 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3852
3853         * driver.cs : kinda reverting the default encoding changes (not exact 
3854           revert since I noticed that "codepage:reset" might not work fine).
3855
3856 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3857
3858         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3859           Location. Now getter and setter store location correctly.
3860           (errors/cs0111-12.cs now reports the expected location.)
3861
3862 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3863
3864         * driver.cs : Use default encoding on the environment.
3865           Removed (now that) extra parameter for SeekableStreamReader.
3866         * support.cs : (SeekableStreamReader) third .ctor() argument for
3867           StreamReader is not required (always true). preamble size could
3868           be acquired in simpler and safe way.
3869
3870 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3871
3872         * cs-parser.jay: report CS0642 at warning level 3
3873           and report CS0642 for an if else statement also
3874           fixes bug #74745. Patch by John Luke (and a bit
3875           modified by me).
3876           Removed extra CS0642 warning check for "while",
3877           "for" and "fixed".
3878         * statement.cs: In Block.Resolve(), CS0642 check
3879           is reimplemented to check a sequence of an empty
3880           statement and a block.
3881
3882           Both fix bug #66777.
3883
3884 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3885
3886         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3887         detection until I fix it.
3888         
3889         * cs-tokenizer.cs: Changed error message.
3890         
3891         * cs-parser.jay: Fixed 2 error locations.
3892         
3893         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3894         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3895         properties.
3896         
3897         * enum.cs (GetSignatureForError): Fixed.
3898         
3899         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3900         method detection.
3901         
3902         * class.cs,
3903         * typemanager.cs (RegisterProperty): Removed.
3904         
3905         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3906
3907 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3908
3909         Fix #75874.
3910         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3911         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3912
3913 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3914
3915         * expression.cs : tiny fix is required for not warning positive ulong.
3916           See test-441.cs.
3917
3918 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3919
3920         * expression.cs : add CS0652 check for constant and integral
3921           expression. Fixed bug #53974.
3922
3923 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3924
3925         * expression.cs : in DoNumericPromotions(), check if there is implicit
3926           conversion overload for string (to check CS0034). Fixed bug #52492.
3927
3928 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3929
3930         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3931
3932 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3933
3934         * ecore.cs : report location when it is *not* Null.
3935
3936 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3937
3938         * codegen.cs,
3939           ecore.cs,
3940           flowanalysis.cs,
3941           expression.cs:
3942           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3943           correctly. Fixed bug #75721.
3944
3945 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3946
3947         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3948         loop that performs 'min (pos, char_count)'.
3949
3950         Fix #75862.
3951         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3952         converted value in Operator.OnesComplement.
3953
3954 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3955
3956         * anonymous.cs: If the anon method is pulled into a helper class,
3957         it needs to be `internal' not `private'. Fixes runtime behavior on
3958         msft. bug #75704
3959
3960 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3961
3962         Fix #75803
3963         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3964         is a partial class.
3965
3966 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3967
3968         The big constants rewrite
3969         Fix #75746, #75685 and more
3970         As a side effect saved 1MB for MWF ;-)
3971         
3972         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3973         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3974         enum based for corlib compilation.
3975         
3976         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3977         subtractions.
3978         
3979         * class.cs (FixedField.Define): Use ResolveAsConstant.
3980         
3981         * const.cs (IConstant): Interface constants and enums.
3982         (Const.ResolveValue): New method for constant resolvning.
3983         (ExternalConstant): Constants from imported assemblies.
3984         
3985         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3986         conversion; like enums.
3987         (Constant.ToType): Converts this constant to different type.
3988         (Constant.Increment): Adds 1.
3989         
3990         * convert.cs (ImplicitConversionRequired): Simplified.
3991         
3992         * cs-parser.jay: Create EnumMember directly.
3993         
3994         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3995         
3996         * doc.cs (GenerateEnumDocComment): Removed.
3997         
3998         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3999         (ConvertIntLiteral): Removed.
4000         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4001         
4002         * enum.cs (EnumMember): Implement IConstant.
4003         (Enum.IsValidEnumConstant): Removed.
4004         (Enum.GetNextDefaultValue): Removed.
4005         (Enum.FindMembers): Updated.
4006         (Enum.GenerateDocComment): Iterate enum members.
4007         
4008         * expression.cs (Cast.TryReduce): Handle enums correctly.
4009         (New.Constantify): Made public.
4010         (MemberAccess.DoResolve): Removed contant specific if(s).
4011         
4012         * literal.cs (NullLiteral): Implement new abstract methods.
4013         
4014         * statement.cs (GotoCase.Resolve): Use new constant methods.
4015         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4016         
4017         * typemanager.cs (LookupEnum): Removed.
4018         (IsEnumType): Fixed to work with corlib.
4019         (RegisterConstant): Removed.
4020         (LookupConstant): Removed.
4021         (GetConstant): Changed to work with IConstant.
4022
4023 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4024
4025         * location.cs : Fixed overflown (>255) column number.
4026
4027 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4028
4029         First cut of the qualified-alias-member feature.
4030         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4031         token.
4032         * cs-parser.jay (DOUBLE_COLON): New token.
4033         (namespace_or_type_name): Add rule for recognizing
4034         qualified-alias-members.
4035         (primary_expression): Likewise.
4036         (element_access): Allow QualifiedAliasMember as a possible
4037         type-bearing expression.
4038         (local_variable_type, local_variable_pointer_type): Likewise.
4039         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4040         aliases in the current and enclosing namespace declarations.
4041         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4042         * decl.cs (MemberName.is_double_colon): New.
4043         (MemberName.MemberName): Add new constructor for alias-member.
4044         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4045         * expression.cs (QualifiedAliasMember): New expression type.
4046
4047 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4048
4049         * location.cs : it borked when no argument was specified.
4050
4051 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4052
4053         * location.cs : tiny ToString() format fix.
4054
4055 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4056
4057         * statement.cs : oops, it was missing.
4058
4059 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4060
4061         A set of fixes for precise line/column location.
4062
4063         * location.cs :
4064           "token" field now holds a file/line "delta", a line number offset 
4065           from the segment, and a column number. See also:
4066           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4067           December/009508.html
4068           Removed static IsNull. Use instance IsNull property instead.
4069         * cs-tokenizer.cs :
4070           For some tokens it stores Location. For Identifier it stores
4071           LocatedToken which is a pair of string name and location.
4072           Column numbers are adjusted only at getChar().
4073         * report.cs :
4074           Use Location.ToString() for reporting (it now contains column).
4075         * cs-parser.jay :
4076           Largely modified to use LocatedToken instead of
4077           string (IDENTIFIER), and to acquire Location from some tokens.
4078         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4079           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4080           codegen.cs :
4081           Now MemberName holds Location. DeclSpace.ctor() receives Location
4082           as a parameter. Removed extra parameters to all derived classes.
4083           Replaced Location.IsNull() with instance property.
4084         * assign.cs, expression.cs :
4085           Added .ctor() overload that omits Location.
4086         * attribute.cs :
4087           Added "nameEscaped" flag that indicates the identifier was escaped
4088           in the source file. This fixes bug #57047.
4089
4090 2005-09-02  Martin Baulig  <martin@ximian.com>
4091
4092         * class.cs: Make CS3005 a warning, not an error.
4093
4094 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4095
4096         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4097         New method, looking for lo-case imported cls type.
4098
4099         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4100         here.
4101
4102         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4103
4104         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4105
4106         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4107         all_imported_types.
4108         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4109
4110         Optimized to save 3.5 MB for SWF compilation.
4111
4112 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4113
4114         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4115         (PartialContainer.Create): Moved logic AddToContainer.
4116         (PartialContainer.MarkForDuplicationCheck): Shares name.
4117         
4118         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4119         place.
4120         
4121         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4122         initialization.
4123         (Namespace.GetSignatureForError): New method.
4124         
4125         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4126         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4127
4128 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4129
4130         Fix #75669.
4131         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4132         member lookup rather than qualifier_type, since qualifier_type can
4133         be null.
4134
4135 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4136
4137         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4138         enum member.
4139
4140 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4141
4142         * statement.cs: Copy the local exception into the exception
4143         captured local.  Fixes 75674
4144
4145 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4146
4147         Fix #75658.
4148         * expression.cs (Invocation.OverloadResolve): Don't report error
4149         CS1501 if error CS1502 has been reported.
4150         (New.DoResolve): Delegate CS1501 reporting to
4151         Invocation.OverloadResolve.
4152
4153         Fix #75656.
4154         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4155         invariant-meaning-in-block property in an enclosing block if
4156         necessary.
4157
4158 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4161         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4162         (Switch.CheckSwitch): Just save 50kb for SWF.
4163
4164 2005-07-27  Martin Baulig  <martin@ximian.com>
4165
4166         * anonymous.cs (CaptureContext.AddField): Added
4167         `AnonymousContainer am' argument; compute its toplevel scope if
4168         it's not already computed.  Fixes #75649.
4169
4170 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4171
4172         Fix #75628.
4173         * class.cs (Constructor.Emit): Reset block to null if the block
4174         resolve fails.
4175
4176 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4177
4178         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4179
4180 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4181
4182         * class.cs (MethodData.Define): Check whether accessor implementing
4183         interface is public.
4184
4185         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4186
4187 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4188
4189         Fix #57245
4190         * namespace.cs (LookupType): Moved same type check to...
4191         
4192         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4193         with the same name.
4194
4195 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4196
4197         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4198         already found a typebuilder.
4199         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4200         MemberNames, not strings.
4201
4202         * const.cs (Error_ExpressionMustBeConst): 
4203         Rename from Error_EpressionMustBeConst.
4204         * const.cs, class.cs, statement.cd: Update.
4205
4206 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4207
4208         Fix #65573
4209
4210         * const.cs (Const.LookupConstantValue): Report missing contant expression
4211         everytime.
4212         (Error_EpressionMustBeConstant): Only one error method.
4213
4214         * class.cs, statement.c: Updated.
4215
4216 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4217
4218         * statement.cs (Block.Flags): Add back HasVarargs.
4219         (Block.flags): Make protected.
4220         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4221
4222         * typemanager.cs (types, typecontainers, user_types): Remove.
4223         (UserTypes, TypeContainers): Likewise.
4224         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4225         (CleanUp, Reset): Update.
4226         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4227         (GetNestedType): Use Type.GetNestedType.
4228         (CoreLookupType): Take two arguments, the namespace and the
4229         basename of the type.  Update to use the Namespace.Lookup
4230         mechanism.
4231         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4232         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4233         string concatenation and substring matches.
4234         * class.cs, enum.cs, delegate.cs: Update to changes.
4235
4236 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4237
4238         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4239         Expression and made virtual.
4240
4241         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4242         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4243
4244         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4245
4246         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4247         error message.
4248
4249         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4250         change.
4251
4252 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4253
4254         Fix #57707
4255         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4256         AssemblyCultureAttribute is not used on executable.
4257
4258         * rootcontext.cs,
4259         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4260
4261 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4262
4263         Fix #60638.
4264         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4265         New.  Reports CS0252/CS0253.
4266         Mostly taken from preliminary patch by Duncak Mak.
4267         (Binary.DoResolveOperator): Store results of operator lookup.
4268         Use them to detect if we need to warn about unintended reference
4269         comparisons.
4270
4271 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4272
4273         Fix #72969.
4274         * namespace.cs (Namespace.Lookup): Add back location parameter.
4275         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4276         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4277
4278         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4279         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4280         (Namespace.LookupType): ... this.
4281         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4282         of namespaces.
4283         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4284         purported to handle pointers.
4285         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4286         CoreLookupType.
4287
4288 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4289
4290         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4291         type as namespace.
4292
4293 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4294
4295         * namespace.cs (Namespace.Lookup): Drop location parameter.
4296         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4297         (NamespaceEntry.Lookup): ... this.
4298         (NamespaceEntry.Error_AmbiguousTypeReference):
4299         Move here from DeclSpace.
4300         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4301         names ...
4302         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4303         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4304         Move to NamespaceEntry.
4305         * delegate.cs, expression.cs: Update to changes.
4306
4307 2005-08-31  Martin Baulig  <martin@ximian.com>
4308
4309         Committing a patch from Atsushi Enomoto for #75850.
4310
4311         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4312         Prefer a generic enumerator over a non-generic one.
4313
4314 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4315
4316         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4317         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4318
4319 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4320
4321         * driver.cs : reverting default encoding change as well as mcs.
4322
4323 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4324
4325         * driver.cs, support.cs : merged r48826.
4326           Marek Safer wrote:
4327           > could you integrate your mcs changes to gmcs otherwise
4328           > gmcs cannot compile some files.
4329
4330 2005-08-20  Martin Baulig  <martin@ximian.com>
4331
4332         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4333         scope if we don't already have it.
4334
4335         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4336         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4337         fixes #75867.
4338
4339 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4340
4341         * statement.cs: Copy the local exception into the exception
4342         captured local.  Fixes 75674
4343
4344 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4345
4346         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4347         type as namespace.
4348
4349 2005-08-12  Martin Baulig  <martin@ximian.com>
4350
4351         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4352         for nested types here to avoid hitting the cache too early.
4353
4354 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4355
4356         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4357         an error. 
4358
4359 2005-08-03  Martin Baulig  <martin@ximian.com>
4360
4361         Make iterators in generic methods work; see gtest-191.cs.
4362
4363         * generic.cs
4364         (Constraints.Resolve): Protect against being called twice.
4365
4366         * class.cs
4367         (TypeContainer.GetClassBases): Make this `protected virtual'.
4368
4369         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4370         (Iterator.GetClassBases): Override this and compute the base
4371         classes here.
4372         (Iterator.DefineNestedTypes): If we're a generic method, all our
4373         method type parameters become class type parameters on the proxy
4374         class.
4375
4376         * statement.cs
4377         (ToplevelBlock.Parameters): Make this a property, not a field.
4378         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4379
4380 2005-08-03  Martin Baulig  <martin@ximian.com>
4381
4382         * typemanager.cs (TypeManager.IsSubclassOf): Use
4383         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4384         (TypeManager.GetFullName_recursed): Improved.
4385
4386 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4387
4388         Fix #75417
4389         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4390         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4391         invocation_type == mi.DeclaringType, since the first one also checks
4392         other condition used by generic instances.
4393         
4394 2005-07-27  Martin Baulig  <martin@ximian.com>
4395
4396         * anonymous.cs (CaptureContext.AddField): Added
4397         `AnonymousContainer am' argument; compute its toplevel scope if
4398         it's not already computed.  Fixes #75649.
4399
4400 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4401
4402         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4403         CheckAttributeType and refactored.
4404         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4405         ResolveAsTypeTerminal error handling.
4406         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4407         handling.
4408         (GetSignatureForError): Print errors in same way.
4409
4410         * class.cs,
4411         * codegen.cs: Reflect attribute GetSignatureForError change.
4412
4413         * ecore.cs,
4414         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4415
4416         * namespace.cs (UsingEntry): Refactored to make fields private.
4417
4418         * assign.cs,
4419         statement.cs: Error_UnexpectedKind has extra parameter.
4420
4421 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4422
4423         * ecore.cs (IAlias): Remove.
4424         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4425         that implement the interface.
4426         * namespace.cs (Namespace): Likewise.
4427         (Namespace.declspaces): Renamed from 'defined_names'.
4428         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4429         DeclSpace instead of an IAlias.
4430         * tree.cs (Tree.AddDecl): Update.
4431
4432 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4433
4434         * statement.cs (Block.Flags); Remove HasVarargs.
4435         (Block.HasVarargs): Move to ToplevelBlock.
4436         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4437         (Block.Variables): Make protected.  Initialize variable hashtable
4438         if necessary.
4439         (Block.AddVariable): Update.
4440         (Block.Resolve): Update to changes.
4441         (ToplevelBlock.HasVarargs): New boolean.
4442         (ToplevelBlock.ThisVariable): Move here from Block.
4443         (ToplevelBlock.AddThisVariable): Likewise.
4444         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4445         * expression.cs (This.ResolveBase): Update to changes.
4446         (ArglistAccess.DoResolve): Likewise.
4447
4448 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4449
4450         Fix #75321
4451         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4452
4453         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4454         not used and not used & assigned.
4455         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4456
4457 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4458
4459         Fix #75053
4460         * expression.cs (Is.DoResolve): null is never provided type.
4461
4462 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4463
4464         Fix #52496
4465         * cs-parser.jay: Less strict event error rule to catch more errors.
4466
4467 2005-07-11  Martin Baulig  <martin@ximian.com>
4468
4469         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4470         for the constructor constraint: we do not only have to check
4471         whether the class has a public constructor, but also ensure that
4472         it's parameterless.  Fixes #75492.
4473
4474 2005-07-11  Martin Baulig  <martin@ximian.com>
4475
4476         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4477         between type parameters if they either have the reference type
4478         constraint or the class constraint.
4479
4480 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4481
4482         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4483
4484 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4485
4486         Fix #74975
4487         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4488         (ExtractSecurityPermissionSet): Cope with self referencing security
4489         attributes properly.
4490
4491         * driver.cs (SetOutputFile): Made public property OutputFile.
4492
4493 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4494
4495         Fix #75486.
4496         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4497         has_nonstatic_fields.  Make into a FieldBase pointer.
4498         (TypeContainer.AddField): Add CS0282 check.
4499         (TypeContainer.EmitType): Update.
4500
4501 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4502
4503         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4504         compare if they start with __.
4505
4506 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4507
4508         * statement.cs (Switch.SwitchGoverningType): Only look at
4509         UserCasts that don't need implicit standard conversions to one of
4510         the allowed switch types (Fixes test-322.cs).
4511         (LocalInfo.Resolve): Re-enable sanity-test.
4512
4513 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4514
4515         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4516         
4517         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4518         
4519         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4520
4521 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4522
4523         Fix #75472.
4524         * ecore.cs (SimpleName.GetSignatureForError): Add.
4525         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4526         (MemberAccess.GetSignatureForError): Add.
4527
4528 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4529  
4530         The big error and warning messages review.
4531         
4532         * anonymous.cs,
4533         * assign.cs,
4534         * attribute.cs,
4535         * class.cs,
4536         * codegen.cs,
4537         * convert.cs,
4538         * cs-parser.jay,
4539         * cs-tokenizer.cs,
4540         * decl.cs,
4541         * delegate.cs,
4542         * doc.cs,
4543         * driver.cs,
4544         * ecore.cs,
4545         * enum.cs,
4546         * expression.cs,
4547         * flowanalysis.cs,
4548         * iterators.cs,
4549         * literal.cs,
4550         * location.cs,
4551         * modifiers.cs,
4552         * namespace.cs,
4553         * parameter.cs,
4554         * pending.cs,
4555         * report.cs,
4556         * rootcontext.cs,
4557         * statement.cs,
4558         * support.cs,
4559         * tree.cs,
4560         * typemanager.cs: Updated.
4561         
4562         * class.cs: (MethodCore.SetYields): Moved here to share.
4563         (PropertyMethod.Define): Moved iterator setup here.
4564         
4565         * iterators.cs: Add orig_method to have full access to parent
4566         container.
4567
4568 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4569
4570         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4571         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4572         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4573         variable of struct type.
4574         * expression.cs (Unary.ResolveOperator): Update to change.
4575         (Indirection.VerifyFixed): Likewise.
4576         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4577         (ParameterReference.VerifyFixed): Value parameters are fixed.
4578         (This.VerifyFixed): Treat 'this' as a value parameter.
4579         * statement.cs (LocalInfo.IsFixed): Remove.
4580
4581 2005-07-01  Martin Baulig  <martin@ximian.com>
4582
4583         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4584         `ec.EmitThis ()' to get the correct scope.
4585
4586 2005-07-01  Martin Baulig  <martin@ximian.com>
4587
4588         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4589         instance is a ParameterReference; fixes #75299.
4590
4591 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4592
4593         Fix #75412.
4594         * expression.cs (Indexers.map): Remove.
4595         (Indexers.Append): Filter out inaccessible setters and getters.
4596         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4597
4598         Fix #75283.
4599         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4600         Refactored from ...
4601         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4602         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4603         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4604         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4605
4606 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4607
4608         Fix #75322
4609         * class.cs (FieldBase.GetInitializerExpression): One more field
4610         for backup.
4611
4612 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4613
4614         * pending.cs: Do not define a proxy if the base method is virtual,
4615         it will be picked up by the runtime (bug 75270).
4616
4617 2005-07-08  Martin Baulig  <martin@ximian.com>
4618
4619         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4620         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4621
4622 2005-07-07  Martin Baulig  <martin@ximian.com>
4623
4624         * generic.cs (ConstructedType.CheckConstraint): Use
4625         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4626         called recursively; fixes #75329.
4627
4628 2005-07-06  Martin Baulig  <martin@ximian.com>
4629
4630         * generic.cs (TypeManager.InferTypeArguments): Added support for
4631         anonymous methods; fixes #75461.
4632
4633 2005-07-01  Martin Baulig  <martin@ximian.com>
4634
4635         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4636         `ec.EmitThis ()' to get the correct scope.
4637
4638 2005-07-01  Martin Baulig  <martin@ximian.com>
4639
4640         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4641         instance is `This'; fixes #75299.
4642
4643 2005-06-30  Martin Baulig  <martin@ximian.com>
4644
4645         * class.cs (Indexer): Implement IIteratorContainer; added support
4646         for iterators in indexers.
4647
4648         * codegen.cs
4649         (EmitContext.CurrentIterator): Make this a property, not a field.
4650
4651         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4652
4653 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4654
4655         * pending.cs: Do not define a proxy if the base method is virtual,
4656         it will be picked up by the runtime (bug 75270).
4657
4658 2005-06-28  Martin Baulig  <martin@ximian.com>
4659
4660         * cs-parser.jay (interface_method_declaration): Avoid a
4661         reduce/reduce conflict by moving some of the code into a separate
4662         `interface_method_declaration_body' rule; fixes #75368.
4663
4664 2005-06-28  Martin Baulig  <martin@ximian.com>
4665
4666         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4667         array check after the check for TypeBuilder's.
4668
4669 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4670
4671         * convert.cs (FindMostEncompassedType): Add two trivial special
4672         cases (number_of_types == 0 || number_of_types == 1).
4673         (FindMostEncompasingType): Likewise.
4674
4675 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4676
4677         Some cleanups preparing for the fix of #75283.
4678         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4679         error testing.
4680         (EventExpr.InstanceResolve): Likewise.
4681         (EventExpr.DoResolve): Remove redundant checks.
4682
4683 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4684
4685         * class.cs: Small fix.
4686
4687 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4688
4689         Fix #75160.
4690         * class.cs (GetPartialBases): Fix return value check of
4691         part.GetClassBases.
4692
4693 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4694
4695         Ensure that partial classes are registered in their enclosing
4696         namespace.  Initial part of fix of #75160.
4697         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4698         Register declspace with namespace here, not in
4699         DeclSpace.RecordDecl.
4700         * cs-parser.jay: Pass namespace to RecordDecl.
4701         * class.cs (PartialContainer.Create): Likewise.
4702         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4703         called.
4704         * decl.cs (Declspace.RecordDecl): Remove.
4705         * namespace.cs (NamespaceEntry.DefineName): Remove.
4706
4707 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4708
4709         * rootcontext.cs: Reset TargetExt as well.
4710
4711 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4712
4713         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4714         -langversion:ISO-1.
4715
4716 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4717
4718         Fix #75080, cs0119.cs.
4719         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4720         of ...
4721         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4722         allowing ExprClass.Type and ExprClass.Namespace for
4723         ResolveFlags.VariableOrValue.
4724         (Expression.Resolve) [1-argument variant]: Change default resolve
4725         flags based on language version.
4726         (Expression.Error_UnexpectedKind): Use a simple string array
4727         rather than an ArrayList.
4728         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4729         not ExprClass.Type.
4730         (TypeOfVoid.DoResolve): Likewise.
4731         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4732         flags argument -- it always has the same value.
4733
4734 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4735
4736         Fix #75081.
4737         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4738         Use it in the error message.
4739         * assign.cs, expression.cs, statement.cs: Update.
4740
4741 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4742
4743         Fix #75088.
4744         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4745         the "almostMatchedMember" case too.
4746         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4747         that failed the accessibility checks to 'almost_match'.
4748
4749 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4750
4751         * attribute.cs: Use internal MethodBuilder methods to set
4752         ExactSpelling and SetLastError on PInvoke methods, instead
4753         of passing them via charset.  Fixes #75060.
4754
4755 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4756
4757         * parameter.cs (Parameter): Remove TODO comment.
4758         (Parameter.DefineParameter): Remove Location parameter.
4759         (Parameters.LabelParameters): Likewise.
4760         * class.cs (Constructor.Emit): Update to change.
4761         (MethodData.Emit): Likewise.
4762         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4763         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4764
4765 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4766
4767         * parameter.cs,
4768           Removed Parameters.Location and added Parameter.Location instead.
4769           Removed Location parameter from Emit() and GetSignature().
4770         * anonymous.cs,
4771           class.cs,
4772           cs-parser.jay,
4773           delegate.cs,
4774           iterators.cs,
4775           statement.cs :
4776           Modified all related calls.
4777
4778 2005-06-21  Martin Baulig  <martin@ximian.com>
4779
4780         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4781         left-hand side is not a nullable type; fixes #75328.
4782
4783 2005-06-21  Martin Baulig  <martin@ximian.com>
4784
4785         * typemanager.cs
4786         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4787         (TypeManager.GetFullNameSignature): Likewise.
4788
4789         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4790         `source.FullName' and `target.FullName' to check whether there are
4791         two conflicting definitions.
4792
4793 2005-06-21  Martin Baulig  <martin@ximian.com>
4794
4795         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4796         a BoxedCast - also for reference types - to be compatible with csc.
4797
4798 2005-06-21  Martin Baulig  <martin@ximian.com>
4799
4800         * expression.cs (MemberAccess.DoResolve): Add support for nested
4801         types in a generic instance; fixes #75320.
4802
4803 2005-06-20  Martin Baulig  <martin@ximian.com>
4804
4805         * generic.cs (TypeManager.InferType): Also walk the class
4806         hierarchy for generic instances; fixes #75261.
4807
4808 2005-06-17  Martin Baulig  <martin@ximian.com>
4809
4810         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4811         to make things work for corlib.
4812
4813 2005-06-15  Martin Baulig  <martin@ximian.com>
4814
4815         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4816         obsolete `SecurityAction' values.
4817
4818 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4819
4820         * rootcontext.cs: Reset TargetExt as well.
4821         
4822 2005-06-09  Martin Baulig  <martin@ximian.com>
4823
4824         * delegate.cs (Delegate.VerifyMethod): Added
4825         `MethodGroupExpr old_mg' argument; inherit its
4826         `HasTypeParameters'; fix #75085.
4827
4828 2005-06-09  Martin Baulig  <martin@ximian.com>
4829
4830         * expression.cs (Invocation.OverloadResolve): Correctly handle
4831         generic methods for the SetMemberIsUsed(); fix #75064.
4832
4833 2005-06-09  Martin Baulig  <martin@ximian.com>
4834
4835         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4836         fixes #75062.
4837
4838 2005-06-08  Martin Baulig  <martin@ximian.com>
4839
4840         * cs-parser.jay (nullable_type_or_conditional): If we put the
4841         nullable back and our `type' is a `ComposedCast', remove the
4842         nullable from it.  Fixes #75156.
4843
4844         * expression.cs (ComposedCast.RemoveNullable): New public method.
4845
4846 2005-06-08  Martin Baulig  <martin@ximian.com>
4847
4848         The big Iterators rewrite :-)
4849
4850         * iterators.cs: Rewrite this to use the anonymous methods framework.
4851
4852         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4853         before the TypeContainers; see 2test-21.cs.
4854
4855         * class.cs
4856         (TypeContainer.DefineType): Don't create a new EmitContext if we
4857         already have one (this only happens if we're an Iterator).
4858         (TypeContainer.Define): Also call Define() on all our iterators.
4859         (Method.CreateEmitContext): Added support for iterators.
4860
4861         * anonymous.cs
4862         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4863         (AnonymousContainer.CreateMethodHost): Moved here from
4864         AnonymousMethod and made abstract.
4865         (AnonymousContainer.CreateScopeType): New abstract method.
4866         (AnonymousContainer.IsIterator): New public property.
4867         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4868         get the ScopeTypeBuilder rather than manually defining it here. 
4869         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4870         iterators here.
4871
4872         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4873         before RootContext.DefineTypes().
4874
4875         * codegen.cs (EmitContext.RemapToProxy): Removed.
4876         (EmitContext.CurrentAnonymousMethod): Changed type from
4877         AnonymousMethod -> AnonymousContainer.
4878         (EmitContext.ResolveTopBlock): Protect from being called twice.
4879         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4880         (EmitContext.EmitThis): Removed the iterators hacks; use the
4881         anonymous methods framework for that.
4882
4883         * statement.cs
4884         (ToplevelBlock.Container): Make this a property, not a field.
4885         (ToplevelBlock.ReParent): New public method; move the
4886         ToplevelBlock into a new container.
4887         (Foreach.TemporaryVariable): Simplify.
4888
4889 2005-06-05  Martin Baulig  <martin@ximian.com>
4890
4891         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4892         (Block.AddTemporaryVariable): New public method; creates a new
4893         `LocalInfo' for a temporary variable.
4894         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4895         variables here.
4896         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4897         non-iterator variables.
4898
4899 2005-06-05  Martin Baulig  <martin@ximian.com>
4900
4901         * statement.cs (Foreach.TemporaryVariable): Create the
4902         LocalBuilder in the Emit phase and not in Resolve since in some
4903         situations, we don't have an ILGenerator during Resolve; see
4904         2test-19.cs for an example.
4905
4906 2005-06-04  Martin Baulig  <martin@ximian.com>
4907
4908         The big Foreach rewrite - Part II.
4909
4910         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4911         with `PropertyInfo ienumerator_getcurrent'.
4912
4913         * codegen.cs (VariableStorage): Removed.
4914
4915         * statement.cs
4916         (Foreach): Derive from Statement, not ExceptionStatement.
4917         (Foreach.CollectionForeach): New nested class.  Moved all the code
4918         dealing with collection foreach here.
4919         (Foreach.ForeachHelperMethods): Removed.
4920         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4921
4922 2005-05-23  Martin Baulig  <martin@ximian.com>
4923
4924         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4925         don't need to.  Fix #75014.
4926
4927 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4928
4929         Improve user-defined conversion handling.
4930         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4931         applicable operators.
4932         (AddConversionOperators): New.  Helper for GetConversionOperators.
4933         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4934         there is only one most encompassed/encompassing type.
4935         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4936         "applicable operator" handling.
4937         (UserConversion): Move cache here from GetConversionOperators.
4938         Directly cache the chosen operator, rather than the whole
4939         MethodGroup.
4940         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4941         case.  Allow conversion of decimal to sbyte and byte too.
4942         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4943         New static methods.  Used to avoid allocating EmptyExpressions in
4944         convert.cs.
4945
4946 2005-05-24  Duncan Mak  <duncan@novell.com>
4947
4948         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4949         another class, used in Convert.ExplicitNumericConversion.
4950         (CastToDecimal): New class, similar to above, but casts to
4951         System.Decimal, used in Convert.ImplicitNumericConversion and also
4952         in explicit convesion from double/float to decimal.
4953
4954         * convert.cs (ImplicitNumericConversion): Handle implicit
4955         conversions to System.Decimal.
4956         (ExplicitNumericConversion): handle explicit conversions to
4957         System.Decimal.
4958
4959         This fixes #68711.
4960         
4961 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4962
4963         * typemanager.cs: Do not throw an exception in the TypeBuilder
4964         case, we take care of it on the TypeCode.
4965
4966 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4967         
4968         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4969         is back.
4970         
4971         * cs-parser.jay: Catch more lexical errors.
4972         
4973         * report.cs: Add one more Error method.
4974         
4975         * rootcontext.cs,
4976         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4977
4978 2005-05-20  Martin Baulig  <martin@ximian.com>
4979
4980         * class.cs (TypeContainer.CircularDepException): Removed.
4981         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4982         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4983         (CS0146) and interface (CS0529) dependencies here.
4984
4985 2005-05-20  Martin Baulig  <martin@ximian.com>
4986
4987         * expression.cs (New.DoResolve): Move the CS0712 check above the
4988         CS0144 check; otherwise it can never be reached.
4989
4990 2005-05-20  Martin Baulig  <martin@ximian.com>
4991
4992         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4993
4994 2005-05-20  Martin Baulig  <martin@ximian.com>
4995
4996         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4997
4998         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4999
5000 2005-05-19  Martin Baulig  <martin@ximian.com>
5001
5002         * delegate.cs
5003         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5004         to disable error reporting.
5005
5006         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5007         here since we don't want to report an error; see the new test-336.cs.
5008
5009 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5010
5011         * statement.cs (ToplevelBlock.GetParameterReference)
5012         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5013         Move here from class Block.
5014         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5015         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5016
5017 2005-05-18  Martin Baulig  <martin@ximian.com>
5018
5019         Fix #74978.
5020
5021         * flowanalysis.cs
5022         (FlowBranching.Reachability): Add non-static public And() and Or()
5023         methods.
5024         (FlowBranchingSwitch): New class; do the `break_origins' thing
5025         like in FlowBranchingLoop.
5026         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5027         reachability, not just locals and parameters.
5028         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5029         switch; MergeBreakOrigins() now takes care of that.
5030
5031 2005-05-18  Martin Baulig  <martin@ximian.com>
5032
5033         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5034         a loop and may leave it, reset the barrier; fixes #74974.
5035
5036 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5037
5038         Fix test-382.cs.  Emit values of decimal constants.
5039         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5040         Carved out of ...
5041         (TypeContainer.AddField): ... this.
5042         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5043         with initializers to include 'Const's.
5044         (ClassPart.RegisterFieldForInitialization): Forward to
5045         PartialContainer.
5046         * const.cs (Const.Const): Pass initializer to base class.
5047         (Const.Define): In case of decimal constants, register them for
5048         initialization in a static constructor.
5049
5050 2005-05-14  Martin Baulig  <martin@ximian.com>
5051
5052         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5053         do not call ResolveUnreachable() on unreachable statements in
5054         here, see the comment in the source code.
5055
5056 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5057
5058         Fix #74934.
5059         * expression.cs (BinaryResolveOperator): If one of the operands of
5060         an equality comparison is 'null' and the other is a pointer type,
5061         convert the null to a NullPointer.
5062         * convert.cs (ImplicitReferenceConversion): If the expression is a
5063         NullLiteral and the target type is a pointer type, return a
5064         NullPointer instead.
5065         (ImplicitConversionStandard): Likewise.
5066
5067 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5068         
5069         * cs-parser.jay: Set readonly context based on special constructs.
5070         
5071         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5072         readonly variable error handling.
5073         
5074         * rootcontext.cs (EmitCode): Don't verify members when error
5075         occurred.
5076         
5077         * statement.cs (LocalInfo): Add reaodnly context information.
5078         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5079
5080 2005-05-17  Martin Baulig  <martin@ximian.com>
5081
5082         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5083         #70970. 
5084
5085 2005-05-13  Martin Baulig  <martin@ximian.com>
5086
5087         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5088         handle unreachable blocks.
5089
5090 2005-05-13  Martin Baulig  <martin@ximian.com>
5091
5092         * class.cs
5093         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5094         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5095         #74905. 
5096
5097 2005-05-13  Martin Baulig  <martin@ximian.com>
5098
5099         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5100         instance variable, not a local.  Fix #74873.
5101         (Block.ResolveUnreachable): Set it to true here.
5102
5103 2005-05-12  Martin Baulig  <martin@ximian.com>
5104
5105         * cs-parser.jay (property_declaration): Pass the `current_class',
5106         not the `current_container' to Property's .ctor.  Fixes #74912.
5107
5108 2005-05-11  Martin Baulig  <martin@ximian.com>
5109
5110         * typemanager.cs (Closure): Copy this from MCS and merge all the
5111         GMCS-specific changes into it.
5112
5113 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5114
5115         Fix #74920.
5116         * typemanager.cs (unmanaged_enclosing_types): New.
5117         (IsUnmanagedType): Avoid infloops by using
5118         'unmanaged_enclosing_types' to talk with recursive invocations.
5119
5120 2005-05-11  Duncan Mak  <duncan@novell.com>
5121
5122         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5123         continuing to process for 'arg'.
5124         (handle_preprocessing_directive): Check the argument of the #endif
5125         directive and report error CS1025 if there are any trailing
5126         characters.
5127
5128         According to the C# spec, having even whitespace after the #endif
5129         directive is illegal; however, because we call arg.TrimEnd ()
5130         beforehand, we have the same behavior as csc, allowing whitespace
5131         after the directive.
5132
5133         Fixes #74892.
5134
5135 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5136
5137         Fix #74863.
5138         
5139         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5140         (Constructor.GetObsoleteAttribute): Implemented correctly.
5141
5142 2005-05-10  Martin Baulig  <martin@ximian.com>
5143
5144         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5145         resolve the type; fixes #74864.
5146         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5147         in DoResolve(); fixes #74862.
5148
5149 2005-05-10  Martin Baulig  <martin@ximian.com>
5150
5151         * support.cs (ReflectionParameters.ParameterModifier): Use
5152         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5153         and `ParameterAttributes.In'.  Fixes #74884.
5154
5155 2005-05-10  Martin Baulig  <martin@ximian.com>
5156
5157         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5158         the cache if we're just looking for `MemberTypes.NestedType' in a
5159         generic instance.
5160
5161         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5162         constraints if we're still resolving the type tree.
5163         (Expression.MemberLookup): If we're resolving the type tree, only
5164         look for `MemberTypes.NestedType' since we're only interested in
5165         getting types.
5166
5167         * class.cs (TypeContainer.DefineType): Don't resolve the type
5168         parameters here; do this later in ResolveType() after the type
5169         tree has been resolved.
5170         (TypeContainer.ResolveType): New public method; this is called
5171         after the type tree is resolved and before the types are being
5172         populated.  We resolve the generic constraints here.
5173         (TypeContainer.DoDefineMember): Check the constraints on our base
5174         class and interfaces.
5175
5176         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5177         set the `ResolvingTypeTree' flag on the EmitContext.
5178
5179         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5180
5181 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5182
5183         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5184         
5185         * expression.cs (Argument.GetParameterModifier): Turned to property.
5186         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5187         
5188         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5189         its C# equivalent.
5190         
5191 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5192
5193         Fix #74852.
5194         * decl.cs (MemberCache.AddMethods): Register override methods,
5195         rather than non-override methods.
5196         * typemanager.cs (RegisterOverride): New.
5197         (IsOverride): Update.
5198
5199 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5200
5201         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5202
5203 2005-05-06  Martin Baulig  <martin@ximian.com>
5204
5205         * attribute.cs
5206         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5207         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5208
5209 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5210
5211         Fix #73105.
5212         
5213         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5214         recursive declaration.
5215         
5216         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5217         
5218 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5219
5220         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5221         
5222         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5223
5224 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5225
5226         Fix #74797.
5227         * decl.cs (DeclSpace.FamilyAccessible): 
5228         Use TypeManager.IsNestedFamilyAccessible.
5229
5230         Fix reopened #64812.
5231         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5232         internal'.
5233
5234 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5235             Abin Thomas  <projectmonokochi@rediffmail.com>
5236             Anoob V E  <projectmonokochi@rediffmail.com>
5237             Harilal P R  <projectmonokochi@rediffmail.com>
5238
5239         Fix #64812.
5240         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5241         allow access to all static members.
5242
5243 2005-05-04  Martin Baulig  <martin@ximian.com>
5244
5245         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5246
5247 2005-05-04  Martin Baulig  <martin@ximian.com>
5248
5249         Fix #74655.
5250
5251         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5252         section at the end; make things work if `default' is not the last
5253         section.        
5254
5255 2005-05-04  Martin Baulig  <martin@ximian.com>
5256
5257         Fix #70400.
5258
5259         * statement.cs (Switch): Replaced the `got_default' field with a
5260         `default_section' one.
5261         (Switch.CheckSwitch): Set `default_section' here.
5262         (Switch.Resolve): If we're a constant switch and the constant is
5263         not found, use the default section.
5264
5265 2005-05-03  Martin Baulig  <martin@ximian.com>
5266
5267         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5268
5269         * statement.cs (Foreach.ArrayForeach): New nested class.
5270         (Foreach.TemporaryVariable): New nested class.
5271         (Foreach.EmitArrayForeach): Removed; this is now in the new
5272         ArrayForeach class.
5273
5274 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5275
5276         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5277         more conservative.
5278         (VerifyPendingMethods): Revert change below.
5279
5280         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5281         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5282         that used to trigger warning -28.  Remove warning -28.
5283         * expression.cs (Invocation.OverloadResolve): Use
5284         TypeManager.IsOverride to distinguish override methods.
5285
5286         Fix #74773.
5287         * pending.cs (VerifyPendingMethods): If a base type implements the
5288         requested interface, don't bother checking individual methods of
5289         the base type.  As a side-effect, this prevents the creation of
5290         unnecessary proxies.
5291
5292 2005-05-02  Martin Baulig  <martin@ximian.com>
5293
5294         Fix #70182.
5295
5296         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5297         Also `And' the locals if the old vector is null.
5298         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5299         null; in this case we basically reset all the variables.        
5300
5301 2005-05-02  Martin Baulig  <martin@ximian.com>
5302
5303         Fix #74529.
5304
5305         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5306         Added `FlowBranching branching' argument; always `and' the
5307         variables instead of `or'ing them unless we're an infinite loop.
5308
5309         * statement.cs (While.Resolve): Create a new sibling unless we're
5310         infinite.       
5311
5312 2005-05-02  Martin Baulig  <martin@ximian.com>
5313
5314         Fix #70140.
5315
5316         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5317         arguments; use it instead of creating a new TopLevelBlock.
5318         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5319         our ConstructorInitializer.
5320
5321         * statement.cs
5322         (TopLevelBlock.TopLevelBranching): New public property.
5323         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5324         and create our `TopLevelBranching'.
5325
5326         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5327         anonymous method host, use `block.TopLevelBranching' rather than
5328         creating a new branching.
5329
5330 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5331
5332         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5333         a ScopeInfo, if any of the current children is a child of the new
5334         entry, move those children there.
5335
5336 2005-04-30  Martin Baulig  <martin@ximian.com>
5337
5338         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5339         at the beginning of a SwitchSection.  Fix #73335.
5340
5341 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5342
5343         Fix #74378
5344         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5345         
5346         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5347         (FieldExpr.DoResolve): Obsolete members are ignored for field
5348         initializers.
5349         
5350 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5353         of arrays detection.
5354
5355         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5356         verification.
5357         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5358
5359         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5360         arrays report.
5361
5362 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5363
5364         * cs-parser.jay: Use the prefered version of -unsafe in error
5365         message.
5366
5367 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5368
5369         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5370         circumstances.
5371
5372 2005-04-20  John Luke  <john.luke@gmail.com>
5373
5374         * driver.cs: fix typo in error message, --outout to --output
5375
5376 2005-04-30  Martin Baulig  <martin@ximian.com>
5377
5378         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5379         handle the .NET 2.x security attributes.
5380
5381 2005-04-30  Martin Baulig  <martin@ximian.com>
5382
5383         * typemanager.cs
5384         (TypeManager.ExpandInterfaces): Don't add things twice.
5385
5386         * class.cs
5387         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5388
5389 2005-04-29  Martin Baulig  <martin@ximian.com>
5390
5391         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5392
5393         * anonymous.cs: Added support for anonymous generic methods.
5394
5395 2005-04-29  Martin Baulig  <martin@ximian.com>
5396
5397         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5398         generic instances.
5399
5400 2005-04-29  Martin Baulig  <martin@ximian.com>
5401
5402         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5403
5404         * expression.cs (New.DoResolve): Fix the CS0304 check.
5405
5406 2005-04-29  Martin Baulig  <martin@ximian.com>
5407
5408         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5409         naming schema.
5410
5411         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5412         explicit interface implementation, compare the interface types.
5413         (MethodData.Define): Use the new naming scheme from the latest
5414         .NET 2.x beta2.
5415         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5416
5417         * decl.cs (MemberName.GetMemberName): Removed.
5418         (MemberName.MethodName, FullName): New properties.
5419
5420 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5421
5422         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5423
5424 2005-04-22  Martin Baulig  <martin@ximian.com>
5425
5426         * generic.cs (GenericMethod): Create the EmitContext in the
5427         `Define()'; in `Define(MethodBuilder)', create the type parameters
5428         before calling `Define()'.  Fixes #73933.
5429
5430 2005-04-22  Martin Baulig  <martin@ximian.com>
5431
5432         * generic.cs
5433         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5434         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5435
5436         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5437         ConstructedType, check its constraints.
5438
5439 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5440
5441         * codegen.cs (InRefOutArgumentResolving): New field.
5442         
5443         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5444         fields outside contructor.
5445         
5446         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5447         
5448 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5449
5450         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5451         parameter code was not completed ever, so it was not as up-to-date
5452         as local variables.  Must finish it.
5453
5454         The bug fix was to compare the Toplevel of the block, not the
5455         current block.  Thanks for Ben for pointing this out. 
5456
5457 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5458
5459         * decl.cs (AddMethods): Use the declaring type of the problem
5460         method to determine if we want to squash a warning.
5461
5462 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5463
5464         * attribute.cs: Removed debug output.
5465
5466         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5467         
5468         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5469         Report.Stderr.
5470         
5471 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5472
5473         Fix #74481.
5474         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5475         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5476         all null comparisons against reference types.
5477
5478 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5479
5480         Fix# 74565
5481         * class.cs (TypeContainer.CircularDepException) New nested
5482         exception class.
5483         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5484         (TypeContainer.DefineType): Removed error, reset InTransit before
5485         exit.
5486         (Class.DefineType): Throw exception when is in Transit.
5487         Catch exception and report error.
5488         (Struct.DefineType): Throw exception when is in Transit.
5489         Catch exception and report error.
5490         (Interface.DefineType): Throw exception when is in Transit.
5491         Catch exception and report error.
5492
5493         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5494         handle nested exception handlers.
5495
5496         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5497         a catch.
5498
5499         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5500         InFinally and InCatch storage.
5501
5502         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5503         (Catch.Resolve): Set and Restore ec.InCatch.
5504         (Try.Resolve): Set and Restore ec.InFinally.
5505         (Try.HasCatch): True when try has catch.
5506
5507 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5508
5509         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5510           for the same event member, so exclude such cases from warning 419.
5511           Fixed bug #74633.
5512
5513 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5514
5515         * expression.cs (Binary.ResolveOperator): Apply patch from John
5516         Luke to fix bug 59864: operators &, | and ^ on enumerations
5517         require that the same enum type on both sides.
5518
5519         * driver.cs: Add warnings to old flag usage, this is to assist
5520         people who produce Makefiles and hope that the Makefiles will be
5521         used on Windows.
5522
5523         * class.cs (TypeContainer.EmitType): Moved the definition of the
5524         special $PRIVATE$ field from the resolve phase to the Emit phase.
5525         During resolve we do not know if we are a struct with
5526         HasExplicitLayout, we know this only after the attributes for the
5527         type are emitted.
5528
5529         Set the FieldOffset to zero on the dummy field that we create for
5530         the class.   Fixes 74590.
5531
5532 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5533
5534         Fix #73834.
5535         * ecore.cs (PropertyExpr.resolved): New.
5536         (DoResolve): Use it to handle a case of double resolution here.
5537         Handle a case of identical-name-and-type-name.
5538         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5539         resolution by storing the results of expression resolution back
5540         into the "probes" array.
5541
5542 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5543
5544         Fix cs0208-7.cs and cs0208-8.cs.
5545         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5546         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5547         error reporting to point out the reason a struct is not unmanaged.
5548
5549 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5550
5551         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5552           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5553
5554 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5555
5556         Fix #74528.
5557         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5558         IdenticalNameAndTypeName here.
5559         (EventExpr.InstanceResolve): Likewise.
5560
5561 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5562
5563         C# 2.0 DefaultCharSetAttribute implementation
5564         
5565         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5566         which allows us to set GlobalNamespace for every resolve.
5567         (Attribute.ResolveArguments): Cut from Resolve.
5568         (Attribute.GetCharSetValue): Returns CharSet named argument.
5569         (Attribute.DefinePInvokeMethod): Gets default charset from
5570         module settings.
5571         (GlobalAttribute.ResolveAsTypeStep): Override.
5572         (GlobalAttribute.ResolveArguments): Override.
5573         
5574         * class.cs (TypeAttr): Is protected.
5575         
5576         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5577         (ModuleClass.DefaultCharSetType): New memeber.
5578         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5579         
5580         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5581         charset from module.
5582         
5583         * delegate.cs (TypeAttr): Override.
5584         (Delegate.DefineType): Use this TypeAttr.
5585         
5586         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5587         at very early stage (before types are defined) to resolve model
5588         module attributes. It will probably not work with corlib but it
5589         should be ok.
5590         
5591         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5592         charset from module.
5593         
5594         * typemanager.cs (default_charset_type): New type.
5595
5596 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5597
5598         * decl.cs (MemberCache.AddMethods): Don't warn if
5599         System.Object.Finalize has buggy MethodAttributes.
5600
5601         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5602         removed below.
5603
5604 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5605
5606         * doc.cs : detect ambiguous reference to overloaded members.
5607           Fixed bug #71603. MS 1.1 csc does not detect it.
5608
5609 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5610
5611         * doc.cs : delegates must not be referenced with parameters.
5612           Fixed bug #71605.
5613
5614 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5615
5616         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5617
5618 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5619
5620         * driver.cs (MainDriver): Stop processing if the CLS stage found
5621         errors. 
5622
5623         (CompilerCallableEntryPoint.InvokeCompiler): Always
5624         reset after execution;   Take a TextWriter argument for the
5625         output.
5626
5627         * report.cs: Use the error stream instead of hardcoding stderr. 
5628
5629 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5630
5631         * class.cs: Reduce code paths to test, too small of an
5632         optimization to make it worth the extra testing.  Always perform
5633         it. 
5634
5635 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5636
5637         Fix #74510.
5638         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5639         operators that had errors reported on them.
5640
5641 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5642
5643         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5644         argument types.
5645         (Attribute.Resolve): Add named argument type checking.
5646         
5647         * class.cs (FixedField.Define): Use IsPrimitiveType
5648         
5649         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5650         
5651         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5652         unsafe parameter types.
5653         
5654         * statement.cs (Using.ResolveExpression): Add better error description.
5655         
5656         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5657         
5658 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5659
5660         Fix #74484.
5661         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5662         AttributeUsageAttribute in the emitcontext of the attribute class,
5663         not in the emitcontext of the attributable entity it was attached to.
5664         * cs-parser.jay: Use 'current_class', not 'current_container',
5665         when creating a GlobalAttribute.
5666
5667 2005-04-08  Alp Toker  <alp@atoker.com>
5668
5669         * pending.cs: The fix to #58413 failed to compile methods implementing
5670         interfaces with/without params modifiers and vice versa, even though
5671         params modifiers aren't part of the signature. Make the modifier check
5672         less strict as in csc.
5673
5674 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5675             Anoob V E  <projectmonokochi@rediffmail.com>
5676             Harilal P R  <projectmonokochi@rediffmail.com>
5677
5678         Fix #58413.
5679         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5680         modifiers of pending methods.
5681         (PendingImplementation.PendingImplementation): Initialize it.
5682         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5683         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5684         with ParameterData.  Add check for modifiers.
5685         * class.cs (MethodData.Define): Update to changes.
5686
5687 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5688
5689         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5690
5691 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5692
5693         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5694         property.
5695         
5696         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5697         
5698         * rootcontext.cs,
5699         * typemanager.cs: Registered RequiredAttributeAttribute.
5700         
5701 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5702
5703         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5704         Warning CS0169 is back at level 3.
5705         (IMethodData.SetMemberIsUsed): New method.
5706         
5707         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5708         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5709         
5710         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5711
5712         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5713         contants.
5714         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5715         is used.
5716         
5717         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5718         is used.
5719         
5720         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5721         to avoid the problems with nested types.
5722
5723 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5724             Anoob V.E  <projectmonokochi@rediffmail.com>
5725             Harilal P.R  <projectmonokochi@rediffmail.com>
5726             Raja R Harinath  <rharinath@novell.com>
5727
5728         Fix #73820.
5729         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5730         attribute.
5731         * typemanager (GetConstructor): Make public.
5732
5733 2005-04-05  John Luke  <john.luke@gmail.com>
5734             Raja R Harinath  <rharinath@novell.com>
5735
5736         Fix #62232.
5737         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5738         struct too.  Return false quicker in a few cases.
5739         (VerifyUnManaged): Use it.
5740
5741 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5742
5743         Fix #74041.
5744         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5745         not 'unreachable_seen'.
5746
5747 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5748
5749         * attribute.cs (Attribute.GetValue): Removed unused.
5750         
5751         * codegen.cs (CodeGen.TrimExt): Removed unused.
5752         
5753         * cs-parser.jay (output): Removed unused.
5754         
5755         * cs-tokenizer.cs (hex_digits): Removed unused.
5756         
5757         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5758         
5759         * expression.cs (Indirection.LoadExprValue): Removed unused.
5760         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5761         
5762         * iterators.cs (Iterator.param_types): Removed unused.
5763         
5764         * statement.cs (Goto.block): Removed unused.
5765         (ToplevelBlock.did): Removed unused.
5766         (Switch.ResolveConstantSwitch): Removed unused.
5767
5768 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5769
5770         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5771         resetting thingy.
5772
5773 2005-04-19  Martin Baulig  <martin@ximian.com>
5774
5775         Merged r42462 from MCS and made it work for GMCS.
5776
5777         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5778
5779         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5780
5781 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5782
5783         Fix #74232 and cs0208-3.cs.
5784         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5785         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5786         unmanaged type.  Don't use FieldBuilders when 't' is a
5787         TypeBuilder.  Use ModFlags and MemberType fields.
5788         * class.cs (MemberBase.member_type): Rename from MemberType.
5789         (MemberBase.MemberType): New property.  Determines member_type on
5790         demand.
5791         (MemberBase.DoDefine): Don't initialize MemberType here.
5792         (FieldMember.Define): Likewise.
5793
5794 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5795
5796         Fix #74241
5797         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5798         Attributes are emitted there.
5799         
5800 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5801
5802         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5803         keyword in 'partial enum' too.
5804         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5805         is not allowed).
5806         Report from Kamil Skalski <nazgul@omega.pl>.
5807
5808         Fix #74309.
5809         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5810         have partial containers too.
5811
5812         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5813         in block' checks to Block.CheckInvariantMeaningInBlock.
5814         * statement.cs (Block.GetKnownVariableInfo): Make private.
5815         (Block.IsVariableUsedInChildBlock): Remove.
5816         (Block.IsVariableUsedInBlock): Likewise.
5817         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5818         conflicting declaration.
5819         (Block.AddVariable): Make error messages less long-winded and more
5820         specific.  Show location of conflicting declaration.
5821         * parameter.cs (Parameters.Location): New readonly property.
5822
5823 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5824
5825         Clean up semantics of invoking ResolveMemberAccess.
5826         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5827         can have an instance, ensure that we pass in a non-TypeExpression
5828         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5829         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5830         argument.  Update to changes and simplify.
5831         (FieldExpr.Emitinstance): Remove CS0120 check.
5832         (PropertyExpr.EmitInstance): Likewise.
5833         * expression.cs (Argument.Resolve): Likewise.
5834         (Invocation.DoResolve): Update to changes in semantics of
5835         InstanceExpression.
5836
5837 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5838
5839         Fix #74241
5840         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5841         customization.
5842         
5843         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5844
5845 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5846
5847         Fix difference in behaviour with commandline invocation.
5848         * driver.cs (Driver.Reset): New.
5849         (CompilerCallableEntryPoint): Call it.
5850
5851         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5852         variable" warnings if the boolean expression failed to resolve.
5853
5854 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5855
5856         * attribute.cs: Fix the union of several permissions when some of them
5857         are unrestricted (so the result isn't an unrestricted permission set).
5858         Fix #74036.
5859
5860 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5861
5862         * ecore.cs (MemberExpr): New class.  Convert from interface
5863         IMemberExpr.
5864         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5865         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5866         error checks.
5867         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5868         (MethodGroupExpr.IsExplicitImpl): Remove.
5869         (Expression.GetFieldFromEvent): Remove.
5870         (SimpleName.MemberStaticCheck): Remove.
5871         (SimpleName.DoSimpleNameResolve): Update to changes.
5872         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5873         (MemberAccess.IdenticalNameAndTypeName): Remove.
5874         (MemberAccess.error176): Move to MemberExpr.
5875         (MemberAccess.DoResolve): Update to changes.
5876         (BaseAccess.DoResolve): Likewise.
5877
5878 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5879
5880         C# 2.0 Conditional attribute class implementation
5881         
5882         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5883         Analyzes class whether it has attribute which has ConditionalAttribute
5884         and its condition is not defined.
5885         
5886         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5887         (Class.IsExcluded): New method. Search for at least one defined
5888         condition in ConditionalAttribute of attribute class.
5889
5890 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5891
5892         * ecore.cs (PropertyExpr): Derive from Expression, not
5893         ExpressionStatement.
5894         (PropertyExpr.EmitStatement): Remove.
5895
5896 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5897
5898         Fix #74060.
5899         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5900         internal field "value__" of an enum be private.  The examples for
5901         "value__" that I found on MSDN all used FieldAttributes.Private.
5902
5903         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5904         Don't mention IL method attribute names.
5905
5906         Fix #47991.  Remove a TODO.
5907         * statement.cs (Block.Toplevel): Make into a field.
5908         (Block.Parameters): Move into ToplevelBlock.
5909         (Block.known_variables): Rename from child_variable_names.
5910         (Block.Block): Remove variants that take Parameters.  Initialize
5911         'Toplevel' with the immediately surrounding toplevel block.
5912         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5913         LocalInfo parameter.
5914         (Block.GetKnownVariableInfo): New.
5915         (Block.IsVariableNameUsedInChildBlock): Update.
5916         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5917         the block, even though it may not be in scope.
5918         (Block.AddVariable): Remove Parameters parameter.  Use
5919         Toplevel.Parameters instead.
5920         (Block.AddConstant): Remove Parameters parameter.
5921         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5922         (Block.IsParamaterReference): Likewise.
5923         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5924         (ToplevelBlock.Parameters): New.  Moved from Block.
5925         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5926         initialize Parameters to a non-null value.
5927         * cs-parser.jay: Update to changes.
5928         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5929         simple names that mean different things in the same block.  Use
5930         Block.IsVariableNameUsedInBlock.
5931
5932 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5933
5934         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5935
5936 2005-03-26  Raja R Harinath  <harinath@acm.org>
5937
5938         Fix #73038.
5939         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5940         fails to resolve, ensure that the LHS is still resolved as an
5941         lvalue.
5942
5943 2005-03-25  Raja R Harinath  <harinath@acm.org>
5944
5945         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5946         ec.ContainerType.
5947         (Enum.current_ec): Remove.
5948         (Enum.LookupEnumValue): Remove EmitContext argument.
5949         Just uses the one created during DefineType.
5950         (Enum.FindMembers): Update.
5951         * expression.cs (MemberAccess.DoResolve): Update.
5952
5953 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5954
5955         * assign.cs (Assign.DoResolve): Check for CS1717 when
5956         source and target are same (uses Equals).
5957
5958         * expression.cs (LocalVariableReference, ParameterReference,
5959         This): Implemented Equals, GetHashCode.
5960
5961         * statement.cs (Block.GetParameterReference): Removed useless
5962         local variable.
5963
5964 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5965
5966         Fix cs0128.cs
5967         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5968         blocks before deciding whether the error is cs0136 or cs0128.
5969
5970         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5971         (using_alias_directive, using_namespace_directive): Pass
5972         MemberName, not an expression to Namespace.UsingAlias and
5973         Namespace.Using.
5974         (MakeName): Use the MemberName of the namespace.
5975         * namespace.cs (Namespace.MemberName): New.
5976         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5977         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5978         Likewise.
5979         * decl.cs (MemberName.Name): Make readonly.
5980         (MemberName.FromDotted): New "constructor".
5981         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5982         (MemberCore.Name): Compute from MemberName on demand.
5983         (MemberCore.SetMemberName): Provide a way to change the
5984         MemberName.
5985         (MemberCore.AddToContainer): Don't take a fullname parameter.
5986         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5987         fully qualified name of the container to the member name.
5988         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5989         only if the type is a member of the root container.
5990         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5991         MemberName.Left rather than searching for an embedded ".".
5992         (PartialContainer.CreatePart): Update to changes in RootContext.
5993         (MemberBase.ShortName): Turn into a property.  Use
5994         MemberCore.SetMemberName.
5995         (MemberBase.ExplicitInterfaceName): Remove.
5996         (MemberBase.UpdateMemberName): Remove.
5997         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5998         (PropertyBase.SetMemberName): New override.
5999         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6000         (Tree.GetDecl): New.
6001         (Tree.AllDecls): Rename from Decls.
6002         * attribute.cs, enum.cs, report.cs: Update to changes.
6003         * driver.cs (MainDriver): Use MemberName.FromDotted on
6004         RootContext.MainClass.
6005
6006 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6007
6008         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6009         checks.
6010
6011         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6012
6013 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6014
6015         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6016         property accessor modifiers.
6017
6018         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6019         fixed buffer attribute (CS1716).
6020         (PropertyMethod.HasCustomAccessModifier): When property accessor
6021         has custom modifier.
6022
6023         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6024         modifiers.
6025         (PropertyExpr.DoResolveLValue): Add CS0272.
6026
6027 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6028
6029         * convert.cs: When converting to a pointer, use the proper Conv.U
6030         or Conv.I depending on the source data type.
6031
6032         * cs-tokenizer.cs: Make the size for large decimal constants,
6033         fixes #72957.
6034
6035 2005-03-17  Martin Baulig  <martin@ximian.com>
6036
6037         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6038         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6039
6040 2005-03-17  Martin Baulig  <martin@ximian.com>
6041
6042         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6043         to bool so we can return an error condition.
6044         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6045         returned an error.
6046
6047 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6048
6049         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6050         attributes.
6051
6052 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6053
6054         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6055         Refactor to avoid traversing the list of assemblies, and to avoid
6056         string concatenation.
6057         * typemanager.cs (guid_attr_type): Remove.
6058         (negative_hits, pointers, references): Remove hashes.
6059         (type_hash): New.
6060         (GetConstructedType): New.  Uses type_hash to handle constructed
6061         types (arrays, references, pointers).
6062         (GetReferenceType, GetPointerType): Use it.
6063         (GetNestedType): New.  Uses type_hash to handle nested types of
6064         reflected types.
6065         (LookupType, LookupTypeDirect): Remove.
6066         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6067         'types' hash and LookupTypeReflection directly.
6068         (params_string, params_object): Use GetConstructedType.
6069         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6070         top-level types.
6071         (Namespace.Lookup): Use cached_types.
6072         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6073         provided by old TypeManager.LookupType.
6074         * rootcontext.cs (MakeFQN): Remove.
6075         * decl.cs (DeclSpace.MakeFQN): Likewise.
6076         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6077         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6078         TypeManager.GetConstructedType.
6079         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6080
6081 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6082
6083         * cs-parser.jay: Fix build.
6084
6085 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6086
6087         * class.cs (TypeContainer.CircularDepException) New nested
6088         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6089
6090         * cs-parser.jay: Reports CS1527 for any namespace element.
6091
6092         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6093         Added CS0407.
6094
6095         * expression.cs (ParameterReference.IsAssigned): Changed error to
6096         CS0269.
6097         (Error_WrongNumArguments): Moved CS0245 detection here.
6098
6099         * statement.cs (Return.Resolve): Add CS1622 report.
6100
6101 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6102
6103         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6104
6105 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6106
6107         * attribute.cs expression.cs: Get rid of some allocations.
6108
6109 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6110
6111         * doc.cs : just eliminate the latest change.
6112
6113 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6114
6115         * doc.cs : commented out the latest change. It breaks xml-030.cs
6116
6117 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6118
6119         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6120           fail. So invoke CreateType() in FindDocumentedType().
6121
6122 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6123
6124         * cs-tokenizer.cs : added IsKeyword().
6125         * doc.cs : Detect keyword incorrectly used as identifier.
6126           Allow identifiers prefixed by @.
6127
6128 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6131         It caused exception in namespace resolving (again!).
6132         
6133         * class.cs (Class.ctor): Removed exit.
6134         (PropertyMethod.ctor): ditto.
6135         
6136         * codegen.cs (Codegen.Reset): Reset static data.
6137         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6138         
6139         * cs-tokenizer.cs (Cleanup): Removed.
6140         
6141         * driver.cs (GetSystemDir): Rewrote to one line command.
6142         It caused problem with unloaded dynamic modules.
6143         (UnixParseOption): Removed Exit.
6144         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6145         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6146         Now can be mcs used as library.
6147         
6148         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6149         empty location.
6150         
6151         * location.cs (Reset): Reset static data.
6152         
6153         * namespace.cs (Reset): Reset static data.
6154         
6155         * report.cs (Report.Reset): Reset static data.
6156         
6157         * rootcontext.cs (RootContext.Reset): Reset static data.
6158         
6159         * tree.cs (RootTypes.ctor): Use Location.Null
6160         
6161         * typemanager.cs (TypeManager.Reset): Reset static data.
6162         (CoreLookupType): Removed Exit.
6163         (TypeHandle.Reset): Reset static data.
6164         
6165 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6166
6167         Fix #73516.
6168         * typemanager.cs (ComputeNamespaces): Import namespaces from
6169         referenced modules too.
6170
6171 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6172
6173         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6174         than '.'.
6175
6176 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6177
6178         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6179         enclosing DeclSpace.  This ensures that a name-lookup populates
6180         more caches and there are fewer 'TypeExpression's.  Carve out
6181         nested type lookup into ...
6182         (LookupNestedTypeInHierarchy): ... this.
6183
6184 2005-04-15  Martin Baulig  <martin@ximian.com>
6185
6186         Merged r41590 from MCS and make it work in the generics land.
6187
6188         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6189         `check' argument.
6190
6191         * class.cs (PartialContainer.UpdateConstraints): Removed.
6192         (PartialContainer.CheckConstraints): Removed.
6193         (PartialContainer.SetParameterInfo): Store the constraints here.
6194         (PartialContainer.DefineTypeParameters): New public method;
6195         resolve the type parameter's constraints here.  Note that the
6196         PartialContainer doesn't have an EmitContext anymore, so we must
6197         do this in the ClassPart.
6198
6199 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6200
6201         Clean up a few partial-class semantics.  
6202         Fixes test-357.cs and cs1618-2.cs.
6203         * cs-parser.jay (struct_declaration): Use 'current_class' as
6204         parent of newly-created struct.  Remove call to Register ().
6205         Use 'pop_current_class' to complete handing the current struct.
6206         (interface_declaration): Likewise.
6207         (class_declaration): Likewise.
6208         (enum_declaration): Use 'current_class' as parent of newly created
6209         enum.
6210         (delegate_declaration): Likewise.
6211         (pop_current_class): New function.  This is used to handle closing
6212         up the 'current_class' and 'current_container', and pointing them
6213         to the enclosing class/container.
6214         (CSharpParser): Initialize 'current_class' too.
6215         * decl.cs (MemberCore): Add check for invariant: a partial
6216         container is not a parsed entity, and thus does not enclose any
6217         parsed members.
6218         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6219         (DeclSpace.BaseTypeExpr): Use it.
6220         (DeclSpace.LookupType): Add check for invariant.
6221         * class.cs (TypeContainer): Add check for invariant: a nested
6222         class should have the same NamespaceEntry as its enclosing class.
6223         (TypeContainer.EmitFieldInitializers): Make virtual.
6224         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6225         MemberCore.
6226         (TypeContainer.Register): Remove.
6227         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6228         null.  Use TypeResolveEmitContext for resolving base types and
6229         interfaces.  Move initialization of Parts.TypeBuilder here from
6230         ...
6231         (TypeContainer.DefineNestedTypes): ... here.
6232         (PartialContainer): Take a Namespace not a NamespaceEntry.
6233         (PartialContainer.Create): Don't use Register.  Call the
6234         appropriate Add... function directly.
6235         (ClassPart): Take both the PartialContainer and the enclosing
6236         class as constructor arguments.
6237         (ClassPart.EmitFieldInitializers): Override.
6238         (ClassPart.PartFindNestedTypes): Remove.
6239         (FieldBase.GetInitializerExpression): Resolve the initializer
6240         expression in the emit context of the enclosing class.
6241         * tree.cs (RootTypes): Remove Register ().
6242         
6243 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6244
6245         * cs-parser.jay: Removed CS0134.
6246         
6247         * driver.cs: Removed CS1901.
6248         
6249         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6250         for predefined types.
6251
6252 2005-03-07  Duncan Mak  <duncan@novell.com>
6253
6254         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6255         well. Fixes bug #73454.
6256
6257 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6258
6259         * cs-tokenizer.cs (xtoken): Add CS1035.
6260         
6261         * class.cs (MethodData.Define): Add CS0683.
6262         (FieldMember.ctor): Add CS0681.
6263
6264 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6265
6266         * ecore.cs (SimpleName.DoResolve): Rename from
6267         SimpleName.DoResolveAllowStatic.
6268         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6269         Pass 'intermediate' flag to MemberStaticCheck.
6270         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6271         of "intermediate" lookups via MemberAccess.
6272         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6273         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6274
6275 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6276
6277         Fix #73394.
6278         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6279         slipped in because of variable names that are identical to a
6280         builtin type's BCL equivalent ('string String;', 'int Int32;').
6281         (PropertyExpr.EmitInstance): Likewise.
6282
6283 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6284
6285         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6286         
6287         * report.cs (warning_ignore_table): Made public.
6288
6289 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6290
6291         Fix #73282.
6292         * class.cs (MethodData.Emit): Pass 'container' to
6293         container.GetObsoleteAttribute instead of 'container.Parent'.
6294
6295 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6296
6297         * cs-parser.jay: Add 1534 error test.
6298
6299         * iterators.cs (Yield.CheckContext): Add error 1629.
6300         (Iterator.ctor): Save unsafe modifier.
6301         (MoveNextMethod.DoEmit): Restore unsafe context.
6302
6303         * namespace.cs (UsingAlias): Better error message.
6304
6305 2005-03-03  Dan Winship  <danw@novell.com>
6306
6307         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6308         the warning message [#73219]
6309
6310 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6311
6312         Fix compile with MCS 1.0.0.0.
6313         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6314         w_restore to not depend on string constant folding.
6315
6316 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6317
6318         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6319         CS0246 check to users who passed 'silent = false'.
6320         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6321         check.
6322         (SimpleName.SimpleNameResolve): Update.
6323         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6324         (MemberAccess.IdenticalNameAndTypeName): Update.
6325         * doc.cs (FindDocumentedTypeNonArray): Update.
6326
6327 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6328
6329         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6330         * parameters.cs (ComputeAndDefineParameters): Remove.
6331         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6332         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6333         Use GetParameterInfo.
6334
6335 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6336
6337         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6338
6339 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6340
6341         Unify DeclSpace.LookupType and DeclSpace.FindType.
6342         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6343         is in charge of defining nested types on demand.
6344         (DeclSpace.LookupType): Use it when the current_type is a
6345         TypeBuilder.  Use LookupTypeDirect for reflected types.
6346         (DeclSpace.FindType): Remove.
6347         (DeclSpace.LookupInterfaceOrClass): Likewise.
6348         (DeclSpace.DefineTypeAndParents): Likewise.
6349         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6350         DeclSpace.LookupType.
6351         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6352         * typemanager.cs (LookupType): Simplify.
6353         (AddUserType): Remove type from negative_hits.
6354         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6355         * class.cs (TypeContainer.FindMembers): Move handling of nested
6356         types ...
6357         (TypeContainer.FindMembers_NestedTypes): ... here.
6358         (TypeContainer.FindNestedType): Implement override.
6359         (ClassPart.FindNestedType): Delegate to PartialContainer.
6360         (ClassPart.PartFindNestedType): Looks up the nested types of the
6361         part alone.
6362
6363 2005-04-14  Martin Baulig  <martin@ximian.com>
6364
6365         * generic.cs (ConstructedType): Moved all the type lookup and
6366         nested class logic into SimpleName.
6367         (ConstructedType.ResolveConstructedType): Our underlying type is
6368         already fully resolved; all the type lookup stuff is in
6369         SimpleName.
6370
6371         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6372         constructed types here instead of in ConstructedType.
6373
6374         * decl.cs (MemberName.GetTypeExpression): Always create a
6375         SimpleName, not a ConstructedType.
6376         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6377
6378 2005-03-02  Martin Baulig  <martin@ximian.com>
6379
6380         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6381         static constructor in static classes.
6382
6383 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6384
6385         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6386         sizeParamIndex is not specified.
6387
6388 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6389
6390         Fix #73117
6391         * report.cs (WarningMessage.IsEnabled): Missing null check.
6392
6393 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6396         in the fields and not in the properties.
6397
6398 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6399
6400         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6401         fields as well.
6402
6403 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6404
6405         * attribute.cs: Small refactoring (improved robustness).
6406         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6407         (ValidateGuid): Removed.
6408         (Resolve): Removed referenced to above mentioned.
6409         (GetAttributeUsage): Made private and changed to work without
6410         class assistance.
6411         (GetIndexerAttributeValue): Don't crash.
6412         (GetConditionalAttributeValue): Ditto.
6413         (GetClsCompliantAttributeValue): Ditto.
6414         (ExtractSecurityPermissionSet): All attributes exceptions are
6415         error 648.
6416         (GetPropertyValue): New helper.
6417         (GetMethodImplOptions): New method.
6418         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6419         some missing properties.
6420         
6421         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6422         (Method.ApplyAttributeBuilder): Updated.
6423         
6424         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6425         exception.
6426
6427 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6428
6429         Fix #73052.
6430         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6431         non-simple types (array, pointer, reference).
6432
6433 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6434
6435         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6436
6437         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6438         for operators.
6439         (Method.CheckBase): Catch wrong destructor here.
6440         (MethodData.Define): Add errors 550, 668.
6441
6442         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6443
6444         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6445
6446         * pending.cs (VerifyPendingMethods): Add error 551.
6447
6448         * typemanager.cs (CSharpName): Next error report helper.
6449
6450 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6451
6452         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6453         attributes. Removed useless attribute double check.
6454         It saves almost 2MBs for corlib.
6455
6456 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6457
6458         Fix #72924.
6459         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6460         called twice in case of error.
6461
6462 2005-02-23  Chris Toshok  <toshok@ximian.com>
6463
6464         Fix compiler portions of #72827.
6465         * statement.cs (Block.Emit): call Begin/EndScope on the
6466         EmitContext instead of the ILGenerator.
6467
6468         * codegen.cs (EmitContext.BeginScope): new method, call
6469         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6470         we have one.)
6471         (EmitContext.BeginScope): same, but EndScope and CloseScope
6472
6473         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6474         offset and call the superclass's OpenScope(int) with it.
6475         (SymbolWriter.CloseScope): get the current il
6476         offset and call superclass's CloseScope(int) with it.
6477
6478 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6479
6480         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6481         CS1677 for out and ref as well.
6482
6483         * class.cs (Method.Define): Add error CS1599 detection.
6484         
6485         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6486         
6487         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6488         
6489         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6490         
6491         * support.cs.cs (ModifierDesc): New helper method.
6492
6493 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6494             Abin Thomas  <projectmonokochi@rediffmail.com>
6495             Anoob V E  <projectmonokochi@rediffmail.com>
6496             Harilal P R  <projectmonokochi@rediffmail.com>
6497
6498         Fix #57851, #72718.
6499         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6500         MemberLookup (used for error reporting) actually returns a result.
6501         Fix error report number (122, not 112).
6502
6503 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6504             Anoob V E  <projectmonokochi@rediffmail.com>
6505             Harilal P R  <projectmonokochi@rediffmail.com>
6506
6507         Fix #71134.
6508         * pending.cs (PendingImplementation.GetAbstractMethods):
6509         Find NonPublic members too.
6510
6511 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6512
6513         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6514         Fixed error 217.
6515         
6516         * class.cs (MethodCore.CheckMethodAgainstBase):
6517         Add error 239 report.
6518
6519 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6520
6521         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6522         
6523         * class.cs (Operator.Define): Add error 217 report.
6524         
6525 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6526
6527         Fix #68955.
6528         * expression.cs (Invocation.IsApplicable): Make public.
6529         (Invocation.IsParamsMethodApplicable): Likewise.
6530         * delegate.cs (Delegate.VerifyApplicability): Don't use
6531         Invocation.VerifyArgumentCompat for parameter applicability
6532         testing.  Use Invocation.IsApplicable and
6533         Invocation.IsParamsMethodApplicable.
6534
6535 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6536
6537         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6538         
6539         * class.cs (Operator.Define): Add error 217 report.
6540         
6541 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6542
6543         * namespace.cs (UsingEntry.Resolve): Undo change below.
6544
6545 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6546
6547         Fix #72756.
6548         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6549         disable the error message when the extended MemberLookup also
6550         fails.
6551         (Expression.MemberLookupFinal): Update.
6552         (SimpleName.DoSimpleNameResolve): Update.
6553         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6554         Don't use MemberLookupFinal.
6555         (New.DoResolve): Update.
6556         (BaseAccess.CommonResolve): Update.
6557
6558 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6559
6560         Fix #72732.
6561         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6562         occured previously, don't resolve again.
6563
6564 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6565
6566         Fix #69949
6567         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6568         argument. Call ResolveAttributeUsage for unresolved.
6569         when types doesn't match ctor arguments.
6570         
6571         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6572         for nested attribute classes.
6573         (Class.attribute_usage): Removed.
6574         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6575         for attribute class.
6576         
6577         * ecore.cs (IsAttribute): Removed.
6578         
6579         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6580         
6581         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6582         now normal types.
6583         (attribute_types): Removed.
6584         (EmitCode): Global attributes are emited as the latest.
6585
6586 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6587
6588         * class.cs (EmitFieldInitializers): Don't emit field initializer
6589         for default values when optimilization is on.
6590         
6591         * constant.cs (Constant.IsDefaultValue): New property.
6592         
6593         * driver.cs: Add /optimize handling.
6594         
6595         * constant.cs,
6596         * ecore.cs,
6597         * literal.cs: Implement new IsDefaultValue property.
6598         
6599         * rootcontext.cs (Optimize): New field, holds /optimize option.
6600
6601 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6602
6603         Fix crasher in re-opened #72347.
6604         * namespace.cs (Namespace.Lookup): Return null if
6605         DeclSpace.DefineType returns null.
6606
6607         Fix #72678.
6608         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6609
6610 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6611
6612         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6613         now returns null if it cannot resolve to an lvalue.
6614         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6615         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6616         returned null.  Remove check for SimpleName.
6617         (EventExpr.DoResolveLValue): New.
6618         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6619         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6620         error from ...
6621         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6622         avoid CS0131 error.
6623         (Unary.ResolveOperator): Move CS0211 check ...
6624         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6625         CS0131 error.
6626         (Unary.DoResolveLValue): Simplify.
6627         (AddressOf.DoResolveLValue): New.
6628         (ArrayAccess.DoResolveLValue): New.
6629
6630 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6631
6632         * attribute.cs (Attribute.Resolve): Add arguments casting for
6633         when types doesn't match ctor arguments.
6634
6635 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6636
6637         Fix parts of #63202.
6638         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6639         lookup of operator in base type.  Ensure that all checks happen
6640         when the operator resolves to an "op_..." method.
6641
6642 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6643
6644         Fix #71992.
6645         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6646         'ignore_cs0104' parameter.  Pass it to ...
6647         (NamespaceEntry.Lookup): ... this.
6648         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6649         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6650         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6651         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6652         Update.  Request that cs0104 errors be ignored.
6653         (ComposedCast.ResolveAsTypeStep): Update.
6654
6655 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6656
6657         Fix #59209.
6658         * expression.cs (Invocation.BetterFunction): Remove support for
6659         comparing virtual functions and their overrides.
6660         (Invocation.IsOverride): New.
6661         (Invocation.OverloadResolve): Don't consider 'override' functions
6662         during candidate selection.  Store them in a lookaside list.
6663         If the selected method is a 'virtual' function, use the list to
6664         find any overrides that are closer to the LHS type.
6665
6666 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6667
6668         * expression.cs (New.DoResolve): Add complex core type reduction.
6669         (New.Constantify): Converts complex core type syntax like 'new int ()'
6670         to simple constant.
6671         
6672 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6673
6674         * decl.cs (EntryType.EntryType): New constructor to create an
6675         updated copy of a cache entry.
6676         (MemberCache.AddMethods): Use it.
6677         (MemberCache.ClearDeclaredOnly): Remove.
6678         (MemberCache.MemberCache): Update.
6679
6680 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6681
6682         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6683         variable.  This one is represents the actual low-level declaration
6684         of the method, as opposed to the semantic level `IsStatic'.   
6685
6686         An anonymous method which is hosted into a static method might be
6687         actually an instance method.  IsStatic would reflect the
6688         container, while MethodIsStatic represents the actual code
6689         generated.
6690
6691         * expression.cs (ParameterReference): Use the new MethodIsStatic
6692         instead of IsStatic.
6693
6694         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6695         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6696         set on the current EmitContext. 
6697
6698         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6699         resolve our casted expression as an LValue.  This triggers the
6700         proper LValue processing that is later required by Assign.
6701
6702         This fixes 72347.
6703
6704         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6705
6706 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6707
6708         C# 2.0 Fixed buffer implementation
6709
6710         * anonymous.cs: Update after RegisterHelperClass renaming.
6711
6712         * attribute.cs (AttributeTester.fixed_buffer_cache):
6713         Cache of external fixed buffers.
6714         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6715         implementation if field is fixed buffer else null.
6716
6717         * class.cs
6718         (TypeContainer.AddField): Accept FieldMember instead of Field.
6719         (FieldBase.IsFieldClsCompliant): Extracted code from
6720         VerifyClsCompliance descendant customization.
6721         (FixedField): New class handles fixed buffer fields.
6722         (FixedFieldExternal): Keeps information about imported fixed
6723         buffer.
6724         (IFixedField): Make access to internal or external fixed buffer
6725         same.
6726
6727         * cs-parser.jay: Add fixed buffer parsing.
6728
6729         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6730         buffer.
6731
6732         * expression.cs (Indirection): Extended implementation to accept
6733         fixed buffer field.
6734         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6735         (ElementAccess.MakePointerAccess): Get type as parameter.
6736         (DoResolve): Add fixed buffer field expression conversion.
6737         (DoResolveLValue): Ditto.
6738         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6739         (ArrayPtr): Derives from FixedBufferPtr.
6740         (ArrayPtr.Emit): Add extra emit for array elements.
6741
6742         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6743
6744         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6745         for compiler generated types.
6746         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6747
6748         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6749         and consume less memory.
6750         (Fixed.Resolve): Add fixed buffer case.
6751
6752         * typemanager.cs (compiler_generated_attr_ctor,
6753         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6754         (HasElementType): Add our own implementation to work on every
6755         runtime.
6756
6757 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6758
6759         * anonymous.cs (CaptureContext): Track whether `this' has been
6760         referenced.   
6761
6762         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6763         only captured `this' if it was implicitly done (instance
6764         methods/variables were used). 
6765
6766         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6767         `this' must be captured.
6768
6769 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6770  
6771         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6772         is null it means that there has been no need to capture anything,
6773         so we just create a sibling.
6774
6775         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6776
6777         Just a partial fix.  The other half is fairly elusive.
6778         
6779 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6780
6781         Fix #52586, cs0121-4.cs.
6782         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6783         and return a hashtable.
6784         (MemberCache.ClearDeclaredOnly): New.
6785         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6786         the method_hash of a base type too.
6787         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6788         type methods.  Overwrite entries with the same MethodHandle so
6789         that the ReflectedType is correct.  The process leaves in base
6790         virtual functions and their overrides as distinct entries.
6791         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6792         matters since it was boxed in a ArrayList before.
6793         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6794         modifier.
6795         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6796         case of a virtual function and its override (choose the overload
6797         as better).
6798         (Invocation.OverloadResolve): Avoid 'override' members during
6799         'applicable_type' calculation.
6800
6801 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6802
6803         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6804         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6805         GetTypeHandle.  It is possible for a reflected type to derive from
6806         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6807         System.Array during mscorlib compilation).
6808         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6809         contain a method_hash, don't create one either.  Don't create a
6810         deep copy of the base cache's method_hash.
6811         (MemberCache.SetupCache): Rename back from DeepCopy.
6812         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6813         already initialized.  If we see an override function, add its
6814         underlying base virtual function to the member_hash too.
6815
6816 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6817
6818         Combine two near-redundant caches.
6819         * typemanager.cs (method_params): Rename from method_internal_params.
6820         (TypeManager.GetParameterData): New.  Replace
6821         Invocation.GetParameterData.
6822         (TypeManager.LookupParametersByBuilder): Remove.
6823         * expression.cs (Invocation.method_parameter_cache): Remove.
6824         (Invocation.GetParameterData): Remove.
6825         Update to changes.
6826         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6827         Update to changes.
6828
6829 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6830
6831         Fix #72015.
6832         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6833         TypeManager.multicast_delegate_type is null, resolve it by looking
6834         up "System.MulticastDelegate".
6835         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6836
6837 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6838             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6839             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6840
6841         Fix cs0164.cs.
6842         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6843         (LabeledStatement.AddReference): New.  Set 'referenced'.
6844         (Goto.Resolve): Use it.
6845
6846 2005-02-05  John Luke  <john.luke@gmail.com>
6847
6848         * driver.cs: remove duplicate -doc line in Usage ()
6849
6850 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6851
6852         * location.cs (Location.AddFile): Fix CS2002 error report.
6853
6854 2005-02-02  Martin Baulig  <martin@ximian.com>
6855
6856         * delegate.cs (Delegate.DefineType): Report an internal error if
6857         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6858         details.        
6859
6860 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6861
6862         Fix a crasher in a variant of #31984.
6863         * const.cs (Constant.CheckBase): New override that defers the
6864         new-or-override check in case the base type hasn't been populated
6865         yet.
6866         (Constant.Define): Ensure the new-or-override check is performed.
6867
6868 2005-02-01  Duncan Mak  <duncan@ximian.com>
6869
6870         * const.cs (LookupConstantValue): Check that `ce' is not null
6871         before calling GetValue ().
6872
6873 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6874
6875         Fix test-334.cs (#69519).
6876         * cs-parser.jay (using_alias_directive): Pass in an expression to
6877         NamespaceEntry.UsingAlias.
6878         (using_namespace_directive): Pass in an expression to
6879         NamespaceEntry.Using.
6880         (namespace_name): Don't flatten to a string.
6881         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6882         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6883         ResolveAsTypeStep.
6884         (NamespaceEntry.UsingEntry): Likewise.
6885         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6886         changes.
6887         (NamespaceEntry.LookupForUsing): Remove.
6888         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6889         names.
6890         (NamespaceEntry.Lookup): Remove support for dotted names.
6891
6892 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6893
6894         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6895         split into two.
6896         (NamespaceEntry.ImplicitParent): Compute on demand.
6897         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6898         parallels the current.
6899         (NamespaceEntry.LookupForUsing): Use it.
6900         (NamespaceEntry.Lookup): If the current namespace-entry is
6901         implicit, don't search aliases and using tables.
6902
6903 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6904
6905         Fix #31984.
6906         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6907         BaseCache here.
6908         (TypeContainer.BaseCache): Compute on demand.
6909         (TypeContainer.FindMembers): Define constants and types if they're
6910         not already created.
6911         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6912         check.
6913         * const.cs (Constant.Define): Make idempotent.
6914
6915 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6916
6917         * pending.cs: Produce better code (no nops produced by using Ldarg
6918         + value).
6919         
6920         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6921         i - 1' it should be arg + 1.
6922
6923         Fixes bug #71819.
6924
6925 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6926
6927         * attribute.cs (Attribute.CheckAttributeType): Make private
6928         non-virtual.
6929         (Attribute.ResolveType): Make virtual.
6930         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6931         handling of RootContext.Tree.Types.
6932
6933 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6934
6935         Update attribute-handling to use the SimpleName/MemberAccess
6936         mechanisms.
6937         * cs-parser.jay (attribute): Pass in an expression to the
6938         constructors of Attribute and GlobalAttribute.
6939         * attribute.cs (Attribute): Take an expression for the name.
6940         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6941         passed in attribute name expression.
6942         (Attribute.CheckAttributeType): Use it.
6943         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6944         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6945         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6946         argument to prevent error messages if the lookup fails.
6947
6948 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6949
6950         * expression.cs (Indirection): Implemented IVariable interface
6951         to support indirection in AddressOf operator.
6952         (PointerArithmetic.Emit): Add optimalization for case where
6953         result can be precomputed.
6954
6955 2005-01-26  Martin Baulig  <martin@ximian.com>
6956
6957         * class.cs (TypeContainer.AttributeTargets): Return the correct
6958         AttributeTargets depending on our `Kind' instead of throwing an
6959         exception; fixes #71632.
6960
6961 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6962
6963         Fix #71257
6964         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6965         constant members.
6966
6967 2005-03-17  Martin Baulig  <martin@ximian.com>
6968
6969         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6970         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6971
6972 2005-03-17  Martin Baulig  <martin@ximian.com>
6973
6974         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6975         to bool so we can return an error condition.
6976         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6977         returned an error.
6978
6979 2005-03-17  Martin Baulig  <martin@ximian.com>
6980
6981         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6982
6983         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6984         converting from an array-type of T to `IEnumerable<T>'.
6985
6986 2005-03-16  Martin Baulig  <martin@ximian.com>
6987
6988         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6989         (Nullable.LiftedUnaryMutator): New public class.
6990
6991         * expression.cs (UnaryMutator.DoResolve): Added support for
6992         Nullable Types.
6993
6994 2005-03-14  Martin Baulig  <martin@ximian.com>
6995
6996         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6997
6998 2005-03-14  Martin Baulig  <martin@ximian.com>
6999
7000         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7001         the comparision operators `<', `>', `<=' and `>='.
7002
7003 2005-03-13  Martin Baulig  <martin@ximian.com>
7004
7005         * generic.cs
7006         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7007         avoid confusion with the `NullLiteral'.
7008         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7009
7010 2005-03-13  Martin Baulig  <martin@ximian.com>
7011
7012         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7013         comparing arbitrary types with the null literal.
7014
7015 2005-03-13  Martin Baulig  <martin@ximian.com>
7016
7017         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7018         boolean operators '&&', '||', '&' and '|'.
7019         (Nullable.OperatorTrueOrFalse): New public class.
7020
7021         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7022         instead of a `StaticCallExpr'; added support for nullables.
7023
7024 2005-03-10  Martin Baulig  <martin@ximian.com>
7025
7026         * expression.cs
7027         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7028         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7029
7030 2005-03-07  Martin Baulig  <martin@ximian.com>
7031
7032         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7033         it work if `expr' is not an IMemoryLocation.
7034         (Nullable.Lifted): Implement IMemoryLocation.
7035         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7036         target type.
7037
7038 2005-03-05  Martin Baulig  <martin@ximian.com>
7039
7040         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7041         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7042         (Nullable): Added support for lifted unary and binary operators.
7043
7044         * expression.cs (Unary.DoResolve): Added support for nullable types.
7045         (Binary.DoResolve): Likewise.
7046         (Conditional.DoResolve): Likewise.
7047
7048 2005-03-02  Martin Baulig  <martin@ximian.com>
7049
7050         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7051
7052         * class.cs (ClassPart.SetParameterInfo): Override this.
7053         (PartialContainer.SetParameterInfo): Override this.
7054         (TypeContainer.CheckConstraints): New protected method.
7055         (PartialContainer.CheckConstraints): Override this and check
7056         whether the same contraints were specified in all parts of a
7057         partial generic type definition.
7058         (PartialContainer.UpdateConstraints): New public method.
7059
7060         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7061
7062 2005-03-02  Martin Baulig  <martin@ximian.com>
7063
7064         Committing a patch from Carlos Alberto Cortez to fix #72887.
7065
7066         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7067         casts from `T []' to `int []'.
7068
7069 2005-03-02  Martin Baulig  <martin@ximian.com>
7070
7071         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7072
7073         * expression.cs (Binary.ResolveOperator): When resolving a
7074         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7075         `=='.  Fixes #71866.  See gen-127.cs.
7076
7077 2005-03-02  Martin Baulig  <martin@ximian.com>
7078
7079         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7080         static constructor in static classes.
7081
7082 2005-03-02  Martin Baulig  <martin@ximian.com>
7083
7084         * generic.cs
7085         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7086         (Nullable.LiftedConversion): Added support for user-defined
7087         conversions.
7088
7089         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7090
7091         * cs-parser.jay: Use ComposedCast everywhere instead of
7092         NullableType, so we don't need to check for NullableType
7093         everywhere.
7094         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7095         case where we'll be resolved into a `parenthesized_expression_0'
7096         afterwards.
7097
7098         * convert.cs
7099         (Convert.UserDefinedConversion): Added nullable conversions.
7100
7101 2005-02-28  Martin Baulig  <martin@ximian.com>
7102
7103         * generic.cs (TypeManager.IsNullableType): New static method.
7104         (Nullable): New abstract class.
7105         (Nullable.NullLiteral): New public class.
7106         (Nullable.LiftedConversion): New public class.
7107
7108         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7109         `builtin_types opt_nullable'.
7110
7111         * convert.cs
7112         (Convert.ImplicitConversionStandard): Added nullable conversions.
7113         (Convert.ExplicitConversionStandard): Likewise.
7114         (Convert.ExplicitConversion): Likewise.
7115
7116 2005-02-26  Martin Baulig  <martin@ximian.com>
7117
7118         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7119         begin with a "?", for instance "?[]".  Don't do a type lookup if
7120         `dim' is empty.
7121
7122 2005-02-25  Martin Baulig  <martin@ximian.com>
7123
7124         The first part of Nullable Types :-)
7125
7126         * generic.cs (NullableType): New public class.
7127         (NullCoalescingOperator): New public class.
7128         (TypeArguments.Resolve): Add a CS0306 check.
7129
7130         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7131         (opt_nullable): New rule.
7132         (type): Added `opt_nullable' to `namespace_or_type_name',
7133         `builtin_types' and `pointer_type'.
7134         (array_type): Added `opt_nullable'.
7135         (opt_rank_specifier_or_nullable): New rule; this is the
7136         combination of `opt_rank_specifier' and `opt_nullable'.
7137         (opt_error): New rule; catch errors here.
7138         (nullable_type_or_conditional): New rule; we use this to check for
7139         nullable and still detect the conditional operator.
7140         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7141         instead `opt_rank_specifier'.
7142
7143         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7144         for nullables.
7145
7146 2005-02-24  Martin Baulig  <martin@ximian.com>
7147
7148         * README, README.Changes: Removed; they're old and obsolete.
7149
7150 2005-02-22  Martin Baulig  <martin@ximian.com>
7151
7152         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7153         returned an error, set `constraints' to null to avoid a crash
7154         later on.
7155         (TypeParameter.ResolveType): Likewise.
7156
7157 2005-02-22  Martin Baulig  <martin@ximian.com>
7158
7159         * generic.cs
7160         (Constraints.ResolveTypes): Protect against being called twice.
7161         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7162         (TypeParameter.ResolveType): New public method; calls
7163         constraints.ResolveTypes().
7164         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7165         into the new ResolveType().
7166         (GenericMethod.Define): Call ResolveType() on all our
7167         TypeParameter's.        
7168
7169 2005-02-21  Martin Baulig  <martin@ximian.com>
7170
7171         * generic.cs
7172         (TypeManager.generic_nullable_type): New static public field.
7173         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7174
7175         * rootcontext.cs
7176         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7177
7178 2005-02-15  Martin Baulig  <martin@ximian.com>
7179
7180         * generic.cs (ConstructedType.Constraints): Correctly check
7181         constraints if the argument type is a type parameter; fixes
7182         #72326. 
7183
7184 2005-02-02  Martin Baulig  <martin@ximian.com>
7185
7186         * delegate.cs (Delegate.DefineType): Report an internal error if
7187         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7188         details.        
7189
7190 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7191
7192         * pending.cs: Produce better code (no nops produced by using Ldarg
7193         + value).
7194         
7195         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7196         i - 1' it should be arg + 1.
7197
7198         Fixes bug #71819.
7199         
7200 2005-01-26  Martin Baulig  <martin@ximian.com>
7201
7202         * cs-parser.jay (indexer_declarator): Don't report an error if we
7203         have type parameters since we can be an explicit interface
7204         implementation; fixes #71449.
7205
7206 2005-01-26  Martin Baulig  <martin@ximian.com>
7207
7208         * class.cs (TypeContainer.AttributeTargets): Return the correct
7209         AttributeTargets depending on our `Kind' instead of throwing an
7210         exception; fixes #71632.
7211
7212 2005-01-26  Martin Baulig  <martin@ximian.com>
7213
7214         * delegate.cs (Delegate.DefineType): Correctly define our type
7215         parameters.  Fixes #71483.
7216
7217 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7218
7219         Fix #71602.
7220         * expression.cs (MemberAccess.DoResolve): Don't complain with
7221         cs0572 when the LHS of a member access has identical name and type
7222         name.
7223
7224 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7225
7226         Fix #71651, #71675
7227         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7228         CreatePermission.
7229         Create custom PermissionSet only for PermissionSetAttribute.
7230
7231 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7232
7233         Fix #71649
7234         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7235         delegates in static class.
7236
7237 2005-01-24  Martin Baulig  <martin@ximian.com>
7238
7239         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7240         merging an implicit block, just use its reachability.
7241
7242         * statement.cs (Block.Resolve): Make the unreachable code check
7243         work wrt. implicit blocks; see test-337 from #63842.
7244
7245 2005-01-21  Alp Toker  <alp@atoker.com>
7246  
7247         * cs-parser.jay: destructor_declaration's container is PartialContainer
7248         not Class when partial types are used, so use Kind prop instead of
7249         'is'.
7250         
7251 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7252
7253         * cs-parser.jay: Improve error reporting when an interface
7254         declares new types.
7255
7256 2005-01-20  Dick Porter  <dick@ximian.com>
7257
7258         * support.cs: SeekableStreamReader fix from Sandor Dobos
7259         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7260         chars are read.  Fixes bug 70369.
7261
7262 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7263
7264         * cs-parser.jay (catch_clause): Simplify current_block handling
7265         somewhat.
7266
7267 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7268
7269         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7270         code with ImplicitStandardConversion to handle the implicit
7271         conversion of method groups into valid delegate invocations. 
7272
7273         The problem is that in parameter handling we were using this code
7274         path.  Fixes bug #64698
7275
7276 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7277
7278         * cs-parser.jay: Fix several infelicities.
7279         - Avoid assigning to the parser value stack.  Code like 
7280           '$3 = null' is unclean.  Synthesize a value for the code block
7281           instead. 
7282         - Avoid using oob_stack for storing location information.  Use ...
7283         (_mark_): ... this.  New (empty) rule.  Saves the current location
7284         in $$.
7285         (foreach_statement): Avoid using oob_stack for current_block
7286         handling.  Use technique used in for_statement and
7287         using_statement.  Synthesize a value for the code block to store
7288         additional intermediate information.
7289
7290 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7291
7292         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7293         of a different type is only allowed to private fields of a
7294         containing type, not on fields of a base class.
7295
7296         See test-174.cs and error cs0122-9.cs
7297
7298 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7299
7300         Fix test-335.cs (bug #58126).
7301         * cs-parser.jay (argument): Split out non-expression parts of the
7302         rule into 'non_simple_argument'.
7303         (invocation_expression): Support parenthesized invocations with
7304         multiple arguments, and with single non-simple arguments.
7305
7306 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7307
7308         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7309         places.
7310
7311 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7312
7313         Fix cs0038-1.cs, cs1640-6.cs.
7314         * ecore.cs (Expression.Resolve): Remove special-case for
7315         SimpleName in error-handling.
7316         (Expression.almostMatchedMembers): Relax access permission to
7317         protected.
7318         (Expression.MemberLookupFailed): Handle duplicates in
7319         almostMatchedMembers list.
7320         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7321         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7322         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7323         overload if the passed in MemberInfo is a MethodBase.
7324
7325 2005-01-25  Martin Baulig  <martin@ximian.com>
7326
7327         * doc.cs
7328         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7329
7330 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7331
7332         Fix #70749
7333         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7334         for non-CAS & merge permission sets properly.
7335
7336 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7337
7338         Improve standard-compliance of simple name and member access 
7339         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7340         * ecore.cs (FullNamedExpression): New abstract base class 
7341         for Namespaces and TypeExpressions.
7342         (ResolveFlags.SimpleName): Remove.
7343         (SimpleName): Remove support for dotted names.
7344         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7345         DeclSpace.FindType and DeclSpace.LookupType.
7346         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7347         (Expression.ExprClassName): Make member function.
7348         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7349         a namespace.  Remove creation of dotted "SimpleName"s.
7350         (MemberAccess.DoResolve): Likewise.
7351         * decl.cs (DeclSpace.Cache): Make private.
7352         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7353         (DeclSpace.FindType): Update.
7354         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7355         FullNamedExpression.
7356         * namespace.cs (Namespace): Derive from FullNamedExpression
7357         so that it can be part of expression resolution.
7358         (Namespace.Lookup): Return an FullNamedExpression.
7359         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7360         namespace.
7361         * rootcontext.cs (NamespaceLookup): Remove.
7362         (LookupType): Move to DeclSpace.
7363         * attribute.cs (CheckAttributeType): Update.
7364         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7365         (FindDocumentedTypeNonArray): Likewise.
7366
7367 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7368
7369         Fix cs0509.cs, cs1632.cs.
7370         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7371         is the same as IsInterface.
7372         (TypeContainer.GetClassBases): Likewise.
7373         * statement.cs (LabeledStatement.ig): New field.
7374         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7375         label.
7376         (LabeledStatement.DoEmit): Check that the label was created with
7377         the same ILGenerator.
7378
7379 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7380
7381         Fix #71058
7382         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7383         accessors to its properties.
7384
7385         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7386         from accessors to property.
7387         
7388 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7389
7390         Fix #70722
7391         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7392         only for overrides.
7393         
7394 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * attribute.cs: Check for null and empty strings.  
7397
7398         I have lost another battle to Paolo.
7399
7400 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7401
7402         Fix #70942
7403         * class.cs (PropertyMethod): Set Parent field in ctors.
7404         (SetMethod.InternalParameters): Add unsafe switch hack.
7405         Override MarkForDuplicationCheck where it is appropriate.
7406
7407         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7408         It says whether container allows members with the same name.
7409         Base default is no.
7410         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7411         Removed is_method parameter.
7412
7413 2005-01-06  Duncan Mak  <duncan@ximian.com>
7414
7415         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7416         because the previous change led to incorrect reporting of CS1032
7417         ("Cannot define/undefine preprocessor symbols after first token in
7418         file"). Instead of using `tokens_seen' as the only flag that
7419         triggers CS1040, introduce `comments_seen'. This new flag is used
7420         to signify having seen comments on the current line, so it is
7421         unset after a newline.
7422
7423 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7424
7425         * doc.cs : When searching for a type, find nested type too.
7426           This fixes bug #71040.
7427
7428 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7429
7430         * doc.cs :
7431           - Warn missing member comment on those classes which also does not
7432             have doc comments. Fixed bug #71041.
7433           - Don't warn missing doc comment on default constructor.
7434             Fixed bug #71042.
7435
7436 2005-01-06  Duncan Mak  <duncan@ximian.com>
7437
7438         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7439         comments, set `tokens_seen' to true. This allows us to detect
7440         misplaced preprocessor directives (i.e. not at the beginning of
7441         the a line, nor after whitespaces). In that case, report error
7442         CS1040. This fixes bug #56460.
7443
7444         * cs-parser.jay (interface_member_declaration): Add checks for
7445         IsExplicitImpl, and report CS0541 error if an interface member is
7446         defined as an explicit interface declaration.
7447
7448 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7449
7450         Fix #70817
7451         * class.cs (PropertyMethod): Set Parent field in ctors.
7452         (SetMethod.InternalParameters): Add unsafe switch hack.
7453         
7454         * decl.cs (MemberCore.Parent): Cannot be readonly.
7455
7456 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7457
7458         * decl.cs (DeclSpace.ResolveType): Remove.
7459         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7460         Merge in code from ...
7461         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7462         * class.cs, enum.cs: Update to changes.
7463
7464 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7465
7466         * anonymous.cs: Ensure that we init the scope of our parent if it
7467         has not been initialized yet.
7468
7469 2004-12-30  Duncan Mak  <duncan@ximian.com>
7470
7471         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7472         if field.FieldBuilder is null. Fixes #70758.
7473
7474         * convert.cs: Fixed some typos and updated some of the comments.
7475         (ImplicitStandardConversionExists):
7476         (TryImplicitIntConversion): If `target_type' is an interface and
7477         the type of `ic' implements this interface, return true or a new
7478         BoxedCast instead of null. This fixes #70468.
7479
7480 2004-12-29  Duncan Mak  <duncan@ximian.com>
7481
7482         * expression.cs (Argument.Emit): Check that Expr is
7483         IMemoryLocation before casting to it, and report CS1510 otherwise.
7484
7485         This fixes #70402.
7486
7487 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7488
7489         * statement.cs (Block.ThisVariable): remove the recursion here, to
7490         make the --profile more sane.
7491
7492 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7493
7494         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7495         assembly, by JB Evain.
7496
7497 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7498
7499         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7500           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7501         "parent" refers to enclosing type/class.  "base" refers to superclass.
7502
7503 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7504
7505         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7506         Ensure that we only have GlobalAttributes.
7507         * attribute.cs (Attribute.Emit): Make non-virtual.
7508         (GlobalAttribute.Emit): Remove.
7509         (Attribute.Resolve): Make virtual.
7510         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7511         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7512         the argument. Don't create one.
7513         (Attribute.GetObsoleteAttribute): Likewise.
7514         (Attribute.GetClsCompliantAttributeValue): Likewise.
7515         * class.cs, decl.cs: Update to changes.
7516
7517 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7518
7519         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7520         
7521         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7522         
7523         * statement.cs (Foreach.Resolve): Add error 186 report.
7524
7525 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7526
7527         * expression.cs (Conditional.DoResolve): Add warning 429.
7528         
7529         * statement.cs (If.Resolve): Add warning 665.
7530
7531 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7532
7533         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7534         except when in the parser, and in GlobalAttribute.
7535         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7536         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7537         RootContext.Tree.Types.NamespaceEntry once work is done.
7538         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7539         and resets RootContext.Tree.Types.NamespaceEntry.
7540
7541 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7542
7543         * cs-parser.jay: Don't create a block for every variable.
7544
7545 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7546
7547         * location.cs: Provide extra information.
7548
7549         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7550         variables from the captured environment, it is the ldarg_0.
7551
7552 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7553
7554         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7555         find a conclusion.
7556         
7557         * class.cs: Changed warning level for 169 to avoid developer
7558         displeasure from warning flooding. It will be changed back when they
7559         fix most of current BCL warnings.
7560         
7561         * RootContext.cs: Pushed default WarningLevel to 3.
7562         
7563         * statement.cs: Removed unused variable.
7564
7565 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7566
7567         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7568         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7569         Add error 502 report.
7570         (StaticClass.DefineType): Add error 441 report.
7571         (Class.AllowedModifiersProp): New virtual property as temporary
7572         extension to AllowedModifiers.
7573         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7574         to share implementation with StaticClass and don't call virtual
7575         methods from ctor.
7576         
7577         * driver.cs (MainDriver): Add error 1558 test.
7578
7579         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7580         report. Moved error 36 test here.
7581
7582         * statement.cs (Throw.Resolve): Add error 724 report.
7583
7584         * typemanager.cs: Add out_attribute_type core type.
7585         
7586 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7587
7588         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7589         3018 report.
7590         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7591
7592         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7593         3017 report.
7594         
7595         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7596
7597         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7598         Add error 3023 report.
7599         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7600
7601         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7602         implementation.
7603
7604 2004-12-12  John Luke  <john.luke@gmail.com>
7605
7606         * driver.cs (AddArgs): take -- into account when
7607         adding arguments, fixes bug 65710 
7608
7609 2004-12-12  Martin Baulig  <martin@ximian.com>
7610
7611         * expression.cs (Unary.TryReduceNegative): Added support for
7612         SByteConstant and ByteConstant.
7613         (Unary.Reduce): Check error values from TryReduceNegative().
7614
7615 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7616
7617         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7618         and report exception as error 182.
7619
7620 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7621
7622         * driver.cs (Main): Fix message when there are warnings.
7623
7624 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7625
7626         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7627
7628 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7629
7630         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7631         Reduced number of warnings.
7632         
7633         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7634
7635 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7636
7637         * driver.cs: Removed message.
7638
7639         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7640
7641 2004-12-08    <vargaz@freemail.hu>
7642
7643         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7644
7645 2004-12-08  Martin Baulig  <martin@ximian.com>
7646
7647         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7648         instead of a CS3002 for properties and indexer.
7649
7650 2004-12-08  Martin Baulig  <martin@ximian.com>
7651
7652         * decl.cs (MemberName.ToString): Make this work again.
7653
7654 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7655
7656         * attribute.cs (Resolve): Add error 591 detection.
7657
7658         * class.cs (FieldMember.Define): Add error 1547 detection.
7659         (Indexer.Define): Add error 620 detection.
7660         (Operator.Define): Add error 590 detection.
7661
7662         * ecore.cs: Missing argument for error 79.
7663
7664         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7665         detection.
7666
7667 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7668
7669         Fix #70106
7670         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7671         only.
7672
7673 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7674
7675         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7676           Some operator comments were suppressed.
7677         * doc.cs : Implicit/explicit operator name in doc comments are like
7678           "op_Explicit(type)~returnType", so added suffix handling.
7679
7680 2005-01-21  Alp Toker  <alp@atoker.com>
7681
7682         * cs-parser.jay: destructor_declaration's container is PartialContainer
7683         not Class when partial types are used, so use Kind prop instead of 'is'.
7684
7685 2004-12-12  Martin Baulig  <martin@ximian.com>
7686
7687         * expression.cs (Unary.TryReduceNegative): Added support for
7688         SByteConstant and ByteConstant.
7689         (Unary.Reduce): Check error values from TryReduceNegative().
7690
7691 2004-12-11  Martin Baulig  <martin@ximian.com>
7692
7693         * support.cs (ReflectionParameters.ParameterName): If we have a
7694         `gpd', call `ParameterName' on it.
7695
7696         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7697
7698         * pending.cs (PendingImplementation.DefineProxy): Call
7699         DefineParameter() for all of the MethodBuilder's arguments.
7700
7701 2004-12-09  Martin Baulig  <martin@ximian.com>
7702
7703         * doc.cs (DocUtil): Make this a static class.
7704
7705 2004-12-09  Martin Baulig  <martin@ximian.com>
7706
7707         * expression.cs (Invocation.InferType): Moved the type inference
7708         implementation into TypeManager.
7709
7710         * generics.cs (TypeManager): Moved the type inference
7711         implementation here.
7712
7713 2004-12-09  Martin Baulig  <martin@ximian.com>
7714
7715         * typemanager.cs (TypeManager): Make this a partial class.
7716
7717         * generics.cs
7718         (TypeManager): Move the generics part of `TypeManager' here.
7719
7720 2004-12-08  Martin Baulig  <martin@ximian.com>
7721
7722         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7723         instead of a CS3002 for properties and indexer.  Added CS3024
7724         check for generic interfaces.
7725
7726         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7727         instances are not CLS-compliant.
7728
7729 2004-12-08  Martin Baulig  <martin@ximian.com>
7730
7731         * cs-parser.jay
7732         (void_pointer_expression): New rule for `void*', `void**' etc.
7733         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7734
7735 2004-12-08  Martin Baulig  <martin@ximian.com>
7736
7737         * expression.cs (Invocation.InferType): Removed the hack for
7738         MethodCore.MayUnify().  
7739
7740         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7741         this actually work.
7742
7743         * class.cs (MethodCore.MayUnify): Use
7744         TypeManager.MayBecomeEqualGenericTypes().       
7745
7746 2004-12-08  Martin Baulig  <martin@ximian.com>
7747
7748         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7749         parameter, box it.  Fixes #69233.
7750
7751 2004-12-08  Martin Baulig  <martin@ximian.com>
7752
7753         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7754         have the ctor constraint.  Fixes #68326.
7755
7756 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7757
7758         * cs-parser.jay : interface comment was not consumed because of
7759           extra opt_semicolon before doc handling.
7760
7761 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7762
7763         Fix test-327.cs, test-328.cs, and put in early infrastructure
7764         for eventually fixing #52697.
7765         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7766         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7767         from other methods.
7768         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7769         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7770         (VerifyUsing, error246): Update.
7771         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7772         'NamespaceEntry.LookupNamespaceOrType'.
7773
7774 2004-12-07  Martin Baulig  <martin@ximian.com>
7775
7776         * driver.cs: Call it "BETA SOFTWARE" :-)
7777
7778 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7779
7780         Fix crash on cs0657-17.cs.
7781         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7782         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7783         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7784         the case where the NamespaceEntry gets overwritten.
7785
7786 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7787
7788         Fixed #69195, #56821
7789         * ecore.cs (ResolveBoolean): Tiny refactoring.
7790
7791         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7792         of right expression resolving when left is false constant and
7793         operator is LogicalAnd OR true constant and operator is LogicalOr.
7794
7795         * statement.cs (ResolveUnreachable): Always reports warning.
7796
7797 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7798
7799         * class.cs: Distinguish between 1721 and 1722 (just a little help
7800         for the programmer).
7801
7802 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7803
7804         * delegate.cs: Only allow this on new versions of the language. 
7805
7806 2004-12-02  Duncan Mak  <duncan@ximian.com>
7807
7808         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7809         Expression class.
7810         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7811         here as a static method. Take an additional bool out parameter
7812         `must_do_cs1540_check' for signaling to InstanceResolve.
7813         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7814         member field from PropertyExpr class and made it an argument of
7815         the method instead.
7816         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7817         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7818         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7819         and `remove_accessor' as well as InstanceResolve: report CS0122
7820         where applicable.
7821
7822         Fixes #70129.
7823
7824 2004-12-07  Martin Baulig  <martin@ximian.com>
7825
7826         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7827         and CS0692 where appropriate.
7828
7829 2004-12-06  Martin Baulig  <martin@ximian.com>
7830
7831         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7832         IsDuplicateImplementation() and improved it.
7833
7834         * expression.cs (Invocation.InferTypeArguments): Added
7835         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7836         and removed the "ref" modifier from `infered_types'.
7837
7838         * decl.cs (MemberName.ToString): Removed the exception.
7839
7840 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7841
7842         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7843           comments are allowed.
7844
7845 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7846
7847         * delegate.cs: Add checks for subtypes in paramaters and return values
7848         in VerifyMethod () to add support for Covariance/Contravariance
7849         in delegates.
7850         
7851 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7852
7853         * report.cs: Remove extra closing parenthesis.
7854
7855         * convert.cs (Error_CannotImplicitConversion): If the name of the
7856         types are the same, provide some extra information.
7857
7858 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7859
7860         Fix bug #70102
7861         * attribute.cs (Resolve): Improved implementation of params
7862         attribute arguments.
7863
7864         * support.cs (ParameterData): Add HasParams to be faster.
7865
7866 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7867
7868         all things are for /doc support:
7869
7870         * doc.cs: new file that supports XML documentation generation.
7871         * mcs.exe.sources: added doc.cs.
7872         * driver.cs:
7873           Handle /doc command line option.
7874           Report error 2006 instead of 5 for missing file name for /doc.
7875           Generate XML documentation when required, after type resolution.
7876         * cs-tokenizer.cs:
7877           Added support for picking up documentation (/// and /** ... */),
7878           including a new XmlCommentState enumeration.
7879         * cs-parser.jay:
7880           Added lines to fill Documentation element for field, constant,
7881           property, indexer, method, constructor, destructor, operator, event
7882           and class, struct, interface, delegate, enum.
7883           Added lines to warn incorrect comment.
7884         * rootcontext.cs :
7885           Added Documentation field (passed only when /doc was specified).
7886         * decl.cs:
7887           Added DocComment, DocCommentHeader, GenerateDocComment() and
7888           OnGenerateDocComment() and some supporting private members for
7889           /doc feature to MemberCore.
7890         * class.cs:
7891           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7892         * delegate.cs:
7893           Added overriden DocCommentHeader.
7894         * enum.cs:
7895           Added overriden DocCommentHeader and GenerateDocComment().
7896
7897 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7898
7899         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7900         unwrapping the enumeration values, chain to
7901         DoConstantNumericPromotions again, so we can promote things to the
7902         fundamental types (takes care of enums that are bytes, sbytes).
7903
7904         Fixes bug #62054.
7905
7906 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7907
7908         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7909         Fix long-standing bug in type-lookup.  Use FindType instead of
7910         LookupType when ec.ResolvingTypeTree.
7911         (Attribute.ResolveType, Attribute.Resolve)
7912         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7913         Update to changes.
7914         (Attributes.Search): Remove internal version.  Update.
7915         (Attributes.SearchMulti): Update.
7916         (Attributes.GetClsCompliantAttribute): Remove.
7917         (Attributes.GetIndexerNameAttribute): Remove.
7918         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7919         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7920         * class.cs (Indexer.Define): Likewise.
7921
7922 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7923
7924         Fix bug #68790
7925         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7926         MarshallByReference members access.
7927
7928         * expression.cs: Use CheckMarshallByRefAccess;
7929         Better error CS0197 message.
7930
7931         * report.cs: Print whole related error message.
7932
7933 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * class (GetClassBases): Better error 60 report.
7936         (EventProperty): Disabled warning 67 detection.
7937
7938 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7939
7940         Fix bug #60324
7941         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7942
7943         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7944         precise values.
7945
7946 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7947
7948         Fix bug #49488
7949         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7950
7951         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7952
7953 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * attribute.cs (Attribute.Resolve): Refine error reporting and
7956         report a cs0117 if the identifier does not exist, to distinguish
7957         from 0617 which is a miss-use of the actual identifier.
7958
7959         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7960         between cs0070 and cs0079.
7961
7962         * class.cs (MemberBase.DoDefine): When reporting a wrong
7963         accessibility level, we use MethodCore to compare instead of
7964         Method (this was a regression in some refactoring effort).
7965
7966         So now we correctly report cs0056 again.
7967
7968         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7969         testing the target_type (which was known to be object_type) and
7970         not the source type (which is anonymous_method).
7971
7972         Fixed reporting of error cs1660.
7973
7974         * expression.cs (UserCast.Source): Expose the underlying cast.
7975
7976         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7977         allowed types to find a match to int32 first (most common).
7978
7979         In addition, it ignores any ImplicitUserConversions that did an
7980         internal implicit conversion (as the switch statement allows only
7981         one integral conversion to exist).
7982
7983         * class.cs (PartialContainer.Create): rename `name' to
7984         `member_name' for clarity.  Then replace the string calls with a
7985         call to MemberName.GetPartialName, as now using
7986         MemberName.ToString is an error (this is due to the side effects
7987         it had, that were fixed in the past).
7988
7989         This will restore the error reporting on a number of partial class
7990         errors that were missusing this (and getting an exception as a
7991         results, which is now just a plain textual warning, because
7992         yyparse debug output would crash otherwise).
7993
7994 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7995
7996         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7997
7998 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7999
8000         * rootcontext.cs (LookupType): Make sure to cache lookups that
8001         don't give us a negative result. This saves about 5% of corlib
8002         compilation time.
8003
8004 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8005
8006         * report.cs (AbstractMessage.Print): messages are sent to stderr
8007
8008         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8009         non-interface in the list of interfaces (at this point, either
8010         parent was properly set, or a base class is being listed in the
8011         interfaces section).
8012
8013         This flags error 1722, and resolves the crash from bug 69259.
8014
8015 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8016
8017         * statement.cs (Using.EmitExpressionFinally): make this work right
8018         for valuetypes. Fixes 69926.
8019
8020 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8021
8022         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8023         converted to an enum" here, before we try to change the underlying
8024         type.  This code exists, but it is a different code path than the
8025         one used while encoding constants.
8026
8027         (ImplicitReferenceConversionExists): In addition, resynchronized
8028         the code here, so it matches the same code in
8029         ImplicitReferenceConversionExists for the `from any class-type S
8030         to any interface-type T'.       
8031
8032 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8033
8034         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8035
8036 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8037
8038         * cs-parser.jay: Use verbosity accordingly. 
8039
8040 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8041
8042         * expression.cs (Unary.ResolveOperator): Do not report warning;
8043         AddressOf reads from variable.
8044         
8045         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8046
8047 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8048
8049         Fix bug #69462
8050
8051         * attribute.cs (Attributable): Removed CheckTargets.
8052         (Attributes.Emit): Explicit attribute targets are tested here.
8053
8054         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8055         not enabled for interfaces.
8056
8057         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8058         (GetAssemblyName): Ouch next bug there.
8059
8060 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8061
8062         * expression.cs: Error 275 added.
8063         
8064 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8065
8066         Fix bug #69177 (Implemented decimal constant support)
8067
8068         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8069         (BinaryFold): Add DecimalConstant.
8070
8071         * const.cs (Define): Decimal constant 
8072         (is not constant.
8073         (ChangeType): Add decimal type handling.
8074         (LookupConstantValue): Don't set value for decimal type but
8075         emit DecimalConstantAttribute. Needed for constant optimization.
8076
8077         * constant.cs (ToDecimal): New method.
8078         (ConvertToDecimal): New method.
8079         (IntConstant): Implemented ConvertToDecimal.
8080         (DecimalConstant.Emit): Emit optimized version for decimals in
8081         int range.
8082
8083         * expression.cs (ResolveOperator): Changed order of constant
8084         reduction to work correctly with native types which have
8085         overloaded operators.
8086         (ResolveMemberAccess): Extract constant value from attribute
8087         for decimal type.
8088
8089         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8090
8091         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8092         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8093         (ChangeType): Decimal is special.
8094         (TypeToCoreType): Add decimal type.
8095
8096 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8097
8098         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8099         decimal types.
8100
8101 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8102
8103         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8104         test cs1667-5.cs.
8105
8106 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8107
8108         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8109
8110         * pending.cs (PendingImplementation): Grab only interfaces.
8111
8112 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8113
8114         * statement.cs (ForeachHelperMethods): Add location member and
8115         error 202 detection.
8116
8117 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8118
8119         * expression.cs (DoResolveBase): Fixed wrong warning for out
8120         variables.
8121
8122 2004-12-04  Martin Baulig  <martin@ximian.com>
8123
8124         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8125         to check whether the conversion is ok.
8126
8127         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8128         `Type.EmptyTypes' if we're not a generic TypeContainer.
8129
8130 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8131
8132         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8133         old bug: when converting from the null literal to a pointer,
8134         return an EmptyCast, not the NullLiteral.
8135
8136         This fixes #69921, the recent null_type changes probably made this
8137         bug more prominent.
8138
8139 2004-12-03  Martin Baulig  <martin@ximian.com>
8140
8141         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8142         method as our child, call AnonymousMethod.Compatible() on it.
8143
8144 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8145
8146         * class.cs (FieldBase): Use an unused bit field from the field to
8147         encode the `has_offset' property from the FieldMember.  This saves
8148         a couple of Ks on bootstrap compilation.
8149
8150         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8151         method as our child, return the AnonymousMethod resolved
8152         expression.
8153
8154         * expression.cs (New.DoResolve): Allow return values from
8155         NewDelegate to also include AnonymousMethods.
8156
8157         Fixes #70150.
8158
8159 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8160
8161         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8162         cs1648 report.
8163         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8164         System.Runtime.InteropServices._Exception, since it's a base
8165         interface of the core type System.Exception in the net_2_0 profile.
8166
8167 2004-11-27  Martin Baulig  <martin@ximian.com>
8168
8169         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8170
8171 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8172
8173         * Makefile: Convert to use executable.make.
8174         * gmcs.exe.sources: New.
8175
8176 2004-11-25  Martin Baulig  <martin@ximian.com>
8177
8178         * expression.cs (Invocation.InferType): Added support for byref types.
8179
8180 2004-11-25  Martin Baulig  <martin@ximian.com>
8181
8182         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8183         in TypeManager.TypeToCoreType().
8184
8185 2004-11-25  Martin Baulig  <martin@ximian.com>
8186
8187         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8188         "Dispose" method from the `current_type'.
8189         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8190         DoDefineMembers() instead of using the MethodBuilder; this is
8191         required for generic iterators.
8192
8193         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8194
8195 2004-11-24  Martin Baulig  <martin@ximian.com>
8196
8197         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8198
8199 2004-11-20  Martin Baulig  <martin@ximian.com>
8200
8201         * expression.cs (Invocation.InferType): Correctly infer generic
8202         instances; see gen-103.cs.
8203         (Invocation.InferTypeArguments): If a generic method doesn't have
8204         any unbound type parameters, we don't need to infer anything.
8205
8206 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8207
8208         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8209
8210 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8211
8212         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8213         (TypeHandle.GetMemberCache): New.
8214         (TypeHandle.TypeHandle): Update.
8215         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8216         (TypeManager.LookupParentInterfacesCache):
8217         Rename from LookupInterfaceCache.  Optimize slightly.
8218         (TypeManager.MemberLookup_FindMembers): Update.
8219         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8220         multi-type variant.
8221         (AddCacheContents): Rename from AddHashtable.
8222         * class.cs (TypeContainer.parent_container): Remove.
8223         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8224         (TypeContainer.DoDefineMembers): Don't initialize it.
8225         Update to name changes.
8226         
8227 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8228
8229         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8230         that factors the code to check access modifiers on override.  
8231
8232         (PropertyBase): Use the code here.
8233
8234         Patch from Lluis S'anchez, fixes bug #69361.
8235
8236 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8239         routine that is used to report the use of a captured variable
8240         whose address has been taken.
8241
8242         There are two checks: one when variables are being captured and
8243         the other check is when the address of a variable is taken. 
8244         
8245         (because an anonymous methods might be resolved before *or* after
8246         the address has been taken) and 
8247
8248         * expression.cs (Conditional.DoResolve): Remove the special
8249         casing that Martin added to trueExpr and falseExpr being both
8250         NullLiteral.  We get the right behavior now just by introducing
8251         the null_type into the compiler. 
8252
8253         * convert.cs (ExplicitConversion): Change the code to use
8254         null_type instead of testing `expr is NullLiteral'.
8255         (ImplicitConversionStandard): use null_type too.
8256         (ImplicitReferenceConversionExists): use null_type too.
8257         (ImplicitReferenceConversion): use null_type too.
8258
8259         * literal.cs: The type of `NullLiteral' is now null_type instead
8260         of object_type. 
8261         (Resolve): Set the type here.
8262
8263         * typemanager.cs: Introduce null_type.
8264
8265 2004-11-18  Martin Baulig  <martin@ximian.com>
8266
8267         * rootcontext.cs
8268         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8269
8270 2004-11-18  Martin Baulig  <martin@ximian.com>
8271
8272         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8273
8274 2004-11-18  Martin Baulig  <martin@ximian.com>
8275
8276         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8277         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8278         call ResolveConstructedType() on it to resolve it without checking
8279         constraints.
8280         (Constraints.ResolveTypes): Check them here.
8281         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8282         but don't check constraints.
8283         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8284         check constraints here.
8285         (ConstructedType.ResolveConstructedType): New public method.  This
8286         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8287         resolve ourselves without checking constraints.
8288
8289         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8290
8291 2004-11-18  Martin Baulig  <martin@ximian.com>
8292
8293         * decl.cs
8294         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8295
8296         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8297
8298 2004-11-18  Martin Baulig  <martin@ximian.com>
8299
8300         * ecore.cs (TypeExpr.ResolveType): Removed.
8301         (Expression.ResolveAsTypeTerminal): We always return a fully
8302         resolved `TypeExpr', so we can just access its `Type'.
8303
8304         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8305
8306 2004-11-17  Martin Baulig  <martin@ximian.com>
8307
8308         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8309         sure we don't return any unresolved TypeExpr's.
8310         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8311         a `TypeExpr'.
8312         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8313
8314         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8315         unresolved `ConstructedType's.
8316
8317 2004-11-17  Martin Baulig  <martin@ximian.com>
8318
8319         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8320
8321 2004-11-17  Martin Baulig  <martin@ximian.com>
8322
8323         * ecore.cs
8324         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8325
8326         * decl.cs (DeclSpace.ResolveType): Removed.
8327         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8328
8329 2004-11-17  Martin Baulig  <martin@ximian.com>
8330
8331         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8332         direction, like FindMembers() does.  Fixes #69546, testcase is in
8333         test-315.cs.    
8334
8335 2004-11-16  Martin Baulig  <martin@ximian.com>
8336
8337         This is based on a patch from Marek Safar, see bug #69082.
8338         Fixes bugs #63705 and #67130.
8339
8340         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8341         method; create a MemberCache for an interface type and cache the
8342         result.
8343
8344         * decl.cs (IMemberContainer.ParentContainer): Removed.
8345         (IMemberContainer.ParentCache): New property.
8346         (MemberCache.SetupCacheForInterface): Removed.
8347         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8348         to create a cache for an interface's "parent".
8349
8350         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8351         interfaces too.
8352
8353 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8354
8355         * statement.cs: Avoid adding bools to a hashtable.
8356
8357 2004-11-15  Martin Baulig  <martin@ximian.com>
8358
8359         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8360
8361 2004-11-11  Martin Baulig  <martin@ximian.com>
8362
8363         * typemanager.cs (TypeManager.GetMethodName): New method.
8364
8365         * class.cs (MethodData.Define): Include the generic arity in the
8366         name of an explicit interface; also add it to the method name.
8367
8368         * pending.cs (PendingImplementation.InterfaceMethod): The method
8369         name now includes the generic arity.
8370
8371 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8372
8373         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8374         calling an unsafe method from a safe location.
8375
8376 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8377
8378         Fix #69167
8379         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8380
8381 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8382
8383         * namespace.cs (VerifyUsing): use GetPartialName instead of
8384         ToString. 
8385
8386 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8387
8388         * statement.cs (Return.Resolve): Fix regression in typo: if
8389         `in_exc', we have to request a NeedReturnLabel, this was a typo
8390         introduced in the anonymous method check-in.  Fixes #69131.
8391
8392         * Indexers were using the ShortName when defining themselves,
8393         causing a regression in the compiler bootstrap when applying the
8394         patch from 2004-11-02 (first part), now they use their full name
8395         and the bug is gone.
8396
8397 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8398
8399         * driver.cs: Strip the path from the names of embedded resources. Fixes
8400         #68519.
8401
8402 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8403
8404         Fix error message regression: cs0104-2.cs.
8405         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8406         (AliasEntry.Resolve): Update.
8407         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8408         'silent' flag.
8409         (RootContext.LookupType): Update.
8410
8411 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8412
8413         * cs-parser.jay: Add support for handling accessor modifiers
8414         * class: Add support port accessor modifiers and error checking,
8415         define PropertyMethod.Define as virtual (not abstract anymore)
8416         * ecore.cs: Add checking for proeprties access with access modifiers
8417         * iterators.cs: Modify Accessor constructor call based in the modified
8418         constructor
8419 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8420
8421         * expression.cs (StringConcat): Handle being called twice,
8422         as when we have a concat in a field init with more than two
8423         ctors in the class
8424
8425 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8426
8427         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8428         special case explicit implementations, we should always produce
8429         the .property or .event declaration.
8430         
8431         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8432         since it will not return correct data if people use this
8433         unresolved in the presence of using statements (see test-313).
8434
8435         * class.cs (MethodData.Define): If we are an explicit interface
8436         implementation, set the method name to the full name of the
8437         interface plus the name of the method.  
8438
8439         Notice that using the method.MethodName.GetFullName() does not
8440         work, as it will only contain the name as declared on the source
8441         file (it can be a shorthand in the presence of using statements)
8442         and not the fully qualifed type name, for example:
8443
8444         using System;
8445
8446         class D : ICloneable {
8447                 object ICloneable.Clone ()  {
8448                 }
8449         }
8450
8451         Would produce a method called `ICloneable.Clone' instead of
8452         `System.ICloneable.Clone'.
8453
8454         * namespace.cs (Alias.Resolve): Use GetPartialName.
8455         
8456 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8457
8458         * cs-parser.jay: Add error 1055 report.
8459
8460 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8461
8462         * assign.cs (Assign.DoResolve): Only do the transform of
8463         assignment into a New if the types are compatible, if not, fall
8464         through and let the implicit code deal with the errors and with
8465         the necessary conversions. 
8466
8467 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8468
8469         * cs-parser.jay: Add error 1031 report.
8470
8471         * cs-tokenizer.cs: Add location for error 1038.
8472
8473 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8474
8475         * cs-parser.jay: Add error 1016 report.
8476
8477 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8478
8479         * cs-parser.jay: Add errors 1575,1611 report.
8480
8481 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8482
8483         * cs-parser.jay: Add error 1001 report.
8484
8485 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8486
8487         Fix #68850
8488         * attribute.cs (GetMarshal): Add method argument for
8489         caller identification.
8490
8491         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8492         agument for GetMarshal and RuntimeMissingSupport.
8493
8494 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8495
8496         * attribute.cs (ExtractSecurityPermissionSet): Removed
8497         TypeManager.code_access_permission_type.
8498
8499         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8500
8501 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8502
8503         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8504         for obsolete use of a variable here.   Fixes regression on errors
8505         cs0619-25 and cs0619-26.
8506
8507 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8508
8509         Fix #62358, implemented security attribute encoding.
8510
8511         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8512         Tests permitted SecurityAction for assembly or other types.
8513         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8514         data from SecurityPermissionAttribute to PermisionSet class.
8515
8516         * class.cs (ApplyAttributeBuilder): Added special handling
8517         for System.Security.Permissions.SecurityAttribute based types.
8518
8519         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8520         special handling for System.Security.Permissions.SecurityAttribute
8521         based types.
8522
8523         * enum.cs (ApplyAttributeBuilder): Added special handling
8524         for System.Security.Permissions.SecurityAttribute based types.
8525
8526         * parameter.cs (ApplyAttributeBuilder): Added special handling
8527         for System.Security.Permissions.SecurityAttribute based types.
8528
8529         * rootcontext.cs: Next 2 core types.
8530
8531         * typemanager.cs (TypeManager.security_permission_attr_type):
8532         Built in type for the SecurityPermission Attribute.
8533         (code_access_permission_type): Build in type.
8534
8535 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8536
8537         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8538         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8539         all of this information into
8540         EmitContext.EmitCapturedVariableInstance.
8541         
8542         * codegen.cs (EmitCapturedVariableInstance): move here the
8543         funcionality of emitting an ldarg.0 in the presence of a
8544         remapping.   This centralizes the instance emit code.
8545
8546         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8547         then emit a load of this: it means that we have reached the
8548         topmost ScopeInfo: the one that contains the pointer to the
8549         instance of the class hosting the anonymous method.
8550
8551         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8552         captures to the topmost CaptureContext.
8553
8554 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8555
8556         * expression.cs (LocalVariableReference): Move the knowledge about
8557         the iterators into codegen's EmitCapturedVariableInstance.
8558
8559 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8560
8561         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8562         all code paths return a value from an anonymous method (it is the
8563         same as the 161 error, but for anonymous methods).
8564
8565 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8566
8567         The introduction of anonymous methods in the compiler changed
8568         various ways of doing things in the compiler.  The most
8569         significant one is the hard split between the resolution phase
8570         and the emission phases of the compiler.
8571
8572         For instance, routines that referenced local variables no
8573         longer can safely create temporary variables during the
8574         resolution phase: they must do so from the emission phase,
8575         since the variable might have been "captured", hence access to
8576         it can not be done with the local-variable operations from the runtime.
8577         
8578         * statement.cs 
8579
8580         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8581         is a toplevel block.
8582
8583         (ToplevelBlock): A new kind of Block, these are the blocks that
8584         are created by the parser for all toplevel method bodies.  These
8585         include methods, accessors and anonymous methods.
8586
8587         These contain some extra information not found in regular blocks:
8588         A pointer to an optional CaptureContext (for tracking captured
8589         local variables and parameters).  A pointer to the parent
8590         ToplevelBlock.
8591         
8592         (Return.Resolve): Catch missmatches when returning a value from an
8593         anonymous method (error 1662).
8594         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8595         phase.
8596
8597         (Break.Resolve): ditto.
8598
8599         (SwitchLabel): instead of defining the labels during the
8600         resolution phase, we now turned the public ILLabel and ILLabelCode
8601         labels into methods called GetILLabelCode() and GetILLabel() that
8602         only define the label during the Emit phase.
8603
8604         (GotoCase): Track the SwitchLabel instead of the computed label
8605         (its contained therein).  Emit the code by using
8606         SwitchLabel.GetILLabelCode ().
8607
8608         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8609         whether the Local has been captured or not.
8610
8611         (LocalInfo.IsCaptured): New property, used to tell whether the
8612         local has been captured.
8613         
8614         * anonymous.cs: Vastly updated to contain the anonymous method
8615         support.
8616
8617         The main classes here are: CaptureContext which tracks any
8618         captured information for a toplevel block and ScopeInfo used to
8619         track the activation frames for various local variables.   
8620
8621         Each toplevel block has an optional capture context associated
8622         with it.  When a method contains an anonymous method both the
8623         toplevel method and the anonymous method will create a capture
8624         context.   When variables or parameters are captured, they are
8625         recorded on the CaptureContext that owns them, for example:
8626
8627         void Demo () {
8628              int a;
8629              MyDelegate d = delegate {
8630                  a = 1;
8631              }
8632         }
8633
8634         Here `a' will be recorded as captured on the toplevel
8635         CapturedContext, the inner captured context will not have anything
8636         (it will only have data if local variables or parameters from it
8637         are captured in a nested anonymous method.
8638
8639         The ScopeInfo is used to track the activation frames for local
8640         variables, for example:
8641
8642         for (int i = 0; i < 10; i++)
8643                 for (int j = 0; j < 10; j++){
8644                    MyDelegate d = delegate {
8645                         call (i, j);
8646                    }
8647                 }
8648
8649         At runtime this captures a single captured variable `i', but it
8650         captures 10 different versions of the variable `j'.  The variable
8651         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8652         recorded on a child.  
8653
8654         The toplevel ScopeInfo will also track information like the `this'
8655         pointer if instance variables were referenced (this is necessary
8656         as the anonymous method lives inside a nested class in the host
8657         type of the method). 
8658
8659         (AnonymousMethod): Expanded to track the Toplevel, implement
8660         `AnonymousMethod.Compatible' to tell whether an anonymous method
8661         can be converted to a target delegate type. 
8662
8663         The routine now also produces the anonymous method content
8664
8665         (AnonymousDelegate): A helper class that derives from
8666         DelegateCreation, this is used to generate the code necessary to
8667         produce the delegate for the anonymous method that was created. 
8668
8669         * assign.cs: API adjustments for new changes in
8670         Convert.ImplicitStandardConversionExists.
8671
8672         * class.cs: Adjustments to cope with the fact that now toplevel
8673         blocks are of type `ToplevelBlock'. 
8674
8675         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8676         insteda of standard blocks.
8677
8678         Flag errors if params arguments are passed to anonymous methods.
8679
8680         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8681         `CurrentAnonymousMethod' which points to the current Anonymous
8682         Method.  The variable points to the AnonymousMethod class that
8683         holds the code being compiled.  It is set in the new EmitContext
8684         created for the anonymous method.
8685
8686         (EmitContext.Phase): Introduce a variable and an enumeration to
8687         assist in enforcing some rules about when and where we are allowed
8688         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8689         only one that enfonces this right now).
8690
8691         (EmitContext.HaveCaptureInfo): new helper method that returns
8692         whether we have a CapturedContext initialized.
8693
8694         (EmitContext.CaptureVariable): New method used to register that a
8695         LocalInfo must be flagged for capturing. 
8696
8697         (EmitContext.CapturedParameter): New method used to register that a
8698         parameters must be flagged for capturing. 
8699         
8700         (EmitContext.CapturedField): New method used to register that a
8701         field must be flagged for capturing. 
8702
8703         (EmitContext.HaveCapturedVariables,
8704         EmitContext.HaveCapturedFields): Return whether there are captured
8705         variables or fields. 
8706
8707         (EmitContext.EmitMethodHostInstance): This is used to emit the
8708         instance for the anonymous method.  The instance might be null
8709         (static methods), this (for anonymous methods that capture nothing
8710         and happen to live side-by-side with the current method body) or a
8711         more complicated expression if the method has a CaptureContext.
8712
8713         (EmitContext.EmitTopBlock): Routine that drives the emission of
8714         code: it will first resolve the top block, then emit any metadata
8715         and then emit the code.  The split is done so that we can extract
8716         any anonymous methods and flag any captured variables/parameters.
8717         
8718         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8719         during this phase, the ILGenerator should not be used as labels
8720         and local variables declared here might not be accessible to any
8721         code that is part of an anonymous method.  
8722
8723         Exceptions to this include the temporary variables that are
8724         created by some statements internally for holding temporary
8725         variables. 
8726         
8727         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8728         metadata for a cb
8729
8730         (EmitContext.TemporaryReturn): This method is typically called
8731         from the Emit phase, and its the only place where we allow the
8732         ReturnLabel to be defined other than the EmitMeta.  The reason is
8733         that otherwise we would have to duplicate a lot of logic in the
8734         Resolve phases of various methods that today is on the Emit
8735         phase. 
8736
8737         (EmitContext.NeedReturnLabel): This no longer creates the label,
8738         as the ILGenerator is not valid during the resolve phase.
8739
8740         (EmitContext.EmitThis): Extended the knowledge in this class to
8741         work in anonymous methods in addition to iterators. 
8742
8743         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8744         code is necessary on the stack to access the instance to a local
8745         variable (the variable will be accessed as a field).
8746
8747         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8748         EmitContext.EmitAddressOfParameter): Routines to support
8749         parameters (not completed at this point). 
8750         
8751         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8752         will also remove the parameters.
8753
8754         * convert.cs (Convert): Define a `ConstantEC' which points to a
8755         null.  This is just to prefity some code that uses
8756         ImplicitStandardConversion code and do not have an EmitContext
8757         handy.
8758
8759         The idea is to flag explicitly that at that point in time, it is
8760         known that the conversion will not trigger the delegate checking
8761         code in implicit conversions (which requires a valid
8762         EmitContext). 
8763
8764         Everywhere: pass new EmitContext parameter since
8765         ImplicitStandardConversionExists now requires it to check for
8766         anonymous method conversions. 
8767
8768         (Convert.ImplicitStandardConversionExists): If the type of an
8769         expression is the anonymous_method_type, and the type is a
8770         delegate, we invoke the AnonymousMethod.Compatible method to check
8771         whether an implicit conversion is possible. 
8772
8773         (Convert.ImplicitConversionStandard): Only do implicit method
8774         group conversions if the language level is not ISO_1.
8775
8776         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8777         MethodInfo for the Invoke method.  used by Delegate and
8778         AnonymousDelegate.
8779
8780         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8781         method conversions if the target type is a delegate.
8782
8783         Removed extra debugging nops.
8784
8785         (LocalVariableReference): Turn the `local_info' into a public
8786         field. 
8787
8788         Add `prepared' field, the same hack used for FieldExprs to cope
8789         with composed assignments, as Local variables do not necessarily
8790         operate purely on the stack as they used to: they can be captured
8791         fields. 
8792
8793         Add `temp' for a temporary result, like fields.
8794
8795         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8796
8797         It now copes with Local variables that are captured and emits the
8798         proper instance variable to load it from a field in the captured
8799         case. 
8800
8801         (ParameterReference.DoResolveBase): During the resolve phase,
8802         capture parameters if we are in an anonymous method.
8803
8804         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8805         anonymous method, use the EmitContext helper routines to emit the
8806         parameter reference.
8807
8808         * iterators.cs: Set RemapToProxy to true/false during the
8809         EmitDispose class.
8810
8811         * parameters.cs (GetParameterByName): New helper method. 
8812
8813         * typemanager.cs (anonymous_method_type) a new type that
8814         represents an anonyous method.  This is always an internal type,
8815         used as a fencepost to test against the anonymous-methodness of an
8816         expression. 
8817         
8818 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8819
8820         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8821         561 report.
8822         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8823
8824 2004-11-10  Martin Baulig  <martin@ximian.com>
8825
8826         * expression.cs (Invocation.BetterFunction): If two methods have
8827         equal parameter types, but only one of them is generic, the
8828         non-generic one wins.
8829         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8830         instance; just use `Type.IsValueType' to determine whether
8831         something is a struct or not.
8832         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8833         so we can be called multiple times.
8834
8835 2004-11-10  Martin Baulig  <martin@ximian.com>
8836
8837         * generic.cs (TypeParameter.DefineConstraints): New public method.
8838         (TypeParameter.CheckAccessLevel): Override this and return true.
8839         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8840         override ResolveType() anymore.
8841         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8842
8843 2004-11-10  Martin Baulig  <martin@ximian.com>
8844
8845         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8846         call DeclSpace.ResolveNestedType() on it.
8847
8848 2004-11-10  Martin Baulig  <martin@ximian.com>
8849
8850         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8851         non-null, call ParameterModifier() on it.
8852
8853 2004-11-10  Martin Baulig  <martin@ximian.com>
8854
8855         * iterators.cs
8856         (Iterators): Added `current_type' and `this_type' fields.
8857         (Iterators.DefineIterator): Create a new EmitContext and store it
8858         in `ec'; compute `this_type'.
8859
8860 2004-11-10  Martin Baulig  <martin@ximian.com>
8861
8862         * typemanager.cs
8863         (TypeManager.IsPrivateAccessible): New public method.
8864         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8865
8866 2004-11-10  Martin Baulig  <martin@ximian.com>
8867
8868         * class.cs (TypeContainer.DefineType): Call
8869         TypeBuilder.DefineGenericParameters() before resolving the type
8870         parameters.
8871         (MethodData.parent_method): New protected field.
8872         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8873         (MethodData.Define): Compute `parent_method'.
8874
8875         * decl.cs
8876         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8877         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8878         (DeclSpace.ec): New protected field; store the EmitContext here.
8879         (DeclSpace.EmitContext): New public property.
8880         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8881         (DeclSpace.ResolveNestedType): New public method.
8882         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8883         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8884         (DeclSpace.FamilyAccessible): Likewise.
8885         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8886         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8887         EmitContext.
8888
8889         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8890         field.
8891
8892         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8893         (Enum.Emit): Don't create a new EmitContext.
8894
8895 2004-10-18  Martin Baulig  <martin@ximian.com>
8896
8897         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8898         `Type' directly, but call ResolveType() on it.
8899         (Catch.Resolve): Likewise.
8900         (Foreach.Resolve): Likewise.
8901
8902 2004-10-18  Martin Baulig  <martin@ximian.com>
8903
8904         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8905         `Type' directly, but call ResolveType() on it.
8906         (Probe.DoResolve): Likewise.
8907         (ArrayCreation.LookupType): Likewise.
8908         (TypeOf.DoResolve): Likewise.
8909         (SizeOf.DoResolve): Likewise.
8910
8911 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8912
8913         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8914         the ResolveType.
8915
8916 2004-10-17  John Luke  <john.luke@gmail.com>
8917
8918         * class.cs (Operator.GetSignatureForError): use CSharpName
8919
8920         * parameter.cs (Parameter.GetSignatureForError): Returns
8921         correct name even if was not defined.
8922
8923 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8924
8925         Fix #65816.
8926         * class.cs (TypeContainer.EmitContext): New property.
8927         (DefineNestedTypes): Create an emitcontext for each part.
8928         (MethodCore.DoDefineParameters): Use container's emitcontext.
8929         Pass type array to InternalParameters.
8930         (MemberBase.DoDefine): Use container's emitcontext.
8931         (FieldMember.Define): Likewise.
8932         (Event.Define): Likewise.
8933         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8934         Pass type array to InternalParameters.
8935         (SetIndexerMethod.GetParameterInfo): Likewise.
8936         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8937         * delegate.cs (Define): Pass emitcontext to
8938         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8939         array to InternalParameters.
8940         * expression.cs (ParameterReference.DoResolveBase): Pass
8941         emitcontext to GetParameterInfo.
8942         (ComposedCast.DoResolveAsTypeStep): Remove check on
8943         ec.ResolvingTypeTree.
8944         * parameter.cs (Parameter.Resolve): Change argument to
8945         EmitContext.  Use ResolveAsTypeTerminal.
8946         (Parameter.GetSignature): Change argument to EmitContext.
8947         (Parameters.ComputeSignature): Likewise.
8948         (Parameters.ComputeParameterTypes): Likewise.
8949         (Parameters.GetParameterInfo): Likewise.
8950         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8951         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8952         * support.cs (InternalParameters..ctor): Remove variant that takes
8953         a DeclSpace.
8954         * typemanager.cs (system_intptr_expr): New.
8955         (InitExpressionTypes): Initialize it.
8956
8957 2004-10-12  Chris Toshok  <toshok@ximian.com>
8958
8959         * cs-parser.jay: fix location for try_statement and catch_clause.
8960
8961 2004-10-18  Martin Baulig  <martin@ximian.com>
8962
8963         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8964         `Type' directly, but call ResolveType() on it.
8965         (MemberBase.DoDefine): Likewise.
8966
8967         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8968         `Type' directly, but call ResolveType() on it.
8969         (ComposedCast.DoResolveAsTypeStep): Likewise.
8970
8971         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8972         `Type' directly, but call ResolveType() on it.
8973
8974 2004-10-17  John Luke  <john.luke@gmail.com>
8975
8976         * class.cs (Operator.GetSignatureForError): use CSharpName
8977
8978         * parameter.cs (Parameter.GetSignatureForError): Returns
8979         correct name even if was not defined.
8980
8981 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8982
8983         Fix #65816.
8984         * class.cs (TypeContainer.EmitContext): New property.
8985         (DefineNestedTypes): Create an emitcontext for each part.
8986         (MethodCore.DoDefineParameters): Use container's emitcontext.
8987         Pass type array to InternalParameters.
8988         (MemberBase.DoDefine): Use container's emitcontext.
8989         (FieldMember.Define): Likewise.
8990         (Event.Define): Likewise.
8991         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8992         Pass type array to InternalParameters.
8993         (SetIndexerMethod.GetParameterInfo): Likewise.
8994         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8995         * delegate.cs (Define): Pass emitcontext to
8996         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8997         array to InternalParameters.
8998         * expression.cs (ParameterReference.DoResolveBase): Pass
8999         emitcontext to GetParameterInfo.
9000         (ComposedCast.DoResolveAsTypeStep): Remove check on
9001         ec.ResolvingTypeTree.
9002         * parameter.cs (Parameter.Resolve): Change argument to
9003         EmitContext.  Use ResolveAsTypeTerminal.
9004         (Parameter.GetSignature): Change argument to EmitContext.
9005         (Parameters.ComputeSignature): Likewise.
9006         (Parameters.ComputeParameterTypes): Likewise.
9007         (Parameters.GetParameterInfo): Likewise.
9008         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9009         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9010         * support.cs (InternalParameters..ctor): Remove variant that takes
9011         a DeclSpace.
9012         * typemanager.cs (system_intptr_expr): New.
9013         (InitExpressionTypes): Initialize it.
9014
9015 2004-10-12  Chris Toshok  <toshok@ximian.com>
9016
9017         * cs-parser.jay: fix location for try_statement and catch_clause.
9018
9019 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9020
9021         More DeclSpace.ResolveType avoidance.
9022         * decl.cs (MemberCore.InUnsafe): New property.
9023         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9024         with newly created EmitContext.
9025         (FieldMember.Define): Likewise.
9026         * delegate.cs (Delegate.Define): Likewise.
9027         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9028         only if normal name-lookup fails.
9029         (TypeExpr.DoResolve): Enable error-checking.
9030         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9031         (SizeOf.DoResolve): Likewise.
9032         (ComposedCast.DoResolveAsTypeStep): Likewise.
9033         (StackAlloc.DoResolve): Likewise.
9034         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9035         (Block.Unsafe): New property.
9036         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9037         (Unsafe): Set 'unsafe' flag of contained block.
9038         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9039         (Fixed.Resolve): Likewise.
9040         (Catch.Resolve): Likewise.
9041         (Using.ResolveLocalVariableDecls): Likewise.
9042         (Foreach.Resolve): Likewise.
9043
9044 2004-10-05  John Luke <john.luke@gmail.com>
9045
9046         * cs-parser.jay: add location to error CS0175
9047
9048 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9049
9050         * ecore.cs (Expression.Constantity): Add support for turning null
9051         into a constant.
9052
9053         * const.cs (Const.Define): Allow constants to be reference types
9054         as long as the value is Null.
9055
9056 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9057
9058         * namespace.cs (NamespaceEntry.Using): No matter which warning
9059         level is set, check if this namespace name has already been added.
9060
9061 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9062
9063         * expression.cs: reftype [!=]= null should always use br[true,false].
9064         # 67410
9065
9066 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9067
9068         Fix #67108
9069         * attribute.cs: Enum conversion moved to 
9070         GetAttributeArgumentExpression to be applied to the all
9071         expressions.
9072
9073 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9074
9075         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9076         * class.c (TypeContainer.DefineType): Flag error if
9077         base types aren't accessible due to access permissions.
9078         * decl.cs (DeclSpace.ResolveType): Move logic to
9079         Expression.ResolveAsTypeTerminal.
9080         (DeclSpace.ResolveTypeExpr): Thin layer over
9081         Expression.ResolveAsTypeTerminal.
9082         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9083         Refactor code into NestedAccess.  Use it.
9084         (DeclSpace.NestedAccess): New.
9085         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9086         argument to silence errors.  Check access permissions.
9087         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9088         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9089         (Cast.DoResolve): Likewise.
9090         (New.DoResolve): Likewise.
9091         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9092         (TypeOf.DoResolve): Likewise.
9093
9094         * expression.cs (Invocation.BetterConversion): Return the Type of
9095         the better conversion.  Implement section 14.4.2.3 more faithfully.
9096         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9097         section 14.4.2.2 explicit.
9098         (Invocation.OverloadResolve): Update.
9099         (Invocation): Remove is_base field.
9100         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9101         (Invocation.Emit): Likewise.
9102
9103 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9104
9105         * cs-parser.jay: Reverted 642 warning fix.
9106
9107 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9108
9109         Fix bug #66615
9110         * decl.cs (FindMemberWithSameName): Indexer can have more than
9111         1 argument.
9112
9113 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9114
9115         * expression.cs (LocalVariableReference.DoResolveLValue):
9116         Do not report warning 219 for out values.
9117         (EmptyExpression.Null): New member to avoid extra allocations.
9118
9119 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9120
9121         * cs-parser.jay: Fix wrong warning 642 report.
9122
9123         * cs-tokenizer.cs (CheckNextToken): New helper;
9124         Inspect next character if is same as expected.
9125
9126 2004-09-23  Martin Baulig  <martin@ximian.com>
9127
9128         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9129         (Convert.ImplicitReferenceConversionExists): Likewise.
9130
9131 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9132
9133         * Makefile (DISTFILES): Comment out a few missing files.
9134
9135 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9136
9137         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9138         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9139         (gmcs.exe): Invoke bootstrap-libs.
9140         (clean-local): Clean the net_2_0_bootstrap profile too.
9141         (PROGRAM_INSTALL_DIR): New.
9142         (install-local): Use it.
9143
9144 2004-10-13  Martin Baulig  <martin@ximian.com>
9145
9146         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9147         (TypeParameter.DefineType): If we're a method type parameter and
9148         that method is overriding something, "inflate" its constraints.
9149
9150 2004-10-12  Martin Baulig  <martin@ximian.com>
9151
9152         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9153         and have type arguments, create and resolve a ConstructedType.
9154
9155 2004-10-12  Martin Baulig  <martin@ximian.com>
9156
9157         * decl.cs (MemberCache.FindMemberToOverride): Use
9158         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9159         to compare the invocationType.
9160
9161         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9162         When comparing two type parameters, only do the signature-only
9163         comparision for method type parameters.
9164
9165 2004-10-11  Martin Baulig  <martin@ximian.com>
9166
9167         * report.cs: Don't make --fatal abort on warnings, we have
9168         -warnaserror for that.
9169
9170 2004-10-11  Martin Baulig  <martin@ximian.com>
9171
9172         * typemanager.cs
9173         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9174         (TypeManager.IsEqual): Call ourself recursively instead of using
9175         Type.IsEqual(). 
9176
9177 2004-10-11  Martin Baulig  <martin@ximian.com>
9178
9179         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9180         on our own type parameters, not on the ones we inherit from a containing
9181         class.
9182
9183         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9184         the comparision.
9185
9186         * generic.cs (TypeParameter.Define): We may only be called once.
9187
9188         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9189         instead of TypeManager.IsEqual().
9190
9191 2004-09-28  Martin Baulig  <martin@ximian.com>
9192
9193         * generic.cs
9194         (GenericConstraints.EffectiveBaseClass): New public property.
9195         (TypeParameter.GenericConstraints): New public property.
9196         (ConstructedType.CheckConstraints): Improved.
9197
9198         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9199         (Convert.TypeParameterConversion): New private method; use this in
9200         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9201         for all conversions related to type parameters.
9202
9203 2004-09-24  Martin Baulig  <martin@ximian.com>
9204
9205         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9206         type parameter conversions for type parameters which are known to
9207         be reference types.
9208
9209 2004-09-24  Martin Baulig  <martin@ximian.com>
9210
9211         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9212         `IsValueType' properties.
9213
9214         * support.cs (ReflectionConstraints): Use
9215         Type.GetGenericParameterConstraints() instead of the old hack.
9216
9217 2004-09-24  Martin Baulig  <martin@ximian.com>
9218
9219         * generic.cs (GenericConstraints): Moved here and made it an
9220         abstract class.
9221
9222         * support.cs (GenericConstraints): Moved to generic.cs.
9223
9224 2004-09-24  Martin Baulig  <martin@ximian.com>
9225
9226         * support.cs
9227         (ReflectionConstraints): Un-nested this class and made it public.
9228
9229         * typemanager.cs
9230         (TypeManager.GetTypeParameterConstraints): New public method.
9231         (TypeManager.HasConstructorConstraint): Use the attributes.
9232
9233 2004-09-24  Martin Baulig  <martin@ximian.com>
9234
9235         * support.cs (GenericConstraints): Replaced `HasConstructor',
9236         `IsReferenceType' and `IsValueType' with `Attributes'.
9237         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9238         method and made the .ctor public.
9239
9240         * generic.cs (Constraints.Attributes): New public property.
9241         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9242         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9243         `IsValueType' -> `HasValueTypeConstraint'.
9244
9245 2004-09-23  Martin Baulig  <martin@ximian.com>
9246
9247         * generic.cs (Constraints): Reflect latest runtime changes.
9248
9249 2004-09-23  Martin Baulig  <martin@ximian.com>
9250
9251         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9252         (Convert.ImplicitReferenceConversionExists): Likewise.
9253
9254 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9255
9256         * class.cs (Operator.Define): Add error 448 and 559 report.
9257         
9258 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9259
9260         * class.cs (MemberBase.IsTypePermitted): New protected
9261         method for checking error CS0610.
9262
9263 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9264
9265         * class.cs (TypeContainer.HasExplicitLayout): New property
9266         Returns whether container has StructLayout attribute set Explicit.
9267         (FieldMember): New abstract class for consts and fields.
9268         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9269         (Field): Reuse FieldMember.
9270
9271         * const.cs (Const): Reuse FieldMember.
9272
9273         * rootcontext.cs: EmitConstants call moved to class.
9274
9275 2004-09-22  Martin Baulig  <martin@ximian.com>
9276
9277         Marek and me just fixed one of our oldest bugs: #28562 :-)
9278
9279         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9280
9281         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9282         we're an EnumConstant, just return that.
9283         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9284         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9285         to get the value which'll actually be written into the attribute.
9286         However, we have to use GetValue() to access the attribute's value
9287         in the compiler.        
9288
9289 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9290
9291         * constant.cs (Constant.IsNegative): New abstract property
9292         IsNegative.
9293
9294         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9295         (StackAlloc.DoResolve): Reused IsNegative.
9296
9297 2004-09-22  Martin Baulig  <martin@ximian.com>
9298
9299         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9300         public method; like LookupTypeContainer, but also works for
9301         generic instances.
9302
9303         * report.cs (Report.SymbolRelatedToPreviousError): Use
9304         TypeManager.LookupGenericTypeContainer().       
9305
9306 2004-09-22  Martin Baulig  <martin@ximian.com>
9307
9308         Thanks to Peter Sestoft for this bug report.
9309
9310         * expression.cs (Conditional): If both the `trueExpr' and the
9311         `falseExpr' is a NullLiteral, return a NullLiteral.
9312
9313 2004-09-22  Martin Baulig  <martin@ximian.com>
9314
9315         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9316         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9317         for the "get_Current" call.
9318
9319 2004-09-21  Martin Baulig  <martin@ximian.com>
9320
9321         * convert.cs (Convert.ImplicitReferenceConversion): When
9322         converting to an interface type, first check whether we're
9323         converting from a reference type.
9324
9325 2004-09-14  Martin Baulig  <martin@ximian.com>
9326
9327         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9328
9329 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9330
9331         Fixed bug #61902
9332         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9333         called and is obsolete then this member suppress message
9334         when call is inside next [Obsolete] method or type.
9335
9336         * expression.cs: Use TestObsoleteMethodUsage member.
9337
9338 2004-09-14  Martin Baulig  <martin@ximian.com>
9339
9340         * genericparser.cs: Removed.
9341
9342 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9343
9344         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9345
9346 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9347
9348         * attribute.cs (Attribute.Resolve): Add error 653 report.
9349
9350         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9351         report.
9352         (Method.ApplyAttributeBuilder): Add error 685 report.
9353         (Operator.Define): Add error 564 report.
9354
9355         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9356
9357         * expression.cs (Invocation.DoResolve): Add error
9358         245 and 250 report.
9359
9360         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9361         error 674 report.
9362
9363 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9364
9365         * class.cs (ConstructorInitializer.Resolve):
9366         Wrong error number (515->516).
9367
9368 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9369
9370         * class.cs (Indexer.Define): Add error 631 report.
9371
9372 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9373
9374         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9375
9376 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9377
9378         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9379
9380 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9381
9382         * cs-parser.jay: Added error CS0241 report.
9383
9384 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9385
9386         * cs-parser.jay (fixed_statement): Introduce a scope for the
9387         declaration in the 'fixed' statement.
9388
9389 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9390
9391         * cs-parser.jay: Added CS0230 error report.
9392
9393 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9394
9395         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9396
9397 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9398
9399         * expression.cs (Argument.Resolve): Added error CS0192 and
9400         CS0199 report.
9401
9402 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9403
9404         C# 2.0 #pragma warning feature
9405
9406         * cs-tokenizer.cs (PreProcessPragma): New method; 
9407         Handles #pragma directive.
9408
9409         * report.cs (WarningRegions): New class; Support
9410         class for #pragma warning directive. It tests whether
9411         warning is enabled for a given line.
9412
9413 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9414
9415         * const.cs: Add more descriptive error report, tahnks to
9416         Sebastien. 
9417
9418 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9419
9420         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9421
9422 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9423
9424         * expression.cs: Apply patch from Ben: Remove dead code from
9425         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9426         as that code just threw an exception anwyays.
9427
9428         * const.cs: Remove the call to the turnintoconstant, for details
9429         see bug: #63144
9430         
9431         * literal.cs: The type of the null-literal is the null type;  So
9432         we use a placeholder type (literal.cs:System.Null, defined here)
9433         for it.
9434
9435         * expression.cs (Conditional.DoResolve): Remove some old code that
9436         is no longer needed, conversions have been fixed.
9437
9438         (ArrayCreationExpression.DoResolve): Return false if we fail to
9439         resolve the inner expression.
9440
9441 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9442
9443         Fix test-290.cs.
9444         * cs-parser.jay (delegate_declaration): Record a delegate
9445         declaration as a type declaration.
9446         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9447
9448 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9449
9450         * parameter.cs: Do not crash if the type can not be resolved. 
9451
9452         * expression.cs: Report errors with unsafe pointers, fixes #64896
9453
9454 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9455
9456         * expression.cs: Pointer arith always needs to do a conv.i
9457         if the operand is a long. fix 65320
9458
9459 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9460
9461         Fixed cs0619-37.cs, cs0619-38.cs
9462
9463         * enum.cs (GetObsoleteAttribute): Removed.
9464
9465         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9466         on Enum member is double staged. The first is tested member
9467         and then enum.
9468
9469 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9470
9471         Fixed #56986, #63631, #65231
9472
9473         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9474         adds member to name container.
9475         (TypeContainer.AddToTypeContainer): New method, adds type to
9476         name container.
9477         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9478         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9479         AddOperator): Simplified by reusing AddToMemberContainer.
9480         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9481         instead of field.
9482         (Method.CheckForDuplications): Fixed implementation to test all
9483         possibilities.
9484         (MemberBase): Detection whether member is explicit interface
9485         implementation is now in constructor.
9486         (MemberBase.UpdateMemberName): Handles IndexerName.
9487         (Accessor): Changed to keep also location information.
9488         (AbstractPropertyEventMethod): Is derived from MemberCore.
9489         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9490         will be emited or not.
9491         (PropertyBase.AreAccessorsDuplicateImplementation):
9492         Tests whether accessors are not in collision with some method.
9493         (Operator): Is derived from MethodCore to simplify common
9494         operations.
9495
9496         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9497         must be performed.
9498         (DeclSpace.AddToContainer): Adds the member to defined_names
9499         table. It tests for duplications and enclosing name conflicts.
9500
9501         * enum.cs (EnumMember): Clean up to reuse the base structures
9502
9503 2004-09-03  Martin Baulig  <martin@ximian.com>
9504
9505         Merged latest changes into gmcs.  Please keep this comment in
9506         here, it makes it easier for me to see what changed in MCS since
9507         the last time I merged.
9508
9509 2004-09-03  Martin Baulig  <martin@ximian.com>
9510
9511         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9512         into TypeContainer, to make partial classes work again.
9513
9514 2004-09-03  Martin Baulig  <martin@ximian.com>
9515
9516         * rootcontext.cs (RootContext.V2): Removed.
9517
9518 2004-03-23  Martin Baulig  <martin@ximian.com>
9519
9520         * expression.cs (Invocation.OverloadResolve): Added `bool
9521         may_fail' argument and use it instead of the Location.IsNull() hack.
9522
9523 2004-09-09  Martin Baulig  <martin@ximian.com>
9524
9525         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9526
9527 2004-09-09  Martin Baulig  <martin@ximian.com>
9528
9529         * generic.cs (TypeParameter.DefineType): Added support for
9530         explicit interface methods.
9531
9532 2004-09-09  Martin Baulig  <martin@ximian.com>
9533
9534         * README.Changes: New document.  Started to list important changes
9535         between MCS and GMCS here.
9536
9537 2004-09-08  Martin Baulig  <martin@ximian.com>
9538
9539         * class.cs
9540         (TypeContainer.CheckRecursiveDefinition): New protected method.
9541         (TypeContainer.DefineType): Move the CS0146 check into
9542         CheckRecursiveDefinition().     
9543
9544 2004-09-06  Martin Baulig  <martin@ximian.com>
9545
9546         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9547         types for the constructor constraint.
9548
9549 2004-09-03  Martin Baulig  <martin@ximian.com>
9550
9551         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9552         into TypeContainer, to make partial classes work again.
9553
9554 2004-09-03  Martin Baulig  <martin@ximian.com>
9555
9556         * rootcontext.cs (RootContext.V2): Removed.
9557
9558 2004-03-23  Martin Baulig  <martin@ximian.com>
9559
9560         * expression.cs (Invocation.OverloadResolve): Added `bool
9561         may_fail' argument and use it instead of the Location.IsNull() hack.
9562
9563 2004-09-03  Martin Baulig  <martin@ximian.com>
9564
9565         Merged latest changes into gmcs.  Please keep this comment in
9566         here, it makes it easier for me to see what changed in MCS since
9567         the last time I merged.
9568
9569 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9570
9571         Fix #61128.
9572         * expression.cs (BetterConversion): Don't allow either conversion 
9573         to be null.  Remove redundant implicit conversion test when 'q ==
9574         null' -- when this function is invoked, we already know that the
9575         implicit conversion exists.
9576         (BetterFunction): Assume that 'best' is non-null.  Remove
9577         redundant reimplementation of IsApplicable when 'best' is null.
9578         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9579         number of arguments.
9580         (IsAncestralType): Extract from OverloadResolve.
9581         (OverloadResolve): Make robust to the MethodGroupExpr being
9582         unsorted.  Implement all the logic of Section 14.5.5.1, and
9583         support overloading of methods from multiple applicable types.
9584         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9585
9586         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9587         (RealError, Warning): Append type of report to related symbol.
9588
9589 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9590
9591         * enum.cs: Fixed CLS-Compliance checks for enum members.
9592         Error tests cs3008-8.cs, cs3014-8.cs
9593
9594 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9595
9596         Fixed bug #62342, #63102
9597         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9598         like ImplementMethod.
9599
9600 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9601
9602         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9603         Fixed bug #65170.
9604
9605 2004-09-02  Martin Baulig  <martin@ximian.com>
9606
9607         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9608         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9609         on the MethodBase.
9610
9611 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9612
9613         C# 2.0 Static classes implemented
9614
9615         * class.cs (TypeContainer): instance_constructors,
9616         initialized_fields, initialized_static_fields,
9617         default_constructor, base_inteface_types are protected to be
9618         accessible from StaticClass.
9619         (TypeContainer.DefineDefaultConstructor): New virtual method
9620         for custom default constructor generating
9621         (StaticClass): New class to handle "Static classes" feature.
9622
9623         * cs-parser.jay: Handle static keyword on class like instance
9624         of StaticClass.
9625
9626         * driver.cs: Added "/langversion" command line switch with two
9627         options (iso-1, default).
9628
9629 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9630
9631         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9632
9633 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * delegate.cs: Style.
9636
9637 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9638
9639         * delegate.cs: Add seperate instance expr field for miguel.
9640
9641 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9642
9643         * PointerArithmetic (Resolve): make sure we are not doing
9644         pointer arith on void*. Also, make sure we are resolved
9645         by not setting eclass until resolve.
9646
9647         All callers: Make sure that PointerArithmetic gets resolved.
9648
9649 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9650
9651         * ArrayCreation (LookupType): If the type does not resolve 
9652         to an array, give an error.
9653
9654 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9655
9656         * statement.cs (Try.Resolve): Fixed bug #64222
9657
9658 2004-08-27  Martin Baulig  <martin@ximian.com>
9659
9660         * class.cs
9661         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9662         crash here.     
9663
9664 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9665
9666         * ecore.cs (Constantify): Get underlying type via
9667         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9668         Windows in special cases.
9669
9670 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9671
9672         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9673         for obtaining also private methods.
9674         (GetRemoveMethod): Used GetRemoveMethod (true)
9675         for obtaining also private methods.
9676
9677 2004-09-02  Martin Baulig  <martin@ximian.com>
9678
9679         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9680         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9681         on the MethodBase.
9682
9683 2004-08-27  Martin Baulig  <martin@ximian.com>
9684
9685         * class.cs
9686         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9687         crash here.     
9688
9689 2004-08-25  Martin Baulig  <martin@ximian.com>
9690
9691         * support.cs (ReflectionParameters..ctor): If this is a generic
9692         method, retrieve and store its type parameters.
9693         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9694         (ReflectionParameters.GenericConstraints): The argument specifies
9695         the type parameter, not the method parameter.
9696         (InternalParameters.GenericConstraints): Likewise.
9697
9698         * generic.cs (TypeParameter.DefineType): Correctly handle
9699         constraints wrt. generic methods in interfaces and their
9700         implementations.        
9701
9702 2004-08-24  Martin Baulig  <martin@ximian.com>
9703
9704         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9705         (Constraints.IsSubclassOf): New internal method.
9706
9707         * typemanager.cs (TypeManager.FindMembers): Added special support
9708         for GenericTypeParameterBuilder's.      
9709         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9710         type parameters.
9711
9712 2004-08-24  Martin Baulig  <martin@ximian.com>
9713
9714         * typemanager.cs
9715         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9716         this for accessibility checks.
9717         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9718         IsNestedFamilyAccessible.
9719         (TypeManager.IsSubclassOf): New method, do what the name actually
9720         says.   
9721
9722 2004-08-24  Martin Baulig  <martin@ximian.com>
9723
9724         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9725         as a SimpleName, include the generic arity.
9726
9727 2004-08-24  Martin Baulig  <martin@ximian.com>
9728
9729         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9730         MethodAttributes.HideBySig for operators.
9731
9732 2004-08-23  Martin Baulig  <martin@ximian.com>
9733
9734         Back to the old error reporting system :-)
9735
9736         * report.cs (Message): Removed.
9737         (Report.MessageData, ErrorData, WarningData): Removed.
9738         (Report.Error, Warning): Back to the old system.
9739
9740 2004-08-23  Martin Baulig  <martin@ximian.com>
9741
9742         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9743
9744         * class.cs (TypeContainer.ParentContainer): New public virtual
9745         method; replaces the explicit interface implementation.
9746         (ClassPart.ParentContainer): Override.
9747
9748 2004-08-23  Martin Baulig  <martin@ximian.com>
9749
9750         * statement.cs (Switch): Added support for constant switches; see
9751         #59428 or test-285.cs.
9752
9753 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9754
9755         Fixed bug #62740.
9756         * statement.cs (GetEnumeratorFilter): Removed useless
9757         logic because C# specs is strict. GetEnumerator must be
9758         public.
9759
9760 2004-08-22  Martin Baulig  <martin@ximian.com>
9761
9762         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9763         a switch and may break, reset the barrier.  Fixes #59867.
9764
9765 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9766
9767         CLS-Compliance speed up (~5% for corlib)
9768
9769         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9770         New method. Tests container for CLS-Compliant names
9771
9772         * class.cs (TypeContainer.VerifyClsName): New method.
9773         Checks whether container name is CLS Compliant.
9774         (Constructor): Implements IMethodData.
9775
9776         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9777         low-case table for CLS Compliance test.
9778         (MemberCache.VerifyClsParameterConflict): New method.
9779         Checks method parameters for CS3006 error.
9780
9781         * enum.cs (EnumMember): Is derived from MemberCore.
9782         (Enum.VerifyClsName): Optimized for better performance.
9783
9784 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9785
9786         * report.cs: Renamed Error_T to Error and changed all
9787         references.
9788
9789 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9790
9791         * class.cs (TypeContainer.IndexerArrayList): New inner class
9792         container for indexers.
9793         (TypeContainer.DefaultIndexerName): New constant for default
9794         indexer name. Replaced all "Item" with this constant.
9795         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9796
9797         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9798         DefaultMemberAttribute constructor.
9799
9800 2004-08-05  Martin Baulig  <martin@ximian.com>
9801
9802         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9803         Fix bug #59429.
9804
9805 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9806
9807         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9808         multi platforms problem.
9809
9810         * compiler.csproj: Included shared files.
9811
9812 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9813
9814         Fix bug 60333, 55971 in the more general way
9815         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9816         Added arg_type argument for constant conversion.
9817         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9818
9819 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9820
9821         Fix bug #59760
9822         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9823         OperatorArrayList, MethodCoreArrayList for typecontainer
9824         containers. Changed class member types to these new types.
9825         (MethodArrayList.DefineMembers): Added test for CS0659.
9826
9827 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cfold.cs: Synchronize the folding with the code in expression.cs
9830         Binary.DoNumericPromotions for uint operands.
9831
9832         * attribute.cs: Revert patch from Raja, it introduced a regression
9833         while building Blam-1.2.1 (hard to isolate a test case).
9834
9835 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9836
9837         Fix for #55382
9838         * class.cs:
9839         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9840         name collision.
9841         (MethodCore.parent_method): New member. The method we're overriding
9842         if this is an override method.
9843         (MethodCore.CheckBase): Moved from Method class and made common.
9844         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9845         private.
9846         (MethodCore.CheckForDuplications): New abstract method. For custom
9847         member duplication search in a container
9848         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9849         method and its return type.
9850         (Event.conflict_symbol): New member. Symbol with same name in the
9851         parent class.
9852
9853         * decl.cs:
9854         (MemberCache.FindMemberWithSameName): New method. The method
9855         is looking for conflict with inherited symbols.
9856
9857 2004-08-04  Martin Baulig  <martin@ximian.com>
9858
9859         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9860
9861         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9862
9863 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9864
9865         * report.cs (Message): New enum for better error, warning reference in
9866         the code.
9867         (MessageData): New inner abstract class. It generally handles printing of
9868         error and warning messages.
9869         Removed unused Error, Warning, Message methods.
9870
9871 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9872
9873         Fix for cs0592-8.cs test
9874         * attribute.cs
9875         (Attributable.ValidAttributeTargets): Made public.
9876         (Attribute.ExplicitTarget): New member for explicit target value.
9877         (Attribute.CheckTargets): Now we translate explicit attribute
9878         target to Target here.
9879
9880 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9881
9882         * ecore.cs (MethodGroupExpr): new IsBase property.
9883
9884         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9885
9886         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9887         rather than an instance expr.
9888
9889         (DelegateCreation.Emit): Use the method group rather than
9890         the instance expression. Also, if you have base.Foo as the
9891         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9892
9893         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9894
9895         (NewDelegate.DoResolve): Only check for the existance of Invoke
9896         if the method is going to be needed. Use MethodGroupExpr.
9897
9898         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9899
9900         * expression.cs: For pointer arith., make sure to use
9901         the size of the type, not the size of the pointer to
9902         the type.
9903
9904 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9905
9906         Fix for #60722
9907         * class.cs (Class): Added error CS0502 test.
9908
9909 2004-08-03  John Luke  <jluke@cfl.rr.com>
9910             Raja R Harinath  <rharinath@novell.com>
9911
9912         Fix for #60997.
9913         * attribute.cs (Attribute.complained_before): New flag.
9914         (Attribute.ResolveType, Attribute.Resolve),
9915         (Attribute.DefinePInvokeMethod): Set it.
9916         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9917         
9918 2004-08-03  Martin Baulig  <martin@ximian.com>
9919
9920         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9921         use a user-defined operator; we still need to do numeric
9922         promotions in case one argument is a builtin type and the other
9923         one has an implicit conversion to that type.  Fixes #62322.
9924
9925 2004-08-18  Martin Baulig  <martin@ximian.com>
9926
9927         * class.cs (Method.Define): Use the correct method name when
9928         creating the MethodBuilder for a generic method.
9929
9930 2004-08-17  Martin Baulig  <martin@ximian.com>
9931
9932         * generic.cs (Constraints): Support type parameter constraints.
9933
9934 2004-08-16  Martin Baulig  <martin@ximian.com>
9935
9936         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9937         (Token.GENERIC_DIMENSION): New token; this is returned if we
9938         encounter an unbound generic type in a typeof() expression.
9939
9940         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9941         this token is only generated while parsing a typeof() expression.
9942         (typeof_expression): Removed the old unbound_type hack.
9943
9944         * generic.cs (TypeArguments.IsUnbound): New public property.
9945
9946         * decl.cs (MemberName): Added support for unbound types.
9947
9948 2004-08-14  Martin Baulig  <martin@ximian.com>
9949
9950         * typemanager.cs
9951         (TypeManager.IsEqualGenericInstance): New static method.
9952         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9953         just used to check accessibility, so follow the rules of 26.1.6.        
9954
9955         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9956         ConstructedType instead of a TypeExpression if we have type arguments.
9957
9958         * cs-parser.jay (typeof_expression): Support unbound generic types.
9959
9960         * ecore.cs (UnboundTypeExpression): New public class.
9961
9962 2004-08-12  Martin Baulig  <martin@ximian.com>
9963
9964         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9965         TypeManager.IsEqual() rather than `=='.
9966
9967         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9968         generic instances as well.
9969
9970 2004-08-12  Martin Baulig  <martin@ximian.com>
9971
9972         * expression.cs (Invocation.InferType): We can only infer method
9973         type parameters.  Fixes #62647.
9974
9975 2004-08-11  Martin Baulig  <martin@ximian.com>
9976
9977         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9978         before resolving the base classes.
9979
9980 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9981
9982         * Makefile: install .mdb file too.
9983
9984 2004-08-05  Martin Baulig  <martin@ximian.com>
9985
9986         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9987         initializer, the current type is just the TypeBuilder, not the
9988         instantiated generic type.
9989         (FieldExpr.IsFieldInitializer): New public property.
9990
9991 2004-08-04  Martin Baulig  <martin@ximian.com>
9992
9993         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9994
9995         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9996
9997 2004-08-03  Martin Baulig  <martin@ximian.com>
9998
9999         * class.cs (MethodData.Define): If we're an explicit
10000         implementation, remove the generic arity from the type name.
10001
10002 2004-08-03  Martin Baulig  <martin@ximian.com>
10003
10004         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10005         use a user-defined operator; we still need to do numeric
10006         promotions in case one argument is a builtin type and the other
10007         one has an implicit conversion to that type.  Fixes #62322.
10008
10009 2004-08-02  Martin Baulig  <martin@ximian.com>
10010
10011         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10012         `TypeExpr[]' array.
10013         (TypeContainer.GetClassBases): Return the unexpanded list of
10014         interfaces; we expand them later.
10015         (TypeContainer.DefineType): After creating the TypeBuilder, call
10016         TypeManager.ExpandInterfaces() to get an expanded and resolved
10017         list of interfaces.
10018
10019         * ecore.cs (TypeExpr.GetInterfaces): Removed
10020
10021         * generics.cs (Constraints.InterfaceConstraints): Remove.
10022         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10023         register the interface constraints.
10024
10025         * typemanager.cs
10026         (TypeManager.AddUserType): Removed the `ifaces' argument.
10027         (TypeManager.AddTypeParameter): Likewise.
10028         (TypeManager.AddUserInterface): Removed, was unused.
10029         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10030         `TypeExpr[]' array for the interfaces.
10031         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10032         has been defined, returns a list of the resolved interfaces types.
10033         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10034         (TypeManager.GetExplicitInterfaces): Likewise.  
10035
10036 2004-08-02  Martin Baulig  <martin@ximian.com>
10037
10038         * expression.cs (Invocation.EmitCall): If we're invoking a method
10039         on a type parameter, use the new `Constrained' prefix opcode.
10040
10041 2004-08-02  Martin Baulig  <martin@ximian.com>
10042
10043         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10044         (LocalInfo.IsThis): New public property.
10045         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10046
10047 2004-08-01  Martin Baulig  <martin@ximian.com>
10048
10049         * class.cs (TypeContainer.GetClassBases): Don't set the default
10050         here since we may get called from GetPartialBases().
10051         (TypeContainer.DefineType): If GetClassBases() didn't return a
10052         parent, use the default one.
10053
10054 2004-07-30  Martin Baulig  <martin@ximian.com>
10055
10056         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10057
10058         * class.cs (SourceMethod): New public class, derive from the
10059         symbol writer's ISourceMethod.
10060         (Method): Use the new symbol writer API.
10061
10062         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10063         as argument and use the new symbol writer.
10064
10065         * location.cs
10066         (SourceFile): Implement the symbol writer's ISourceFile.
10067         (Location.SymbolDocument): Removed.
10068         (Location.SourceFile): New public property.
10069
10070         * symbolwriter.cs: Use the new symbol writer API.
10071
10072 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10073
10074         * Makefile (install-local): Remove.  Functionality moved to
10075         executable.make.
10076
10077 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10078
10079         * Makefile: Install mcs.exe.config file together with mcs.exe.
10080         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10081         correct runtime version.
10082         
10083 2004-07-25  Martin Baulig  <martin@ximian.com>
10084
10085         * class.cs
10086         (TypeContainer.RegisterOrder): Removed, this was unused.
10087         (TypeContainer, interface_order): Removed.
10088         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10089         TypeContainer as argument since we can also be called with a
10090         `PartialContainer' for a partial class/struct/interface.
10091         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10092         of checking whether we're an `Interface' - we could be a
10093         `PartialContainer'.
10094         (PartialContainer.Register): Override; call
10095         AddClass()/AddStruct()/AddInterface() on our parent.
10096
10097         * cs-parser.jay (interface_member_declaration): Add things to the
10098         `current_container', not the `current_class'.
10099
10100         * rootcontext.cs (RegisterOrder): The overloaded version which
10101         takes an `Interface' was unused, removed.
10102
10103         * typemanager.cs (TypeManager.LookupInterface): Return a
10104         `TypeContainer', not an `Interface'.
10105         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10106         contain a `PartialContainer' for an interface, so check it's
10107         `Kind' to figure out what it is.
10108
10109 2004-07-25  Martin Baulig  <martin@ximian.com>
10110
10111         * class.cs (Class.DefaultTypeAttributes): New public constant.
10112         (Struct.DefaultTypeAttributes): Likewise.
10113         (Interface.DefaultTypeAttributes): Likewise.
10114         (PartialContainer.TypeAttr): Override this and add the
10115         DefaultTypeAttributes.
10116
10117 2004-07-25  Martin Baulig  <martin@ximian.com>
10118
10119         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10120         we can just use the `Parent' field instead.
10121
10122 2004-07-25  Martin Baulig  <martin@ximian.com>
10123
10124         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10125
10126 2004-07-25  Martin Baulig  <martin@ximian.com>
10127
10128         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10129         our parts before defining any methods.
10130         (TypeContainer.VerifyImplements): Make this virtual.
10131         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10132         on our PartialContainer.
10133
10134 2004-07-25  Martin Baulig  <martin@ximian.com>
10135
10136         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10137
10138         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10139         argument, we can just use the `Parent' field instead.
10140
10141         * class.cs
10142         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10143         (MemberBase.DoDefine): Likewise.
10144
10145 2004-07-24  Martin Baulig  <martin@ximian.com>
10146
10147         * decl.cs (MemberCore.Parent): New public field.
10148         (DeclSpace.Parent): Moved to MemberCore.
10149
10150         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10151         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10152         parent's .ctor.
10153         (FieldBase, Field, Operator): Likewise.
10154         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10155         (EventField, Event): Likewise.
10156
10157 2004-07-23  Martin Baulig  <martin@ximian.com>
10158
10159         * class.cs (PartialContainer): New public class.
10160         (ClassPart): New public class.
10161         (TypeContainer): Added support for partial classes.
10162         (TypeContainer.GetClassBases): Splitted some of the functionality
10163         out into GetNormalBases() and GetPartialBases().
10164
10165         * cs-tokenizer.cs (Token.PARTIAL): New token.
10166         (Tokenizer.consume_identifier): Added some hacks to recognize
10167         `partial', but only if it's immediately followed by `class',
10168         `struct' or `interface'.
10169
10170         * cs-parser.jay: Added support for partial clases.
10171
10172 2004-07-23  Martin Baulig  <martin@ximian.com>
10173
10174         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10175         a `DeclSpace' and also made it readonly.
10176         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10177         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10178         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10179
10180         * cs-parser.jay: Pass the `current_class', not the
10181         `current_container' (at the moment, this is still the same thing)
10182         to a new Method, Property, Event, Indexer or Constructor.
10183
10184 2004-07-23  Martin Baulig  <martin@ximian.com>
10185
10186         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10187         and removed the `current_interface' one.
10188         (struct_declaration, class_declaration, interface_declaration):
10189         Set `current_class' to the newly created class/struct/interface;
10190         set their `Bases' and call Register() before parsing their body.
10191
10192 2004-07-23  Martin Baulig  <martin@ximian.com>
10193
10194         * class.cs (Kind): New public enum.
10195         (TypeContainer): Made this class abstract.
10196         (TypeContainer.Kind): New public readonly field.
10197         (TypeContainer.CheckDef): New public method; moved here from
10198         cs-parser.jay.
10199         (TypeContainer.Register): New public abstract method.
10200         (TypeContainer.GetPendingImplementations): New public abstract
10201         method.
10202         (TypeContainer.GetClassBases): Removed the `is_class' and
10203         `is_iface' parameters.
10204         (TypeContainer.DefineNestedTypes): Formerly known as
10205         DoDefineType().
10206         (ClassOrStruct): Made this class abstract.
10207
10208         * tree.cs (RootTypes): New public type. 
10209
10210 2004-07-20  Martin Baulig  <martin@ximian.com>
10211
10212         * tree.cs (Tree.RecordNamespace): Removed.
10213         (Tree.Namespaces): Removed.
10214
10215         * rootcontext.cs (RootContext.IsNamespace): Removed.
10216
10217         * cs-parser.jay (namespace_declaration): Just create a new
10218         NamespaceEntry here.
10219
10220 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10221
10222         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10223         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10224         entry to make sure it runs in the correct runtime version.
10225         
10226 2004-07-18  Martin Baulig  <martin@ximian.com>
10227
10228         * generic.cs (ConstructedType.CheckConstraints): Improved
10229         constraints checking.
10230
10231 2004-07-18  Martin Baulig  <martin@ximian.com>
10232
10233         * expression.cs (Invocation.BetterMethod): Call
10234         TypeManager.TypeToCoreType() on all types and removed my previous
10235         hack; we're already doig the right thing here.
10236
10237 2004-07-17  Martin Baulig  <martin@ximian.com>
10238
10239         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10240
10241 2004-07-16  Martin Baulig  <martin@ximian.com>
10242
10243         * iterators.cs: Added generics support.
10244
10245 2004-07-16  Martin Baulig  <martin@ximian.com>
10246
10247         * iterators.cs: Rewrote this.  We're now using one single Proxy
10248         class for both the IEnumerable and the IEnumerator interface and
10249         `Iterator' derives from Class so we can use the high-level API.
10250
10251         * class.cs (TypeContainer.AddIterator): New method.
10252         (TypeContainer.DoDefineType): New protected virtual method, which
10253         is called from DefineType().
10254         (TypeContainer.DoDefineMembers): Call DefineType() and
10255         DefineMembers() on all our iterators.
10256         (TypeContainer.Emit): Call Emit() on all our iterators.
10257         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10258
10259         * codegen.cs (EmitContext.CurrentIterator): New public field.
10260
10261 2004-07-15  Martin Baulig  <martin@ximian.com>
10262
10263         * typemanager.cs
10264         (TypeManager.not_supported_exception_type): New type.   
10265
10266 2004-07-14  Martin Baulig  <martin@ximian.com>
10267
10268         * typemanager.cs
10269         (TypeManager.generic_ienumerable_type): New type.
10270         (TypeManager.generic_ienumerator_type): New type.
10271
10272         * rootcontext.cs
10273         (RootContext.interfaces_first_stage): Added
10274         "System.Collections.Generic.IEnumerator`1" and
10275         "System.Collections.Generic.IEnumerable`1".     
10276
10277 2004-07-14  Martin Baulig  <martin@ximian.com>
10278
10279         * iterators.cs: Use real error numbers.
10280
10281 2004-07-14  Martin Baulig  <martin@ximian.com>
10282
10283         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10284         requires this to be a System.Collection.IEnumerable and not a
10285         class implementing that interface.
10286         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10287
10288 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10289
10290         * class.cs: Fixed previous fix, it broke some error tests.
10291
10292 2004-07-12  Martin Baulig  <martin@ximian.com>
10293
10294         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10295         Fixes #61293.
10296
10297 2004-07-14  Martin Baulig  <martin@ximian.com>
10298
10299         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10300         an exclamation mark (!) for the generic arity to reflect the
10301         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10302
10303 2004-07-13  Martin Baulig  <martin@ximian.com>
10304
10305         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10306         specifiers being part of a type argument.
10307
10308 2004-07-13  Martin Baulig  <martin@ximian.com>
10309
10310         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10311         name for generic types.
10312
10313 2004-07-13  Martin Baulig  <martin@ximian.com>
10314
10315         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10316         bit to fix #60119.
10317
10318 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * assign.cs (LocalTemporary): Add new argument: is_address,If
10321         `is_address' is true, then the value that we store is the address
10322         to the real value, and not the value itself.
10323         
10324         * ecore.cs (PropertyExpr): use the new local temporary
10325         stuff to allow us to handle X.Y += z (where X is a struct)
10326
10327 2004-07-08  Martin Baulig  <martin@ximian.com>
10328
10329         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10330         not always return, just like we're doing in Using.Resolve().
10331
10332 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * cs-parser.jay (fixed_statement): flag this as Pinned.
10335
10336 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10337
10338         * typemanager.cs (TypeManager): Removed MakePinned method, this
10339         mechanism is replaced with the .NET 2.x compatible mechanism of
10340         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10341
10342         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10343         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10344         `IsFixed' property which has a different meaning.
10345
10346 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10347
10348         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10349         visible from inside a nested class, not just the names of the
10350         immediately enclosing class.
10351         Fix for bug #60730.
10352
10353 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10354
10355         * expression.cs (BetterConversion): Remove buggy special-case
10356         handling of "implicit constant expression conversions".  At this
10357         point, we already know that the conversion is possible -- we're
10358         only checking to see which is better.
10359
10360 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10361
10362         * cs-parser.jay: Added error CS0210 test.
10363
10364 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10365
10366         * cs-parser.jay: Added error CS0134 test.
10367
10368 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10369
10370         Fix bug #52507
10371         * cs-parser.jay: Added error CS0145 test.
10372
10373 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10374
10375         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10376
10377 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10378         
10379         * expression.cs (StackAlloc.Resolve): The argument may not
10380         be a constant; deal with this case.
10381         
10382 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10383
10384         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10385         GetIndexerAttributeValue.
10386         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10387
10388         * class.cs (Indexer.Define): Added error tests for CS0415,
10389         CS0609.
10390
10391 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10394         property code.
10395
10396 2004-06-23  Martin Baulig  <martin@ximian.com>
10397
10398         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10399         neither return nor throw, reset the barrier as well.  Fixes #60457.
10400
10401 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10402
10403         * class.cs : EventAttributes is now set to None by default.
10404           This fixes bug #60459.
10405
10406 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10407
10408         Fix bug #60219
10409         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10410         Don't throw exception but return null (it's sufficient now).
10411
10412 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10413
10414         * typemanager.cs (GetArgumentTypes): Faster implementation.
10415
10416 2004-06-18  Martin Baulig  <martin@ximian.com>
10417
10418         * attribute.cs (Attribute.Resolve): Check whether we're an
10419         EmptyCast which a Constant child.  Fixes #60333.
10420
10421 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10422
10423         * statement.cs (EmitCollectionForeach): Account for the fact that
10424         not all valuetypes are in areas which we can take the address of.
10425         For these variables, we store to a temporary variable. Also, make
10426         sure that we dont emit a `callvirt' on a valuetype method.
10427
10428 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10429
10430         * expression.cs (StackAlloc.DoReSolve): Added test for
10431         negative parameter (CS0247).
10432
10433 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10434
10435         Fix bug #59792
10436         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10437
10438 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10439
10440         Fix bug #59781
10441         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10442         ulong.
10443
10444 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10445
10446         Fix bug #58254 & cs1555.cs, cs1556.cs
10447         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10448
10449 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10450
10451         * cs-parser.jay: Added error CS1669 test for indexers.
10452
10453 2004-06-18  Martin Baulig  <martin@ximian.com>
10454
10455         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10456         argument.  Fixes #60441.
10457
10458 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10459         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10460         The name needs to have the actual name of the method in order
10461         for other tests (such as the one in OverloadResolve for Invoke
10462         on a delegate) to work. As well, it does not really help
10463         error reporting because the method group had multiple methods.
10464         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10465         Make profiling work.
10466         
10467 2004-06-13  Martin Baulig  <martin@ximian.com>
10468
10469         * cs-parser.jay: Don't allow generic attributes.
10470
10471 2004-06-13  Martin Baulig  <martin@ximian.com>
10472
10473         * class.cs (MemberBase.DoDefineBase): New protected method.
10474         (MemberBase.DoDefine): Compute the `flags' in the new
10475         DoDefineBase() which must be called first.
10476         (Method.Define): Call DoDefineBase() first so we have the flags
10477         when defining the generic method.
10478
10479         * cs-parser.jay (interface_method_declaration): Support generic methods.
10480
10481 2004-06-13  Martin Baulig  <martin@ximian.com>
10482
10483         * decl.cs (TypeName): Removed.
10484         (MemberName): Removed TypeName and MemberNow; now we just have
10485         MemberName.
10486
10487         * cs-parser.jay: Don't distinguish between type arguments and type
10488         parameters in the grammar and simplified the rules a bit.  The
10489         reduce/reduce conflicts are now gone (except the one we inherited
10490         from mcs).
10491
10492 2004-06-11  Martin Baulig  <martin@ximian.com>
10493
10494         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10495         call this twice: for params and varargs methods.
10496
10497 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10498
10499         * class.cs:
10500         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10501
10502 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10503
10504         * attribute.cs (Attribute.GetValidTargets): Made public.
10505
10506         * class.cs: 
10507         (AbstractPropertyEventMethod): New class for better code sharing.
10508         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10509         CS1667 report.
10510         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10511
10512 2004-06-09  Martin Baulig  <martin@ximian.com>
10513
10514         * cs-parser.jay: Removed a reduce/reduce conflict.
10515
10516 2004-06-03  Martin Baulig  <martin@ximian.com>
10517
10518         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10519         GetSimpleName() and return a SimpleName.
10520
10521         * ecore.cs (SimpleName.Arguments): New public field.
10522         (SimpleName): Added overloaded ctor which takes an additional
10523         TypeArguments argument.
10524         (SimpleName.SimpleNameResolve): Added support for generic methods.
10525         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10526         formerly in MemberAccess.DoResolve(), but we also need it in
10527         SimpleNameResolve().
10528
10529         * expression.cs (MemberAccess.DoResolve): Use the new
10530         MethodGroupExpr.ResolveGeneric().       
10531
10532 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10533
10534         * decl.cs: If possible, use lookuptypedirect here. We can only do
10535         this if there is no `.' after the namespace. Avoids using
10536         LookupType, which does lots of slow processing.
10537         (FindNestedType) New method, does what it says :-).
10538         * namespace.cs: use LookupTypeDirect.
10539         * rootcontext.cs: use membercache, if possible.
10540         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10541
10542 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10543
10544         * expression.cs:
10545         According to the spec, 
10546
10547         In a member access of the form E.I, if E is a single identifier,
10548         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10549         field, property, localvariable, or parameter with the same type as
10550         the meaning of E as a type-name (§3.8), then both possible
10551         meanings of E are permitted.
10552
10553         We did not check that E as a simple-name had the same type as E as
10554         a type name.
10555
10556         This trivial check gives us 5-7% on bootstrap time.
10557
10558 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10559
10560         * expression.cs (Invocation.OverloadResolve): Avoid the
10561         use of hashtables and boxing here by allocating on demand.
10562
10563 2004-05-30  Martin Baulig  <martin@ximian.com>
10564
10565         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10566         we're doing a silent lookup.  Don't try to lookup nested types in
10567         TypeManager.object_type (thanks to Ben Maurer).
10568
10569 2004-05-30  Martin Baulig  <martin@ximian.com>
10570
10571         Committing a patch from Ben Maurer.
10572
10573         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10574
10575 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10576
10577         * convert.cs: add a trivial cache for overload operator resolution.
10578
10579 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10580
10581         * attribute.cs
10582         (AttributeTester.GetObsoleteAttribute): Returns instance of
10583         ObsoleteAttribute when type is obsolete.
10584
10585         * class.cs
10586         (TypeContainer.VerifyObsoleteAttribute): Override.
10587         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10588         (MethodCode.VerifyObsoleteAttribute): Override.
10589         (MemberBase.VerifyObsoleteAttribute): Override.
10590
10591         * decl.cs
10592         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10593         and report proper error.
10594
10595         *delegate.cs
10596         (Delegate.VerifyObsoleteAttribute): Override.
10597
10598         * ecore.cs
10599         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10600         and report proper error.
10601         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10602
10603         * enum.cs
10604         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10605         and enum member.
10606
10607         * expression.cs
10608         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10609         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10610         Added test for ObsoleteAttribute.
10611
10612         * statement.cs
10613         (Catch): Derived from Statement.
10614
10615 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10616
10617         * decl.cs: If possible, use lookuptypedirect here. We can only do
10618         this if there is no `.' after the namespace. Avoids using
10619         LookupType, which does lots of slow processing.
10620         (FindNestedType) New method, does what it says :-).
10621         * namespace.cs: use LookupTypeDirect.
10622         * rootcontext.cs: use membercache, if possible.
10623         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10624
10625 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10626
10627         * expression.cs:
10628         According to the spec, 
10629
10630         In a member access of the form E.I, if E is a single identifier,
10631         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10632         field, property, localvariable, or parameter with the same type as
10633         the meaning of E as a type-name (§3.8), then both possible
10634         meanings of E are permitted.
10635
10636         We did not check that E as a simple-name had the same type as E as
10637         a type name.
10638
10639         This trivial check gives us 5-7% on bootstrap time.
10640
10641 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10642
10643         Fixed bug #59071 & cs0160.cs
10644         * statement.cs (Try.Resolve): Check here whether order of catch
10645         clauses matches their dependencies.
10646
10647 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10648
10649         Fixed bug #58624
10650         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10651         unsafe type.
10652
10653 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10654
10655         * expression.cs (Invocation.OverloadResolve): Avoid the
10656         use of hashtables and boxing here by allocating on demand.
10657
10658 2004-05-30  Martin Baulig  <martin@ximian.com>
10659
10660         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10661         we're doing a silent lookup.  Don't try to lookup nested types in
10662         TypeManager.object_type (thanks to Ben Maurer).
10663
10664 2004-05-30  Martin Baulig  <martin@ximian.com>
10665
10666         Committing a patch from Ben Maurer.
10667
10668         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10669
10670 2004-05-29  Martin Baulig  <martin@ximian.com>
10671
10672         * class.cs (IMethodData.ShouldIgnore): New method.
10673
10674         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10675         `Location' argument, we don't need it anywhere.  Use
10676         `IMethodData.ShouldIgnore ()' instead of
10677         `MethodData.GetMethodFlags ()'.
10678         (TypeManager.AddMethod): Removed.
10679         (TypeManager.AddMethod2): Renamed to AddMethod.
10680
10681 2004-05-29  Martin Baulig  <martin@ximian.com>
10682
10683         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10684
10685         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10686         converting from a class type S to an interface type and we already
10687         have an object on the stack, don't box it again.  Fixes #52578.
10688
10689 2004-05-29  Martin Baulig  <martin@ximian.com>
10690
10691         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10692         Added support for `params' parameters.  Fixes #59267.
10693
10694 2004-05-29  Martin Baulig  <martin@ximian.com>
10695
10696         * literal.cs (NullPointer): Provide a private .ctor which sets
10697         `type' to TypeManager.object_type.  Fixes #59048.
10698
10699 2004-05-29  Martin Baulig  <martin@ximian.com>
10700
10701         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10702         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10703
10704         * ecore.cs (EventExpr.instance_expr): Make the field private.
10705
10706 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10707
10708         Fixed bug #50080 & cs0214-2.cs
10709         * expression.cs (Cast.DoResolve): Check unsafe context here.
10710         
10711         * statement.cs (Resolve.DoResolve): Likewise.
10712
10713 2004-05-26  Martin Baulig  <martin@ximian.com>
10714
10715         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10716
10717         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10718         (RootContext.LookupType): Pass down the `silent' flag.
10719
10720 2004-05-25  Martin Baulig  <martin@ximian.com>
10721
10722         * expression.cs
10723         (MethodGroupExpr.IdenticalTypeName): New public property.
10724         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10725         expression actually refers to a type.
10726
10727 2004-05-25  Martin Baulig  <martin@ximian.com>
10728
10729         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10730         for #56176 and made it actually work.
10731
10732 2004-05-25  Martin Baulig  <martin@ximian.com>
10733
10734         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10735         (FieldExpr, PropertyExpr): Override and implement
10736         CacheTemporaries.  Fixes #52279.
10737
10738 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * location.cs: In the new compiler listing a file twice is a
10741         warning, not an error.
10742
10743 2004-05-24  Martin Baulig  <martin@ximian.com>
10744
10745         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10746         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10747
10748 2004-05-24  Martin Baulig  <martin@ximian.com>
10749
10750         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10751         walking the `using' list.  Fixes #53921.
10752
10753 2004-05-24  Martin Baulig  <martin@ximian.com>
10754
10755         * const.cs (Const.LookupConstantValue): Added support for
10756         EmptyCast's; fixes #55251.
10757
10758 2004-05-24  Martin Baulig  <martin@ximian.com>
10759
10760         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10761         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10762         which does the CS0135 check.  The reason is that we first need to
10763         check whether the variable actually exists.
10764
10765 2004-05-24  Martin Baulig  <martin@ximian.com>
10766
10767         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10768         than RootContext.LookupType() to find the explicit interface
10769         type.  Fixes #58584.
10770
10771 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10772
10773         * Makefile: Simplify.  Use executable.make.
10774         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10775
10776 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10777
10778         * decl.cs:
10779         * enum.cs:
10780         Use the invariant culture when doing String.Compare for CLS case
10781         sensitivity.
10782         
10783 2004-05-23  Martin Baulig  <martin@ximian.com>
10784
10785         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10786         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10787
10788         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10789
10790 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10791
10792         * class.cs (MemberBase.Define): Reuse MemberType member for 
10793         resolved type. Other methods can use it too.
10794
10795 2004-05-23  Martin Baulig  <martin@ximian.com>
10796
10797         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10798         the variable also exists in the current block (otherwise, we need
10799         to report a CS0103).  Fixes #58670.
10800
10801 2004-05-23  Martin Baulig  <martin@ximian.com>
10802
10803         * flowanalysis.cs (Reachability.Reachable): Compute this
10804         on-the-fly rather than storing it as a field.
10805
10806 2004-05-23  Martin Baulig  <martin@ximian.com>
10807
10808         * flowanalysis.cs (Reachability.And): Manually compute the
10809         resulting `barrier' from the reachability.      
10810        
10811 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10812
10813         Fix bug #57835
10814         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10815         instance of ObsoleteAttribute when symbol is obsolete.
10816
10817         * class.cs
10818         (IMethodData): Extended interface for ObsoleteAttribute support.
10819
10820 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10821
10822         * attribute.cs: Fix bug #55970
10823
10824 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10825
10826         Fix bug #52705
10827         * attribute.cs
10828         (GetObsoleteAttribute): New method. Creates the instance of
10829         ObsoleteAttribute.
10830         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10831         ObsoleteAttribute when member is obsolete.
10832         (AttributeTester.Report_ObsoleteMessage): Common method for
10833         Obsolete error/warning reporting.
10834
10835         * class.cs
10836         (TypeContainer.base_classs_type): New member for storing parent type.
10837
10838         * decl.cs
10839         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10840         for this MemberCore.
10841
10842 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10843
10844         * attribute.cs, const.cs: Fix bug #58590
10845
10846 2004-05-21  Martin Baulig  <martin@ximian.com>
10847
10848         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10849         out parameters if the end of the method is unreachable.  Fixes
10850         #58098. 
10851
10852 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10853
10854         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10855         Hari was right, why extra method.
10856
10857 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10858
10859         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10860
10861 2004-05-20  Martin Baulig  <martin@ximian.com>
10862
10863         * delegate.cs: Convert this file to Unix mode - like the original
10864         version in mcs is.
10865
10866 2004-05-20  Martin Baulig  <martin@ximian.com>
10867
10868         * attribute.cs: Convert this file to Unix mode - like the original
10869         version in mcs is.
10870
10871 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10872
10873        Fix bug #58688 (MCS does not report error when the same attribute
10874        is assigned twice)
10875
10876        * attribute.cs (Attribute.Emit): Distinction between null and default.
10877
10878 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10879
10880        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10881        of a top-level attribute without an attribute target.
10882        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10883        Make non-static.
10884        (Attribute.Conditional_GetConditionName), 
10885        (Attribute.Obsolete_GetObsoleteMessage): Update.
10886        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10887        part of ScanForIndexerName.
10888        (Attribute.CanIgnoreInvalidAttribute): New function.
10889        (Attribute.ScanForIndexerName): Move to ...
10890        (Attributes.ScanForIndexerName): ... here.
10891        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10892        (Attributes.Search): New internal variant that can choose not to
10893        complain if types aren't resolved.  The original signature now
10894        complains.
10895        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10896        complaints suppressed.
10897        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10898        only if it not useful.
10899        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10900        top-level for attributes that are shared between the assembly
10901        and a top-level class.
10902        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10903        * class.cs: Update to reflect changes.
10904        (DefineIndexers): Fuse loops.
10905        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10906        a couple more variants of attribute names.
10907
10908 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10909
10910         Fix bug #52585 (Implemented explicit attribute declaration)
10911
10912         * attribute.cs:
10913         (Attributable.ValidAttributeTargets): New abstract method. It gets
10914         list of valid attribute targets for explicit target declaration.
10915         (Attribute.Target): It holds target itself.
10916         (AttributeSection): Removed.
10917         (Attribute.CheckTargets): New method. It checks whether attribute
10918         target is valid for the current element.
10919
10920         * class.cs:
10921         (EventProperty): New class. For events that are declared like
10922         property (with add and remove accessors).
10923         (EventField): New class. For events that are declared like field.
10924         class.cs
10925
10926         * cs-parser.jay: Implemented explicit attribute target declaration.
10927
10928         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10929         Override ValidAttributeTargets.
10930
10931         * parameter.cs:
10932         (ReturnParameter): Class for applying custom attributes on 
10933         the return type.
10934         (ParameterAtribute): New class. Class for applying custom
10935         attributes on the parameter type.
10936
10937 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10938
10939         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10940         definitions. 
10941
10942         (Method): Allow UNSAFE here.
10943
10944         * modifiers.cs: Support unsafe reporting.
10945
10946 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10947
10948         * decl.cs: Fix bug #58478.
10949
10950 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10951
10952         * statement.cs: When checking for unreachable code on an EmptyStatement,
10953         set the location. Fixes bug #58488.
10954
10955 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10956
10957         * driver.cs: Add -pkg handling.
10958
10959         From Gonzalo: UseShelLExecute=false
10960
10961 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10962
10963         * attribute.cs:
10964         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10965         for attribute.
10966         (Attribute.IsClsCompliaceRequired): Moved to base for better
10967         accesibility.
10968         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10969         when attribute is AttributeUsageAttribute.
10970         (Attribute.GetValidTargets): Simplified.
10971         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10972         attribute for this type.
10973         (Attribute.ApplyAttributes): Method renamed to Emit and make
10974         non-static.
10975         (GlobalAttributeSection): New class for special handling of global
10976         attributes (assembly, module).
10977         (AttributeSection.Emit): New method.
10978
10979         * class.cs: Implemented Attributable abstract methods.
10980         (MethodCore.LabelParameters): Moved to Parameter class.
10981         (Accessor): Is back simple class.
10982         (PropertyMethod): Implemented Attributable abstract class.
10983         (DelegateMethod): Implemented Attributable abstract class.
10984         (Event): New constructor for disctintion between normal Event
10985         and Event with accessors.
10986
10987         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10988
10989         * codegen.cs, const.cs, decl.cs, delegate.cs:
10990         (CommonAssemblyModulClass): Implemented Attributable abstract class
10991         and simplified.
10992
10993         * enum.cs: Implement IAttributeSupport interface.
10994         (EnumMember): New class for emum members. Implemented Attributable
10995         abstract class
10996
10997         * parameter.cs:
10998         (ParameterBase): Is abstract.
10999         (ReturnParameter): New class for easier [return:] attribute handling.
11000
11001         * typemanager.cs: Removed builder_to_attr.
11002
11003 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11004
11005         Fix bug #57151.
11006         * attribute.cs (Attribute.GetPositionalValue): New function.
11007         * class.cs (TypeContainer.VerifyMembers): New function.
11008         (TypeContainer.Emit): Use it.
11009         (ClassOrStruct): New base class for Class and Struct.
11010         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11011         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11012         class.
11013         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11014         then each non-static field should have a FieldOffset attribute.
11015         Otherwise, none of the fields should have a FieldOffset attribute.
11016         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11017         and FieldOffset attributes.
11018         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11019         (TypeManager.field_offset_attribute_type): New core types.
11020         (TypeManager.InitCoreTypes): Initialize them.
11021
11022 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11023
11024         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11025         Return correct type.
11026         From bug #58270.
11027
11028 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11029
11030         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11031         be implicitly converted to ulong.
11032         
11033         * expression.cs: The logic for allowing operator &, | and ^ worked
11034         was wrong, it worked before because we did not report an error in
11035         an else branch.  Fixes 57895.
11036
11037         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11038         allow volatile fields to be reference types.
11039
11040 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11041
11042         * driver.cs: Add support for /debug-
11043
11044 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11045
11046         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11047         Add a 'complain' parameter to silence errors.
11048         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11049         silently overlooked type-resolutions.
11050         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11051         to reflect changes.
11052         (Attributes.Search): New function.
11053         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11054         (Attributes.GetAttributeFullName): Remove hack.
11055         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11056         Update to reflect changes.
11057         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11058         Use Attributes.Search instead of nested loops.
11059
11060 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11061
11062         * decl.cs:
11063         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11064         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11065         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11066
11067         * report.cs: (Report.Warning): Renamed to Warning_T because of
11068         parameter collision.
11069
11070 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11071
11072         * expression.cs (MemberAccess.ResolveMemberAccess):
11073         Exit with non-zero status after Report.Error.
11074         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11075         Likewise.
11076         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11077
11078 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11079
11080         * support.cs: Don't hang when the file is empty.
11081
11082 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11083
11084         * support.cs: In SeekableStreamReader, compute the preamble size of the
11085           underlying stream. Position changes should take into account that initial
11086           count of bytes.
11087
11088 2004-05-03  Todd Berman  <tberman@sevenl.net>
11089
11090         * driver.cs: remove unused GetSysVersion function.
11091
11092 2004-05-03  Todd Berman  <tberman@sevenl.net>
11093
11094         * driver.cs: Remove the hack from saturday, as well as the hack
11095         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11096         link_paths to get that bit proper.
11097
11098 2004-05-01  Todd Berman  <tberman@sevenl.net>
11099
11100         * driver.cs: Try a LoadFrom before a Load, this checks the current
11101         path. This is currently a bug in mono that is be fixed, however, this
11102         provides a workaround for now. This will be removed when the bug
11103         is fixed.
11104
11105 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11106
11107         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11108         incomplete key pairs (#57941).
11109
11110 2004-05-01  Todd Berman  <tberman@sevenl.net>
11111
11112         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11113         from the GAC
11114
11115 2004-04-30  Jackson Harper  <jackson@ximian.com>
11116
11117         * codegen.cs: Open keys readonly.
11118         
11119 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11120
11121         * typemanager.cs: don't report cyclic struct layout when a struct
11122         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11123         which has 2 Pango.Rectangle fields.
11124
11125 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11126
11127         * expression.cs: Handle IntPtr comparisons with IL code
11128         rather than a method call.
11129
11130 2004-04-29  Martin Baulig  <martin@ximian.com>
11131
11132         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11133         the list of PropertyInfo's in class hierarchy and find the
11134         accessor.  Fixes #56013.
11135
11136 2004-04-29  Martin Baulig  <martin@ximian.com>
11137
11138         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11139
11140 2004-04-29  Martin Baulig  <martin@ximian.com>
11141
11142         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11143
11144         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11145
11146 2004-04-29  Martin Baulig  <martin@ximian.com>
11147
11148         * class.cs (ConstructorInitializer.Resolve): Check whether the
11149         parent .ctor is accessible.  Fixes #52146.
11150
11151 2004-04-29  Martin Baulig  <martin@ximian.com>
11152
11153         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11154
11155         * statement.cs (Using.EmitLocalVariableDecls): Use
11156         TypeManager.idisposable_type, not typeof (IDisposable).
11157         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11158
11159 2004-04-29  Martin Baulig  <martin@ximian.com>
11160
11161         * class.cs (Event.Define): Don't emit the field and don't set
11162         RTSpecialName and SpecialName for events on interfaces.  Fixes
11163         #57703. 
11164
11165 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11166
11167         Refactor Attribute.ApplyAttributes.
11168         * attribute.cs (Attributable): New base class for objects that can
11169         have Attributes applied on them.
11170         (Attribute): Make AttributeUsage fields public.
11171         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11172         (Attribute.IsInternalCall): New property.
11173         (Attribute.UsageAttr): Convert to a public read-only property.
11174         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11175         (Attribute.ResolveType, Attribute.Resolve)
11176         (Attribute.ScanForIndexerName): Update to reflect changes.
11177         (Attribute.CheckAttributeTarget): Re-format.
11178         (Attribute.ApplyAttributes): Refactor, to various
11179         Attributable.ApplyAttributeBuilder methods.
11180         * decl.cs (MemberCore): Make Attributable.
11181         * class.cs (Accessor): Make Attributable.
11182         (MethodData.ApplyAttributes): Use proper attribute types, not
11183         attribute names.
11184         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11185         (TypeContainer.ApplyAttributeBuilder)
11186         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11187         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11188         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11189         (Operator.ApplyAttributeBuilder): New factored-out methods.
11190         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11191         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11192         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11193         * parameter.cs (ParameterBase): New Attributable base class
11194         that can also represent Return types.
11195         (Parameter): Update to the changes.
11196
11197 2004-04-29  Jackson Harper  <jackson@ximian.com>
11198
11199         * driver.cs: Prefer the corlib system version when looking for
11200         assemblies in the GAC. This is still a hack, but its a better hack
11201         now.
11202         
11203 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11204
11205         * decl.cs, enum.cs: Improved error 3005 reporting.
11206   
11207         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11208         (related_symbols): New private member for list of symbols
11209         related to reported error/warning.
11210         
11211         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11212
11213 2004-04-29  Martin Baulig  <martin@ximian.com>
11214
11215         * ecore.cs (Expression.Constantify): If we're an enum and
11216         TypeManager.TypeToCoreType() doesn't give us another type, use
11217         t.UnderlyingSystemType.  Fixes #56178.  
11218
11219 2004-04-29  Martin Baulig  <martin@ximian.com>
11220
11221         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11222         interfaces and for each interface, only add members directly
11223         declared in that interface.  Fixes #53255.
11224
11225 2004-04-28  Martin Baulig  <martin@ximian.com>
11226
11227         * expression.cs (ConditionalLogicalOperator): Use a temporary
11228         variable for `left' to avoid that we evaluate it more than once;
11229         bug #52588.
11230
11231 2004-04-28  Martin Baulig  <martin@ximian.com>
11232
11233         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11234         `void[]' (CS1547).
11235
11236 2004-04-28  Martin Baulig  <martin@ximian.com>
11237
11238         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11239         void (CS1547).
11240
11241         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11242         whether the type is not void (CS1547).
11243
11244 2004-04-28  Martin Baulig  <martin@ximian.com>
11245
11246         * expression.cs (Unary.DoResolveLValue): Override this and report
11247         CS0131 for anything but Operator.Indirection.
11248
11249 2004-04-28  Martin Baulig  <martin@ximian.com>
11250
11251         Committing a patch from Ben Maurer; see bug #50820.
11252
11253         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11254         check for classes.
11255
11256         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11257         classes.        
11258
11259 2004-04-28  Martin Baulig  <martin@ximian.com>
11260
11261         Committing a patch from Ben Maurer; see bug #50820.
11262
11263         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11264         check for classes.
11265
11266         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11267         classes.        
11268
11269 2004-04-28  Martin Baulig  <martin@ximian.com>
11270
11271         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11272         (Block.AddLabel): Call DoLookupLabel() to only search in the
11273         current block.
11274
11275 2004-04-28  Martin Baulig  <martin@ximian.com>
11276
11277         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11278         comparing StringConstants and NullLiterals in Equality and Inequality.
11279
11280 2004-04-28  Jackson Harper  <jackson@ximian.com>
11281
11282         * driver.cs: Attempt to load referenced assemblies from the
11283         GAC. This is the quick and dirty version of this method that
11284         doesnt take into account versions and just takes the first
11285         canidate found. Will be good enough for now as we will not have more
11286         then one version installed into the GAC until I update this method.
11287
11288 2004-04-28  Martin Baulig  <martin@ximian.com>
11289
11290         * typemanager.cs (TypeManager.CheckStructCycles): New public
11291         static method to check for cycles in the struct layout.
11292
11293         * rootcontext.cs (RootContext.PopulateTypes): Call
11294         TypeManager.CheckStructCycles() for each TypeContainer.
11295         [Note: We only need to visit each type once.]
11296
11297 2004-04-28  Martin Baulig  <martin@ximian.com>
11298
11299         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11300
11301         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11302         success and added `out object value'.  Use a `bool resolved' field
11303         to check whether we've already been called rather than
11304         `ConstantValue != null' since this breaks for NullLiterals.
11305
11306 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11307
11308         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11309         setting of this flag, since the 'set' method may be non-public.
11310
11311 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11312
11313         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11314         check on current_vector.Block.
11315
11316 2004-04-27  Martin Baulig  <martin@ximian.com>
11317
11318         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11319         a field initializer.  Fixes #56459.
11320
11321 2004-04-27  Martin Baulig  <martin@ximian.com>
11322
11323         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11324         we're not attempting to use an indexer.  Fixes #52154.
11325
11326 2004-04-27  Martin Baulig  <martin@ximian.com>
11327
11328         * statement.cs (Return): Don't create a return label if we don't
11329         need it; reverts my change from January 20th.  Thanks to Ben
11330         Maurer for this.
11331
11332 2004-04-27  Martin Baulig  <martin@ximian.com>
11333
11334         According to the spec, `goto' can only leave a nested scope, but
11335         never enter it.
11336
11337         * statement.cs (Block.LookupLabel): Only lookup in the current
11338         block, don't recurse into parent or child blocks.
11339         (Block.AddLabel): Check in parent and child blocks, report
11340         CS0140/CS0158 if we find a duplicate.
11341         (Block): Removed this indexer for label lookups.
11342         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11343         this already does the error reporting for us.
11344
11345         * flowanalysis.cs
11346         (FlowBranching.UsageVector.Block): New public variable; may be null.
11347         (FlowBranching.CreateSibling): Added `Block' argument.
11348         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11349         label for the target of a `goto' and check whether we're not
11350         leaving a `finally'.
11351
11352 2004-04-27  Martin Baulig  <martin@ximian.com>
11353
11354         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11355         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11356         just for returns).
11357
11358 2004-04-27  Martin Baulig  <martin@ximian.com>
11359
11360         * statement.cs (Block.AddLabel): Also check for implicit blocks
11361         and added a CS0158 check.
11362
11363 2004-04-27  Martin Baulig  <martin@ximian.com>
11364
11365         * flowanalysis.cs (FlowBranchingLoop): New class.
11366         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11367         UsageVector's instead of an ArrayList.
11368         (FlowBranching.Label): Likewise.
11369         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11370         (FlowBranching.AddBreakVector): New method.
11371
11372 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11373
11374         * attribute.cs: Small regression fix: only convert the type if we
11375         the type is different, fixes System.Drawing build.
11376
11377 2004-04-27  Martin Baulig  <martin@ximian.com>
11378
11379         * attribute.cs (Attribute.Resolve): If we have a constant value
11380         for a named field or property, implicity convert it to the correct
11381         type.
11382
11383 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11384
11385         * statement.cs (Block.Block): Implicit blocks share
11386         'child_variable_names' fields with parent blocks.
11387         (Block.AddChildVariableNames): Remove.
11388         (Block.AddVariable): Mark variable as "used by a child block" in
11389         every surrounding block.
11390         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11391         been used in a child block, complain about violation of "Invariant
11392         meaning in blocks" rule.
11393         * cs-parser.jay (declare_local_variables): Don't use
11394         AddChildVariableNames.
11395         (foreach_statement): Don't create an implicit block: 'foreach'
11396         introduces a scope.
11397
11398 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11399
11400         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11401         converting from 0L to ulong.  Fixes 57522.
11402
11403 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11404
11405         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11406         derived class hides via 'new' keyword field from base class (test-242.cs).
11407         TODO: Handle this in the more general way.
11408         
11409         * class.cs (CheckBase): Ditto.
11410
11411 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11412
11413         * decl.cs (caching_flags): New member for storing cached values
11414         as bit flags.
11415         (MemberCore.Flags): New enum where bit flags for caching_flags
11416         are defined.
11417         (MemberCore.cls_compliance): Moved to caching_flags.
11418         (DeclSpace.Created): Moved to caching_flags.
11419
11420         * class.cs: Use caching_flags instead of DeclSpace.Created
11421         
11422 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11425         if we are only a derived class, not a nested class.
11426
11427         * typemanager.cs: Same as above, but do this at the MemberLookup
11428         level (used by field and methods, properties are handled in
11429         PropertyExpr).   Allow for the qualified access if we are a nested
11430         method. 
11431
11432 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11433
11434         * class.cs: Refactoring.
11435         (IMethodData): New inteface; Holds links to parent members
11436         to avoid member duplication (reduced memory allocation).
11437         (Method): Implemented IMethodData interface.
11438         (PropertyBase): New inner classes for get/set methods.
11439         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11440         (Event): New inner classes for add/remove methods.
11441         (Event.DelegateMethod): Implemented IMethodData interface.
11442
11443         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11444         EmitContext (related to class.cs refactoring).
11445
11446 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11447
11448         * delegate.cs (Delegate.VerifyApplicability): If the number of
11449         arguments are the same as the number of parameters, first try to
11450         verify applicability ignoring  any 'params' modifier on the last
11451         parameter.
11452         Fixes #56442.
11453
11454 2004-04-08  Martin Baulig  <martin@ximian.com>
11455
11456         Merged latest changes into gmcs.  Please keep this comment in
11457         here, it makes it easier for me to see what changed in MCS since
11458         the last time I merged.
11459
11460 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11461
11462         * class.cs (TypeContainer.AddIndexer): Use
11463         'ExplicitInterfaceName' to determine if interface name was
11464         explicitly specified.  'InterfaceType' is not initialized at this time.
11465         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11466         Indexers array is already in the required order.  Initialize
11467         'IndexerName' only if there are normal indexers.
11468         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11469         (TypeContainer.Emit): Emit DefaultMember attribute only if
11470         IndexerName is initialized.
11471         Fixes #56300.
11472
11473 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11474
11475         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11476         Fixes #57007
11477
11478 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11479
11480         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11481         attributes.
11482         Fix for #56456.
11483
11484         * attribute.cs (Attribute.Resolve): Check for duplicate named
11485         attributes.
11486         Fix for #56463.
11487
11488 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11489
11490         * iterators.cs (MarkYield): track whether we are in an exception,
11491         and generate code accordingly.  Use a temporary value to store the
11492         result for our state.
11493
11494         I had ignored a bit the interaction of try/catch with iterators
11495         since their behavior was not entirely obvious, but now it is
11496         possible to verify that our behavior is the same as MS .NET 2.0
11497
11498         Fixes 54814
11499
11500 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11501
11502         * iterators.cs: Avoid creating temporaries if there is no work to
11503         do. 
11504
11505         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11506         Enumerations, use TypeManager.EnumToUnderlying and call
11507         recursively. 
11508
11509         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11510         bug #57013
11511
11512         (This.Emit): Use EmitContext.EmitThis to emit our
11513         instance variable.
11514
11515         (This.EmitAssign): Ditto.
11516
11517         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11518         codepaths, we will move all the functionality into
11519         Mono.CSharp.This 
11520
11521         (FieldExpr.EmitAssign): Ditto.
11522
11523         This fixes several hidden bugs that I uncovered while doing a code
11524         review of this today.
11525
11526         * codegen.cs (EmitThis): reworked so the semantics are more clear
11527         and also support value types "this" instances.
11528
11529         * iterators.cs: Changed so that for iterators in value types, we
11530         do not pass the value type as a parameter.  
11531
11532         Initialization of the enumerator helpers is now done in the caller
11533         instead of passing the parameters to the constructors and having
11534         the constructor set the fields.
11535
11536         The fields have now `assembly' visibility instead of private.
11537
11538 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11539
11540         * expression.cs (Argument.Resolve): Check if fields passed as ref
11541         or out are contained in a MarshalByRefObject.
11542
11543         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11544         another compiler type.
11545
11546 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11547
11548         * class.cs (Indexer.Define): use the new name checking method.
11549         Also, return false on an error.
11550         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11551         (is_identifier_[start/part]_character): make static.
11552
11553 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * expression.cs (Binary.ResolveOperator): Do no append strings
11556         twice: since we can be invoked more than once (array evaluation)
11557         on the same concatenation, take care of this here.  Based on a fix
11558         from Ben (bug #56454)
11559
11560 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11561
11562         * codegen.cs: Fix another case where CS1548 must be reported (when 
11563         delay-sign isn't specified and no private is available #56564). Fix
11564         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11565         error when MCS is used on the MS runtime and we need to delay-sign 
11566         (which seems unsupported by AssemblyBuilder - see #56621).
11567
11568 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11569
11570         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11571         (TypeManager.ComputeNamespaces): Faster implementation for
11572         Microsoft runtime.
11573
11574         * compiler.csproj: Updated AssemblyName to mcs.
11575
11576 2004-05-11  Jackson Harper  <jackson@ximian.com>
11577
11578         * Makefile: Preserve MONO_PATH
11579         
11580 2004-05-11  Jackson Harper  <jackson@ximian.com>
11581
11582         * Makefile: Use mono and mcs to build gmcs
11583         
11584 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * codegen.cs: Add patch from Robert Shade
11587         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11588         sync with mcs.
11589
11590 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11591
11592         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11593         incomplete key pairs (#57941).
11594
11595 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11596
11597         * codegen.cs: Fix another case where CS1548 must be reported (when 
11598         delay-sign isn't specified and no private is available #56564). Fix
11599         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11600         error when MCS is used on the MS runtime and we need to delay-sign 
11601         (which seems unsupported by AssemblyBuilder - see #56621).
11602
11603 2004-04-29  Jackson Harper  <jackson@ximian.com>
11604
11605         * Makefile: Set MONO_PATH to use the bootstrap corlib
11606         * driver.cs: Check the GAC for referenced assemblies.
11607                 
11608 2004-04-29  Martin Baulig  <martin@ximian.com>
11609
11610         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11611
11612 2004-04-07  Martin Baulig  <martin@ximian.com>
11613
11614         * expression.cs (Binary.ResolveOperator): Added special case for
11615         Equality/Inequality between a type parameter and a null literal.
11616
11617 2004-04-07  Martin Baulig  <martin@ximian.com>
11618
11619         * convert.cs: Check null literal -> type parameter conversions.
11620
11621 2004-04-07  Martin Baulig  <martin@ximian.com>
11622
11623         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11624         `class' and `struct' constraints.
11625
11626 2004-04-07  Martin Baulig  <martin@ximian.com>
11627
11628         * generic.cs (SpecialConstraint): New public enum.
11629         (Constraints.Resolve): Added support for the `class' and `struct'
11630         constraints.
11631
11632         * cs-parser.jay (type_parameter_constraint): Added support for the
11633         `class' and `struct' constraints.
11634
11635 2004-04-07  Martin Baulig  <martin@ximian.com>
11636
11637         * support.cs (GenericConstraints): Replaced `Types' by
11638         `ClassConstraint' and `InterfaceConstraints'; added
11639         `HasClassConstraint'.   
11640
11641 2004-04-07  Martin Baulig  <martin@ximian.com>
11642
11643         * generic.cs
11644         (Constraints.InterfaceConstraints): New public property.
11645         (Constraints.Types): Make this property public
11646         (TypeParameter): Implement IMemberContainer.
11647         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11648         instead of a TypeBuilder/MethodBuilder; pass the interface
11649         constraints to TypeManager.AddTypeParameter().
11650         (TypeParameter.DefineType): Just take an EmitContext and no
11651         TypeBuilder/MethodBuilder.  Use the new public API.
11652
11653         * typemanager.cs (TypeManager.AddTypeParameter): Added
11654         `TypeExpr[]' argument; add the interfaces to the
11655         `builder_to_ifaces' hash.
11656         (TypeManager.LookupMemberContainer): For
11657         GenericTypeParameterBuilders, get the TypeParameter from the
11658         `builder_to_type_param'.
11659         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11660         the TypeParameter and call FindMembers on it.
11661
11662 2004-04-07  Martin Baulig  <martin@ximian.com>
11663
11664         * class.cs
11665         (MethodCore.GenericMethod): Moved this field here from Method.
11666         (MethodCore.IsDuplicateImplementation): Take the number of type
11667         parameters into account if we're a generic method.
11668
11669         * expression.cs (Invocation.InferTypeArguments): Don't return true
11670         if `arguments' is null; we still need to check whether we actually
11671         don't need to infer anything in this case.
11672         (MemberAccess): Merged the functionality from GenericMemberAccess
11673         into this class.
11674
11675         * generic.cs (GenericMemberAccess): Removed.
11676
11677 2004-04-05  Martin Baulig  <martin@ximian.com>
11678
11679         * decl.cs (MemberCore): For generic classes, interfaces and
11680         structs, `Name' now includes the number of type parameters
11681         ("Stack!1.Node!1").
11682         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11683         encode the number of type arguments in the type name.
11684
11685         * expression.cs (Expression.MemberLookup): Removed the
11686         `num_type_args' argument; we now encode the number of type
11687         arguments in the type name.
11688
11689         * ecore.cs (SimpleName): Encode the number of type arguments in
11690         the type name itself.
11691
11692         * generic.cs (ConstructedType): Likewise.
11693
11694         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11695         `MemberName'; we now include the number of type parameters in the
11696         type name.
11697
11698         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11699         (TypeManager.MemberLookup): Removed the
11700         `num_type_args' argument; we now encode the number of type
11701         arguments in the type name.     
11702
11703 2004-04-03  Martin Baulig  <martin@ximian.com>
11704
11705         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11706         (MemberCore.MemberName): Moved here from MemberBase.
11707         (DeclSpace.SetParameterInfo): Just take the constraints as an
11708         ArrayList; we already have the type parameters in our
11709         `MemberName'; also do the CS0080 reporting here.
11710
11711         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11712         `IDENTIFIER opt_type_parameter_list'; when constructing our
11713         `MemberName', it'll already include our type parameters.
11714         (class_declaration, interface_declaration): Likewise.
11715         (delegate_declaration): Likewise.
11716         (MakeName): Take a MemberName and return a MemberName.
11717         The following two changes are required to avoid shift/reduce conflicts:
11718         (member_name): Don't include a TypeName anymore; ie. this is now
11719         just 'IDENTIFIER opt_type_parameter_list'.
11720         (property_declaration, event_declaration): Use a
11721         `namespace_or_type_name' instead of a `member_name'.            
11722
11723 2004-04-03  Martin Baulig  <martin@ximian.com>
11724
11725         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11726         `MemberName' class.
11727         (TypeName): Formerly known as MemberName.
11728
11729         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11730         instead of a `MemberName'.
11731
11732         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11733         (member_name): New rule; create a MemberName.
11734
11735 2004-04-02  Martin Baulig  <martin@ximian.com>
11736
11737         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11738         (CS0305 and CS0308).
11739
11740 2004-04-02  Martin Baulig  <martin@ximian.com>
11741
11742         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11743         support for nested types.
11744
11745 2004-04-02  Martin Baulig  <martin@ximian.com>
11746
11747         * ecore.cs (IAlias): New public interface.
11748         (TypeExpr, TypeExpression): Implement IAlias.
11749         (TypeAliasExpression): New public class.
11750
11751         * namespace.cs (Namespace): Implement IAlias.
11752         (Namespace.Lookup): Return an IAlias instead on an object.
11753         (Namespace.DefineName): Take an IAlias instead of an object.
11754         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11755         an object.
11756         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11757         Expression.
11758         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11759         object.
11760         (NamespaceEntry.Lookup): Likewise.
11761
11762         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11763         instead of a Type.      
11764
11765         * decl.cs (DeclSpace): Implement IAlias.
11766         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11767
11768         * generic.cs (ConstructedType): Improved error checking.
11769
11770 2004-04-02  Martin Baulig  <martin@ximian.com>
11771
11772         * convert.cs: Added type parameter conversions.
11773
11774         * ecore.cs
11775         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11776         (ClassCast.Emit): If the source type is a type parameter, box it.
11777         If the target type is a type parameter, emit an `unbox.any'
11778         instead of a `classcast'.1      
11779
11780 2004-04-01  Martin Baulig  <martin@ximian.com>
11781
11782         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11783
11784 2004-04-01  Martin Baulig  <martin@ximian.com>
11785
11786         * generic.cs (ConstructedType.CheckConstraints): Use
11787         Convert.ImplicitStandardConversionExists(); user-defined implicit
11788         conversions are not allowed according to the spec.
11789
11790 2004-03-30  Martin Baulig  <martin@ximian.com>
11791
11792         * expression.cs (New): Added support for type parameters.
11793
11794         * typemanager.cs
11795         (TypeManager.activator_type): New public static field.
11796         (TypeManager.activator_create_instance): Likewise.
11797
11798 2004-03-30  Martin Baulig  <martin@ximian.com>
11799
11800         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11801         public method.
11802
11803 2004-03-30  Martin Baulig  <martin@ximian.com>
11804
11805         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11806         the spec here: the argument type must be convertible to the
11807         constraints.
11808
11809 2004-03-30  Martin Baulig  <martin@ximian.com>
11810
11811         * generic.cs
11812         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11813         TypeManager.AddTypeParameter().
11814         (ConstructedType.CheckConstraints): Re-enable this and actually
11815         check whether we have a constructor constraint.
11816
11817         * typemanager.cs
11818         (TypeManager.builder_to_type_param): New static field.
11819         (TypeManager.AddTypeParameter): New static method.
11820         (TypeManager.LookupTypeParameter): New public method.
11821
11822 2004-03-30  Martin Baulig  <martin@ximian.com>
11823
11824         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11825         the new API to actually define the constructor constraint.
11826
11827         * typemanager.cs
11828         (TypeManager.new_constraint_attr_type): New static field.
11829         (TypeManager.InitCoreTypes): Initialize it.
11830
11831 2004-03-30  Martin Baulig  <martin@ximian.com>
11832
11833         * generic.cs (Constraints): Completed error checking, use correct
11834         error numbers.
11835
11836 2004-03-29  Martin Baulig  <martin@ximian.com>
11837
11838         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11839
11840         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11841         public version which takes a `ParameterData pd' instead of an
11842         `ArrayList args'.
11843
11844 2004-03-29  Martin Baulig  <martin@ximian.com>
11845
11846         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11847         not a MethodInfo.       
11848
11849 2004-03-29  Martin Baulig  <martin@ximian.com>
11850
11851         * expression.cs (Argument.ResolveMethodGroup): If we're a
11852         ConstructedType, call GetMemberAccess() on it.  
11853
11854 2004-03-29  Martin Baulig  <martin@ximian.com>
11855
11856         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11857         (MethodCore.CheckGenericOverride): When overriding a generic
11858         method, check whether the constraints match.
11859
11860         * support.cs (GenericConstraints): New public interface.
11861         (ParameterData.GenericConstraints): New public method.
11862
11863         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11864         method parameter and compute our constraints if appropriate.
11865         (Parameter.GenericConstraints): New public property.
11866
11867         * generic.cs (Constraints): Implement GenericConstraints.
11868
11869 2004-03-29  Martin Baulig  <martin@ximian.com>
11870
11871         * decl.cs (MemberCache.FindMemberToOverride): Use
11872         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11873
11874 2004-03-29  Martin Baulig  <martin@ximian.com>
11875
11876         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11877
11878 2004-03-29  Martin Baulig  <martin@ximian.com>
11879
11880         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11881         not allowed on non-generic declarations").
11882
11883 2004-03-29  Martin Baulig  <martin@ximian.com>
11884
11885         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11886         public version of this method.
11887
11888         * class.cs (MethodCore.IsDuplicateImplementation): Use
11889         Invocation.InferTypeArguments() to check this.
11890
11891 2004-03-29  Martin Baulig  <martin@ximian.com>
11892
11893         * convert.cs: Use TypeManager.IsDelegateType() instead of
11894         comparing types correctly.
11895
11896 2004-03-29  Martin Baulig  <martin@ximian.com>
11897
11898         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11899         types directly to make it work for generic instances.
11900
11901         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11902
11903 2004-03-29  Martin Baulig  <martin@ximian.com>
11904
11905         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11906         support for arrays.     
11907
11908 2004-03-24  Martin Baulig  <martin@ximian.com>
11909
11910         * decl.cs (DeclSpace.FindType): Also use
11911         TypeManager.CheckGeneric() for types from the using clauses.
11912
11913 2004-03-23  Martin Baulig  <martin@ximian.com>
11914
11915         * expression.cs (Invocation.OverloadResolve): Added `bool
11916         may_fail' argument and use it instead of the Location.IsNull() hack.
11917
11918 2004-03-23  Martin Baulig  <martin@ximian.com>
11919
11920         * expression.cs (Invocation.InferType): Use correct type inference
11921         rules here.     
11922
11923 2004-03-23  Martin Baulig  <martin@ximian.com>
11924
11925         * ecore.cs (MethodGroupExpr.Name): Use
11926         TypeManager.CSharpSignature() instead of just the name.
11927
11928         * expression.cs (Invocation.OverloadResolve): Provide better error
11929         reporting.
11930         (Invocation.DoResolve): OverloadResolve() never returns null
11931         without reporting an error, so removed the error -6 reporting here.
11932
11933 2004-03-23  Martin Baulig  <martin@ximian.com>
11934
11935         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11936         generic methods.
11937
11938         * cs-parser.jay (delegate_declaration): Support generic delegates.
11939
11940         * delegate.cs: Support generic delegates.
11941
11942 2004-03-22  Martin Baulig  <martin@ximian.com>
11943
11944         * expression.cs (Invocation.InferParamsTypeArguments): New static
11945         method; does type inference for params arguments.
11946
11947 2004-03-21  Martin Baulig  <martin@ximian.com>
11948
11949         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11950         method; checks whether a method is a generic method.    
11951
11952         * expression.cs (Invocation.InferTypeArguments): New static method;
11953         infer type arguments for generic method invocation.
11954
11955         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11956         property; we set this to true if we're resolving a generic method
11957         invocation and the user specified type arguments, ie. we're not
11958         doing type inference.
11959
11960 2004-03-20  Martin Baulig  <martin@ximian.com>
11961
11962         * class.cs (MethodData.DeclaringType): New public property.
11963         (MethodData.Define): Set DeclaringType here.
11964         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11965         instead of OperatorMethodBuilder.DeclaringType.
11966
11967 2004-03-20  Martin Baulig  <martin@ximian.com>
11968
11969         * cs-tokenizer.cs (xtoken): Return a special
11970         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11971
11972         * cs-parser.jay (default_value_expression): Switch to the new
11973         syntax (14.5.13).
11974
11975 2004-03-19  Martin Baulig  <martin@ximian.com>
11976
11977         * decl.cs (MemberName): New class.  We use this to "construct"
11978         namespace_or_type_name's.
11979
11980         * generics.cs (TypeArguments.GetDeclarations): New public method;
11981         returns the type arguments as a string[] and reports a CS0081 if
11982         one of them is not an identifier.
11983
11984         * class.cs (MemberBase): The .ctor now takes the name as a
11985         MemberName instead of a string.
11986         (MemberBase.ExplicitInterfaceName): Changed type from string to
11987         Expression.
11988         (MemberBase.DoDefine): If we're an explicit implementation, the
11989         InterfaceType may be a generic instance.
11990
11991         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11992         (namespace_name): Call MemberName.GetName () to transform the
11993         MemberName into a string and ensure we don't have any type
11994         arguments.
11995         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11996         MemberName into an expression.
11997         (method_header): Use namespace_or_type_name instead of member_name.     
11998
11999 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * rootcontext.cs: Add new types to the boot resolution.
12002
12003         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12004         MulticastDelegate is not allowed.
12005
12006         * typemanager.cs: Add new types to lookup: System.TypedReference
12007         and ArgIterator.
12008
12009         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12010         check for TypedReference or ArgIterator, they are not allowed. 
12011
12012         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12013         makes us properly catch 1510 in some conditions (see bug 56016 for
12014         details). 
12015
12016 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12017
12018         * CryptoConvert.cs: update from corlib version
12019         with endian fixes.
12020
12021 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12022
12023         * class.cs (Indexer.Define): Check indexername declaration
12024
12025 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12026
12027         * attribute.cs (IsClsCompliant): Fixed problem with handling
12028         all three states (compliant, not-compliant, undetected).
12029
12030 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12031
12032         * attribute.cs (Attribute): Location is now public.
12033         (Resolve): Store resolved arguments (pos_values) in attribute class.
12034         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12035         (GetClsCompliantAttributeValue): New method that gets
12036         CLSCompliantAttribute value.
12037         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12038         if exists else null.
12039         (AttributeTester): New class for CLS-Compliant verification routines.
12040
12041         * class.cs (Emit): Add CLS-Compliant verification.
12042         (Method.GetSignatureForError): Implemented.
12043         (Constructor.GetSignatureForError): Implemented
12044         (Constructor.HasCompliantArgs): Returns if constructor has
12045         CLS-Compliant arguments.
12046         (Constructor.Emit): Override.
12047         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12048         is needed to test only parameters.
12049         (FieldBase.GetSignatureForError): Implemented.
12050         (TypeContainer): New member for storing base interfaces.
12051         (TypeContainer.FindMembers): Search in base interfaces too.
12052
12053         * codegen.cs (GetClsComplianceAttribute): New method that gets
12054         assembly or module CLSCompliantAttribute value.
12055         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12056         for assembly.
12057         (ModuleClass.Emit): Add error 3012 test.
12058
12059         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12060
12061         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12062         state for all decl types.
12063         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12064         if CLS-Compliant tests are required.
12065         (IsClsCompliaceRequired): New method. Analyze whether code
12066         must be CLS-Compliant.
12067         (IsExposedFromAssembly): New method. Returns true when MemberCore
12068         is exposed from assembly.
12069         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12070         value or gets cached value.
12071         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12072         is explicitly marked with CLSCompliantAttribute.
12073         (IsIdentifierClsCompliant): New abstract method. This method is
12074         used to testing error 3005.
12075         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12076         for identifier and parameters CLS-Compliant testing.
12077         (VerifyClsCompliance): New method. The main virtual method for
12078         CLS-Compliant verifications.
12079         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12080         null. I don't know why is null (too many public members !).
12081         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12082         and get value of first CLSCompliantAttribute that found.
12083
12084         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12085         (VerifyClsCompliance): Override and add extra tests.
12086
12087         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12088         clscheck- disable CLS-Compliant verification event if assembly is has
12089         CLSCompliantAttribute(true).
12090
12091         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12092         ApllyAttribute is now called in emit section as in the other cases.
12093         Possible future Emit integration.
12094         (IsIdentifierClsCompliant): New override.
12095         (VerifyClsCompliance): New override.
12096         (GetEnumeratorName): Returns full enum name.
12097
12098         * parameter.cs (GetSignatureForError): Implemented.
12099
12100         * report.cs (WarningData): New struct for Warning message information.
12101         (LocationOfPreviousError): New method.
12102         (Warning): New method. Reports warning based on the warning table.
12103         (Error_T): New method. Reports error based on the error table.
12104
12105         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12106         verifications are done here.
12107
12108         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12109
12110         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12111         CLSCompliantAttribute.
12112         (all_imported_types): New member holds all imported types from other
12113         assemblies.
12114         (LoadAllImportedTypes): New method fills static table with exported types
12115         from all referenced assemblies.
12116         (Modules): New property returns all assembly modules.
12117
12118 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12121         throwing a parser error.
12122
12123         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12124         which removes the hardcoded get_/set_ prefixes for properties, as
12125         IL allows for the properties to be named something else.  
12126
12127         Bug #56013
12128
12129         * expression.cs: Do not override operand before we know if it is
12130         non-null.  Fix 56207
12131
12132 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12133
12134         * typemanager.cs: support for pinned variables.
12135
12136 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12137
12138         * decl.cs, typemanager.cs: Avoid using an arraylist
12139         as a buffer if there is only one result set.
12140
12141 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12142
12143         * expression.cs: Make sure you cant call a static method
12144         with an instance expression, bug #56174.
12145
12146 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * class.cs (IsDuplicateImplementation): Improve error reporting to
12149         flag 663 (method only differs in parameter modifier).
12150
12151         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12152         in preprocessor directives.
12153
12154         * location.cs (LookupFile): Allow for the empty path.
12155
12156         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12157         better approach for some of that patch, but its failing with the
12158         CharSet enumeration.  For now try/catch will do.
12159
12160         * typemanager.cs: Do not crash if a struct does not have fields.
12161         Fixes 56150.
12162
12163 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12164
12165         * expression.cs: cs0213, cant fix a fixed expression.
12166         fixes 50231.
12167
12168 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12169
12170         * cs-parser.jay: detect invalid embeded statements gracefully.
12171         bug #51113.
12172
12173 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12174
12175         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12176         As a regex:
12177         s/
12178         the invocation type may not be a subclass of the tye of the item/
12179         The type of the item must be a subclass of the invocation item.
12180         /g
12181
12182         Fixes bug #50820.
12183
12184 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12185
12186         * attribute.cs: Added methods to get a string and a bool from an
12187         attribute. Required to information from AssemblyKeyFileAttribute,
12188         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12189         * codegen.cs: Modified AssemblyName creation to include support for
12190         strongnames. Catch additional exceptions to report them as CS1548.
12191         * compiler.csproj: Updated include CryptoConvert.cs.
12192         * compiler.csproj.user: Removed file - user specific configuration.
12193         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12194         Mono.Security assembly. The original class is maintained and tested in
12195         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12196         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12197         like CSC 8.0 (C# v2) supports.
12198         * Makefile: Added CryptoConvert.cs to mcs sources.
12199         * rootcontext.cs: Added new options for strongnames.
12200
12201 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12202
12203         * driver.cs: For --expect-error, report error code `2'
12204         if the program compiled with no errors, error code `1' if
12205         it compiled with an error other than the one expected.
12206
12207 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12208
12209         * compiler.csproj: Updated for Visual Studio .NET 2003.
12210         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12211         * compiler.sln: Updated for Visual Studio .NET 2003.
12212
12213 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12214
12215         * expression.cs: Fix bug #47234. We basically need to apply the
12216         rule that we prefer the conversion of null to a reference type
12217         when faced with a conversion to 'object' (csc behaviour).
12218
12219 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12220
12221         * statement.cs: Shorter form for foreach, eliminates
12222         a local variable. r=Martin.
12223
12224 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12225
12226         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12227         checks if we can use brtrue/brfalse to test for 0.
12228         * expression.cs: use the above in the test for using brtrue/brfalse.
12229         cleanup code a bit.
12230
12231 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12232
12233         * expression.cs: Rewrite string concat stuff. Benefits:
12234
12235         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12236         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12237         rather than a concat chain.
12238
12239         * typemanager.cs: Add lookups for more concat overloads.
12240
12241 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12242
12243         * expression.cs: Emit shorter il code for array init.
12244
12245         newarr
12246         dup
12247         // set 1
12248
12249         // set 2
12250
12251         newarr
12252         stloc.x
12253
12254         ldloc.x
12255         // set 1
12256
12257         ldloc.x
12258         // set 2
12259
12260 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12261
12262         * statement.cs: Before, two switch blocks would be merged if the
12263         total size of the blocks (end_item - begin_item + 1) was less than
12264         two times the combined sizes of the blocks.
12265
12266         Now, it will only merge if after the merge at least half of the
12267         slots are filled.
12268
12269         fixes 55885.
12270
12271 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12272
12273         * class.cs : csc build fix for GetMethods(). See bug #52503.
12274
12275 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12276
12277         * expression.cs: Make sure fp comparisons work with NaN.
12278         This fixes bug #54303. Mig approved this patch a long
12279         time ago, but we were not able to test b/c the runtime
12280         had a related bug.
12281
12282 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12283
12284         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12285
12286 2004-03-19  Martin Baulig  <martin@ximian.com>
12287
12288         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12289         two overloads may unify for some type parameter substitutions and
12290         report a CS0408 if appropriate.
12291
12292 2004-03-19  Martin Baulig  <martin@ximian.com>
12293
12294         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12295         error here and not in our caller.
12296
12297 2004-03-19  Martin Baulig  <martin@ximian.com>
12298
12299         * interface.cs: Completely killed this file.
12300         (Interface): We're now a TypeContainer and live in class.cs.
12301
12302         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12303         argument; we're now also called for interfaces.
12304         (TypeContainer.DefineMembers): Allow this method being called
12305         multiple times.
12306         (TypeContainer.GetMethods): New public method; formerly known as
12307         Interface.GetMethod().  This is used by PendingImplementation.
12308         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12309         it's now private and non-static.
12310         (Interface): Moved this here; it's now implemented similar to
12311         Class and Struct.
12312         (Method, Property, Event, Indexer): Added `bool is_interface'
12313         argument to their .ctor's.
12314         (MemberBase.IsInterface): New public field.
12315
12316         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12317         instances instead of InterfaceMethod, InterfaceProperty, etc.
12318         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12319         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12320
12321 2004-03-19  Martin Baulig  <martin@ximian.com>
12322
12323         * class.cs (MethodCore.IsDuplicateImplementation): New private
12324         method which does the CS0111 checking.
12325         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12326         Use IsDuplicateImplementation().
12327
12328 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12329
12330         * decl.cs (FindMemberToOverride): New method to find the correct
12331         method or property to override in the base class.
12332         * class.cs
12333             - Make Method/Property use the above method to find the
12334               version in the base class.
12335             - Remove the InheritableMemberSignatureCompare as it is now
12336               dead code.
12337
12338         This patch makes large code bases much faster to compile, as it is
12339         O(n) rather than O(n^2) to do this validation.
12340
12341         Also, it fixes bug 52458 which is that nested classes are not
12342         taken into account when finding the base class member.
12343
12344         Reviewed/Approved by Martin.
12345
12346 2004-03-17  Martin Baulig  <martin@ximian.com>
12347
12348         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12349         of type arguments into account; use the `real_num_type_args'
12350         approach like in DoResolveAsTypeStep().
12351
12352         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12353         nested types.
12354
12355 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12356
12357         * interface.cs: In all interface classes removed redundant
12358         member initialization.
12359
12360 2004-03-16  Martin Baulig  <martin@ximian.com>
12361
12362         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12363
12364 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12365
12366         * decl.cs (DefineTypeAndParents): New helper method to define a
12367         type's containers before the type itself is defined;  This is a
12368         bug exposed by the recent changes to Windows.Forms when an
12369         implemented interface was defined inside a class that had not been
12370         built yet.   
12371
12372         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12373
12374         (Check): Loop correctly to report errors modifiers
12375         (UNSAFE was not in the loop, since it was the same as TOP).
12376
12377         * interface.cs: Every interface member now takes a ModFlags,
12378         instead of a "is_new" bool, which we set on the base MemberCore. 
12379
12380         Every place where we called "UnsafeOk" in the interface, now we
12381         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12382         the unsafe settings from the member declaration instead of the
12383         container interface. 
12384
12385         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12386
12387         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12388         `set_indexer_name' to the pending bits (one per type).
12389
12390         We fixed a bug today that was picking the wrong method to
12391         override, since for properties the existing InterfaceMethod code
12392         basically ignored the method name.  Now we make sure that the
12393         method name is one of the valid indexer names.
12394
12395 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12396  
12397         * support.cs (SeekableStreamReader): Keep track of stream byte
12398         positions and don't mix them with character offsets to the buffer.
12399
12400         Patch from Gustavo Giráldez
12401
12402 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12403
12404         * interface.cs (InterfaceSetGetBase): Removed double member
12405         initialization, base class does it as well.
12406
12407 2004-03-13  Martin Baulig  <martin@ximian.com>
12408
12409         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12410         when compiling corlib.
12411
12412 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12413
12414         * convert.cs (ExplicitConversion): We were reporting an error on
12415         certain conversions (object_type source to a value type, when the
12416         expression was `null') before we had a chance to pass it through
12417         the user defined conversions.
12418
12419         * driver.cs: Replace / and \ in resource specifications to dots.
12420         Fixes 50752
12421
12422         * class.cs: Add check for duplicate operators.  Fixes 52477
12423
12424 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12425
12426         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12427         that are in the middle of the statements, not only at the end.
12428         Fixes #54987
12429
12430         * class.cs (TypeContainer.AddField): No longer set the
12431         `HaveStaticConstructor' flag, now we call it
12432         `UserDefineStaticConstructor' to diferentiate the slightly
12433         semantic difference.
12434
12435         The situation is that we were not adding BeforeFieldInit (from
12436         Modifiers.TypeAttr) to classes that could have it.
12437         BeforeFieldInit should be set to classes that have no static
12438         constructor. 
12439
12440         See:
12441
12442         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12443
12444         And most importantly Zoltan's comment:
12445
12446         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12447
12448         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12449          before its static fields are used', i.e. initialization does not need
12450          to be triggered by the first access to the type. Setting this flag
12451          helps the JIT to compile better code, since it can run the static
12452          constructor at JIT time, and does not need to generate code to call it
12453          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12454          this flag for lots of classes like String. 
12455          
12456          csc sets this flag if the type does not have an explicit static 
12457          constructor. The reasoning seems to be that if there are only static
12458          initalizers for a type, and no static constructor, then the programmer
12459          does not care when this initialization happens, so beforefieldinit
12460          can be used.
12461          
12462          This bug prevents the AOT compiler from being usable, since it 
12463          generates so many calls to mono_runtime_class_init that the AOT code
12464          is much slower than the JITted code. The JITted code is faster, 
12465          because it does not generate these calls if the vtable is type is
12466          already initialized, which is true in the majority of cases. But the
12467          AOT compiler can't do this."
12468
12469 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12470
12471         * class.cs (MethodData.Emit): Refactor the code so symbolic
12472         information is generated for destructors;  For some reasons we
12473         were taking a code path that did not generate symbolic information
12474         before. 
12475
12476 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12477
12478         * class.cs: Create a Constructor.CheckBase method that
12479         takes care of all validation type code. The method
12480         contains some code that was moved from Define.
12481
12482         It also includes new code that checks for duplicate ctors.
12483         This fixes bug #55148.
12484
12485 2004-03-09  Joshua Tauberer <tauberer@for.net>
12486
12487         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12488         a { ... }-style array creation invokes EmitStaticInitializers
12489         which is not good for reference-type arrays.  String, decimal
12490         and now null constants (NullCast) are not counted toward
12491         static initializers.
12492
12493 2004-03-05  Martin Baulig  <martin@ximian.com>
12494
12495         * location.cs (SourceFile.HasLineDirective): New public field;
12496         specifies whether the file contains or is referenced by a "#line"
12497         directive.
12498         (Location.DefineSymbolDocuments): Ignore source files which
12499         either contain or are referenced by a "#line" directive.        
12500
12501 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12502
12503         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12504         direct access to our parent, so check the method inline there.
12505
12506 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12507
12508         * expression.cs (Invocation.EmitCall): Miguel's last commit
12509         caused a regression. If you had:
12510
12511             T t = null;
12512             t.Foo ();
12513
12514         In Foo the implict this would be null.
12515
12516 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12517
12518         * expression.cs (Invocation.EmitCall): If the method is not
12519         virtual, do not emit a CallVirt to it, use Call.
12520
12521         * typemanager.cs (GetFullNameSignature): Improve the method to
12522         cope with ".ctor" and replace it with the type name.
12523
12524         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12525         as an argument the ConstructorBuilder where it is being defined,
12526         to catch the recursive constructor invocations.
12527
12528 2004-03-16  Martin Baulig  <martin@ximian.com>
12529
12530         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12531         ConstructedType, call ResolveType() on it to get the type rather
12532         than just using `expr.Type'.
12533
12534 2004-03-16  Martin Baulig  <martin@ximian.com>
12535
12536         * generics.cs (ConstructedType.GetMemberAccess): Take the
12537         EmitContext instead on the TypeExpr and use
12538         ec.TypeContainer.CurrentType/ec.ContainerType.
12539
12540 2004-03-16  Martin Baulig  <martin@ximian.com>
12541
12542         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12543         parameters before aliases.
12544
12545 2004-03-16  Martin Baulig  <martin@ximian.com>
12546
12547         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12548         New oublic function; checks whether two generic instances may become
12549         equal under some instantiations (26.3.1).
12550
12551         * class.cs (TypeContainer.Define): Call
12552         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12553         error.
12554
12555 2004-03-16  Martin Baulig  <martin@ximian.com>
12556
12557         * class.cs (TypeContainer.GetClassBases): Moved
12558         Error_TypeParameterAsBase() here and also check whether the base
12559         class is not an attribute.
12560
12561 2004-03-16  Martin Baulig  <martin@ximian.com>
12562
12563         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12564
12565 2004-03-16  Martin Baulig  <martin@ximian.com>
12566
12567         * class.cs (Error_TypeParameterAsBase): Use correct error number
12568         here (CS0689).  
12569
12570 2004-03-16  Martin Baulig  <martin@ximian.com>
12571
12572         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12573         for generics.
12574
12575         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12576         error reporting.
12577
12578 2004-03-15  Martin Baulig  <martin@ximian.com>
12579
12580         * typemanager.cs (TypeManager.GetFullName): New public method.
12581         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12582         argument; only return members with the correct number of type
12583         arguments.
12584         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12585         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12586         whether the number of type arguments matches.
12587
12588         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12589         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12590
12591         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12592         field; it's set by the protected .ctor when we're actually a
12593         GenericMemberAccess.
12594         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12595         arguments and pass it to MemberLookupFinal ().
12596
12597         * ecore.cs (Expression.MemberLookup): Added `int
12598         num_type_arguments' argument; only return members with the correct
12599         number of type arguments.
12600         (Expression.MemberLookupFailed): Check whether the MemberLookup
12601         failed because we did not have the correct number of type
12602         arguments; report CS0305 in this case.
12603
12604         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12605         `e.ResolveAsTypeTerminal()' already did so.
12606
12607 2004-03-15  Martin Baulig  <martin@ximian.com>
12608
12609         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12610         we're a ConstructedType; in this case, the caller must report an
12611         error (for instance CS0131).
12612
12613         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12614         (TypeArguments.Resolve): Actually report errors here.
12615
12616 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12617
12618         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12619         `set_indexer_name' to the pending bits (one per type).
12620
12621         We fixed a bug today that was picking the wrong method to
12622         override, since for properties the existing InterfaceMethod code
12623         basically ignored the method name.  Now we make sure that the
12624         method name is one of the valid indexer names.
12625
12626 2004-03-15  Martin Baulig  <martin@ximian.com>
12627
12628         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12629         for generic instances.
12630
12631 2004-03-13  Martin Baulig  <martin@ximian.com>
12632
12633         * class.cs (TypeContainer.DefineType): Call
12634         TypeManager.AddUserType() immediately after creating the
12635         TypeBuilder; pass all type parameters when creating the
12636         CurrentType.
12637
12638         * decl.cs (DeclSpace.FindNestedType): New public method.
12639         (DeclSpace.FindType): Added `int num_type_args' argument; only
12640         return types with the correct number of type parameters.
12641         (DeclSpace.CountTypeParams): New public property.
12642
12643         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12644         the number of type parameters; defaults to zero.
12645
12646         * generic.cs (TypeArguments.Count): New public property.
12647         (ConstructedType.DoResolveAsTypeStep): First call
12648         ds.FindNestedType() to find out whether we're nested in the
12649         current generic type; in this case, we inherit all type parameters
12650         from the current class.
12651
12652         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12653         num_type_args' argument.
12654         (RootContext.LookupType): Added overloaded version which takes the
12655         number of type arguments; only return types with the correct
12656         number of type arguments.
12657
12658         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12659         checks whether `Type t' has `int num_type_args'.
12660
12661 2004-03-13  Martin Baulig  <martin@ximian.com>
12662
12663         * generic.cs (GenericMethod.DefineType): New method; calls
12664         DefineType() on all the type parameters.
12665
12666         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12667         (MethodData.Define): If we're a generic method, call
12668         GenericMethod.DefineType() to define the type parameters.       
12669
12670 2004-03-10  Martin Baulig  <martin@ximian.com>
12671
12672         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12673         instead of IsAssignableFrom.    
12674
12675 2004-03-10  Martin Baulig  <martin@ximian.com>
12676
12677         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12678
12679         * support.cs (ParameterData.HasArrayParameter): New property.
12680         (ReflectionParameters.ctor): Take a MethodBase instead of a
12681         ParameterInfo[].  If we have any type parameters, get the generic
12682         method definition and ask it whether we have variable arguments.
12683
12684 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12685
12686         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12687         routines to check if a type is an enumerable/enumerator allow
12688         classes that implement the IEnumerable or IEnumerator interfaces.
12689
12690         * class.cs (Property, Operator): Implement IIteratorContainer, and
12691         implement SetYields.
12692
12693         (Property.Define): Do the block swapping for get_methods in the
12694         context of iterators.   We need to check if Properties also
12695         include indexers or not.
12696
12697         (Operator): Assign the Block before invoking the
12698         OperatorMethod.Define, so we can trigger the Iterator code
12699         replacement. 
12700
12701         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12702         Property and Operator classes are not created when we parse the
12703         declarator but until we have the block completed, so we use a
12704         singleton SimpleIteratorContainer.Simple to flag whether the
12705         SetYields has been invoked.
12706
12707         We propagate this setting then to the Property or the Operator to
12708         allow the `yield' to function.
12709
12710 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12711
12712         * codegen.cs: Implemented attribute support for modules.
12713         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12714         Assembly/Module functionality.
12715
12716         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12717         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12718         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12719
12720 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12721
12722         * interface.cs (FindMembers): The operation is performed on all base
12723         interfaces and not only on the first. It is required for future CLS Compliance patch.
12724
12725 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12726
12727         * statement.cs, codegen.cs:
12728         This patch deals with patterns such as:
12729
12730         public class List : IEnumerable {
12731
12732                 public MyEnumerator GetEnumerator () {
12733                         return new MyEnumerator(this);
12734                 }
12735
12736                 IEnumerator IEnumerable.GetEnumerator () {
12737                         ...
12738                 }
12739                 
12740                 public struct MyEnumerator : IEnumerator {
12741                         ...
12742                 }
12743         }
12744
12745         Before, there were a few things we did wrong:
12746         1) we would emit callvirt on a struct, which is illegal
12747         2) we emited ldarg when we needed to emit ldarga
12748         3) we would mistakenly call the interface methods on an enumerator
12749         type that derived from IEnumerator and was in another assembly. For example:
12750
12751         public class MyEnumerator : IEnumerator
12752
12753         Would have the interface methods called, even if there were public impls of the
12754         method. In a struct, this lead to invalid IL code.
12755
12756 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12757
12758         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12759           renamed to Emit.
12760
12761         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12762
12763 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12764
12765         * cs-parser.jay: Fix small regression: we were not testing V2
12766         compiler features correctly.
12767
12768         * interface.cs: If the emit context is null, then create one
12769
12770 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12771
12772         * decl.cs (GetSignatureForError): New virtual method to get full name
12773           for error messages.
12774
12775         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12776           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12777
12778         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12779           Duplicated members and code in these classes has been removed.
12780           Better encapsulation in these classes.
12781
12782 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12783
12784         * assign.cs (Assign.DoResolve): When dealing with compound
12785         assignments, there is a new rule in ECMA C# 2.4 (might have been
12786         there before, but it is documented here) that states that in:
12787
12788         a op= b;
12789
12790         If b is of type int, and the `op' is a shift-operator, then the
12791         above is evaluated as:
12792
12793         a = (int) a op b 
12794
12795         * expression.cs (Binary.ResolveOperator): Instead of testing for
12796         int/uint/long/ulong, try to implicitly convert to any of those
12797         types and use that in pointer arithmetic.
12798
12799         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12800         method to print information for from the type, not from the
12801         null-method we were given.
12802
12803 2004-02-01  Duncan Mak  <duncan@ximian.com>
12804
12805         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12806         parsing for cmd, fixes bug #53694.
12807
12808 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12809
12810         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12811         in the member name duplication tests. Property and operator name duplication
12812         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12813
12814 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12815
12816         * interface.cs (PopulateMethod): Fixed crash when interface method
12817         returns not existing type (error test cs0246-3.cs).
12818
12819 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12820
12821         * cs-parser.jay (interface_accessors): Re-write actions to also
12822         store attributes attached to get and set methods. Fix spelling
12823         while at it.
12824
12825         (inteface_property_declaration): Modify accordingly.
12826
12827         (InterfaceAccessorInfo): New helper class to store information to pass
12828         around between rules that use interface_accessors.
12829
12830         * interface.cs (Emit): Apply attributes on the get and set
12831         accessors of properties and indexers too.
12832
12833         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12834         right MethodBuilder when applying attributes to the get and set accessors.
12835
12836 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12837
12838         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12839
12840 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12843
12844 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12845
12846         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12847         changes that treat `yield' specially when present before `break'
12848         or `return' tokens.
12849
12850         * cs-tokenizer.cs: yield is no longer a keyword.
12851
12852 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12853
12854         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12855         setting for default constructors.
12856         For default constructors are almost every time set wrong Modifier. The
12857         generated IL code has been alright. But inside mcs this values was
12858         wrong and this was reason why several of my CLS Compliance tests
12859         failed.
12860
12861 2004-02-27  Martin Baulig  <martin@ximian.com>
12862
12863         * generics.cs (ConstructedType.ResolveType): Make the nested type
12864         stuff actually work.
12865
12866 2004-02-25  Martin Baulig  <martin@ximian.com>
12867
12868         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12869         property; returns the type parameters just from the current type,
12870         ie. with the ones from outer classes.
12871         (DeclSpace.LookupGeneric): First search in the current class, then
12872         in outer classes.
12873         (DeclSpace.initialize_type_params): When hiding a type parameter
12874         from an outer class, put it into the `type_param_list' anyways.
12875
12876         * expression.cs (MemberAccess.expr): Made this field protected.
12877
12878         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12879         the type parameters from the current class.
12880
12881         * generic.cs (ConstructedType.ResolveType): Support nested generic
12882         types by taking the type parameters which we inherit from outer
12883         classes into account.
12884         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12885         support for nested generic types.
12886
12887 2004-02-23  Martin Baulig  <martin@ximian.com>
12888
12889         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12890         field and check whether we're nested inside a generic type.
12891         (DeclSpace.ResolveType): If we're resolving to a generic type
12892         definition, create a ConstructedType and return its resolved type.
12893         (DeclSpace.initialize_type_params): New private method;
12894         initializes the `type_param_list' field from the type parameters
12895         from this and all enclosing classes.
12896         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12897         we're already initialized.
12898
12899 2004-02-23  Martin Baulig  <martin@ximian.com>
12900
12901         * class.cs (Method.Define): Create the generic method before
12902         calling DoDefine().
12903         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12904         the TypeContainer one); we use this for generic methods.
12905
12906         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12907         parent's TypeBuilder.
12908
12909 2004-02-18  Martin Baulig  <martin@ximian.com>
12910
12911         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12912         to check for equality.
12913
12914 2004-02-05  Martin Baulig  <martin@ximian.com>
12915
12916         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12917         `ec.TypeContainer.CurrentType', use it instead of
12918         `ec.ContainerType' to check whether we're in the type's ctor.
12919
12920 2004-01-29  Martin Baulig  <martin@ximian.com>
12921
12922         * expression.cs (Invocation.DoResolve): If we're a
12923         `ConstructedType', then we're actually a generic method, so
12924         rewrite the expr as a GenericMemberAccess.
12925
12926         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12927         here; manually parse it into a string.
12928
12929 2004-01-28  Martin Baulig  <martin@ximian.com>
12930
12931         * typemanager.cs (TypeManager.IsEqual): New static method.
12932         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12933         check for equality instead of using `=='.
12934
12935 2004-01-26  Martin Baulig  <martin@ximian.com>
12936
12937         * decl.cs (DeclSpace.CurrentType): New public field.
12938
12939         * expression.cs (This.ResolveBase): If we have an
12940         `ec.TypeContainer.CurrentType', use it instead of
12941         `ec.ContainerType'.
12942
12943         * class.cs (TypeContainer.DefineType): If we're a generic type,
12944         create the `CurrentType' (unresolved).
12945         (TypeContainer.GenericType): New private field.
12946         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12947         it and store it in `GenericType' before creating the MemberCache.
12948         (TypeContainer.GetMembers): If we have a `GenericType', call
12949         TypeManager.FindMembers() on it.
12950
12951         * interface.cs (Interface.GenericType): New private field.
12952         (Interface.DefineType): If we're a generic type, create the
12953         `CurrentType' (unresolved).
12954         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12955         and store it in `GenericType' before creating the MemberCache.
12956         (Interface.GetMembers): If we have a `GenericType', call
12957         TypeManager.FindMembers() on it.
12958
12959 2004-01-22  Martin Baulig  <martin@ximian.com>
12960
12961         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12962         not a QualifiedIdentifier.  This is what `type_name_expression'
12963         was previously doing.
12964         (type_name_expression): Removed; the code is now in
12965         `namespace_or_type_name'.
12966         (qualified_identifier): Removed, use `namespace_or_type_name'
12967         instead.
12968         (QualifiedIdentifier): Removed this class.      
12969
12970 2004-01-22  Martin Baulig  <martin@ximian.com>
12971
12972         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12973         not a string as alias name.
12974
12975 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12976
12977         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12978         #52730 bug, and instead compute correctly the need to use a
12979         temporary variable when requesting an address based on the
12980         static/instace modified of the field and the constructor.
12981  
12982 2004-01-21  Martin Baulig  <martin@ximian.com>
12983
12984         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12985         class and namespace before looking up aliases.  Fixes #52517.
12986
12987 2004-01-21  Martin Baulig  <martin@ximian.com>
12988
12989         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12990         assinged in a 'try'; fixes exception4.cs.
12991
12992 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12993         * class.cs : Implemented parameter-less constructor for TypeContainer
12994
12995         * decl.cs: Attributes are now stored here. New property OptAttributes
12996
12997         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12998
12999         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13000
13001 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13002
13003         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13004           (CSharpSignature): New method for indexer and property signature.
13005
13006 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13007
13008         * pending.cs (IsVirtualFilter): Faster implementation.
13009
13010 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13011
13012         * typemanager.cs: Avoid inclusion of same assembly more than once.
13013
13014 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13015
13016         * cs-parser.jay: Fixed problem where the last assembly attribute
13017           has been applied also to following declaration (class, struct, etc.)
13018           
13019 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13020
13021         * class.cs: Added error CS0538, CS0539 reporting.
13022         Fixed crash on Microsoft runtime when field type is void.
13023
13024         * cs-parser.jay: Added error CS0537 reporting.
13025
13026         * pending.cs: Added error CS0535 reporting.
13027         Improved error report for errors CS0536, CS0534.
13028
13029 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13030
13031         Merge a few bits from the Anonymous Method MCS tree.
13032
13033         * statement.cs (ToplevelBlock): New class for toplevel methods,
13034         will hold anonymous methods, lifted variables.
13035
13036         * cs-parser.jay: Create toplevel blocks for delegates and for
13037         regular blocks of code. 
13038
13039 2004-01-20  Martin Baulig  <martin@ximian.com>
13040
13041         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13042         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13043         and `NeedExplicitReturn'; added `IsLastStatement'.
13044         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13045         have a `ReturnLabel' or we're not unreachable.
13046
13047         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13048         child's reachability; don't just override ours with it.  Fixes
13049         #58058 (lluis's example).
13050         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13051         InFinally(), InLoop(), InSwitch() and
13052         BreakCrossesTryCatchBoundary() methods.
13053
13054         * statement.cs (Return): Do all error checking in Resolve().
13055         Unless we are the last statement in a top-level block, always
13056         create a return label and jump to it.
13057         (Break, Continue): Do all error checking in Resolve(); also make
13058         sure we aren't leaving a `finally'.
13059         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13060         statement in a top-level block.
13061         (Block.Flags): Added `IsDestructor'.
13062         (Block.IsDestructor): New public property.
13063
13064 2004-01-20  Martin Baulig  <martin@ximian.com>
13065
13066         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13067
13068 2004-01-20  Martin Baulig  <martin@ximian.com>
13069
13070         * statement.cs (Statement.ResolveUnreachable): New public method.
13071         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13072         (Block.Resolve): Resolve unreachable statements.
13073
13074 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13075
13076         * expression.cs: We need to fix the case where we do
13077         not have a temp variable here.
13078
13079         * assign.cs: Only expression compound assignments need
13080         temporary variables.
13081
13082 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13083
13084         * flowanalysis.cs: Reduce memory allocation in a few ways:
13085           - A block with no variables should not allocate a bit
13086             vector for itself.
13087           - A method with no out parameters does not need any tracking
13088             for assignment of the parameters, so we need not allocate
13089             any data for it.
13090           - The arrays:
13091                 public readonly Type[] VariableTypes;
13092                 public readonly string[] VariableNames;
13093             Are redundant. The data is already stored in the variable
13094             map, so we need not allocate another array for it.
13095           - We need to add alot of checks for if (params | locals) == null
13096             due to the first two changes.
13097
13098 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13101         implement IMemoryLocation, we store a copy on a local variable and
13102         take the address of it.  Patch from Benjamin Jemlich
13103
13104         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13105         to use a special "type_name_expression" rule which reduces the
13106         number of "QualifiedIdentifier" classes created, and instead
13107         directly creates MemberAccess expressions.
13108
13109 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13112         that fixes #52853.  Null literal assignment to ValueType
13113
13114         * class.cs (MethodData.Emit): Instead of checking the name of the
13115         method to determine if its a destructor, create a new derived
13116         class from Method called Destructor, and test for that.  
13117
13118         * cs-parser.jay: Create a Destructor object instead of a Method.  
13119
13120         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13121
13122         Fixes: 52933
13123
13124 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13125
13126         * expression.cs (Binary.ResolveOperator): Perform an implicit
13127         conversion from MethodGroups to their delegate types on the
13128         Addition operation.
13129
13130         * delegate.cs: Introduce a new class DelegateCreation that is the
13131         base class for `NewDelegate' and `ImplicitDelegateCreation',
13132         factor some code in here.
13133
13134         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13135         conversion from MethodGroups to compatible delegate types. 
13136
13137         * ecore.cs (Expression.Resolve): Do not flag error 654
13138         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13139         we allow conversions from MethodGroups to delegate types now.
13140
13141         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13142         assignments in v2 either.
13143
13144 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13145
13146         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13147         static read-only fields in ctors.
13148
13149         Applied patch from Benjamin Jemlich 
13150
13151         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13152
13153 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13154
13155         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13156         here to return true, as they can be used like this:
13157
13158                 (XXX) int.MEMBER ()
13159
13160         Fixed 49836 and all the other dups
13161
13162 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13163
13164         * driver.cs: Implement /win32res and /win32icon.
13165
13166 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13167
13168         * cs-parser.jay: Add a rule to improve error handling for the
13169         common mistake of placing modifiers after the type.
13170
13171 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13172
13173         * cs-parser.jay (interface_event_declaration): Catch
13174         initialization of events on interfaces, and report cs0068
13175
13176         * cs-parser.jay (interface_event_declaration): Catch
13177         initialization of events. 
13178
13179         * ecore.cs: Better report missing constructors.
13180
13181         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13182         the error reporting done in the wrong place.  Fix.
13183
13184         * expression.cs (Binary.ResolveOperator): Catch the 
13185         operator + (E x, E y) error earlier, and later allow for implicit
13186         conversions in operator +/- (E e, U x) from U to the underlying
13187         type of E.
13188
13189         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13190         52596, if the container class is abstract, the default constructor
13191         is protected otherwise its public (before, we were always public).
13192
13193         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13194         fixed statement.
13195
13196         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13197         Jemlich that fixes bug #52597, MCS was generating invalid code for
13198         idisposable structs.   Thanks to Ben for following up with this
13199         bug as well.
13200
13201 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13202
13203         * driver.cs: Allow assemblies without code to be generated, fixes
13204         52230.
13205
13206 2004-01-07  Nick Drochak <ndrochak@gol.com>
13207
13208         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13209
13210 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13211
13212         * cs-parser.jay: Add rules to improve error reporting if fields or
13213         methods are declared at the namespace level (error 116)
13214
13215         * Add rules to catch event add/remove
13216
13217 2004-01-04  David Sheldon <dave-mono@earth.li>
13218
13219   * expression.cs: Added matching ")" to error message for 
13220   CS0077
13221
13222 2004-01-03 Todd Berman <tberman@gentoo.org>
13223
13224         * ecore.cs, attribute.cs:
13225         Applying fix from #52429.
13226
13227 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13228
13229         * ecore.cs, expression.cs, statement.cs:
13230         Total rewrite of how we handle branching. We
13231         now handle complex boolean expressions with fewer
13232         jumps. As well if (x == 0) no longer emits a ceq.
13233
13234         if (x is Foo) is much faster now, because we generate
13235         better code.
13236
13237         Overall, we get a pretty big improvement on our benchmark
13238         tests. The code we generate is smaller and more readable.
13239
13240         I did a full two-stage bootstrap. The patch was reviewed
13241         by Martin and Miguel.
13242
13243 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13244
13245         * cs-parser.jay: Make primary_expression not take a QI.
13246         we dont need this because the member_access rule covers
13247         us here. So we replace the rule with just IDENTIFIER.
13248
13249         This has two good effects. First, we remove a s/r conflict.
13250         Second, we allocate many fewer QualifiedIdentifier objects.
13251
13252 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13253
13254         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13255         set the correct information via SRE. This prevents
13256         hanging on the MS runtime. Fixes #29374.
13257
13258 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13259
13260         * convert.cs: correctly handle conversions to value types
13261         from Enum and ValueType as unboxing conversions.
13262
13263         Fixes bug #52569. Patch by Benjamin Jemlich.
13264
13265 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13266
13267         * expression.cs (BetterConversion): Prefer int -> uint
13268         over int -> ulong (csc's behaviour). This fixed bug #52046.
13269
13270 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13271
13272         * decl.cs (MemberCache.FindMembers): now returns a
13273         MemberInfo [].
13274
13275         * typemanager.cs: In general, go with with ^^.
13276         (CopyNewMethods): take an IList.
13277         (RealMemberLookup): Only allocate an arraylist
13278         if we copy from two sets of methods.
13279
13280         This change basically does two things:
13281         1) Fewer array lists allocated due to CopyNewMethods.
13282         2) the explicit cast in MemberList costed ALOT.
13283
13284 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13285
13286         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13287         a hashtable to avoid needless string allocations when an identifier is
13288         used more than once (the common case).
13289
13290 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13291
13292         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13293         is broken, it will not return anything. So, we
13294         have to use the information we have in mcs to
13295         do the task.
13296
13297         * typemanager.cs: Add a cache for GetInterfaces,
13298         since this will now be used more often (due to ^^)
13299
13300         (GetExplicitInterfaces) New method that gets the
13301         declared, not effective, interfaces on a type
13302         builder (eg, if you have interface IFoo, interface
13303         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13304         { IBar }.
13305
13306         This patch makes MCS able to bootstrap itself on
13307         Windows again.
13308
13309 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13310
13311         * expression.cs: Remove the Nop's that Miguel put
13312         in by mistake.
13313
13314 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13315
13316         * report.cs, codegen.cs: Give the real stack trace to
13317         the error when an exception is thrown.
13318
13319 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13320
13321         * decl.cs: only allocate hashtables for ifaces if 
13322         it is an iface!
13323
13324 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13325
13326         * expression.cs: fix the error from cs0121-2.cs
13327         (a parent interface has two child interfaces that
13328         have a function with the same name and 0 params
13329         and the function is called through the parent).
13330
13331 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13332
13333         * class.cs, rootcontext.cs, typmanager.cs: do not
13334         leak pointers.
13335
13336 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13337
13338         * codegen.cs: remove stack for the ec flow branching.
13339         It is already a linked list, so no need.
13340
13341 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13342
13343         * Makefile: Allow custom profiler here.
13344
13345 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13346
13347         * typemanager.cs (LookupType):
13348           - Use a static char [], because split takes
13349             a param array for args, so it was allocating
13350             every time.
13351           - Do not store true in a hashtable, it boxes.
13352
13353 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13354
13355         * flowanalysis.cs: bytify common enums.
13356
13357 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13358
13359         * modifiers.cs: Add a new set of flags for the
13360         flags allowed on explicit interface impls.
13361         * cs-parser.jay: catch the use of modifiers in
13362         interfaces correctly.
13363         * class.cs: catch private void IFoo.Blah ().
13364
13365         All related to bug #50572.
13366
13367 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13368
13369         * decl.cs: Rewrite the consistant accessability checking.
13370         Accessability is not linear, it must be implemented in
13371         a tableish way. Fixes #49704.
13372
13373 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13374
13375         * expression.cs: Handle negation in a checked context.
13376         We must use subtraction from zero. Fixes #38674.
13377
13378 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13379
13380         * class.cs: Ignore static void main in DLLs.
13381         * rootcontext.cs: Handle the target type here,
13382         since we are have to access it from class.cs
13383         * driver.cs: account for the above.
13384
13385 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13386
13387         * report.cs: Give line numbers and files if available.
13388
13389 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13390
13391         * driver.cs: Implement /addmodule.
13392
13393         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13394         ModuleBuilders.
13395
13396 2003-12-20  Martin Baulig  <martin@ximian.com>
13397
13398         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13399         (FieldBase.IsAssigned): Removed this field.
13400         (FieldBase.SetAssigned): New public method.
13401         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13402
13403 2003-12-20  Martin Baulig  <martin@ximian.com>
13404
13405         * expression.cs (LocalVariableReference.DoResolve): Don't set
13406         `vi.Used' if we're called from DoResolveLValue().
13407
13408         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13409         returns the usage vector it just merged into the current one -
13410         pass this one to UsageWarning().
13411         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13412         of the `EmitContext', don't call this recursively on our children.
13413
13414 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13415
13416         * driver.cs: Implement /target:module.
13417
13418 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13419
13420         * support.cs (CharArrayHashtable): New helper class.
13421
13422         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13423         char arrays, not strings, so we can avoid creating a string in
13424         consume_identifier if the identifier is a keyword.
13425
13426 2003-12-16  Martin Baulig  <martin@ximian.com>
13427
13428         * statement.cs (LocalInfo.Assigned): Removed this property.
13429         (LocalInfo.Flags): Removed `Assigned'.
13430         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13431         and uses flow analysis.
13432         (Block.UsageWarning): Made this method private.
13433         (Block.Resolve): Call UsageWarning() if appropriate.
13434
13435         * expression.cs (LocalVariableReference.DoResolve): Always set
13436         LocalInfo.Used here.
13437
13438 2003-12-13  Martin Baulig  <martin@ximian.com>
13439
13440         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13441         any value here; we're now using flow analysis to figure out
13442         whether a statement/block returns a value.
13443
13444 2003-12-13  Martin Baulig  <martin@ximian.com>
13445
13446         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13447         working again.
13448         (FlowBranching.MergeFinally): Don't call
13449         `branching.CheckOutParameters()' here, this is called in
13450         MergeTopBlock().
13451         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13452         when adding the `finally' vector.       
13453
13454 2003-12-13  Martin Baulig  <martin@ximian.com>
13455
13456         * flowanalysis.cs
13457         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13458         actually work and also fix #48962.
13459
13460 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13461
13462         * decl.cs: Do not check System.Object for nested types,
13463         since we know it does not have any. Big bang for buck:
13464
13465         BEFORE:
13466            Run 1:   8.35 seconds
13467            Run 2:   8.32 seconds
13468            corlib:  17.99 seconds
13469         AFTER:
13470            Run 1:   8.17 seconds
13471            Run 2:   8.17 seconds
13472            corlib:  17.39 seconds
13473
13474 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13475
13476         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13477         time we are returning 0 members, so we save alot here.
13478
13479 2003-12-11  Martin Baulig  <martin@ximian.com>
13480
13481         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13482         `MergeChild()', also just take the `FlowBranching' as argument;
13483         call Merge() on it and return the result.
13484         (FlowBranching.Merge): We don't need to do anything if we just
13485         have one sibling.
13486
13487 2003-12-11  Martin Baulig  <martin@ximian.com>
13488
13489         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13490         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13491         Maurer for this idea.
13492
13493 2003-12-11  Martin Baulig  <martin@ximian.com>
13494
13495         * flowanalysis.cs (MergeResult): This class is now gone; we now
13496         use the `UsageVector' for this.  The reason for this is that if a
13497         branching just has one sibling, we don't need to "merge" them at
13498         all - that's the next step to do.
13499         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13500         `MergeResult'.
13501
13502 2003-12-11  Martin Baulig  <martin@ximian.com>
13503
13504         Reworked flow analyis and made it more precise and bug-free.  The
13505         most important change is that we're now using a special `Reachability'
13506         class instead of having "magic" meanings of `FlowReturns'.  I'll
13507         do some more cleanups and optimizations and also add some more
13508         documentation this week.
13509
13510         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13511         largely reworked this class.
13512         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13513         the new `Reachability' class instead of having "magic" values here.
13514         (FlowBranching): We're now using an instance of `Reachability'
13515         instead of having separate `Returns', `Breaks' etc. fields.
13516
13517         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13518         based on flow analysis; ignore the return value of block.Emit ().
13519
13520 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13521
13522         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13523         if they are private.
13524
13525 2003-12-09  Martin Baulig  <martin@ximian.com>
13526
13527         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13528         call them directly on the UsageVector.
13529
13530 2003-12-09  Martin Baulig  <martin@ximian.com>
13531
13532         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13533         Changed return type from `FlowReturns' to `Reachability'.
13534
13535 2003-12-09  Martin Baulig  <martin@ximian.com>
13536
13537         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13538         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13539         `Reachable' fields with a single `Reachability' one.
13540
13541 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13542
13543         * class.cs (FindMembers): Remove foreach's.
13544
13545         Bootstrap times:
13546
13547         BEFORE
13548                 Run 1:   8.74 seconds
13549                 Run 2:   8.71 seconds
13550
13551         AFTER
13552                 Run 1:   8.64 seconds
13553                 Run 2:   8.58 seconds
13554
13555
13556 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13557
13558         * cs-parser.jay:
13559         * gen-treedump.cs:
13560         * statement.cs:
13561         This patch does a few things:
13562                 1. EmptyStatement is now a singleton, so it is never reallocated.
13563                 2. All blah is EmptyStatement constructs have been changed to
13564                    blah == EmptyStatement.Value, which is much faster and valid
13565                    now that EmptyStatement is a singleton.
13566                 3. When resolving a block, rather than allocating a new array for
13567                    the non-empty statements, empty statements are replaced with
13568                    EmptyStatement.Value
13569                 4. Some recursive functions have been made non-recursive.
13570         Mainly the performance impact is from (3), however (1) and (2) are needed for
13571         this to work. (4) does not make a big difference in normal situations, however
13572         it makes the profile look saner.
13573
13574         Bootstrap times:
13575
13576         BEFORE
13577         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13578         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13579         Total memory allocated: 56397 KB
13580
13581         AFTER
13582         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13583         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13584         Total memory allocated: 55666 KB
13585
13586 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13587
13588         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13589         than the hashtable in a hashtable version
13590
13591         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13592         we always end up concating a string. This results in a huge perf
13593         loss, because many strings have to be tracked by the GC. In this
13594         patch, we first use a hashtable that works with two keys, so that
13595         the strings do not need to be concat'ed.
13596
13597         Bootstrap times:
13598         BEFORE
13599                 Run 1:   8.74 seconds
13600                 Run 2:   8.71 seconds
13601
13602         AFTER
13603                 Run 1:   8.65 seconds
13604                 Run 2:   8.56 seconds
13605
13606 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13607
13608         * Makefile: Add a new target `do-time' that does a quick and simple
13609         profile, leaving easy to parse output.
13610
13611 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13612
13613         * codegen.cs (Init): Create the dynamic assembly with 
13614         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13615
13616 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13617
13618         * support.cs: Make the PtrHashtable use only one
13619         instance of its comparer.
13620
13621 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13622
13623         * typemanager.cs: Fix lookup of GetNamespaces.
13624
13625 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * expression.cs: Removed redundant line.
13628
13629         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13630         ArrayLists, use for loops with bounds.  
13631
13632         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13633         arraylist.
13634
13635         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13636         arraylists, use for loop with bounds.
13637
13638         The above three changes give us a 0.071 second performance
13639         improvement out of 3.294 seconds down to 3.223.  On my machine
13640         the above changes reduced the memory usage by 1,387 KB during
13641         compiler bootstrap.
13642
13643         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13644         QualifiedIdentifiers.  Before we created a new string through
13645         concatenation, and mostly later on, the result would be
13646         manipulated by DecomposeQI through string manipulation.
13647
13648         This reduced the compiler memory usage for bootstrapping from
13649         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13650         compile times in 0.05 seconds.
13651
13652 2003-11-28  Dick Porter  <dick@ximian.com>
13653
13654         * support.cs: Do string compares with the Invariant culture.
13655
13656         * rootcontext.cs: 
13657         * gen-treedump.cs: 
13658         * expression.cs: 
13659         * driver.cs: 
13660         * decl.cs: 
13661         * codegen.cs: 
13662         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13663         the comparison is done with the Invariant culture.
13664
13665 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13668         GetEnumerator method.
13669
13670         (ProbeCollectionType): Iterate starting at the most specific type
13671         upwards looking for a GetEnumerator
13672
13673         * expression.cs: Shift count can be up to 31 for int/uint and 63
13674         for long/ulong.
13675
13676 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * statement.cs (Block.LookupLabel): Also look for the label on the
13679         children blocks.  Use a hash table to keep track of visited
13680         nodes. 
13681
13682         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13683         we actually did transform the other operand, otherwise fall back
13684         to the common codepath that casts to long.
13685
13686         * cs-tokenizer.cs: Use the same code pattern as the int case.
13687         Maybe I should do the parsing myself, and avoid depending on the
13688         Parse routines to get this done.
13689
13690 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13691
13692         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13693         which fixes bug 51347.  This time test it.
13694
13695         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13696         attributes for example can not tell the difference between these.
13697         The difference was only a syntax feature of the language. 
13698
13699         * attribute.cs: Apply attributes to delegates.
13700
13701         * delegate.cs: Call the apply attributes method.
13702
13703 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13704
13705         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13706         comparing 0 vs Byte.MinValue, not the value
13707
13708         (ImplicitConversionRequired): When reporting a conversion error,
13709         use error 31 to print out the constant error instead of the
13710         simpler 29.
13711
13712         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13713         which fixes bug 51347.
13714
13715 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13716
13717         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13718         which fixes the -warnaserror command line option.
13719
13720 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13721
13722         * cfold.cs (DoNumericPromotions): During constant folding of
13723         additions on UIntConstant, special case intconstants with
13724         IntConstants like we do on the expression binary operator. 
13725
13726 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * convert.cs (ImplicitReferenceConversion): We were missing a case
13729         (System.Enum are not value types or class types, so we need to
13730         classify them separatedly).
13731
13732         * driver.cs: We do not support error 2007.
13733
13734 2003-11-12 Jackson Harper <jackson@ximian.com>
13735
13736         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13737         system directory. Also use the full file name so users can
13738         libraries names mscorlib-o-tron.dll in a non system dir.
13739         
13740 2004-01-04  David Sheldon <dave-mono@earth.li>
13741
13742         * expression.cs: Added matching ")" to error message for CS0077.
13743
13744 2003-12-19  Martin Baulig  <martin@ximian.com>
13745
13746         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13747         static method; see documentation in the method.
13748         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13749
13750         * convert.cs (Convert.ImplicitReferenceConversion,
13751         Convert.ImplicitReferenceConversionExists): Add support for
13752         generic type declarations; see gen-36.cs.
13753
13754 2003-12-19  Martin Baulig  <martin@ximian.com>
13755
13756         * pending.cs (Pending.InterfaceMethod): Use
13757         `Type.IsAssignableFrom()' instead of `=='.
13758
13759 2003-12-18  Martin Baulig  <martin@ximian.com>
13760
13761         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13762         byref types first.
13763
13764         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13765         `expr_type.Equals (target_type)' instead of `=='.
13766
13767 2003-12-08  Martin Baulig  <martin@ximian.com>
13768
13769         * generics.cs (Constraints.Types): Removed.
13770         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13771         to Type's.
13772         (Constraints.ResolveTypes): New public method; resolves the
13773         TypeExpr's to Type's.
13774         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13775         longer takes the constraints.
13776         (TypeParameter.DefineMethod): Likewise.
13777         (TypeParameter.DefineType): New public method.  Calls
13778         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13779         the constraints.
13780
13781 2003-12-08  Martin Baulig  <martin@ximian.com>
13782
13783         * convert.cs (Convert.ImplicitConversionStandard): Use
13784         `expr_type.Equals (target_type)' instead of `=='.
13785
13786 2003-12-08  Martin Baulig  <martin@ximian.com>
13787
13788         * typemanager.cs (TypeManager.GetReferenceType): Call
13789         `Type.MakeByRefType ()'.
13790
13791 2003-12-08  Martin Baulig  <martin@ximian.com>
13792
13793         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13794         just has some special meaning in some situations.  For instance,
13795         it is allowed to use `where' as the name of a variable etc.
13796
13797 2003-12-04  Martin Baulig  <martin@ximian.com>
13798
13799         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13800         `Type.MakeArrayType()' for array types.
13801
13802 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13803
13804         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13805         debugging message.
13806
13807         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13808         corlib to compile.
13809
13810 2003-11-16  Martin Baulig  <martin@ximian.com>
13811
13812         * codegen.cs (EmitContext.IsGeneric): Removed.
13813
13814         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13815         ResolveGeneric() on the DeclSpace.
13816
13817 2003-11-16  Martin Baulig  <martin@ximian.com>
13818
13819         * generic.cs (TypeArguments.Resolve):
13820         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13821         `ResolveType()' on it to get the Type.
13822
13823 2003-11-15  Martin Baulig  <martin@ximian.com>
13824
13825         * generic.cs (ConstructedType.GetInterfaces): Override this.
13826
13827 2003-11-14  Martin Baulig  <martin@ximian.com>
13828
13829         * interface.cs (Interface.DefineType): Define all type parameters
13830         before adding the interfaces we inherit.
13831
13832 2003-11-11  Martin Baulig  <martin@ximian.com>
13833
13834         * generic.cs (ConstructedType.ResolveType): Always call
13835         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13836
13837 2003-11-10  Martin Baulig  <martin@ximian.com>
13838
13839         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13840         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13841         calling `ResolveType()' on them, directly assign their `Type'.
13842
13843 2003-11-08  Martin Baulig  <martin@ximian.com>
13844
13845         * generic.cs (ConstructedType): Override `IsClass' etc.
13846
13847 2003-11-08  Martin Baulig  <martin@ximian.com>
13848
13849         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13850         return value and the `out parent' parameter.
13851         (TypeContainer.DefineType): Moved the CS0644 check into
13852         GetClassBases().  Don't pass the interface types to the
13853         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13854         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13855
13856         * ecore.cs (TypeExpr.IsAttribute): New property.
13857         (TypeExpr.GetInterfaces): New method.
13858
13859         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13860         TypeExpr instead of a Type.
13861         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13862         (Interface.DefineType): Don't pass the interface types to the
13863         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13864         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13865
13866         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13867         instead of a `Type[]'.
13868         (TypeManager.RegisterBuilder): Likewise.
13869         (TypeManager.AddUserInterface): Likewise.
13870         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13871         `Type[]' and also return a `TypeExpr[]'.
13872         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13873
13874 2003-11-08  Martin Baulig  <martin@ximian.com>
13875
13876         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13877         Expression.     
13878
13879 2003-11-08  Martin Baulig  <martin@ximian.com>
13880
13881         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13882         TypeManager.ResolveExpressionTypes().
13883
13884         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13885         instead of an Expression.
13886         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13887         (TypeExpression): New public class; formerly known as `TypeExpr'.
13888
13889         * expression.cs (ComposedCast): Derive from TypeExpr.
13890
13891         * typemanager.cs (TypeManager.system_*_expr): These are now
13892         TypExpr's instead of Expression's.
13893         (TypeManager.ResolveExpressionTypes): New public static function;
13894         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13895         of them.        
13896
13897 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13898
13899         * expression.cs (New.DoResolve): Do not dereference value that
13900         might be a null return.
13901
13902         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13903         sure that the constant value has the right type.  Fixes an
13904         unreported bug, similar to 50425.
13905
13906         * const.cs (Const.LookupConstantValue): Call
13907         ImplicitStandardConversionExists before doing a conversion to
13908         avoid havng the TypeManager.ChangeType do conversions.
13909
13910         Reduced the number of casts used
13911
13912         (Const.ChangeType): New routine to enable reuse of the constant
13913         type changing code from statement.
13914
13915         * typemanager.cs (ChangeType): Move common initialization to
13916         static global variables.
13917
13918         Fixes #50425.
13919
13920         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13921         every value type to go through, even if it was void.  Fix that. 
13922
13923         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13924         character of the define, and the is_identifier_part_character for
13925         the rest of the string.
13926
13927 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13928
13929         * expression.cs (UnaryMutator.EmitCode): When I updated
13930         LocalVariableReference.DoResolve, I overdid it, and dropped an
13931         optimization done on local variable references.
13932
13933 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * ecore.cs: Convert the return from Ldlen into an int.
13936
13937 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13938
13939         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13940         the accessibility, this is a special case for toplevel non-public
13941         classes (internal for instance).
13942
13943 2003-10-20  Nick Drochak <ndrochak@gol.com>
13944
13945         * ecore.cs: Fix typo and build.  Needed another right paren.
13946
13947 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13950         `internal' case regular and protected, but not allowing protected
13951         to be evaluated later.  Bug 49840
13952
13953 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13956         to kb.Nlast, and not the kb.nFirst to isolate the switch
13957         statement.
13958
13959         Extract the underlying type, so enumerations of long/ulong are
13960         treated like long/ulong.
13961
13962 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13963
13964         * expression.cs (New): Overload the meaning of RequestedType to
13965         track the possible creation of the NewDelegate type, since
13966         DoResolve is invoked more than once for new constructors on field
13967         initialization.
13968
13969         See bugs: #48800 and #37014
13970
13971         * cs-parser.jay (declare_local_constants): Take an arraylist
13972         instead of a single constant.
13973
13974         (local_constant_declaration): It should take a
13975         constant_declarators, not a constant_declarator.  Fixes 49487
13976
13977         * convert.cs: Fix error report.
13978
13979 2003-10-13 Jackson Harper <jackson@ximian.com>
13980
13981         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13982         bug #49611
13983         
13984 2003-11-03  Martin Baulig  <martin@ximian.com>
13985
13986         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13987         `out bool has_type_arg'; if set, we need to pass the type to
13988         ig.Emit().
13989         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13990         Stelem_Any/Ldelem_Any for generic parameters.   
13991
13992 2003-11-02  Martin Baulig  <martin@ximian.com>
13993
13994         * expression.cs (Invocation.EmitCall): Use
13995         `TypeManager.IsValueType()' to check whether it's a value type.
13996         Don't set `struct_call' when calling a method on a type parameter.
13997
13998 2003-11-02  Martin Baulig  <martin@ximian.com>
13999
14000         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14001         and removed the TypeBuilder argument.
14002
14003         * typemanager.cs (TypeManager.IsValueType): Return
14004         `t.IsGenericParameter || t.IsValueType'.
14005
14006 2003-10-25  Martin Baulig  <martin@ximian.com>
14007
14008         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14009         call ConstructedType.Resolve() on it.
14010
14011         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14012
14013 2003-10-25  Martin Baulig  <martin@ximian.com>
14014
14015         * class.cs (TypeContainer.GetClassBases): Changed
14016         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14017         CS8214 reporting here.
14018         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14019         instead of a `Type' for our parent.  In case of a recursive
14020         declaration (see tests/gen-23.cs for an example), our parent is a
14021         ConstructedType and it doesn't have its type set.  So, first
14022         create our own TypeBuilder, then call constructed.Resolve() to get
14023         the parent's type and finally TypeBuilder.SetParent() it.
14024
14025         * ecore.cs (TypeExpr.Name): New public virtual property.
14026
14027         * generic.cs
14028         (ConstructedType): We're now a TypeExpr and not just an Expression.
14029         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14030         arguments here; this is done later.
14031         (ConstructedType.Resolve): New public method to resolve the type
14032         arguments and bind them.
14033
14034 2003-10-21  Martin Baulig  <martin@ximian.com>
14035
14036         * convert.cs: Use `TypeManager.IsValueType' instead of
14037         'type.IsValueType' everywhere.
14038
14039         * typemanager.cs (TypeManager.IsValueType): Return true for type
14040         parameters.  The reason for this is that we need to box a type
14041         parameter when converting it to a reference type.
14042
14043         * cs-parser.jay: Added support for default value expressions.
14044
14045         * generics.cs (DefaultValueExpression): New public class.       
14046
14047 2003-10-17  Martin Baulig  <martin@ximian.com>
14048
14049         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14050         TypeContainer so we can also use this for Interfaces.
14051         (TypeParameter.Resolve): Likewise.
14052
14053         * interface.cs (Interface.DefineType): Added support for generic
14054         interfaces.
14055
14056         * cs-parser.jay: Added support for generic structs and interfaces.
14057
14058 2003-10-17  Martin Baulig  <martin@ximian.com>
14059
14060         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14061         call generic methods :-)
14062
14063 2003-10-16  Martin Baulig  <martin@ximian.com>
14064
14065         * cs-parser.jay (namespace_or_type_name): Only create a
14066         GenericMemberAccess if we actually have type arguments.
14067
14068 2003-10-13  Martin Baulig  <martin@ximian.com>
14069
14070         * class.cs (Method.Define): If we're a generic method, call
14071         TypeBuilder.DefineGenericMethod () before resolving
14072         the parameters.
14073         (MethodData): Added .ctor which takes an additional MethodBuilder
14074         argument; this is used for generic methods.
14075         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14076         we already have a MethodBuilder.
14077
14078 2003-10-10  Martin Baulig  <martin@ximian.com>
14079
14080         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14081         instead of a `DeclSpace'.  This is used for generic methods.
14082
14083         * cs-parser.jay (method_header): Added support for generic
14084         methods; create a `GenericMethod' instance and pass it to the
14085         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14086         parameters and locals.
14087
14088         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14089         since we already have the location.  Check whether we're a generic
14090         type declaration or a generic method and create the correct type
14091         parameter.
14092
14093         * generic.cs (TypeParameter.DefineMethod): New public method.
14094         (GenericMethod): New public class; derives from DeclSpace and is
14095         used for generic methods.       
14096
14097 2003-10-09  Martin Baulig  <martin@ximian.com>
14098
14099         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14100         to the .ctor.
14101         (MethodCore.DoDefineParameters): Removed the TypeContainer
14102         argument; use the DeclSpace which was passed to the .ctor instead.
14103         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14104         TypeContainer; we only need a DeclSpace here.
14105
14106 2003-10-09  Martin Baulig  <martin@ximian.com>
14107
14108         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14109         to the .ctor.
14110         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14111         EmitContext's .ctor.    
14112
14113 2003-10-09  Martin Baulig  <martin@ximian.com>
14114
14115         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14116         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14117         AsAccessible(), moved them as well.
14118
14119         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14120
14121 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14124         generation for >=, as spotted by Paolo, bug 48679.  
14125         Patch from David Waite.
14126
14127         * cs-tokenizer.cs: Add handling for #pragma.
14128
14129         * cs-parser.jay: Allow for both yield and yield return in the
14130         syntax.  The anti-cobolization of C# fight will go on!
14131
14132         * class.cs (TypeBuilder.DefineType): Catch error condition here
14133         (Parent.DefineType erroring out and returning null).
14134
14135         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14136         coping with enumerations variables, we were mistakenly processing
14137         them as a regular value type instead of built-in types.  Fixes the
14138         bug #48063
14139
14140         * typemanager.cs (IsBuiltinOrEnum): New method.
14141
14142 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14143
14144         * cs-parser.jay: Upgrade: yield now needs the return clause.
14145
14146 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14147
14148         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14149
14150 2003-09-29  Martin Baulig  <martin@ximian.com>
14151
14152         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14153         inflated generic methods.
14154
14155         * generics.cs (ConstructedType): Distinguish between open and
14156         closed constructed types; correctly resolve the arguments.
14157
14158 2003-09-22  Martin Baulig  <martin@ximian.com>
14159
14160         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14161         all type arguments meet their constraints.
14162
14163 2003-09-19  Martin Baulig  <martin@ximian.com>
14164
14165         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14166         `MemberCache parent' argument.  Normally, an interface doesn't
14167         have a parent type except System.Object, but we use this in gmcs
14168         for generic type parameters.
14169
14170 2003-09-18  Martin Baulig  <martin@ximian.com>
14171
14172         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14173         on `type.IsInterface'; don't check whether the type has a parent
14174         to determine whether it's an interface.
14175
14176 2003-09-17  Martin Baulig  <martin@ximian.com>
14177
14178         * generic.cs (ConstructedType.ToString): Always use `name' as the
14179         type name.
14180
14181 2003-09-15  Martin Baulig  <martin@ximian.com>
14182
14183         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14184
14185         * generic.cs (Constraints.Resolve): New public method; this is
14186         called to resolve the constraint types and to check whether all
14187         the constraints are correct.
14188         (Constraints.Types): New public property.
14189         (TypeParameter.Resolve): New public method; resolves all the
14190         type's constraints.
14191
14192         * class.cs (TypeContainer.DefineType): Call
14193         TypeParameter.Resolve() before actually defining the type.
14194
14195 2003-09-15  Martin Baulig  <martin@ximian.com>
14196
14197         * class.cs (TypeContainer.DefineType): Added an error flag to
14198         avoid reporting duplicate CS0146's ("class definition is
14199         circular.").
14200
14201         * driver.cs (Driver.MainDriver): Abort if
14202         RootContext.ResolveTree() reported any errors.
14203
14204 2003-09-07  Martin Baulig  <martin@ximian.com>
14205
14206         * report.cs (Error, Warning): Added overloaded versions which take
14207         a `params object[] args' and call String.Format().
14208
14209 2003-09-07  Martin Baulig  <martin@ximian.com>
14210
14211         * decl.cs (DeclSpace..ctor): Don't call
14212         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14213         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14214         (DeclSpace.RecordDecl): New method.
14215
14216         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14217
14218 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14219
14220         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14221         value attributes to be applied to ParameterBuilders.
14222
14223         * class.cs (MethodCore.LabelParameters): Make static and more
14224         generic so that it can be used from other places - like interface
14225         methods, for instance.
14226
14227         * interface.cs (Interface.Emit): Call LabelParameters before
14228         emitting attributes on the InterfaceMethod.
14229
14230 2003-09-07  Martin Baulig  <martin@ximian.com>
14231
14232         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14233         if the number of type parameters doesn't match.
14234
14235 2003-09-04  Martin Baulig  <martin@ximian.com>
14236
14237         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14238         for arrays of generic type params (ie. `!0[]').
14239
14240 2003-09-04  Martin Baulig  <martin@ximian.com>
14241
14242         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14243         for the moment.
14244
14245 2003-09-04  Martin Baulig  <martin@ximian.com>
14246
14247         * decl.cs (DeclSpace.LookupGeneric): New method.
14248         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14249         moment.
14250
14251         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14252         argument, not just a string.
14253         (TypeParameter.Define): New public method; this is called to
14254         actually define the generic parameter; after this, you can use the
14255         new `Type' property to get the type.
14256
14257 2003-09-04  Martin Baulig  <martin@ximian.com>
14258
14259         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14260         is now an ArrayList; initialize the result of the `TypeParameters'
14261         property here.
14262         (DeclSpace.GetGenericData): Removed.
14263         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14264         implement this in a different way.
14265         (DeclSpace.GetTypeParameters): Removed; there's now a
14266         `TypeParameters' property.
14267         (DeclSpace.TypeParameters): New public property.
14268
14269         * generic.cs (Constraints): Make this class public.
14270         (TypeParameter): New public class.
14271
14272 2003-09-04  Martin Baulig  <martin@ximian.com>
14273
14274         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14275         generic parameters.
14276
14277         * class.cs (TypeContainer.DefineType): Call
14278         TypeBuilder.DefineGenericParameter () on all generic parameters if
14279         this is a generic type.
14280
14281 2003-08-28  Martin Baulig  <martin@ximian.com>
14282
14283         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14284         sample-stack.il".
14285
14286         * sample-hello.cs: Compile this with gmcs: "gmcs
14287         /r:sample-stack.dll sample-hello.cs".
14288
14289 2003-08-28  Martin Baulig  <martin@ximian.com>
14290
14291         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14292         the parameters to the generic type.
14293
14294 2003-08-28  Martin Baulig  <martin@ximian.com>
14295
14296         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14297
14298 2003-08-28  Martin Baulig  <martin@ximian.com>
14299
14300         * cs-parser.jay (opt_type_argument_list): Use
14301         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14302         (primary_expression): Replace `qualified_identifier' with `type_name'.
14303         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14304
14305         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14306         parser to check whether it is syntactically a type parameter list;
14307         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14308         this case.
14309
14310 2003-08-26  Martin Baulig  <martin@ximian.com>
14311
14312         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14313         resolving aliases; fixes #47927.
14314
14315 2003-08-26  Martin Baulig  <martin@ximian.com>
14316
14317         * statement.cs (Using.DoResolve): This is internally emitting a
14318         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14319         do not always return.  Fixes #47681.
14320
14321 2003-08-26  Martin Baulig  <martin@ximian.com>
14322
14323         * decl.cs (MemberCore): Moved WarningNotHiding(),
14324         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14325         into MemberBase.
14326         (AdditionResult): Make this nested in DeclSpace.
14327         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14328         argument; call NamespaceEntry.Define() unless we're nested in a
14329         class or struct.
14330
14331         * namespace.cs (Namespace.DefineName): New public function.  This
14332         is called from DeclSpace's .ctor to add 
14333         (Namespace.Lookup): Include DeclSpaces in the lookup.
14334
14335         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14336
14337         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14338
14339 2003-08-25  Martin Baulig  <martin@ximian.com>
14340
14341         * convert.cs (Convert.ExplicitReferenceConversion): When
14342         converting from an interface type to a class, unbox if the target
14343         type is a struct type.  Fixes #47822.
14344
14345 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14346
14347         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14348         #47854.
14349
14350 2003-08-22  Martin Baulig  <martin@ximian.com>
14351
14352         * class.cs (TypeManager.DefineType): When defining a nested type,
14353         call DefineType() on our parent; fixes #47801.
14354
14355 2003-08-22  Martin Baulig  <martin@ximian.com>
14356
14357         * class.cs (MethodData.Define): While checking if a method is an
14358         interface implementation, improve the test a bit more to fix #47654.
14359
14360 2003-08-22  Martin Baulig  <martin@ximian.com>
14361
14362         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14363         correctly; fixes #47722.
14364
14365 2003-08-22  Martin Baulig  <martin@ximian.com>
14366
14367         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14368         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14369
14370         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14371
14372 2003-08-22  Martin Baulig  <martin@ximian.com>
14373
14374         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14375         can only be assigned in static constructors.  Fixes #47161.
14376
14377 2003-08-22  Martin Baulig  <martin@ximian.com>
14378
14379         Rewrote and improved the flow analysis code.
14380
14381         * flowbranching.cs (FlowBranching): Make this class abstract.
14382         (FlowBranching.CreateBranching): New static function to create a
14383         new flow branching.
14384         (FlowBranchingBlock, FlowBranchingException): New classes.
14385         (FlowBranching.UsageVector.Type): New public readonly field.
14386         (FlowBranching.UsageVector.Breaks): Removed the setter.
14387         (FlowBranching.UsageVector.Returns): Removed the setter.
14388         (FlowBranching.UsageVector): Added Break(), Return(),
14389         NeverReachable() and Throw() methods to modify the reachability.
14390         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14391         done by FlowBranching.Merge().
14392         (FlowBranching.UsageVector.MergeChild): New method; merges the
14393         merge result into the current vector.
14394         (FlowBranching.Merge): New abstract method to merge a branching.
14395
14396 2003-08-12  Martin Baulig  <martin@ximian.com>
14397
14398         * expression.cs (Indirection.CacheTemporaries): Create the
14399         LocalTemporary with the pointer type, not its element type.
14400
14401 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14404         token was a keyword or not.
14405
14406         Add `error' options where an IDENTIFIER was expected;  Provide
14407         CheckToken and CheckIdentifierToken convenience error reporting
14408         functions. 
14409
14410         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14411
14412         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14413         NameSpaceEntry NameSpaceEntry.
14414
14415         (LookupInterfaceOrClass): Avoid creating a full qualified name
14416         from namespace and name: avoid doing lookups when we know the
14417         namespace is non-existant.   Use new Tree.LookupByNamespace which
14418         looks up DeclSpaces based on their namespace, name pair.
14419
14420         * driver.cs: Provide a new `parser verbose' to display the
14421         exception thrown during parsing.  This is turned off by default
14422         now, so the output of a failure from mcs is more graceful.
14423
14424         * namespace.cs: Track all the namespaces defined in a hashtable
14425         for quick lookup.
14426
14427         (IsNamespace): New method
14428
14429 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14430
14431         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14432         we know that we need to concatenate (full typename can never be
14433         null). 
14434
14435         * class.cs: ditto.
14436
14437         * statement.cs: Use a bitfield;  Do not initialize to null things
14438         which are done by the constructor by default.
14439
14440         * cs-parser.jay: bug fix, parameter was 4, not 3.
14441
14442         * expression.cs: Just use the property;
14443
14444         * statement.cs: No need for GetVariableInfo method.
14445
14446 2003-08-08  Martin Baulig  <martin@ximian.com>
14447
14448         * flowanalysis.cs (FlowReturns): This is now nested in the
14449         `FlowBranching' class.
14450         (MyBitVector): Moved this here from statement.cs.
14451         (FlowBranching.SiblingType): New enum type.
14452         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14453
14454 2003-08-07  Martin Baulig  <martin@ximian.com>
14455
14456         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14457         `FlowBranching' class and called `BranchingType'.
14458
14459 2003-08-07  Martin Baulig  <martin@ximian.com>
14460
14461         * flowanalysis.cs: Moved all the control flow analysis code into
14462         its own file.
14463
14464 2003-08-07  Martin Baulig  <martin@ximian.com>
14465
14466         * assign.cs (Assign.DoResolve): `target' must either be an
14467         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14468         #37319.
14469
14470 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14471
14472         * expression.cs (BinaryMethod): This kind of expression is created by the
14473         Binary class if it determines that the operator has to be handled
14474         by a method.
14475
14476         (BinaryDelegate): This kind of expression is created if we are
14477         dealing with a + or - operator on delegates.
14478
14479         (Binary): remove method, argumetns, and DelegateOperator: when
14480         dealing with methods, 
14481
14482         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14483
14484         * statement.cs (Block): use bitfields for the three extra booleans
14485         we had in use.   Remove unused topblock parameter.
14486
14487         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14488
14489         * assign.cs: Drop extra unneeded tests.
14490
14491 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14492
14493         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14494
14495         * statement.cs (Foreach): Use VariableStorage instead of
14496         LocalBuilders.   
14497
14498         * codegen.cs (VariableStorage): New class used by clients that
14499         require a variable stored: locals or fields for variables that
14500         need to live across yield.
14501
14502         Maybe provide a convenience api for EmitThis+EmitLoad?
14503
14504         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14505         these bad boys.
14506
14507 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14510         RemapParameterLValue): New methods that are used to turn a
14511         precomputed FieldInfo into an expression like this:
14512
14513                 instance.FieldInfo
14514
14515         The idea is to use this instead of making LocalVariableReference
14516         have more than one meaning.
14517
14518         * cs-parser.jay: Add error production to BASE.
14519
14520         * ecore.cs: Deal with TypeManager.GetField returning null, which
14521         is now a valid return value.
14522
14523         (FieldExprNoAddress): New expression for Fields whose address can
14524         not be taken.
14525
14526         * expression.cs (LocalVariableReference): During the resolve
14527         phases, create new expressions if we are in a remapping context.
14528         Remove code that dealt with remapping here.
14529
14530         (ParameterReference): same.
14531
14532         (ProxyInstance): New expression, like the `This' expression, but
14533         it is born fully resolved.  We know what we are doing, so remove
14534         the errors that are targeted to user-provided uses of `this'.
14535
14536         * statement.cs (Foreach): our variable is now stored as an
14537         Expression;  During resolution, follow the protocol, dont just
14538         assume it will return this.
14539
14540 2003-08-06  Martin Baulig  <martin@ximian.com>
14541
14542         * support.cs (SeekableStreamReader.cs): New public class.
14543
14544         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14545         SeekableStreamReader instead of the normal StreamReader.
14546
14547 2003-08-04  Martin Baulig  <martin@ximian.com>
14548
14549         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14550         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14551         deambiguate casts and delegate invocations.
14552         (parenthesized_expression): Use the new tokens to ensure this is
14553         not a cast of method invocation.
14554
14555         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14556         when reading a `)' and Deambiguate_CloseParens () was previously
14557         called.
14558
14559         * expression.cs (ParenthesizedExpression): New class.  This is
14560         just used for the CS0075 test.
14561         (Binary.DoResolve): Check for CS0075.   
14562
14563 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14564
14565         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14566         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14567         reference comparison.
14568
14569         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14570         examine the ReturnType for equality - this is necessary in the
14571         cases of implicit and explicit operators whose signature also
14572         includes the return type.
14573
14574 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14575
14576         * namespace.cs: Cache the result of the namespace computation,
14577         instead of computing it every time.
14578
14579 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14580
14581         * decl.cs: Use a global arraylist that we reuse over invocations
14582         to avoid excesive memory consumption.  Reduces memory usage on an
14583         mcs compile by one meg (45 average).
14584
14585         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14586         private, work around that.
14587
14588 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14589
14590         * literal.cs (IntLiteral): Define Zero and One static literals. 
14591
14592         * cs-parser.jay (integer_literal): use static literals to reduce
14593         memory usage for the most used literals (0, 1 and -1).  211kb
14594         reduced in memory usage.
14595
14596         Replace all calls to `new ArrayList' with `new
14597         ArrayList(4)' which is a good average number for most allocations,
14598         and also requires only 16 bytes of memory for its buffer by
14599         default. 
14600
14601         This reduced MCS memory usage in seven megabytes for the RSS after
14602         bootstrapping.
14603
14604 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14605
14606         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14607         handle params methods the correct way by forming only one
14608         applicable set with params and normal methods in them. Earlier we
14609         were looking at params methods only if we found no normal methods
14610         which was not the correct thing to do.
14611
14612         (Invocation.BetterFunction): Take separate arguments indicating
14613         when candidate and the best method are params methods in their
14614         expanded form.
14615
14616         This fixes bugs #43367 and #46199.
14617
14618         * attribute.cs: Documentation updates.
14619
14620         (CheckAttribute): Rename to CheckAttributeTarget.
14621         (GetValidPlaces): Rename to GetValidTargets.
14622
14623         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14624         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14625
14626         Fixes bug #44468.
14627
14628 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14629
14630         * codegen.cs: Compute IsGeneric correctly.
14631
14632         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14633         resolution. 
14634
14635         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14636         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14637         regressions, and I was chasing more bugs than I required.
14638
14639         * interface.cs: Use expressions for base type names (like classes
14640         and structs have been doing for a while now), and resolve that.
14641         This patch should probably go into head as well.
14642
14643         This makes it one less user of FindType.
14644
14645 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14646
14647         This compiler can not self host currently.  Need to fix that.
14648         
14649         * Makefile: compile to `gmcs.exe'
14650
14651         * driver.cs: Turn on v2 by default on gmcs.
14652
14653         * generic.cs (ConstructedType): Does no longer take a container
14654         type argument;  That will be taken care of later.
14655
14656         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14657         Use SimpleName to resolve for now, so we can continue the work on
14658         the parser, until we get Type.GetType that understands generics.
14659
14660         (ConstructedType.ToString): Implement
14661
14662         (TypeArguments.Resolve): Resolve the child expressions as types. 
14663         
14664         * cs-parser.jay: Rename interface_constraints to
14665         type_parameter_constraints
14666
14667         (namespace_or_type_name): Only use constructed types for the basic
14668         construction, we will deal with identifier<...> later.
14669
14670         (type/type_name): No longer call DecomposeQI, as
14671         namespace_or_type_name is always decoded now.
14672         
14673 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14674
14675         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14676         closely: we eliminate methods in base types when we have an
14677         applicable method in a top-level type.
14678
14679         Please see section 14.5.5.1 for an exact description of what goes
14680         on. 
14681
14682         This fixes bug #45127 and a host of other related to corlib compilation.
14683
14684         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14685         array is the method corresponding to the top-level type (this is
14686         because of the changes made to icall.c) so we change this
14687         accordingly.
14688
14689         (MethodGroupExpr.Name): This too.
14690
14691         * typemanager.cs (GetElementType): New method which does the right
14692         thing when compiling corlib. 
14693
14694         * everywhere: Make use of the above in the relevant places.
14695
14696 2003-07-22  Martin Baulig  <martin@ximian.com>
14697
14698         * cs-parser.jay (invocation_expression): Moved
14699         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14700         `cast_expression', but create a InvocationOrCast which later
14701         resolves to either an Invocation or a Cast.
14702
14703         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14704         method; call this before EmitStatement() to make sure that this
14705         expression can be used as a statement.
14706
14707         * expression.cs (InvocationOrCast): New class; resolves to either
14708         an Invocation or a Cast.
14709
14710         * statement.cs (StatementExpression): Call ResolveStatement() on
14711         the ExpressionStatement before emitting it.
14712
14713 2003-07-21  Martin Baulig  <martin@ximian.com>
14714
14715         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14716         `ref' and `out' attributes match; fixes #46220.
14717         (MemberAccess.ResolveMemberAccess): You can't reference a type
14718         through an expression; fixes #33180.
14719         (Indexers.GetIndexersForType): Don't return the indexers from
14720         interfaces the class implements; fixes #46502.
14721
14722 2003-07-21  Martin Baulig  <martin@ximian.com>
14723
14724         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14725         CS0661 checks; fixes bug #30442.
14726
14727 2003-07-21  Martin Baulig  <martin@ximian.com>
14728
14729         * decl.cs (AdditionResult): Added `Error'.
14730
14731         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14732
14733         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14734         cs0031.cs actually work.
14735
14736  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14737  
14738         * cs-parser.jay (namespace_name): do not use
14739         namespace_or_type_name, use qualified_identifier, because
14740         namespace_or_type_name will soon return a composed expression
14741         instead of a string.
14742  
14743         (namespace_or_type_name): Instead of returning a string, now this
14744         production returns an expression.
14745  
14746         * codegen.cs (EmitContext): Setup IsGeneric property based on
14747         whether our DeclSpace is generic, our the method is generic.
14748  
14749         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14750         the method is generic.
14751  
14752         * cs-parser.jay (type_arguments, opt_type_argument_list,
14753         type_parameters, type_parameter_list, opt_type_parameter_list,
14754         type_parameter,, opt_type_parameter_constraints_clauses,
14755         type_parameter_constraints_clauses,
14756         type_parameter_constraint_clause, type_parameter_constraint,
14757         interface_constraints): Add new production
14758  
14759         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14760         DeclSpace is generic or not.
14761  
14762         (DeclSpace.SetParameterInfo): New routine, used to set the
14763         parameter info for a type.
14764  
14765         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14766         returns a GenericTypeExpr
14767  
14768         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14769         generic, lookup the generic argument.
14770  
14771         * attribute.cs: Do not allow TypeParameterExpressions in
14772         Attributes.
14773  
14774         * class.cs: Do not allow the Main method to be defined in a
14775         Generic container.
14776  
14777         * expression.cs (SizeOf): Do not allow generic types to be used as
14778         arguments to sizeof.
14779  
14780         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14781         it: whether a type is generic or not.  Only works for types we are
14782         currently building for now.
14783         
14784 2003-07-20  Martin Baulig  <martin@ximian.com>
14785
14786         * namespace.cs: Fixed that bug which caused a crash when compiling
14787         the debugger's GUI.
14788
14789 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14790
14791         * typemanager.cs (LookupTypeReflection): Never expose types which
14792         are NotPublic, NestedPrivate, NestedAssembly, or
14793         NestedFamANDAssem.  We used to return these, and later do a check
14794         that would report a meaningful error, but the problem is that we
14795         would not get the real match, if there was a name override.
14796
14797 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14798
14799         * namespace.cs (Namespace, Name): Do not compute the namespace
14800         name dynamically, compute it in the constructor.  This reduced
14801         memory usage by 1697 KB.
14802
14803         * driver.cs: Use --pause to pause at the end.
14804
14805 2003-07-17  Peter Williams  <peter@newton.cx>
14806
14807         * Makefile: Change the name of the test target so that it doesn't
14808         conflict with the recursive test target.
14809
14810 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14811
14812         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14813         AddressOf): Do not use EmitThis, that was wrong, use the actual
14814         this pointer.
14815
14816 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14817
14818         * class.cs (MethodData.Define): While checking if a method is an
14819         interface implementation, improve the test: If we are not public
14820         (use new test here: use the computed MethodAttributes directly,
14821         instead of the parsed modifier flags) check if the `implementing'
14822         method comes from an interface or not.
14823
14824         * pending.cs (VerifyPendingMethods): Slightly better error
14825         message.
14826
14827         * makefile: add test target that does the mcs bootstrap.
14828
14829 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14830
14831         * interface.cs (Define): Do nothing here since there are no
14832         members to populate etc. Move the attribute emission out of here
14833         since this was just totally the wrong place to put it. Attribute
14834         application happens during the 'Emit' phase, not in the 'Define'
14835         phase.
14836
14837         (Emit): Add this method and move the attribute emission here
14838
14839         * rootcontext.cs (EmitCode): Call the Emit method on interface
14840         types too.
14841
14842 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14843
14844         * expression.cs (OverloadResolve): Report error only if Location
14845         is not 'Null' which means that there was a probe going on.
14846
14847 2003-07-14  Martin Baulig  <martin@ximian.com>
14848
14849         * expression.cs (ConditionalLogicalOperator): New public class to
14850         implement user defined conditional logical operators.
14851         This is section 14.11.2 in the spec and bug #40505.
14852
14853 2003-07-14  Martin Baulig  <martin@ximian.com>
14854
14855         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14856
14857 2003-07-14  Martin Baulig  <martin@ximian.com>
14858
14859         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14860
14861         * ecore.cs (IVariable.VerifyFixed): New interface method.
14862
14863         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14864         operator, check whether the variable is actually fixed.  Fixes bug
14865         #36055.  Set a variable definitely assigned when taking its
14866         address as required by the spec.
14867
14868         * statement.cs (LocalInfo.IsFixed): New field.
14869         (LocalInfo.MakePinned): Set `IsFixed' to true.
14870
14871 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14872
14873         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14874         for .ctors, ensure that we only ask for members declared in the
14875         attribute type (BindingFlags.DeclaredOnly).
14876
14877         Fixes bug #43632.
14878
14879         * expression.cs (Error_WrongNumArguments): Report error 1501
14880         correctly the way CSC does.
14881
14882 2003-07-13  Martin Baulig  <martin@ximian.com>
14883
14884         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14885         lookup on the fully qualified name, to make things like "X.X" work
14886         where "X.X" is a fully qualified type name, but we also have a
14887         namespace "X" in the using list.  Fixes #41975.
14888
14889 2003-07-13  Martin Baulig  <martin@ximian.com>
14890
14891         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14892         function. If we're a CompoundAssign, we need to create an embedded
14893         CompoundAssign, not an embedded Assign.
14894         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14895         Fixes #45854.
14896
14897 2003-07-13  Martin Baulig  <martin@ximian.com>
14898
14899         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14900         work to fix bug #46088.
14901
14902 2003-07-13  Ravi Pratap <ravi@ximian.com>
14903
14904         * class.cs (Operator.Emit): Do not emit attributes here - it is
14905         taken care of by the Method class that we delegate too. This takes
14906         care of bug #45876.
14907
14908 2003-07-10  Martin Baulig  <martin@ximian.com>
14909
14910         * expression.cs (TypeOfVoid): New class.
14911         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14912
14913 2003-07-10  Martin Baulig  <martin@ximian.com>
14914
14915         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14916         bug #35957.
14917
14918 2003-07-10  Martin Baulig  <martin@ximian.com>
14919
14920         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14921         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14922
14923         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14924
14925         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14926
14927 2003-07-10  Martin Baulig  <martin@ximian.com>
14928
14929         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14930         of decimal.  Fixes #42850.
14931
14932         NOTE: I also fixed the created byte blob, but this doesn't work on
14933         the MS runtime and csc never produces any byte blobs for decimal
14934         arrays.
14935
14936 2003-07-10  Martin Baulig  <martin@ximian.com>
14937
14938         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14939         structs; fixes #32068.
14940         (Block.AddChildVariableNames): Fixed #44302.
14941
14942 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14943
14944         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14945
14946 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * attribute.cs: And this test is onger needed.
14949
14950 2003-07-08  Martin Baulig  <martin@ximian.com>
14951
14952         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14953         inaccessible types.  Fixes #36313.
14954
14955         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14956
14957         * namespace.cs (NamespaceEntry): Create implicit entries for all
14958         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14959         implicit entries for N1.N2 and N1.
14960
14961 2003-07-08  Martin Baulig  <martin@ximian.com>
14962
14963         Rewrote the handling of namespaces to fix a lot of the issues
14964         wrt. `using' aliases etc.
14965
14966         * namespace.cs (Namespace): Splitted this class into a
14967         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14968
14969         * typemanager.cs (TypeManager.IsNamespace): Removed.
14970         (TypeManager.ComputeNamespaces): Only compute namespaces from
14971         loaded assemblies here, not the namespaces from the assembly we're
14972         currently compiling.
14973
14974 2003-07-08  Martin Baulig  <martin@ximian.com>
14975
14976         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14977
14978 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14979
14980         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14981         already fixed it.  
14982
14983         I thought about the memory savings here, but LookupTypeReflection
14984         is used under already very constrained scenarios.  Compiling
14985         corlib or mcs only exposes one hit, so it would not really reduce
14986         any memory consumption.
14987
14988 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14989
14990         * typemanager.cs: fixes bug #45889 by only adding public types from
14991         other assemblies to the list of known types.
14992
14993 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14996         on the type we resolved.
14997
14998 2003-07-05  Martin Baulig  <martin@ximian.com>
14999
15000         * pending.cs (PendingImplementation.ParentImplements): Don't
15001         create the proxy if the parent is abstract.
15002
15003         * class.cs (TypeContainer.DefineIndexers): Process explicit
15004         interface implementations first.  Fixes #37714.
15005
15006 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15007
15008         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15009         defined recursively;  but since we modify the input parameters
15010         (left is set to `this' temporarily), we reset this value if the
15011         left_is_explicit is false, which gives the original semantics to
15012         the code.  
15013
15014         * literal.cs (NullPointer): new class used to represent a null
15015         literal in a pointer context.
15016
15017         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15018         type is a pointer, use a NullPointer object instead of a
15019         NullLiteral.   Closes 43687
15020
15021         (ExplicitConversion): Convert pointer values using
15022         the conv opcode to the proper type.
15023
15024         * ecore.cs (New): change ValueTypeVariable property into a method,
15025         that returns whether the valuetype is suitable for being used.
15026
15027         * expression.cs (Binary.DoNumericPromotions): Only return if we
15028         the int constant was a valid uint, and we can return both left and
15029         right as uints.  If not, we continue processing, to trigger the
15030         type conversion.  This fixes 39018.
15031
15032         * statement.cs (Block.EmitMeta): During constant resolution, set
15033         the CurrentBlock property on the emitcontext, so that we resolve
15034         constants propertly.
15035
15036 2003-07-02  Martin Baulig  <martin@ximian.com>
15037
15038         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15039         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15040
15041         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15042         than emitting it here.
15043
15044         * statement.cs: Fixed some more flow analysis bugs.
15045
15046 2003-07-02  Martin Baulig  <martin@ximian.com>
15047
15048         * class.cs (MethodData.Define): When implementing interface
15049         methods, set Final unless we're Virtual.
15050
15051         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15052         check work for interface methods.
15053
15054 2003-07-01  Martin Baulig  <martin@ximian.com>
15055
15056         * ecore.cs (EmitContext.This): Replaced this property with a
15057         GetThis() method which takes a Location argument.  This ensures
15058         that we get the correct error location for a CS0188.
15059
15060 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15061
15062         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15063         ImplicitStandardConversion.
15064
15065         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15066
15067 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15068
15069         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15070         optimization.
15071
15072 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15073
15074         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15075         constructors.
15076
15077         (MethodData.Define): Turn off initlocals for unsafe methods.
15078
15079 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15082         complete;  Fixes #37521.
15083
15084         * delegate.cs: Use Modifiers.TypeAttr to compute the
15085         TypeAttributes, instead of rolling our own.  This makes the flags
15086         correct for the delegates.
15087
15088 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15089
15090         * class.cs (Constructor.Define): Set the private flag for static
15091         constructors as well.
15092
15093         * cs-parser.jay (statement_expression): Set the return value to
15094         null, to avoid a crash when we catch an error.
15095
15096 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * cs-parser.jay: Applied patch from Jackson that adds support for
15099         extern and unsafe modifiers to destructor declarations.
15100
15101         * expression.cs: Report error 21 if the user is trying to index a
15102         System.Array.
15103
15104         * driver.cs: Add an error message, suggested by the bug report.
15105
15106         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15107         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15108
15109 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15110
15111         * namespace.cs: Add some information to reduce FAQs.
15112
15113 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15114
15115         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15116         underlying enumeration types.  Fixes #43915.
15117
15118         * expression.cs: Treat ushort/short as legal values to be used in
15119         bitwise operations.
15120
15121 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15122
15123         * delegate.cs: transfer custom attributes for paramenters from
15124         the delegate declaration to Invoke and BeginInvoke.
15125
15126 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15127
15128         * attribute.cs: handle custom marshalers and emit marshal info
15129         for fields, too.
15130
15131 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15132
15133         * makefile.gnu: Added anonymous.cs to the compiler sources.
15134
15135 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * iterators.cs: Change the name of the proxy class to include two
15138         underscores.
15139
15140         * cs-parser.jay: Update grammar to include anonymous methods.
15141
15142         * anonymous.cs: new file.
15143
15144 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15145
15146         * class.cs (Field.Define): Add missing test for pointers and
15147         safety. 
15148
15149 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15150
15151         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15152         we use the stobj opcode.
15153
15154         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15155         since it wasn't the correct fix. 
15156
15157         It still is puzzling that we are required to use stobj for IntPtr
15158         which seems to be a ValueType.
15159
15160 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15163         during regular simple name resolution.   Now, the trick is that
15164         instead of returning for processing the simplename, we do a
15165         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15166         contextual lookup type).   If a match is found, return that, if
15167         not, return for further composition.
15168
15169         This fixes long-standing 30485.
15170
15171         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15172         using the address to initialize an object, do an Stobj instead of
15173         using the regular Stelem.
15174
15175         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15176         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15177         Because if we are a BaseIndexerAccess that value will be true.
15178         Fixes 43643.
15179
15180         * statement.cs (GotoCase.Resolve): Return after reporting an
15181         error, do not attempt to continue. 
15182
15183         * expression.cs (PointerArithmetic.Emit): If our operand is a
15184         long, convert our constants to match the operand before
15185         multiplying.  Convert to I type before adding.   Fixes 43670.
15186
15187 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15188
15189         * enum.cs (ImplicitConversionExists) : Rename to
15190         ImplicitEnumConversionExists to remove ambiguity. 
15191
15192         * ecore.cs (NullCast): New type of cast expression class which
15193         basically is very similar to EmptyCast with the difference being
15194         it still is a constant since it is used only to cast a null to
15195         something else
15196         (eg. (string) null)
15197
15198         * convert.cs (ImplicitReferenceConversion): When casting a null
15199         literal, we return a NullCast.
15200
15201         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15202         should be around anymore.
15203
15204         The renaming (reported was slightly wrong). Corrections:
15205
15206         ConvertImplicitStandard -> ImplicitConversionStandard
15207         ConvertExplicitStandard -> ExplicitConversionStandard
15208
15209         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15210         before passing them in !
15211
15212         * convert.cs (ImplicitConversionStandard): When comparing for
15213         equal expr and target types, ensure that expr is not a
15214         NullLiteral.
15215
15216         In general, we must not be checking (expr_type ==
15217         target_type) in the top level conversion methods
15218         (ImplicitConversion, ExplicitConversion etc). This checking is
15219         done in the methods that they delegate to.
15220
15221 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * convert.cs: Move Error_CannotConvertType,
15224         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15225         ImplicitNumericConversion, ImplicitConversionExists,
15226         ImplicitUserConversionExists, StandardConversionExists,
15227         FindMostEncompassedType, FindMostSpecificSource,
15228         FindMostSpecificTarget, ImplicitUserConversion,
15229         ExplicitUserConversion, GetConversionOperators,
15230         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15231         TryImplicitIntConversion, Error_CannotConvertImplicit,
15232         ConvertImplicitRequired, ConvertNumericExplicit,
15233         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15234         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15235         its own file.
15236
15237         Perform the following renames:
15238
15239         StandardConversionExists -> ImplicitStandardConversionExists
15240         ConvertImplicit -> ImplicitConversion
15241         ConvertImplicitStandard -> ImplicitStandardConversion
15242         TryImplicitIntConversion -> ImplicitIntConversion
15243         ConvertImplicitRequired -> ImplicitConversionRequired
15244         ConvertNumericExplicit -> ExplicitNumericConversion
15245         ConvertReferenceExplicit -> ExplicitReferenceConversion
15246         ConvertExplicit -> ExplicitConversion
15247         ConvertExplicitStandard -> ExplicitStandardConversion
15248
15249 2003-05-19  Martin Baulig  <martin@ximian.com>
15250
15251         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15252         (TypeInfo): Added support for structs having structs as fields.
15253
15254         * ecore.cs (FieldExpr): Implement IVariable.
15255         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15256         VariableInfo for the field.
15257
15258 2003-05-18  Martin Baulig  <martin@ximian.com>
15259
15260         * expression.cs (This.DoResolve): Report a CS0027 if we're
15261         emitting a field initializer.
15262
15263 2003-05-18  Martin Baulig  <martin@ximian.com>
15264
15265         * expression.cs (This.ResolveBase): New public function.
15266         (This.DoResolve): Check for CS0188.
15267
15268         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15269         This.Resolve().
15270
15271         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15272         `instance_expression' to null if we don't have any non-static
15273         methods.
15274
15275 2003-05-18  Martin Baulig  <martin@ximian.com>
15276
15277         Reworked the way how local variables and parameters are handled by
15278         the flow analysis code.
15279
15280         * statement.cs (TypeInfo, VariableMap): New public classes.
15281         (VariableInfo): New public class.  This is now responsible for
15282         checking whether a variable has been assigned.  It is used for
15283         parameters and local variables.
15284         (Block.EmitMeta): Take the InternalParameters as argument; compute
15285         the layout of the flow vectors here.
15286         (Block.LocalMap, Block.ParameterMap): New public properties.
15287         (FlowBranching): The .ctor doesn't get the InternalParameters
15288         anymore since Block.EmitMeta() now computes the layout of the flow
15289         vector.
15290         (MyStructInfo): This class is now known as `StructInfo' and nested
15291         in `TypeInfo'; we don't access this directly anymore.
15292
15293         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15294         property and removed IsAssigned(), IsFieldAssigned(),
15295         SetAssigned() and SetFieldAssigned(); we now call them on the
15296         VariableInfo so we don't need to duplicate this code everywhere.
15297
15298         * expression.cs (ParameterReference): Added `Block block' argument
15299         to the .ctor.
15300         (LocalVariableReference, ParameterReference, This): The new
15301         VariableInfo class is now responsible for all the definite
15302         assignment stuff.
15303
15304         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15305         IsParameterAssigned, SetParameterAssigned): Removed.
15306
15307 2003-05-18  Martin Baulig  <martin@ximian.com>
15308
15309         * typemanager.cs (InitCoreTypes): Try calling
15310         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15311         the 3-args-version.  Corlib now also needs our `void_type'.
15312         (GetMethod): Added overloaded version which takes an optional
15313         `bool report_errors' to allow lookups of optional methods.
15314
15315 2003-05-12  Martin Baulig  <martin@ximian.com>
15316
15317         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15318         only used for locals and not for parameters.
15319
15320 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * support.cs (InternalParameters.ParameterType): Return the
15323         ExternalType of the parameter.
15324
15325         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15326         they were unused.
15327
15328 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * class.cs (MethodData.Define): Do not set the `newslot' on
15331         interface members, if they are also flagged as "override".
15332
15333         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15334         better code for ++i and i++.  This only works for static fields
15335         and local variables.
15336
15337         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15338         want to pull the DeclSpace out of the builder_to_declspace instead
15339         of the TypeBuilder (like in TypeContainer.FindMembers).
15340
15341         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15342         instead of LookupTypeContainer.  Fixes the crash on .NET for
15343         looking up interface members.
15344
15345         * const.cs: Create our own emit context during the Definition
15346         stage, so that constants are evaluated in the proper context, when
15347         a recursive definition happens.
15348
15349 2003-05-11  Martin Baulig  <martin@ximian.com>
15350
15351         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15352         new block for a switch section.
15353         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15354         the adding/lookup in the switch block.  Fixes #39828.
15355
15356 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15357
15358         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15359         functionality: I needed to convert the data after I had performed
15360         the add/sub operation into the operands type size.
15361
15362         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15363         pass the type for the box operation, otherwise the resulting
15364         object would have been of type object.
15365
15366         (BoxedCast): Add constructor to specify the type to box as.
15367
15368 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15369
15370         * iterators.cs: I was reusing the `count' variable inadvertently,
15371         take steps to not allow this to happen.
15372
15373 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15374
15375         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15376         by creating an array at the point where the params starts and
15377         putting all those arguments there, then adjusting the size of the
15378         array.
15379
15380 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15381
15382         * expression.cs (New.AddressOf): Implement interface
15383         IMemoryLocation.  This is used when the `new' operator is used in
15384         the context of an invocation to a method on a value type.
15385
15386         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15387         example. 
15388
15389         * namespace.cs: Also check the using aliases here.
15390
15391         * driver.cs: Move the test for using validity after the types have
15392         been entered, so we do a single pass that also includes the using
15393         aliases. 
15394
15395         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15396         in the regular case.   CreateSiblingForFinally is doing extra
15397         error checking.
15398
15399         * attribute.cs (GetAttributeArgumentExpression): Store the result
15400         on an out value, and use the return value to indicate failure
15401         instead of using null (which is a valid return for Constant.GetValue).
15402
15403         * statement.cs: Perform the analysis flow for the increment
15404         portion after the statement, because this will be the real flow of
15405         execution.  Fixes #42385
15406
15407         * codegen.cs (EmitContext.EmitArgument,
15408         EmitContext.EmitStoreArgument): New helper functions when the
15409         RemapToProxy flag is set.
15410
15411         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15412         function.
15413
15414         Add support for remapping parameters. 
15415
15416         * iterators.cs: Propagate parameter values;  Store parameter
15417         values in the proxy classes.
15418
15419 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15420
15421         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15422         need a proxy reference;  I do not know what I was thinking
15423
15424         * cs-parser.jay (constructor_initializer): catch another error,
15425         and display nice message.
15426
15427         (field_declaration): catch void field declaration
15428         to flag a better error. 
15429
15430         * class.cs (MemberBase.CheckBase): Report an error instead of a
15431         warning if a new protected member is declared in a struct. 
15432         (Field.Define): catch the error of readonly/volatile.
15433
15434         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15435
15436         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15437         volatile variable is taken
15438
15439 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15440
15441         * statement.cs (Fixed.Resolve): Report an error if we are not in
15442         an unsafe context.
15443
15444 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * typemanager.cs: reuse the code that handles type clashes for
15447         delegates and enumerations.
15448
15449         * class.cs (Report28): Always report.
15450
15451         * expression.cs (EncodeAsAttribute): Allow nulls here.
15452
15453 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15456         the functionality for testing whether an expression is valid for
15457         an attribute here.  Also handle the case of arrays of elements
15458         being stored. 
15459
15460         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15461         encoding a linear array into an array of objects that are suitable
15462         to be passed to an CustomAttributeBuilder.
15463
15464         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15465
15466         * ecore.cs: (FieldExpr): Handle field remapping here.
15467
15468         * iteratators.cs: Pass the instance variable (if the method is an
15469         instance method) to the constructors, so we can access the field
15470         variables on the class.
15471
15472         TODO: Test this with structs.  I think the THIS variable on
15473         structs might have to be a pointer, and not a refenrece
15474
15475 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15478         local variables to fields in a proxy class.
15479
15480         * iterators.cs (PopulateProxy): Rename our internal fields to
15481         <XXX>.  
15482         Create a <THIS> field if we are an instance method, so we can
15483         reference our parent container variables.
15484         (MapVariable): Called back from the EmitContext code to enter a
15485         new variable to field mapping into the proxy class (we just create
15486         a FieldBuilder).
15487
15488         * expression.cs
15489         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15490         for using the remapped locals to fields.
15491
15492         I placed the code here, because that gives the same semantics to
15493         local variables, and only changes the Emit code.
15494
15495         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15496         statements inside iterators.
15497         (VariableInfo): Add a FieldBuilder for the cases when we are
15498         remapping local variables to fields in a proxy class
15499
15500         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15501         current_block != null.
15502
15503         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15504         not cope with strings, as it has been moved to the
15505         TableSwitchEmit.  Fixed bug in switch generation.
15506
15507         * expression.cs (New.DoResolve): Provide more context for the user
15508         when reporting an error.
15509
15510         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15511         pointers. 
15512
15513         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15514         check the permissions for it.  Note than in a type-resolution
15515         context the check was already present in DeclSpace.ResolveType,
15516         but was missing from the MemberAccess.
15517
15518         (ArrayCreation.CheckIndices): warn if the user has
15519         more nested levels of expressions, but there are no more
15520         dimensions specified.  Avoids crash on bug 41906.
15521
15522 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15523
15524         * statement.cs (Block): replace Implicit bool, for a generic
15525         flags.   
15526         New flag: `Unchecked'.  This is used during the EmitMeta phase
15527         (which is out-of-line with the regular Resolve/Emit process for a
15528         statement, as this is done ahead of time, but still gets a chance
15529         to call constant resolve).
15530
15531         (Block.Flags): new enum for adding a new flag.
15532
15533         (Block.EmitMeta): track the state of unchecked.
15534
15535         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15536         to enable constant resolution to work there as well.
15537
15538 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15539
15540         * typemanager.cs (ienumerable_type): Also look up
15541         System.Collections.IEnumerable. 
15542
15543 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15544
15545         TODO: Test more than one conditional per method.
15546
15547         * class.cs (Indexer.Define): Report the location where the user is
15548         referencing the unsupported feature.
15549
15550         (MethodData): Overload the use of `conditionals' to
15551         minimize the creation of needless ArrayLists.   This saves roughly
15552         212kb on my machine.
15553
15554         (Method): Implement the new IIteratorContainer interface.
15555         (Method.SetYields): Implement the method by setting the ModFlags
15556         to contain METHOD_YIELDS.
15557
15558         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15559         which just got set to null.
15560
15561         * iterators.cs: New file.
15562
15563         (Yield, YieldBreak): New statements.
15564
15565         * statement.cs (Return.Resolve): Flag an error if we are used in
15566         an iterator method.
15567
15568         * codegen.cs (InIterator): New flag set if the code is being
15569         compiled in an iterator method.
15570
15571         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15572         internal modifier, and we just use it to avoid adding extra
15573         fields, as this is seldom used.  
15574
15575         * cs-parser.jay: Add yield_statement (yield and yield break).
15576
15577         * driver.cs: New flag -v2 to turn on version 2 features. 
15578
15579         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15580         hashtable when v2 is enabled.
15581
15582 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15585         there is already a namespace defined with this name.
15586
15587         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15588         people upgraded their corlibs.
15589
15590         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15591         always use fully qualified types, no need to use the compiler
15592         front end.
15593
15594         (TypeManager.IsNamespace): Use binarysearch.
15595
15596         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15597         AddDelegate): I did not quite use the new IsValid API properly: I
15598         have to pass the short-name and the fullname.  I was passing only
15599         the basename instead of the fullname sometimes. 
15600
15601         (TypeContainer.DefineType): call NamespaceClash.
15602
15603         * interface.cs (Interface.DefineType): use NamespaceClash before
15604         defining the type.
15605
15606         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15607         defining the type.
15608
15609         * enum.cs: (Enum.DefineType): use NamespaceClash before
15610         defining the type.
15611
15612         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15613         speed increase.  First, use the negative_hits cache when we get a
15614         negative.  Second, add the type with its full original name
15615         instead of the new . and + encoded name (reflection uses + to
15616         separate type from a nested type).  Use LookupTypeReflection
15617         directly which bypasses the type->name hashtable (that we already
15618         know does not contain the type.
15619
15620         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15621         location/container type. 
15622
15623         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15624
15625 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15626
15627         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15628
15629         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15630         method is being referenced in the method group from a static
15631         context, and report error 120 if so.
15632
15633         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15634         Error118. 
15635
15636         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15637         is created, we create the A namespace).
15638
15639         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15640         Fixes #41591
15641
15642 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15643
15644         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15645         invocation to ModuleBuilder.GetType with the same values will
15646         return a new type instance, so we need to cache its return
15647         values. 
15648
15649         * expression.cs (Binary.ResolveOperator): Only allow the compare
15650         operators on enums if they are of the same type.
15651
15652         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15653         types of ValueType on their own case.  Before we were giving them
15654         the same treatment as objects.
15655
15656         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15657         fullname.  Short name is used to compare against container name.
15658         Fullname is used to check against defined namespace names.
15659
15660         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15661         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15662
15663         (Method.CheckBase): Call parent.
15664         (MemberBase.CheckBase): Check for protected members on sealed
15665         classes.
15666         (PropertyBase.CheckBase): Call parent.
15667         (Field.Define): Call parent.
15668
15669         * report.cs: Negative error codes are now mapped to 8000 - code,
15670         so that the display is render more nicely.
15671
15672         * typemanager.cs: Do not use try/catch, instead report a regular
15673         error. 
15674
15675         (GetPointerType, GetReferenceType): These methods provide
15676         mechanisms to obtain the T* and T& from a T.  We had the code
15677         previously scattered around the code base, and it also used
15678         TypeManager.LookupType that would go through plenty of caches.
15679         This one goes directly to the type source.
15680
15681         In some places we did the Type.GetType followed by
15682         ModuleBuilder.GetType, but not in others, so this unifies the
15683         processing as well.
15684
15685         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15686         statements now that we have namespace information.
15687
15688         * typemanager.cs (IsNamespace): New method, returns whether the
15689         string presented is a namespace or not.
15690
15691         (ComputeNamespaces): New public entry point, computes the list of
15692         available namespaces, using the GetNamespaces API call in Mono, or
15693         the slower version in MS.NET.   
15694
15695         Now before we start the semantic analysis phase, we have a
15696         complete list of namespaces including everything that the user has
15697         provided.
15698
15699         Deleted old code to cache namespaces in .nsc files.
15700
15701 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15704         class/struct location definition Location for the implicit
15705         constructor location.
15706
15707         (Operator.Define): Use the location of the operator for the
15708         implicit Method definition.
15709
15710         (Constructor.Emit): use the constructor location for the implicit
15711         base initializer constructor.
15712
15713         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15714         and the Expression class now contains two new methods:
15715
15716         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15717         isolate type lookup from the rest of the resolution process.
15718
15719         Since we use Expressions to hold type definitions due to the way
15720         we parse the input we have historically overloaded Resolve to
15721         perform the Type lookups if a special flag is passed.  Now this is
15722         eliminated and two methods take their place. 
15723
15724         The differences in the two methods between xStep and xTerminal is
15725         that xStep is involved in our current lookup system that uses
15726         SimpleNames to compose a name, while xTerminal is used just to
15727         catch the case where the simplename lookup failed.
15728
15729 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15730
15731         * expression.cs (ResolveMemberAccess): Remove redundant code.
15732         TypeExpr expressions are always born fully resolved.
15733
15734         * interface.cs (PopulateMethod): Do not lookup the types twice.
15735         We were doing it once during SemanticAnalysis and once during
15736         PopulateMethod.
15737
15738         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15739         in local variable type definitions, were being returned as a
15740         SimpleName (we decomposed everything into a string), that is
15741         because primary_expression was being used instead of a type in the
15742         grammar (reduce/reduce conflicts).
15743
15744         The part that was wrong is that we converted the expression into a
15745         string (an oversimplification in one hand, compounded with primary
15746         expressions doing string concatenation).
15747
15748         So things like:
15749
15750         A.B.C [] x;
15751
15752         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15753         using clauses from working on this particular context.  And a type
15754         was being matched directly against "A.B.C[]".
15755
15756         We now use the correct approach, and allow for ComposedCast to be
15757         part of the unary expression.  So the "A.B.C []" become a composed
15758         cast of "A.B.C" (as a nested group of MemberAccess with a
15759         SimpleName at the end) plus the rank composition "[]". 
15760
15761         Also fixes 35567
15762
15763 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15766         for the access level checking.
15767
15768         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15769         `TypeContainer container', because I kept getting confused when I
15770         was debugging this code.
15771
15772         * expression.cs (Indexers): Instead of tracking getters/setters,
15773         we now track them in parallel.  We create one arraylist less, but
15774         most importantly it is possible now for the LValue code to find a
15775         matching get for a set.
15776
15777         (IndexerAccess.DoResolveLValue): Update the code.
15778         GetIndexersForType has been modified already to extract all the
15779         indexers from a type.  The code assumed it did not.
15780
15781         Also make the code set the correct return type for the indexer.
15782         This was fixed a long time ago for properties, but was missing for
15783         indexers.  It used to be void_type.
15784
15785         (Binary.Emit): Test first for doubles instead of
15786         floats, as they are more common.
15787
15788         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15789         when dealing with floats and the <=, >= operators.  This fixes bug
15790         #39314 
15791
15792         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15793         to load the array value by emitting a load on the foreach variable
15794         type.  This was incorrect.  
15795
15796         We now emit the code to load an element using the the array
15797         variable type, and then we emit the conversion operator.
15798
15799         Fixed #40176
15800
15801 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15802
15803         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15804
15805 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15806
15807         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15808         test for protection before we test for signatures. 
15809
15810         (MethodSignature.ToString): implement.
15811
15812         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15813         to the case where we reduced into a LongConstant.
15814
15815         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15816         depend on whether the information is acurrate, because the
15817         Microsoft runtime will always claim that the array type is public,
15818         regardless of the real state.
15819
15820         If the type is a pointer, another problem happens: the type is
15821         reported as non-public in Microsoft.  
15822
15823         In both cases we have to call CheckAccessLevel recursively with
15824         the underlying type as the argument to be tested.
15825
15826 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15827
15828         * assign.cs (Assign.Emit): If we are dealing with a compound
15829         assignment expression, we should use the code path that stores the
15830         intermediate result in a temporary value.  This fixes #40903.
15831
15832         *expression.cs (Indirection.ToString): Provide ToString method for
15833         debugging. 
15834
15835 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15836
15837         * class.cs: Null out fields holding references to Block objects so
15838         they can be garbage collected.
15839
15840         * expression.cs (OverloadResolve): Remove unused local.
15841
15842 2003-04-07  Martin Baulig  <martin@ximian.com>
15843
15844         * codegen.cs (EmitContext.CurrentFile): New public field.
15845         (EmitContext.Mark): Use the CurrentFile to check whether the
15846         location is in the correct file.
15847         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15848
15849 2003-04-07  Martin Baulig  <martin@ximian.com>
15850
15851         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15852
15853         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15854         location.  [FIXME: The location argument which gets passed to this
15855         method is sometimes wrong!]
15856
15857 2003-04-07  Nick Drochak <ndrochak@gol.com>
15858
15859         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15860
15861 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * expression.cs (Indirection.EmitAssign): We were using the
15864         temporary, but returning immediately instead of continuing the
15865         EmitAssing flow.
15866
15867 2003-04-06  Martin Baulig  <martin@ximian.com>
15868
15869         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15870         if it's a nested child, but also deriving from the outer class.
15871         See test 190.cs.
15872
15873         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15874         nested child, but also deriving from the outer class.  See
15875         test-190.cs.
15876         (FilterWithClosure): We may access private members of the outer
15877         class if we're a nested child and deriving from the outer class.
15878         (RealMemberLookup): Only set `closure_private_ok' if the
15879         `original_bf' contained BindingFlags.NonPublic.
15880
15881 2003-04-05  Martin Baulig  <martin@ximian.com>
15882
15883         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15884         probe if its a type parameter, and if so, flag an error.
15885
15886         * decl.cs: Move here the SetParameterInfo code from class.cs.
15887         Handle IsGeneric here.
15888
15889         Handle a variety of errors in the parameter info definition.
15890
15891         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15892         type parameters here.
15893
15894         * cs-parser.jay (class_declaration): report errors for parameters
15895         here as well.
15896
15897 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15898
15899         * generic.cs: New file, contains support code for generics.
15900
15901         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15902         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15903
15904         Update parser for the above removals.
15905
15906         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15907         now taken care of in the parser.
15908
15909 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15910
15911         * class.cs (Event.Define): Do not allow abstract events to have
15912         initializers. 
15913
15914 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15915
15916         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15917         block in event declarations.
15918
15919         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15920         value type, get its address.
15921
15922         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15923         leaving a class on the stack instead of a boolean value (int
15924         0/1).  Change the code so we compare against null, and then the
15925         result against zero.
15926
15927         * class.cs (TypeContainer.GetClassBases): We were checking for the
15928         parent class being sealed too late.
15929
15930         * expression.cs (Binary.Emit): For <= and >= when dealing with
15931         floating point values, use cgt.un and clt.un instead of cgt and
15932         clt alone.
15933
15934 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15935
15936         * statement.cs: Apply the same optimization as MS: skip the 
15937         GetEnumerator returning an IEnumerator, and use the one returning a 
15938         CharEnumerator instead. This allows us to avoid the try-finally block 
15939         and the boxing.
15940
15941 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15942
15943         * cs-parser.jay: Attributes cannot be applied to
15944                          namespaces. Fixes #40473
15945
15946 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15947
15948         * class.cs:
15949         (Add*): check if the name is valid using the full name for constants,
15950         fields, properties and events.
15951
15952 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15953
15954         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15955         char constants to be part of the enumeration.
15956
15957         * expression.cs (Conditional.DoResolve): Add support for operator
15958         true. Implements the missing functionality from 14.12
15959
15960         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15961         operator true/false as required by the spec.
15962
15963         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15964         implicit conversion to boolean.
15965
15966         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15967         also one where the type implements `operator true'. 
15968
15969         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15970         get an expression that will invoke operator true based on an
15971         expression.  
15972
15973         (GetConversionOperators): Removed the hack that called op_True
15974         here.  
15975
15976         (Expression.ResolveBoolean): Move this from Statement.
15977
15978 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15979
15980         * ecore.cs (FieldExpr): do not allow initialization of initonly
15981         fields on derived classes
15982
15983 2003-03-13  Martin Baulig  <martin@ximian.com>
15984
15985         * statement.cs (Block.Emit): Call ig.BeginScope() and
15986         ig.EndScope() when compiling with debugging info; call
15987         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15988
15989 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * expression.cs (Indexers): Do not construct immediately, allow
15992         for new members to be appended as we go.  Fixes 38143
15993
15994 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15995
15996         * expression.cs: save/restore context when resolving an unchecked
15997         expression.
15998
15999 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * cfold.cs: Catch division by zero in modulus operator during
16002         constant folding.
16003
16004 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16005
16006         * interface.cs (Interface.DefineMembers): Avoid defining members
16007         twice. 
16008
16009 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16010
16011         * driver.cs: handle the +/- options for -noconfig
16012
16013         * statement.cs (Unckeched.Resolve): Also track the state of
16014         unchecked in the Resolve phase.
16015
16016 2003-02-27  Martin Baulig  <martin@ximian.com>
16017
16018         * ecore.cs (Expression.MemberLookup): Don't create a
16019         MethodGroupExpr for something which is not a method.  Fixes #38291.
16020
16021 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * class.cs (MemberBase.CheckParameters): Also check that the type
16024         is unmanaged if it is a pointer.
16025
16026         * expression.cs (SizeOf.Resolve): Add location information.
16027
16028         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16029         a managed type is declared.
16030
16031         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16032         parameter modifiers as well.  Fixes bug 38606
16033
16034         * class.cs: Very sad.  Am backing out the speed up changes
16035         introduced by the ArrayList -> Array in the TypeContainer, as they
16036         were not actually that much faster, and introduced a bug (no error
16037         reports on duplicated methods).
16038
16039         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16040         source first, this will guarantee that we have a valid expression
16041         before calling in lower levels functions that will require a
16042         resolved object.  Then use this original_source in the
16043         target.ResolveLValue instead of the original source that was
16044         passed to us.
16045
16046         Another change.  Use target.Resolve instead of LValueResolve.
16047         Although we are resolving for LValues, we will let the Assign code
16048         take care of that (it will be called again from Resolve).  This
16049         basically allows code like this:
16050
16051         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16052         class Y { void A (X x) { x [0] += o; }
16053
16054         The problem was that the indexer was trying to resolve for
16055         set_Item (idx, object o) and never finding one.  The real set_Item
16056         was set_Item (idx, X).  By delaying the process we get the right
16057         semantics. 
16058
16059         Fixes bug 36505
16060
16061 2003-02-23  Martin Baulig  <martin@ximian.com>
16062
16063         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16064         while calling DoEmit ().
16065
16066         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16067         source files; if you use the #line directive inside a method, the
16068         compiler stops emitting line numbers for the debugger until it
16069         reaches the end of the method or another #line directive which
16070         restores the original file.
16071
16072 2003-02-23  Martin Baulig  <martin@ximian.com>
16073
16074         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16075
16076 2003-02-23  Martin Baulig  <martin@ximian.com>
16077
16078         * statement.cs (Block.AddChildVariableNames): We need to call this
16079         recursively, not just for our immediate children.
16080
16081 2003-02-23  Martin Baulig  <martin@ximian.com>
16082
16083         * class.cs (Event.Define): Always make the field private, like csc does.
16084
16085         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16086         actually work, fixes bug #37521.
16087
16088 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * delegate.cs: When creating the various temporary "Parameters"
16091         classes, make sure that we call the ComputeAndDefineParameterTypes
16092         on those new parameters (just like we do with the formal ones), to
16093         allow them to be resolved in the context of the DeclSpace.
16094
16095         This fixes the bug that Dick observed in Bugzilla #38530.
16096
16097 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16098
16099         * expression.cs (ResolveMemberAccess): When resolving a constant,
16100         do not attempt to pull a constant if the value was not able to
16101         generate a valid constant.
16102
16103         * const.cs (LookupConstantValue): Do not report more errors than required.
16104
16105 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16106
16107         * expression.cs: fixes bug #38328.
16108
16109 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * class.cs: Changed all the various members that can be part of a
16112         class from being an ArrayList to be an Array of the right type.
16113         During the DefineType type_list, interface_list, delegate_list and
16114         enum_list are turned into types, interfaces, delegates and enums
16115         arrays.  
16116
16117         And during the member population, indexer_list, event_list,
16118         constant_list, field_list, instance_constructor_list, method_list,
16119         operator_list and property_list are turned into their real arrays.
16120
16121         Although we could probably perform this operation earlier, for
16122         good error reporting we need to keep the lists and remove the
16123         lists for longer than required.
16124
16125         This optimization was triggered by Paolo profiling the compiler
16126         speed on the output of `gen-sample-program.pl' perl script. 
16127
16128         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16129         not crash in methods like MemberLookupFailed that use this field.  
16130
16131         This problem arises when the compiler fails to resolve a type
16132         during interface type definition for example.
16133
16134 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16135
16136         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16137         inherit from System.Object, so we have to stop at null, not only
16138         when reaching System.Object.
16139
16140 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16143         DeclaredOnly because the parent indexer might have had a different
16144         name, but did not loop until the top of the hierarchy was reached.
16145
16146         The problem this one fixes is 35492: when a class implemented an
16147         indexer from an interface, we were getting the interface method
16148         (which was abstract) and we were flagging an error (can not invoke
16149         abstract method).
16150
16151         This also keeps bug 33089 functioning, and test-148 functioning.
16152
16153         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16154         out if a method is special is to see if it is declared in a
16155         property or event, or whether it is one of the predefined operator
16156         names.   This should fix correctly #36804.
16157
16158 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16159
16160         The goal here is to remove the dependency on EmptyCast.Peel ().
16161         Killing it completely.
16162
16163         The problem is that currently in a number of places where
16164         constants are expected, we have to "probe" for an EmptyCast, and
16165         Peel, which is not the correct thing to do, as this will be
16166         repetitive and will likely lead to errors. 
16167
16168         The idea is to remove any EmptyCasts that are used in casts that
16169         can be reduced to constants, so we only have to cope with
16170         constants. 
16171
16172         This bug hunt was triggered by Bug 37363 and the desire to remove
16173         the duplicate pattern where we were "peeling" emptycasts to check
16174         whether they were constants.  Now constants will always be
16175         constants.
16176
16177         * ecore.cs: Use an enumconstant here instead of wrapping with
16178         EmptyCast.  
16179
16180         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16181         throwing me off.  By handling this we can get rid of a few hacks.
16182
16183         * statement.cs (Switch): Removed Peel() code.
16184
16185 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16186
16187         * class.cs: Location information for error 508
16188
16189         * expression.cs (New.DoResolve): Add a guard against double
16190         resolution of an expression.  
16191
16192         The New DoResolve might be called twice when initializing field
16193         expressions (see EmitFieldInitializers, the call to
16194         GetInitializerExpression will perform a resolve on the expression,
16195         and later the assign will trigger another resolution
16196
16197         This leads to bugs (#37014)
16198
16199         * delegate.cs: The signature for EndInvoke should contain any ref
16200         or out parameters as well.  We were not doing this in the past. 
16201
16202         * class.cs (Field.Define): Do not overwrite the type definition
16203         inside the `volatile' group.  Turns out that volatile enumerations
16204         were changing the type here to perform a validity test, which
16205         broke conversions. 
16206
16207 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16210         and structs, we do not want to load the instance variable
16211
16212         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16213         enum_type has to be handled like an object reference (implicit
16214         conversions exists from this to object), but the regular IsClass
16215         and IsValueType tests will never return true for this one.
16216
16217         Also we use TypeManager.IsValueType instead of type.IsValueType,
16218         just for consistency with the rest of the code (this is only
16219         needed if we ever use the construct exposed by test-180.cs inside
16220         corlib, which we dont today).
16221
16222 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16223
16224         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16225         just InternalCall.
16226
16227 2003-02-09  Martin Baulig  <martin@ximian.com>
16228
16229         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16230         (Namespace.DefineNamespaces): New static public method; this is
16231         called when we're compiling with debugging to add all namespaces
16232         to the symbol file.
16233
16234         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16235         pass it to the Namespace's .ctor.
16236
16237         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16238         and MethodBase arguments; pass the namespace ID to the symwriter;
16239         pass the MethodBase instead of the token to the symwriter.
16240         (SymbolWriter.DefineNamespace): New method to add a namespace to
16241         the symbol file.
16242
16243 2003-02-09  Martin Baulig  <martin@ximian.com>
16244
16245         * symbolwriter.cs: New file.  This is a wrapper around
16246         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16247         methods here in near future.
16248
16249 2003-02-09  Martin Baulig  <martin@ximian.com>
16250
16251         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16252         ILGenerator.MarkSequencePoint() which are actually used by the
16253         symbol writer.
16254
16255 2003-02-09  Martin Baulig  <martin@ximian.com>
16256
16257         * location.cs (SourceFile): New public sealed class.  This
16258         contains the name and an index which is used in the location's token.
16259         (Location): Reserve an appropriate number of bits in the token for
16260         the source file instead of walking over that list, this gives us a
16261         really huge performance improvement when compiling with debugging.
16262
16263         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16264         `SourceFile' argument instead of a string.
16265         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16266         but don't parse/tokenize here, we need to generate the list of all
16267         source files before we do that.
16268         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16269         the files.
16270
16271         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16272         instead of a string.
16273
16274         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16275         of a string.
16276
16277 2003-02-09  Martin Baulig  <martin@ximian.com>
16278
16279         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16280         filename on `#line default'.
16281
16282 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16283
16284         * statement.cs: don't clear the pinned var when the fixed statement
16285         returns from the method (fixes bug#37752).
16286
16287 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16288
16289         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16290         to IsValueType.
16291
16292 2003-02-07  Martin Baulig  <martin@ximian.com>
16293
16294         * driver.cs: Removed the `--debug-args' command line argument.
16295
16296         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16297         automatically by the AsssemblyBuilder.
16298         (CodeGen.InitializeSymbolWriter): We don't need to call any
16299         initialization function on the symbol writer anymore.  This method
16300         doesn't take any arguments.
16301
16302 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16303
16304         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16305         from referenced assemblies as well.
16306
16307 2003-02-02  Martin Baulig  <martin@ximian.com>
16308
16309         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16310
16311 2003-02-02  Martin Baulig  <martin@ximian.com>
16312
16313         * class.cs (Constructor.Emit): Open the symbol writer before
16314         emitting the constructor initializer.
16315         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16316         single-stepping through constructor initializers.
16317
16318 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16319
16320         * class.cs: Handle error 549: do not allow virtual methods in
16321         sealed classes. 
16322
16323 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16324
16325         * decl.cs: Check access levels when resolving types
16326
16327 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16328
16329         * statement.cs: Add parameters and locals set in catch blocks that might 
16330         return to set vector
16331
16332 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16333
16334         * class.cs (Operator): Set the SpecialName flags for operators.
16335
16336         * expression.cs (Invocation.DoResolve): Only block calls to
16337         accessors and operators on SpecialName methods.
16338
16339         (Cast.TryReduce): Handle conversions from char constants.
16340
16341
16342 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16343
16344         * statement.cs: small memory and time optimization in FlowBranching.
16345
16346 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16347
16348         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16349         problem that the last fix but in the other sid (Set).
16350
16351         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16352         access when there is no indexer in the hierarchy.
16353
16354 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16355
16356         * class.cs: Combine some if statements.
16357
16358 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16359
16360         * driver.cs: fixed bug #37187.
16361
16362 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16363
16364         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16365         any indexer, it's needed to build a list with all the indexers in the
16366         hierarchy (AllGetters), else we have problems. Fixes #35653.
16367
16368 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * class.cs (MethodData.Define): It is wrong for an interface
16371         implementation to be static in both cases: explicit and implicit.
16372         We were only handling this in one case.
16373
16374         Improve the if situation there to not have negations.
16375
16376         * class.cs (Field.Define): Turns out that we do not need to check
16377         the unsafe bit on field definition, only on usage.  Remove the test.
16378
16379 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16380
16381         * driver.cs: use assembly.Location instead of Codebase (the latest
16382         patch made mcs fail when using MS assemblies).
16383
16384 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16385
16386         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16387         get the path to *corlib.dll.
16388
16389 2003-01-21  Nick Drochak <ndrochak@gol.com>
16390
16391         * cs-tokenizer.cs:
16392         * pending.cs:
16393         * typemanager.cs: Remove compiler warnings
16394
16395 2003-01-20  Duncan Mak  <duncan@ximian.com>
16396
16397         * AssemblyInfo.cs: Bump the version number to 0.19.
16398
16399 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16400
16401         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16402
16403 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16404
16405         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16406
16407 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * cs-parser.jay: Small fix: we were not comparing the constructor
16410         name correctly.   Thanks to Zoltan for the initial pointer.
16411
16412 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16413
16414         * cs-tokenizer.cs: Set file name when specified with #line
16415
16416 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * cs-parser.jay: Only perform the constructor checks here if we
16419         are named like the class;  This will help provider a better
16420         error.  The constructor path is taken when a type definition is
16421         not found, but most likely the user forgot to add the type, so
16422         report that rather than the constructor error.
16423
16424 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16425
16426         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16427         allocations.
16428
16429 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16430
16431         * cs-parser.jay: Add cleanup call.
16432
16433 2003-01-13  Duncan Mak  <duncan@ximian.com>
16434
16435         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16436         consistent with other methods.
16437
16438 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16439
16440         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16441
16442 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16443
16444         * attribute.cs: only set GuidAttr to true when we have a
16445         GuidAttribute.
16446
16447 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16448
16449         * ecore.cs:
16450         * expression.cs:
16451         * typemanager.cs: fixes to allow mcs compile corlib with the new
16452         Type.IsSubclassOf fix.
16453
16454 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * expression.cs (LocalVariableReference.DoResolve): Classify a
16457         constant as a value, not as a variable.   Also, set the type for
16458         the variable.
16459
16460         * cs-parser.jay (fixed_statement): take a type instead of a
16461         pointer_type, so we can produce a better error message later.
16462
16463         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16464         as an error.  
16465
16466         (For.DoEmit): Make inifinite loops have a
16467         non-conditional branch back.
16468
16469         (Fixed.DoEmit): First populate the pinned variables, then emit the
16470         statement, then clear the variables.  Before I was emitting the
16471         code once for each fixed piece.
16472
16473
16474 2003-01-08  Martin Baulig  <martin@ximian.com>
16475
16476         * statement.cs (FlowBranching.MergeChild): A break in a
16477         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16478
16479 2003-01-08  Martin Baulig  <martin@ximian.com>
16480
16481         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16482         lives in the same number space than `param_map'.  Fixes #36154.
16483
16484 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16485
16486         * cs-parser.jay (constructor_declaration): Set the
16487         Constructor.ModFlags before probing for it.  This makes the
16488         compiler report 514, 515 and 132 (the code was there, but got
16489         broken). 
16490
16491         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16492         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16493         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16494
16495 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16496
16497         * enum.cs: create the enum static fields using the enum type.
16498
16499 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16500
16501         * class.cs: don't try to create the ParamBuilder for the return
16502         type if it's not needed (and handle it breaking for the ms runtime
16503         anyway).
16504
16505 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16506
16507         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16508
16509 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16510
16511         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16512         the command.   This showed up while compiling the JANET source
16513         code, which used \r as its only newline separator.
16514
16515 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16516
16517         * class.cs (Method.Define): If we are an operator (because it
16518         reuses our code), then set the SpecialName and HideBySig.  #36128
16519
16520 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16521
16522         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16523         exception, report error 120 `object reference required'.
16524
16525         * driver.cs: Add --pause option, used during to measure the size
16526         of the process as it goes with --timestamp.
16527
16528         * expression.cs (Invocation.DoResolve): Do not allow methods with
16529         SpecialName to be invoked.
16530
16531 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16534         number before adding it.
16535
16536 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16537
16538         * ecore.cs (StandardImplicitConversion): When in an unsafe
16539         context, we allow conversion between void * to any other pointer
16540         type. This fixes bug #35973.
16541
16542 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16543
16544         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16545         is not thrown when extensionless outputs are used 
16546
16547 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16548
16549         * rootcontext.cs: fixed compilation of corlib.
16550
16551 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * attribute.cs (Attributes.Contains): Add new method.
16554
16555         * class.cs (MethodCore.LabelParameters): if the parameter is an
16556         `out' parameter, check that no attribute `[In]' has been passed.
16557
16558         * enum.cs: Handle the `value__' name in an enumeration.
16559
16560 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16561
16562         * decl.cs: Added special case to allow overrides on "protected
16563         internal" methods
16564
16565 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16566
16567         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16568         since it makes much more sense.
16569
16570         (Attributes.ctor): Don't require a Location parameter.
16571
16572         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16573
16574         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16575         since we already have that information per attribute.
16576
16577         * everywhere : make appropriate changes.
16578
16579         * class.cs (LabelParameters): Write the code which actually
16580         applies attributes to the return type. We can't do this on the MS
16581         .NET runtime so we flag a warning in the case an exception is
16582         thrown.
16583
16584 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * const.cs: Handle implicit null conversions here too.
16587
16588 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16589
16590         * class.cs (MethodCore.LabelParameters): Remove the extra
16591         Type [] parameter since it is completely unnecessary. Instead
16592         pass in the method's attributes so that we can extract
16593         the "return" attribute.
16594
16595 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16596
16597         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16598         of ignoring it and letting the compile continue.
16599
16600         * typemanager.cs (ChangeType): use an extra argument to return an
16601         error condition instead of throwing an exception.
16602
16603 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16604
16605         * expression.cs (Unary.TryReduce): mimic the code for the regular
16606         code path.  Perform an implicit cast in the cases where we can
16607         implicitly convert to one of the integral types, and then reduce
16608         based on that constant.   This fixes bug #35483.
16609
16610 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16611
16612         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16613
16614 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16615
16616         * namespace.cs: fixed bug #35489.
16617
16618 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16619
16620         * class.cs: Remove some dead code.
16621
16622         * cs-parser.jay: Estimate the number of methods needed
16623         (RootContext.MethodCount);
16624
16625         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16626         numbers instead of StringBuilders.
16627
16628         * support.cs (PtrHashtable): Add constructor with initial size;
16629         We can now reduce reallocations of the method table.
16630
16631 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16632
16633         * attribute.cs (ApplyAttributes): Keep track of the emitted
16634         attributes on a per-target basis. This fixes bug #35413.
16635
16636 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16639         default to the Windows 1252 encoding.
16640
16641         (UnixParseOption): Support version, thanks to Alp for the missing
16642         pointer. 
16643
16644         * AssemblyInfo.cs: Add nice assembly information.
16645
16646         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16647         (bug 35169).
16648
16649         * cs-parser.jay: Allow a trailing comma before the close bracked
16650         in the attribute_section production.
16651
16652         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16653         address of the instance was being taken, I will take this out,
16654         because we take the address of the object immediately here.
16655
16656 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16657
16658         * typemanager.cs (AreMultipleAllowed): Take care of the most
16659         obvious case where attribute type is not in the current assembly -
16660         stupid me ;-)
16661
16662 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16663
16664         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16665         definitions, instead of doing that afterwards.  
16666
16667         Also we use a nice little hack, depending on the constructor, we
16668         know if we are a "composed" name or a simple name.  Hence, we
16669         avoid the IndexOf test, and we avoid 
16670
16671         * codegen.cs: Add code to assist in a bug reporter to track down
16672         the source of a compiler crash. 
16673
16674 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16675
16676         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16677         types have been emitted for a given element and flag an error
16678         if something which does not have AllowMultiple set is used more
16679         than once.
16680
16681         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16682         attribute types and their corresponding AllowMultiple properties
16683
16684         (AreMultipleAllowed): Check the property for a given type.
16685
16686         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16687         property in the case we have a TypeContainer.
16688
16689         (Attributes.AddAttribute): Detect duplicates and just skip on
16690         adding them. This trivial fix catches a pretty gross error in our
16691         attribute emission - global attributes were being emitted twice!
16692
16693         Bugzilla bug #33187 is now fixed.
16694
16695 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16698         instead of pp_and).
16699
16700         * expression.cs (Binary.ResolveOperator): I can only use the
16701         Concat (string, string, string) and Concat (string, string,
16702         string, string) if the child is actually a concatenation of
16703         strings. 
16704
16705 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16708         context where we need a 2-character lookahead.
16709
16710         * pending.cs (PendingImplementation): Rework so we can keep track
16711         of interface types all the time, and flag those which were
16712         implemented by parents as optional.
16713
16714 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * expression.cs (Binary.ResolveOperator): Use
16717         String.Concat(string,string,string) or
16718         String.Concat(string,string,string,string) when possible. 
16719
16720         * typemanager: More helper methods.
16721
16722
16723 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16724
16725         * pending.cs: remove the bogus return from GetMissingInterfaces()
16726         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16727
16728 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16729
16730         * namespace.cs: avoid duplicated 'using xxx' being added to
16731         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16732         when we get more than one 'using' statement for the same namespace.
16733         Report a CS0105 warning for it.
16734
16735 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16738         of calling getChar/putback, uses internal knowledge of it.    
16739
16740         (xtoken): Reorder tokenizer so most common patterns are checked
16741         first.  This reduces the compilation time in another 5% (from 8.11s
16742         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16743
16744         The parsing time is 22% of the compilation in mcs, and from that
16745         64% is spent on the tokenization process.  
16746
16747         I tried using a binary search for keywords, but this is slower
16748         than the hashtable.  Another option would be to do a couple of
16749         things:
16750
16751                 * Not use a StringBuilder, instead use an array of chars,
16752                   with a set value.  Notice that this way we could catch
16753                   the 645 error without having to do it *afterwards*.
16754
16755                 * We could write a hand-parser to avoid the hashtable
16756                   compares altogether.
16757
16758         The identifier consumption process takes 37% of the tokenization
16759         time.  Another 15% is spent on is_number.  56% of the time spent
16760         on is_number is spent on Int64.Parse:
16761
16762                 * We could probably choose based on the string length to
16763                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16764                   computations. 
16765
16766         Another 3% is spend on wrapping `xtoken' in the `token' function.
16767
16768         Handle 0xa0 as whitespace (#34752)
16769
16770 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16771
16772         * typemanager.cs (IsCLRType): New routine to tell whether a type
16773         is one of the builtin types.  
16774
16775         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16776         typecode in more places instead of doing pointer comparissions.
16777         We could leverage some knowledge about the way the typecodes are
16778         laid out.
16779
16780         New code to cache namespaces in assemblies, it is currently not
16781         invoked, to be used soon.
16782
16783         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16784
16785         * expression.cs (Binary.ResolveOperator): specially handle
16786         strings, and do not perform user-defined operator overloading for
16787         built-in types.
16788
16789 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16790
16791         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16792         internalcall as it is a pretty simple operation;  Avoid whenever
16793         possible to call Char.IsLetter.
16794
16795         (consume_identifier): Cut by half the number of
16796         hashtable calls by merging the is_keyword and GetKeyword behavior.
16797
16798         Do not short-circuit, because if we do, we
16799         report errors (ie, #if false && true would produce an invalid
16800         directive error);
16801
16802
16803 2002-11-24  Martin Baulig  <martin@ximian.com>
16804
16805         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16806         check constant ranges and report a CS0221.  Fixes #33186.
16807
16808 2002-11-24  Martin Baulig  <martin@ximian.com>
16809
16810         * cs-parser.jay: Make this work for uninitialized variable
16811         declarations in the `for' initializer.  Fixes #32416.
16812
16813 2002-11-24  Martin Baulig  <martin@ximian.com>
16814
16815         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16816         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16817
16818 2002-11-24  Martin Baulig  <martin@ximian.com>
16819
16820         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16821         argument; if true, we also check for user-defined conversions.
16822         This is only needed if both arguments are of a user-defined type.
16823         Fixes #30443, added test-175.cs.
16824         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16825
16826         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16827
16828 2002-11-24  Martin Baulig  <martin@ximian.com>
16829
16830         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16831         function to get the store opcode.
16832         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16833         only emit the Ldelema if the store opcode is Stobj.  You must run
16834         both test-34 and test-167 to test this.  Fixes #34529.
16835
16836 2002-11-23  Martin Baulig  <martin@ximian.com>
16837
16838         * ecore.cs (Expression.MemberLookup): Added additional
16839         `qualifier_type' argument which is used when we're being called
16840         from MemberAccess.DoResolve() and null if we're called from a
16841         SimpleName lookup.
16842         (Expression.MemberLookupFailed): New method to report errors; this
16843         does the CS1540 check and reports the correct error message.
16844
16845         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16846         argument for the CS1540 check and redone the way how we're dealing
16847         with private members.  See the comment in the source code for details.
16848         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16849         `closure_start_type' to `closure_qualifier_type' and check whether
16850         it's not null.  It was not this filter being broken, it was just
16851         being called with the wrong arguments.
16852
16853         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16854         and pass it the correct `qualifier_type'; this also does the error
16855         handling for us.
16856
16857 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16858
16859         * expression.cs (Invocation.EmitParams): If the we are dealing
16860         with a non-built-in value type, load its address as well.
16861
16862         (ArrayCreation): Use a a pretty constant instead
16863         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16864         static initializers.  
16865
16866         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16867         because they are not really value types, just glorified integers. 
16868
16869         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16870
16871         * ecore.cs: Remove redundant code for enumerations, make them use
16872         the same code path as everything else, fixes the casting issue
16873         with enumerations in Windows.Forms.
16874
16875         * attribute.cs: Do only cast to string if it is a string, the
16876         validation happens later.
16877
16878         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16879         people upgrade their corlibs.
16880
16881         * ecore.cs: Oops, enumerations were not following the entire code path
16882
16883 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16884
16885         * typemanager.cs (FilterWithClosure): Commented out the test for
16886         1540 in typemanager.cs, as it has problems when accessing
16887         protected methods from a parent class (see test-174.cs). 
16888
16889         * attribute.cs (Attribute.ValidateGuid): new method.
16890         (Attribute.Resolve): Use above.
16891
16892 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16895
16896         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16897         handling for enumerations, as we only needed the TypeContainer
16898         functionality to begin with (this is required for the fix below to
16899         work for enums that reference constants in a container class for
16900         example). 
16901
16902         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16903
16904         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16905         a valid TypeBuilder to perform lookups on.o
16906
16907         * class.cs (InheritableMemberSignatureCompare): Use true in the
16908         call to GetGetMethod and GetSetMethod, because we are comparing
16909         the signature, and we need to get the methods *even* if they are
16910         private. 
16911
16912         (PropertyBase.CheckBase): ditto.
16913
16914         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16915         GotoCase.Resolve): Use Peel on EmpytCasts.
16916
16917         * ecore.cs (EmptyCast): drop child, add Peel method.
16918
16919 2002-11-17  Martin Baulig  <martin@ximian.com>
16920
16921         * ecore.cs (EmptyCast.Child): New public property.
16922
16923         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16924         label resolved to an EmptyCast.  Fixes #34162.
16925         (GotoCase.Resolve): Likewise.
16926         (Block.EmitMeta): Likewise.
16927
16928 2002-11-17  Martin Baulig  <martin@ximian.com>
16929
16930         * expression.cs (Invocation.BetterConversion): Prefer int over
16931         uint; short over ushort; long over ulong for integer literals.
16932         Use ImplicitConversionExists instead of StandardConversionExists
16933         since we also need to check for user-defined implicit conversions.
16934         Fixes #34165.  Added test-173.cs.
16935
16936 2002-11-16  Martin Baulig  <martin@ximian.com>
16937
16938         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16939         with the `true' and `false' literals.  Fixes #33151.
16940
16941 2002-11-16  Martin Baulig  <martin@ximian.com>
16942
16943         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16944         October 22nd; don't do the cs1540 check for static members.
16945
16946         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16947         now using our own filter here and doing the cs1540 check again.
16948
16949 2002-11-16  Martin Baulig  <martin@ximian.com>
16950
16951         * support.cs (InternalParameters): Don't crash if we don't have
16952         any fixed parameters.  Fixes #33532.
16953
16954 2002-11-16  Martin Baulig  <martin@ximian.com>
16955
16956         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16957         when looking up static methods to make this work on Windows.
16958         Fixes #33773.
16959
16960 2002-11-16  Martin Baulig  <martin@ximian.com>
16961
16962         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16963         a setter rather than using PropertyInfo.CanWrite.
16964
16965 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16966
16967         * class.cs: Allow acces to block member by subclasses. Fixes build
16968         breaker.
16969
16970 2002-11-14  Martin Baulig  <martin@ximian.com>
16971
16972         * class.cs (Constructor.Emit): Added the extern/block check.
16973         Fixes bug #33678.
16974
16975 2002-11-14  Martin Baulig  <martin@ximian.com>
16976
16977         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16978         iteration while looking for indexers, this is needed because the
16979         indexer may have a different name in our base classes.  Fixed the
16980         error reporting (no indexers at all, not get accessor, no
16981         overloaded match).  Fixes bug #33089.
16982         (IndexerAccess.DoResolveLValue): Likewise.
16983
16984 2002-11-14  Martin Baulig  <martin@ximian.com>
16985
16986         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16987         indexers.  Fixes the first part of bug #33089.
16988         (MethodSignature.InheritableMemberSignatureCompare): Added support
16989         for properties.
16990
16991 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16992
16993         * attribute.cs (Attribute.Resolve): Catch the
16994         NullReferenceException and report it since it isn't supposed to
16995         happen. 
16996
16997 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17000         LogicalOr and LogicalAnd that can benefit from recursively
17001         handling EmitBranchable.  The code now should be nice for Paolo.
17002
17003 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17006         the Type lookups, as we perform quite a number of lookups on
17007         non-Types.  This can be removed once we can deterministically tell
17008         whether we have a type or a namespace in advance.
17009
17010         But this might require special hacks from our corlib.
17011
17012         * TODO: updated.
17013
17014         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17015         and double which avoids a conversion from an integer to a double.
17016
17017         * expression.cs: tiny optimization, avoid calling IsConstant,
17018         because it effectively performs the lookup twice.
17019
17020 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17021
17022         But a bogus return here to keep the semantics of the old code
17023         until the Mono runtime is fixed.
17024
17025         * pending.cs (GetMissingInterfaces): New method used to remove all
17026         the interfaces that are already implemented by our parent
17027         classes from the list of pending methods. 
17028
17029         * interface.cs: Add checks for calls after ResolveTypeExpr.
17030
17031 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17032
17033         * class.cs (Class.Emit): Report warning 67: event not used if the
17034         warning level is beyond 3.
17035
17036         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17037         being a NullLiteral.
17038
17039         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17040         specifiers. 
17041
17042         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17043         path that might fail if a type can not be resolved.
17044
17045         * expression.cs (Binary.Emit): Emit unsigned versions of the
17046         operators. 
17047
17048         * driver.cs: use error 5.
17049
17050 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17051
17052         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17053
17054 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * cs-parser.jay (switch_section): A beautiful patch from Martin
17057         Baulig that fixed 33094.
17058
17059 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17060
17061         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17062         Check whether the base is abstract and report an error if so.
17063
17064         * expression.cs (IndexerAccess.DoResolveLValue,
17065         IndexerAccess.DoResolve): ditto. 
17066
17067         (Invocation.DoResolve): ditto.
17068
17069         (Invocation.FullMethodDesc): Improve the report string.
17070
17071         * statement.cs (Block): Eliminate IsVariableDefined as it is
17072         basically just a wrapper for GetVariableInfo.
17073
17074         * ecore.cs (SimpleName): Use new 
17075
17076         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17077         type, as we return the actual parameter ref/unref state on a
17078         different call.
17079
17080 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17081
17082         * support.cs: Return proper flags REF/OUT fixing the previous
17083         commit.  
17084
17085         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17086         not used to mean `ref' but `ref or out' in ParameterReference
17087
17088         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17089         full type signature instead of calling TypeManger.CSharpName
17090         ourselves. 
17091
17092         * support.cs (InternalParameters.ParameterDesc): Do not compare
17093         directly to the modflags, because REF/OUT will actually be bitsets
17094         if set. 
17095
17096         * delegate.cs (VerifyMethod): Check also the modifiers.
17097
17098         * cs-tokenizer.cs: Fix bug where floating point values with an
17099         exponent where a sign was missing was ignored.
17100
17101         * driver.cs: Allow multiple assemblies to be specified in a single
17102         /r: argument
17103
17104 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17105
17106         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17107         because identifiers after a parenthesis would end up in this kind
17108         of production, and we needed to desamiguate it for having casts
17109         like:
17110
17111                 (UserDefinedType *) xxx
17112
17113 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17114
17115         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17116         we should set on the Bindingflags.NonPublic, but not turn on
17117         private_ok.  private_ok controls whether a Private member is
17118         returned (this is chekced on the filter routine), while the
17119         BindingFlags.NonPublic just controls whether private/protected
17120         will be allowed.   This fixes the problem part of the problem of
17121         private properties being allowed to be used in derived classes.
17122
17123         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17124         so we can call the children DoResolveLValue method (this will
17125         properly signal errors on lvalue assignments to base properties)
17126
17127         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17128         getter are null, and we have a property info, we know that this
17129         happened because the lookup failed, so we report an error 122 for
17130         protection level violation.
17131
17132         We also silently return if setter and getter are null in the
17133         resolve functions, this condition only happens if we have flagged
17134         the error before.  This is the other half of the problem. 
17135
17136         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17137         not have accessibility information, that is why we were returning
17138         true in the filter function in typemanager.cs.
17139
17140         To properly report 122 (property is inaccessible because of its
17141         protection level) correctly, we report this error in ResolveAccess
17142         by failing if both the setter and the getter are lacking (ie, the
17143         lookup failed). 
17144
17145         DoResolve and DoLResolve have been modified to check for both
17146         setter/getter being null and returning silently, the reason being
17147         that I did not want to put the knowledge about this error in upper
17148         layers, like:
17149
17150         int old = Report.Errors;
17151         x = new PropertyExpr (...);
17152         if (old != Report.Errors)
17153                 return null;
17154         else
17155                 return x;
17156
17157         So the property expr is returned, but it is invalid, so the error
17158         will be flagged during the resolve process. 
17159
17160         * class.cs: Remove InheritablePropertySignatureCompare from the
17161         class, as we no longer depend on the property signature to compute
17162         whether it is possible to implement a method or not.
17163
17164         The reason is that calling PropertyInfo.GetGetMethod will return
17165         null (in .NET, in Mono it works, and we should change this), in
17166         cases where the Get Method does not exist in that particular
17167         class.
17168
17169         So this code:
17170
17171         class X { public virtual int A { get { return 1; } } }
17172         class Y : X { }
17173         class Z : Y { public override int A { get { return 2; } } }
17174
17175         Would fail in Z because the parent (Y) would not have the property
17176         defined.  So we avoid this completely now (because the alternative
17177         fix was ugly and slow), and we now depend exclusively on the
17178         method names.
17179
17180         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17181         reference method, instead of using the property.
17182
17183         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17184         routines are gone now.
17185
17186         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17187         names, they were incorrectly named.
17188
17189         * cs-tokenizer.cs: Return are more gentle token on failure. 
17190
17191         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17192         had an out-of-sync index variable, which caused it to remove from
17193         the list of pending methods the wrong method sometimes.
17194
17195 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17196
17197         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17198         CanWrite, because those refer to this particular instance of the
17199         property, and do not take into account the fact that we can
17200         override single members of a property.
17201
17202         Constructor requires an EmitContext.  The resolution process does
17203         not happen here, but we need to compute the accessors before,
17204         because the resolution does not always happen for properties.
17205
17206         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17207         subclass, before we did not update this flag, but we did update
17208         bindingflags. 
17209
17210         (GetAccessors): Drop this routine, as it did not work in the
17211         presence of partially overwritten set/get methods. 
17212
17213         Notice that this broke the cs1540 detection, but that will require
17214         more thinking. 
17215
17216 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17217
17218         * class.cs:
17219         * codegen.cs:
17220         * driver.cs: issue a warning instead of an error if we don't support
17221         debugging for the platform. Also ignore a couple of errors that may
17222         arise when trying to write the symbols. Undo my previous patch.
17223
17224 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17225
17226         * driver.cs: ignore /debug switch except for Unix platforms.
17227
17228 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17229
17230         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17231
17232 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17233
17234         * driver.cs: Do not make mcs-debug conditional, so we do not break
17235         builds that use it.
17236
17237         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17238         review this patch.  But basically after all the children variables
17239         have been merged, the value of "Breaks" was not being set to
17240         new_breaks for Switch blocks.  I think that it should be set after
17241         it has executed.  Currently I set this to the value of new_breaks,
17242         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17243         conservative, but I do not understand this code very well.
17244
17245         I did not break anything in the build, so that is good ;-)
17246
17247         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17248
17249 2002-10-20  Mark Crichton  <crichton@gimp.org>
17250
17251         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17252
17253 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17254
17255         * cfold.cs: Fixed compile blocker.
17256
17257 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17258
17259         * driver.cs: I was chekcing the key, not the file.
17260
17261 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17262
17263         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17264         message that we were generating - we just need to silently return
17265         a null.
17266
17267 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17268
17269         * class.cs (Event.Define): Change my previous commit, as this
17270         breaks the debugger.  This is a temporary hack, as it seems like
17271         the compiler is generating events incorrectly to begin with.
17272
17273         * expression.cs (Binary.ResolveOperator): Added support for 
17274         "U operator - (E x, E y)"
17275
17276         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17277         y)".
17278
17279         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17280         init-only variables, but this path did not take into account that
17281         there might be also instance readonly variables.  Correct this
17282         problem. 
17283
17284         This fixes bug 32253
17285
17286         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17287         delegates as well.
17288
17289         * driver.cs: Change the extension for modules to `netmodule'
17290
17291         * cs-parser.jay: Improved slightly the location tracking for
17292         the debugger symbols.
17293
17294         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17295         modifiers that were specified instead of the hardcoded value
17296         (FamAndAssem).  This was basically ignoring the static modifier,
17297         and others.  Fixes 32429.
17298
17299         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17300         fixed a bug in the process (32476)
17301
17302         * expression.cs (ArrayAccess.EmitAssign): Patch from
17303         hwang_rob@yahoo.ca that fixes bug 31834.3
17304
17305 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * driver.cs: Make the module extension .netmodule.
17308
17309 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17310
17311         * driver.cs: Report an error if the resource file is not found
17312         instead of crashing.
17313
17314         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17315         false, like Emit does.
17316
17317 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17318
17319         * typemanager.cs: Remove unused private member.  Also reported mcs
17320         bug to report this as a warning like csc.
17321
17322 2002-10-15  Martin Baulig  <martin@gnome.org>
17323
17324         * statement.cs (Statement.Emit): Made this a virtual method; emits
17325         the line number info and calls DoEmit().
17326         (Statement.DoEmit): New protected abstract method, formerly knows
17327         as Statement.Emit().
17328
17329         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17330
17331 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17332
17333         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17334         have fixed a remaining problem: not every AddXXXX was adding a
17335         fully qualified name.  
17336
17337         Now everyone registers a fully qualified name in the DeclSpace as
17338         being defined instead of the partial name.  
17339
17340         Downsides: we are slower than we need to be due to the excess
17341         copies and the names being registered this way.  
17342
17343         The reason for this is that we currently depend (on the corlib
17344         bootstrap for instance) that types are fully qualified, because
17345         we dump all the types in the namespace, and we should really have
17346         types inserted into the proper namespace, so we can only store the
17347         basenames in the defined_names array.
17348
17349 2002-10-10  Martin Baulig  <martin@gnome.org>
17350
17351         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17352         from bug #31834, see the bug report for a testcase which is
17353         miscompiled.
17354
17355 2002-10-10  Martin Baulig  <martin@gnome.org>
17356
17357         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17358         flow analysis code for this.
17359
17360         * statement.cs (Do, While, For): Tell the flow analysis code about
17361         infinite loops.
17362         (FlowBranching.UsageVector): Added support for infinite loops.
17363         (Block.Resolve): Moved the dead code elimination here and use flow
17364         analysis to do it.
17365
17366 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17367
17368         * class.cs (Field.Define): Catch cycles on struct type
17369         definitions. 
17370
17371         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17372         fields if the fields are static.  We only need to check instance
17373         fields. 
17374
17375         * expression.cs (As.DoResolve): Test for reference type.
17376
17377         * statement.cs (Using.ResolveExpression): Use
17378         ConvertImplicitRequired, not ConvertImplicit which reports an
17379         error on failture
17380         (Using.ResolveLocalVariableDecls): ditto.
17381
17382         * expression.cs (Binary.ResolveOperator): Report errors in a few
17383         places where we had to.
17384
17385         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17386
17387 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * expression.cs: Use StoreFromPtr instead of extracting the type
17390         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17391
17392         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17393         an enumeration value to a System.Enum, but System.Enum is not a
17394         value type, but an class type, so we need to box.
17395
17396         (Expression.ConvertExplicit): One codepath could return
17397         errors but not flag them.  Fix this.  Fixes #31853
17398
17399         * parameter.cs (Resolve): Do not allow void as a parameter type.
17400
17401 2002-10-06  Martin Baulig  <martin@gnome.org>
17402
17403         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17404         if it's a class type and not a struct.  Fixes #31815.
17405
17406 2002-10-06  Martin Baulig  <martin@gnome.org>
17407
17408         * statement.cs: Reworked the flow analysis code a bit to make it
17409         usable for dead code elimination.
17410
17411 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17412
17413         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17414
17415 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17416
17417         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17418         to fix the test 165, will investigate deeper.
17419
17420 2002-10-04  Martin Baulig  <martin@gnome.org>
17421
17422         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17423         finally blocks actually work.
17424         (Try.Resolve): We don't need to create a sibling for `finally' if
17425         there is no finally block.
17426
17427 2002-10-04  Martin Baulig  <martin@gnome.org>
17428
17429         * class.cs (Constructor.Define): The default accessibility for a
17430         non-default constructor is private, not public.
17431
17432 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * class.cs (Constructor): Make AllowedModifiers public, add
17435         EXTERN.
17436
17437         * cs-parser.jay: Perform the modifiers test here, as the
17438         constructor for the Constructor class usually receives a zero
17439         because of the way we create it (first we create, later we
17440         customize, and we were never checking the modifiers).
17441
17442         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17443         is a version of LookupTypeReflection that includes the type-name
17444         cache.  This can be used as a fast path for functions that know
17445         the fully qualified name and are only calling into *.GetType() to
17446         obtain a composed type.
17447
17448         This is also used by TypeManager.LookupType during its type
17449         composition.
17450
17451         (LookupType): We now also track the real type name, as sometimes
17452         we can get a quey for the real type name from things like
17453         ComposedCast.  This fixes bug 31422.
17454
17455         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17456         complete type fullname, it does not have to go through the type
17457         resolution system to obtain the composed version of the type (for
17458         obtaining arrays or pointers).
17459
17460         (Conditional.Emit): Use the EmitBoolExpression to
17461         generate nicer code, as requested by Paolo.
17462
17463         (ArrayCreation.CheckIndices): Use the patch from
17464         hwang_rob@yahoo.ca to validate the array initializers. 
17465
17466 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17467
17468         * class.cs (ConstructorInitializer.Emit): simplify code by using
17469         Invocation.EmitCall, and at the same time, fix the bugs in calling
17470         parent constructors that took variable arguments. 
17471
17472         * ecore.cs (Expression.ConvertNumericExplicit,
17473         Expression.ImplicitNumericConversion): Remove the code that
17474         manually wrapped decimal (InternalTypeConstructor call is now gone
17475         as well).
17476
17477         * expression.cs (Cast.TryReduce): Also handle decimal types when
17478         trying to perform a constant fold on the type.
17479
17480         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17481
17482         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17483         that only turned off an error report, and did nothing else. 
17484
17485 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17486
17487         * driver.cs: Handle and ignore /fullpaths
17488
17489 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17490
17491         * expression.cs (Binary.ResolveOperator): Catch the case where
17492         DoNumericPromotions returns true, 
17493
17494         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17495
17496 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17497
17498         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17499         report error 70.
17500
17501 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17504         conversion exists, but it is also required that the conversion be
17505         performed.  This manifested in "(Type64Enum) 2".  
17506
17507         * class.cs (TypeManager.AddMethod): The fix is not to change
17508         AddEnum, because that one was using a fully qualified name (every
17509         DeclSpace derivative does), but to change the AddMethod routine
17510         that was using an un-namespaced name.  This now correctly reports
17511         the duplicated name.
17512
17513         Revert patch until I can properly fix it.  The issue
17514         is that we have a shared Type space across all namespaces
17515         currently, which is wrong.
17516
17517         Options include making the Namespace a DeclSpace, and merge
17518         current_namespace/current_container in the parser.
17519
17520 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17521
17522         * cs-parser.jay: Improve error reporting when we get a different
17523         kind of expression in local_variable_type and
17524         local_variable_pointer_type. 
17525
17526         Propagate this to avoid missleading errors being reported.
17527
17528         * ecore.cs (ImplicitReferenceConversion): treat
17529         TypeManager.value_type as a target just like object_type.   As
17530         code like this:
17531
17532         ValueType v = 1;
17533
17534         Is valid, and needs to result in the int 1 being boxed before it
17535         is assigned to the value type v.
17536
17537         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17538         to validate the enumeration name.
17539
17540         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17541         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17542         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17543
17544         * ecore.cs (TryImplicitIntConversion): When doing an
17545         implicit-enumeration-conversion, check if the type is 64-bits and
17546         perform a conversion before passing to EnumConstant.
17547
17548 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17549
17550         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17551         report ambiguous type references.  Unlike the MS version, we
17552         report what the ambiguity is.   Innovation at work ;-)
17553
17554         (DeclSpace.FindType): Require a location argument to
17555         display when we display an ambiguous error.
17556
17557         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17558
17559         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17560
17561         * expression.cs (EmitDynamicInitializers): Apply patch from
17562         hwang_rob@yahoo.ca that fixes the order in which we emit our
17563         initializers. 
17564
17565 2002-09-21  Martin Baulig  <martin@gnome.org>
17566
17567         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17568         delegate takes no arguments.
17569
17570 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17571
17572         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17573         from integers.
17574
17575         * expression.cs: Extract the underlying type.
17576
17577         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17578
17579         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17580
17581 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17582
17583         * class.cs (TypeContainer.DefineType): We can not use the nice
17584         PackingSize with the size set to 1 DefineType method, because it
17585         will not allow us to define the interfaces that the struct
17586         implements.
17587
17588         This completes the fixing of bug 27287
17589
17590         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17591         means also structs.  This fixes part of the problem. 
17592         (Expresion.ImplicitReferenceConversionExists): ditto.
17593
17594         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17595         error if there were no errors reported during the type lookup
17596         process, to avoid duplicates or redundant errors.  Without this
17597         you would get an ambiguous errors plus a type not found.  We have
17598         beaten the user enough with the first error.  
17599
17600         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17601         reference. 
17602
17603         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17604         during the resolution process, stop the lookup, this avoids
17605         repeated error reports (same error twice).
17606
17607         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17608
17609         * typemanager.cs (LookupType): Redo the type lookup code to match
17610         the needs of System.Reflection.  
17611
17612         The issue is that System.Reflection requires references to nested
17613         types to begin with a "+" sign instead of a dot.  So toplevel
17614         types look like: "NameSpace.TopLevelClass", and nested ones look
17615         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17616         levels. 
17617
17618 2002-09-19  Martin Baulig  <martin@gnome.org>
17619
17620         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17621         says that a method always returns or always throws an exception,
17622         don't report the CS0161.
17623
17624         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17625         set `Returns = new_returns'.
17626
17627 2002-09-19  Martin Baulig  <martin@gnome.org>
17628
17629         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17630         to an enum constant, check for a CS0176.
17631
17632 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17633
17634         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17635         for operators that must be in pairs and report errors.
17636
17637         * ecore.cs (SimpleName.DoResolveType): During the initial type
17638         resolution process, when we define types recursively, we must
17639         check first for types in our current scope before we perform
17640         lookups in the enclosing scopes.
17641
17642         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17643
17644         (Invocation.VerifyArgumentsCompat): Call
17645         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17646         I thought we were supposed to always call this, but there are a
17647         few places in the code where we dont do it.
17648
17649 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17650
17651         * driver.cs: Add support in -linkres and -resource to specify the
17652         name of the identifier.
17653
17654 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * ecore.cs (StandardConversionExists): Sync with the conversion
17657         code: allow anything-* to void* conversions.
17658
17659         (FindMostSpecificSource): Use an Expression argument
17660         instead of a Type, because we might be handed over a Literal which
17661         gets a few more implicit conversions that plain types do not.  So
17662         this information was being lost.
17663
17664         Also, we drop the temporary type-holder expression when not
17665         required.
17666
17667 2002-09-17  Martin Baulig  <martin@gnome.org>
17668
17669         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17670         this is an explicit interface implementation.
17671
17672 2002-09-17  Martin Baulig  <martin@gnome.org>
17673
17674         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17675         different `IndexerName' attributes.
17676
17677         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17678         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17679         virtual CommonResolve().
17680
17681 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17684         and convert that to the UnderlyingType.
17685
17686         * statement.cs (Foreach.Resolve): Indexers are just like variables
17687         or PropertyAccesses.
17688
17689         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17690         inside quoted strings, we were not doing this before.
17691
17692 2002-09-16  Martin Baulig  <martin@gnome.org>
17693
17694         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17695         resolve it.  This is needed for the definite assignment check of the
17696         instance expression, fixes bug #29846.
17697         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17698
17699 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17700
17701         * parameter.cs: Fix compile error.  Cannot reference static member
17702         from an instance object.  Is this an mcs bug?
17703
17704 2002-09-14  Martin Baulig  <martin@gnome.org>
17705
17706         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17707         multiple times.  Fixes bug #30295, added test-166.cs.
17708
17709 2002-09-14  Martin Baulig  <martin@gnome.org>
17710
17711         * statement.cs (Block.Emit): Don't emit unreachable code.
17712         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17713         `break' statements.
17714         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17715
17716 2002-09-14  Martin Baulig  <martin@gnome.org>
17717
17718         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17719         is set.
17720
17721 2002-09-14  Martin Baulig  <martin@gnome.org>
17722
17723         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17724         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17725         be false on the ms runtime.
17726
17727 2002-09-13  Martin Baulig  <martin@gnome.org>
17728
17729         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17730         the CS0038 error message.
17731
17732 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17735         constant inside, return it.
17736
17737 2002-09-12  Martin Baulig  <martin@gnome.org>
17738
17739         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17740         implicit conversion can be done between enum types.
17741
17742         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17743         check whether an implicit conversion to the current enum's UnderlyingType
17744         exists and report an error if not.
17745
17746         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17747         without debugging support.
17748
17749         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17750         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17751
17752 2002-09-12  Martin Baulig  <martin@gnome.org>
17753
17754         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17755
17756         * ecore.cs (IMemberExpr.DeclaringType): New property.
17757         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17758         nonstatic member of an outer type (CS0038).
17759
17760 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17761
17762         * driver.cs: Activate the using-error detector at warning level
17763         4 (at least for MS-compatible APIs).
17764
17765         * namespace.cs (VerifyUsing): Small buglett fix.
17766
17767         * pending.cs (PendingImplementation): pass the container pointer. 
17768
17769         * interface.cs (GetMethods): Allow for recursive definition.  Long
17770         term, I would like to move every type to support recursive
17771         definitions, not the current ordering mechanism that we have right
17772         now.
17773
17774         The situation is this: Attributes are handled before interfaces,
17775         so we can apply attributes to interfaces.  But some attributes
17776         implement interfaces, we will now handle the simple cases
17777         (recursive definitions will just get an error).  
17778
17779         * parameter.cs: Only invalidate types at the end if we fail to
17780         lookup all types.  
17781
17782 2002-09-09  Martin Baulig  <martin@gnome.org>
17783
17784         * ecore.cs (PropertyExpr.Emit): Also check for
17785         TypeManager.system_int_array_get_length so this'll also work when
17786         compiling corlib.  Fixes #30003.
17787
17788 2002-09-09  Martin Baulig  <martin@gnome.org>
17789
17790         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17791         and throw an exception if we can't get the type's size.  Fixed #30040,
17792         added test-165.cs.
17793
17794 2002-09-09  Martin Baulig  <martin@gnome.org>
17795
17796         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17797
17798         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17799         context.  Fixes bug #30027.
17800
17801         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17802         virtual functions.  Fixes bug #30043, added test-164.cs.
17803
17804 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17805
17806         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17807
17808 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17809
17810         * driver.cs: Use an object to get the windows codepage since it's not a
17811         static property.
17812
17813 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17814
17815         * statement.cs (For.Emit): for infinite loops (test == null)
17816         return whether there is a break inside, not always "true".
17817
17818         * namespace.cs (UsingEntry): New struct to hold the name of the
17819         using definition, the location where it is defined, and whether it
17820         has been used in a successful type lookup.
17821
17822         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17823         strings.
17824
17825         * decl.cs: ditto.
17826
17827 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17828
17829         * attribute.cs : Fix incorrect code which relied on catching
17830         a NullReferenceException to detect a null being passed in
17831         where an object was expected.
17832
17833 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17834
17835         * statement.cs (Try): flag the catch variable as assigned
17836
17837         * expression.cs (Cast): Simplified by using ResolveType instead of
17838         manually resolving.
17839
17840         * statement.cs (Catch): Fix bug by using ResolveType.
17841
17842 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17843
17844         * expression.cs (BetterConversion): Special case for when we have
17845         a NullLiteral as the argument and we have to choose between string
17846         and object types - we choose string the way csc does.
17847
17848         * attribute.cs (Attribute.Resolve): Catch the
17849         NullReferenceException and report error #182 since the Mono
17850         runtime no more has the bug and having this exception raised means
17851         we tried to select a constructor which takes an object and is
17852         passed a null.
17853
17854 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17855
17856         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17857         message (1502, 1503) when we can't locate a method after overload
17858         resolution. This is much more informative and closes the bug
17859         Miguel reported.
17860
17861         * interface.cs (PopulateMethod): Return if there are no argument
17862         types. Fixes a NullReferenceException bug.
17863
17864         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17865         expressions too. Previously we were checking only in one place for
17866         positional arguments leaving out named arguments.
17867
17868         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17869         type to the enum type is not allowed. Remove code corresponding to
17870         that.
17871
17872         (ConvertNumericExplicit): Allow explicit conversions from
17873         the underlying type to enum type. This precisely follows the spec
17874         and closes a bug filed by Gonzalo.
17875
17876 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17877
17878         * compiler.csproj:
17879         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17880
17881 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17882
17883         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17884         it was important that we stored the right value after the
17885         reduction in `converted'.
17886
17887 2002-09-04  Martin Baulig  <martin@gnome.org>
17888
17889         * location.cs (Location.SymbolDocument): Use full pathnames for the
17890         source files.
17891
17892 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17893
17894         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17895         of the expression resolve mechanism, because that will catch the
17896         SimpleName error failures.
17897
17898         (Conditional): If we can not resolve the
17899         expression, return, do not crash.
17900
17901 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17902
17903         * cs-tokenizer.cs:
17904         (location): display token name instead of its number.
17905
17906 2002-08-28  Martin Baulig  <martin@gnome.org>
17907
17908         * expression.cs (Binary.ResolveOperator): Don't silently return
17909         but return an error if an operator cannot be applied between two
17910         enum types.
17911
17912 2002-08-28  Martin Baulig  <martin@gnome.org>
17913
17914         * class.cs (Constructor.Define): Set the permission attributes
17915         correctly instead of making all constructors public.
17916
17917 2002-08-28  Martin Baulig  <martin@gnome.org>
17918
17919         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17920         for private members before reporting a CS0103; if we find anything,
17921         it's a CS0122.
17922
17923 2002-08-28  Martin Baulig  <martin@gnome.org>
17924
17925         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17926         to check whether `closure_start_type == closure_invocation_type',
17927         we also need to check whether `m.DeclaringType == closure_invocation_type'
17928         before bypassing the permission checks.  We might be accessing
17929         protected/private members from the base class.
17930         (TypeManager.RealMemberLookup): Only set private_ok if private
17931         members were requested via BindingFlags.NonPublic.
17932
17933         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17934
17935         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17936         MethodGroupExpr.IsExplicitImpl if appropriate.
17937         (Invocation.DoResolve): Don't report the CS0120 for explicit
17938         interface implementations.
17939
17940 2002-08-27  Martin Baulig  <martin@gnome.org>
17941
17942         * expression.cs (Invocation.DoResolve): If this is a static
17943         method and we don't have an InstanceExpression, we must report
17944         a CS0120.
17945
17946 2002-08-25  Martin Baulig  <martin@gnome.org>
17947
17948         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17949         `==' between a valuetype and an object.
17950
17951 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * ecore.cs (TypeExpr): Provide a ToString method.
17954
17955 2002-08-24  Martin Baulig  <martin@gnome.org>
17956
17957         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17958         now called proggie.dbg and it's a binary file.
17959
17960 2002-08-23  Martin Baulig  <martin@gnome.org>
17961
17962         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17963
17964 2002-08-23  Martin Baulig  <martin@gnome.org>
17965
17966         * struct.cs (MyStructInfo.ctor): Make this work with empty
17967         structs; it's not allowed to use foreach() on null.
17968
17969 2002-08-23  Martin Baulig  <martin@gnome.org>
17970
17971         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17972         writer the full pathname of the generated assembly.
17973
17974 2002-08-23  Martin Baulig  <martin@gnome.org>
17975
17976         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17977         A `finally' block never returns or breaks; improved handling of
17978         unreachable code.
17979
17980 2002-08-23  Martin Baulig  <martin@gnome.org>
17981
17982         * statement.cs (Throw.Resolve): Allow `throw null'.
17983
17984 2002-08-23  Martin Baulig  <martin@gnome.org>
17985
17986         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17987         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17988         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17989         MemberLookup would return a wrong event if this is an explicit
17990         interface implementation and the class has an event with the same
17991         name.
17992
17993 2002-08-23  Martin Baulig  <martin@gnome.org>
17994
17995         * statement.cs (Block.AddChildVariableNames): New public method.
17996         (Block.AddChildVariableName): Likewise.
17997         (Block.IsVariableNameUsedInChildBlock): Likewise.
17998         (Block.AddVariable): Check whether a variable name has already
17999         been used in a child block.
18000
18001         * cs-parser.jay (declare_local_variables): Mark all variable names
18002         from the current block as being used in a child block in the
18003         implicit block.
18004
18005 2002-08-23  Martin Baulig  <martin@gnome.org>
18006
18007         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18008         find the symbol writer.
18009
18010         * driver.cs: csc also allows the arguments to /define being
18011         separated by commas, not only by semicolons.
18012
18013 2002-08-23  Martin Baulig  <martin@gnome.org>
18014
18015         * interface.cs (Interface.GetMembers): Added static check for events.
18016
18017 2002-08-15  Martin Baulig  <martin@gnome.org>
18018
18019         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18020         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18021
18022         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18023         why the MethodData.EmitDestructor() change was necessary.
18024
18025 2002-08-20  Martin Baulig  <martin@gnome.org>
18026
18027         * class.cs (TypeContainer.FindMembers): Added static check for events.
18028
18029         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18030
18031         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18032         use Type.GetEvents(), not Type.FindMembers().
18033
18034 2002-08-20  Martin Baulig  <martin@gnome.org>
18035
18036         * decl.cs (MemberCache): Added a special method cache which will
18037         be used for method-only searched.  This ensures that a method
18038         search will return a MethodInfo with the correct ReflectedType for
18039         inherited methods.      
18040
18041 2002-08-20  Martin Baulig  <martin@gnome.org>
18042
18043         * decl.cs (DeclSpace.FindMembers): Made this public.
18044
18045 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18046
18047         * delegate.cs: fixed build on windows.
18048         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18049
18050 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18051
18052         * ecore.cs (StandardConversionExists): Return a false
18053         if we are trying to convert the void type to anything else
18054         since that is not allowed.
18055
18056         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18057         we flag error 70 in the event an event is trying to be accessed
18058         directly from outside the declaring type.
18059
18060 2002-08-20  Martin Baulig  <martin@gnome.org>
18061
18062         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18063         MemberCache from typemanager.cs to decl.cs.
18064
18065 2002-08-19  Martin Baulig  <martin@gnome.org>
18066
18067         * class.cs (TypeContainer): Implement IMemberContainer.
18068         (TypeContainer.DefineMembers): Create the MemberCache.
18069         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18070         return public members if BindingFlags.Public was given, check
18071         whether members are static.
18072
18073 2002-08-16  Martin Baulig  <martin@gnome.org>
18074
18075         * decl.cs (DeclSpace.Define): Splitted this in Define and
18076         DefineMembers.  DefineMembers is called first and initializes the
18077         MemberCache.
18078
18079         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18080         DefineMembers() on all our DeclSpaces.
18081
18082         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18083         but call DefineMembers() on all nested interfaces.  We call their
18084         Define() in our new Define() function.
18085
18086         * interface.cs (Interface): Implement IMemberContainer.
18087         (Interface.Define): Moved all code except the attribute stuf to
18088         DefineMembers().
18089         (Interface.DefineMembers): Initialize the member cache.
18090
18091         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18092         need this anymore since we can use MemberCache.FindMembers directly.
18093
18094 2002-08-19  Martin Baulig  <martin@gnome.org>
18095
18096         * typemanager.cs (MemberCache): When creating the cache for an
18097         interface type, add all inherited members.
18098         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18099         to `out bool used_cache' and documented it.
18100         (TypeManager.MemberLookup): If we already used the cache in the first
18101         iteration, we don't need to do the interfaces check.
18102
18103 2002-08-19  Martin Baulig  <martin@gnome.org>
18104
18105         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18106         here from IMemberFinder and don't implement this interface anymore.
18107         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18108
18109         * typemanager.cs (IMemberFinder): This interface is now only used by
18110         classes which actually support the member cache.
18111         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18112         since we only put DeclSpaces into this Hashtable.
18113         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18114         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18115
18116 2002-08-16  Martin Baulig  <martin@gnome.org>
18117
18118         * typemanager.cs (ICachingMemberFinder): Removed.
18119         (IMemberFinder.MemberCache): New property.
18120         (TypeManager.FindMembers): Merged this with RealFindMembers().
18121         This function will never be called from TypeManager.MemberLookup()
18122         so we can't use the cache here, just the IMemberFinder.
18123         (TypeManager.MemberLookup_FindMembers): Check whether the
18124         IMemberFinder has a MemberCache and call the cache's FindMembers
18125         function.
18126         (MemberCache): Rewrote larger parts of this yet another time and
18127         cleaned it up a bit.
18128
18129 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18130
18131         * driver.cs (LoadArgs): Support quoting.
18132
18133         (Usage): Show the CSC-like command line arguments.
18134
18135         Improved a few error messages.
18136
18137 2002-08-15  Martin Baulig  <martin@gnome.org>
18138
18139         * typemanager.cs (IMemberContainer.Type): New property.
18140         (IMemberContainer.IsInterface): New property.
18141
18142         The following changes are conditional to BROKEN_RUNTIME, which is
18143         defined at the top of the file.
18144
18145         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18146         class'es members, but add all members from TypeHandle.ObjectType
18147         if we're an interface.
18148         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18149         is the current type.
18150         (MemberCache.CacheEntry.Container): Removed this field.
18151         (TypeHandle.GetMembers): Include inherited members.
18152
18153 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18154
18155         * typemanager.cs: fixed compilation and added a comment on a field that
18156         is never used.
18157
18158 2002-08-15  Martin Baulig  <martin@gnome.org>
18159
18160         * class.cs (ConstructorInitializer.Resolve): In the
18161         Expression.MemberLookup call, use the queried_type as
18162         invocation_type.
18163
18164         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18165         declared' attribute, it's always true.
18166         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18167         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18168         temporary wrapper for FindMembers which tells MemberLookup whether
18169         members from the base classes are included in the return value.
18170         This will go away soon.
18171         (TypeManager.MemberLookup): Use this temporary hack here; once the
18172         new MemberCache is completed, we don't need to do the DeclaredOnly
18173         looping here anymore since the MemberCache will take care of this.
18174         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18175         (MemberCache): When creating the MemberCache for a class, get
18176         members from the current class and all its base classes.
18177         (MemberCache.CacheEntry.Container): New field.  This is a
18178         temporary hack until the Mono runtime is fixed to distinguish
18179         between ReflectedType and DeclaringType.  It allows us to use MCS
18180         with both the MS runtime and the unfixed Mono runtime without
18181         problems and without accecting performance.
18182         (MemberCache.SearchMembers): The DeclaredOnly looping from
18183         TypeManager.MemberLookup is now done here.      
18184
18185 2002-08-14  Martin Baulig  <martin@gnome.org>
18186
18187         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18188         Type.GetFields on dynamic types but get the fields from the
18189         corresponding TypeContainer.
18190         (MyStructInfo.GetStructInfo): Added check for enum types.
18191
18192         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18193         (MemberList.SyncRoot): Implemented.
18194         (TypeManager.FilterWithClosure): No need to check permissions if
18195         closure_start_type == closure_invocation_type, don't crash if
18196         closure_invocation_type is null.
18197
18198 2002-08-13  Martin Baulig  <martin@gnome.org>
18199
18200         Rewrote TypeContainer.FindMembers to use a member cache.  This
18201         gives us a speed increase of about 35% for the self-hosting MCS
18202         build and of about 15-20% for the class libs (both on GNU/Linux).
18203
18204         * report.cs (Timer): New class to get enhanced profiling.  This
18205         whole class is "TIMER" conditional since it remarkably slows down
18206         compilation speed.
18207
18208         * class.cs (MemberList): New class.  This is an IList wrapper
18209         which we're now using instead of passing MemberInfo[]'s around to
18210         avoid copying this array unnecessarily.
18211         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18212         (ICachingMemberFinder, IMemberContainer): New interface.
18213         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18214         has already been checked, otherwise use it for the name comparision.
18215         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18216         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18217         if possible.  Returns a MemberList, not a MemberInfo [].
18218         (TypeHandle): New class, implements IMemberContainer.  We create
18219         one instance of this class per type, it contains a MemberCache
18220         which is used to do the member lookups.
18221         (MemberCache): New class.  Each instance of this class contains
18222         all members of a type and a name-based hash table.
18223         (MemberCache.FindMembers): This is our new member lookup
18224         function.  First, it looks up all members of the requested name in
18225         the hash table.  Then, it walks this list and sorts out all
18226         applicable members and returns them.
18227
18228 2002-08-13  Martin Baulig  <martin@gnome.org>
18229
18230         In addition to a nice code cleanup, this gives us a performance
18231         increase of about 1.4% on GNU/Linux - not much, but it's already
18232         half a second for the self-hosting MCS compilation.
18233
18234         * typemanager.cs (IMemberFinder): New interface.  It is used by
18235         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18236         Enum, Delegate or Interface.
18237         (TypeManager.finder_to_member_finder): New PtrHashtable.
18238         (TypeManager.finder_to_container): Removed.
18239         (TypeManager.finder_to_delegate): Removed.
18240         (TypeManager.finder_to_interface): Removed.
18241         (TypeManager.finder_to_enum): Removed.
18242
18243         * interface.cs (Interface): Implement IMemberFinder.
18244
18245         * delegate.cs (Delegate): Implement IMemberFinder.
18246
18247         * enum.cs (Enum): Implement IMemberFinder.
18248
18249         * class.cs (TypeContainer): Implement IMemberFinder.
18250
18251 2002-08-12  Martin Baulig  <martin@gnome.org>
18252
18253         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18254
18255 2002-08-12  Martin Baulig  <martin@gnome.org>
18256
18257         * ecore.cs (ITypeExpression): New interface for expressions which
18258         resolve to a type.
18259         (TypeExpression): Renamed to TypeLookupExpression.
18260         (Expression.DoResolve): If we're doing a types-only lookup, the
18261         expression must implement the ITypeExpression interface and we
18262         call DoResolveType() on it.
18263         (SimpleName): Implement the new ITypeExpression interface.
18264         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18265         hack, the situation that we're only looking up types can't happen
18266         anymore when this method is called.  Moved the type lookup code to
18267         DoResolveType() and call it.
18268         (SimpleName.DoResolveType): This ITypeExpression interface method
18269         is now doing the types-only lookup.
18270         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18271         (ResolveFlags): Added MaskExprClass.
18272
18273         * expression.cs (MemberAccess): Implement the ITypeExpression
18274         interface.
18275         (MemberAccess.DoResolve): Added support for a types-only lookup
18276         when we're called via ITypeExpression.DoResolveType().
18277         (ComposedCast): Implement the ITypeExpression interface.
18278
18279         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18280         Expression.Resolve() with ResolveFlags.Type instead.
18281
18282 2002-08-12  Martin Baulig  <martin@gnome.org>
18283
18284         * interface.cs (Interface.Define): Apply attributes.
18285
18286         * attribute.cs (Attribute.ApplyAttributes): Added support for
18287         interface attributes.
18288
18289 2002-08-11  Martin Baulig  <martin@gnome.org>
18290
18291         * statement.cs (Block.Emit): Only check the "this" variable if we
18292         do not always throw an exception.
18293
18294         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18295         whether the property has a set accessor.
18296
18297 2002-08-11  Martin Baulig  <martin@gnome.org>
18298
18299         Added control flow analysis support for structs.
18300
18301         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18302         with control flow analysis turned off.
18303         (IVariable): New interface.
18304         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18305         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18306         (FieldExpr.DoResolve): Resolve the instance expression with flow
18307         analysis turned off and do the definite assignment check after the
18308         resolving when we know what the expression will resolve to.
18309
18310         * expression.cs (LocalVariableReference, ParameterReference):
18311         Implement the new IVariable interface, only call the flow analysis
18312         code if ec.DoFlowAnalysis is true.
18313         (This): Added constructor which takes a Block argument.  Implement
18314         the new IVariable interface.
18315         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18316         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18317         This does the definite assignment checks for struct members.
18318
18319         * class.cs (Constructor.Emit): If this is a non-static `struct'
18320         constructor which doesn't have any initializer, call
18321         Block.AddThisVariable() to tell the flow analysis code that all
18322         struct elements must be initialized before control returns from
18323         the constructor.
18324
18325         * statement.cs (MyStructInfo): New public class.
18326         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18327         argument to this indexer.  If non-zero, check an individual struct
18328         member, not the whole struct.
18329         (FlowBranching.CheckOutParameters): Check struct members.
18330         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18331         overloaded versions of these methods which take an additional
18332         `int field_idx' argument to check struct members.
18333         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18334         overloaded versions of these methods which take an additional
18335         `string field_name' argument to check struct member.s
18336         (VariableInfo): Implement the IVariable interface.
18337         (VariableInfo.StructInfo): New public property.  Returns the
18338         MyStructInfo instance of the variable if it's a struct or null.
18339         (Block.AddThisVariable): New public method.  This is called from
18340         Constructor.Emit() for non-static `struct' constructor which do
18341         not have any initializer.  It creates a special variable for the
18342         "this" instance variable which will be checked by the flow
18343         analysis code to ensure that all of the struct's fields are
18344         initialized before control returns from the constructor.
18345         (UsageVector): Added support for struct members.  If a
18346         variable/parameter is a struct with N members, we reserve a slot
18347         in the usage vector for each member.  A struct is considered fully
18348         initialized if either the struct itself (slot 0) or all its
18349         members are initialized.
18350
18351 2002-08-08  Martin Baulig  <martin@gnome.org>
18352
18353         * driver.cs (Driver.MainDriver): Only report an error CS5001
18354         if there were no compilation errors.
18355
18356         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18357         `UnsafeContext' property to determine whether the parent is in
18358         unsafe context rather than checking the parent's ModFlags:
18359         classes nested in an unsafe class are unsafe as well.
18360
18361 2002-08-08  Martin Baulig  <martin@gnome.org>
18362
18363         * statement.cs (UsageVector.MergeChildren): Distinguish between
18364         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18365         we return.  Added test17() and test18() to test-154.cs.
18366
18367 2002-08-08  Martin Baulig  <martin@gnome.org>
18368
18369         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18370         Family access, make sure the invoking type isn't a subclass of the
18371         queried type (that'd be a CS1540).
18372
18373         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18374         this method which takes an additional `Type invocation_type'.
18375
18376         * expression.cs (BaseAccess.DoResolve): Use the base type as
18377         invocation and query type.
18378         (MemberAccess.DoResolve): If the lookup failed and we're about to
18379         report a CS0122, try a lookup with the ec.ContainerType - if this
18380         succeeds, we must report a CS1540.
18381
18382 2002-08-08  Martin Baulig  <martin@gnome.org>
18383
18384         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18385         (MethodGroupExpr): Implement the IMemberExpr interface.
18386
18387         * expression (MemberAccess.ResolveMemberAccess): No need to have
18388         any special code for MethodGroupExprs anymore, they're now
18389         IMemberExprs.   
18390
18391 2002-08-08  Martin Baulig  <martin@gnome.org>
18392
18393         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18394         Family, FamANDAssem and FamORAssem permissions.
18395         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18396
18397 2002-08-08  Martin Baulig  <martin@gnome.org>
18398
18399         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18400         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18401         or loop block.
18402
18403 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18404
18405         * driver.cs: implemented /resource option to embed managed resources.
18406
18407 2002-08-07  Martin Baulig  <martin@gnome.org>
18408
18409         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18410         (FieldBase.HasFieldInitializer): New public property.
18411         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18412         returns the field initializer and makes sure it is only resolved once.
18413         (TypeContainer.EmitFieldInitializers): Call
18414         FieldBase.GetInitializerExpression to get the initializer, this ensures
18415         that it isn't resolved multiple times.
18416
18417         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18418         the resolving process (SimpleName/MemberLookup) that we're currently
18419         emitting a field initializer (which must not access any instance members,
18420         this is an error CS0236).
18421
18422         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18423         argument, if the `IsFieldInitializer' flag is set, we must report and
18424         error CS0236 and not an error CS0120.   
18425
18426 2002-08-07  Martin Baulig  <martin@gnome.org>
18427
18428         * ecore.cs (IMemberExpr): New public interface.
18429         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18430         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18431         if the expression is an IMemberExpr.
18432
18433         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18434         to be null, implicitly default to `this' if we're non-static in
18435         this case.  Simplified the code a lot by using the new IMemberExpr
18436         interface.  Also fixed bug #28176 here.
18437
18438 2002-08-06  Martin Baulig  <martin@gnome.org>
18439
18440         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18441         ParameterReferences during semantic analysis so that we can do a
18442         type-only search when resolving Cast, TypeOf and SizeOf.
18443         (block): Pass the `current_local_parameters' to the Block's
18444         constructor.
18445
18446         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18447         argument to the constructor.
18448         (ConstructorInitializer.Resolve): Create a temporary implicit
18449         block with the parameters.
18450
18451         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18452         references here if we aren't doing a type-only search.
18453
18454         * statement.cs (Block): Added constructor which takes a
18455         `Parameters parameters' argument.
18456         (Block.Parameters): New public property.
18457
18458         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18459         to `Parameters' and made it public readonly.
18460
18461 2002-08-06  Martin Baulig  <martin@gnome.org>
18462
18463         * ecore.cs (Expression.Warning): Made this public as well.
18464
18465         * report.cs (Report.Debug): Print the contents of collections.
18466
18467 2002-08-06  Martin Baulig  <martin@gnome.org>
18468
18469         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18470         used to tell Resolve() which kinds of expressions it may return.
18471         (Expression.Resolve): Added overloaded version of this method which
18472         takes a `ResolveFlags flags' argument.  This can be used to tell
18473         Resolve() which kinds of expressions it may return.  Reports a
18474         CS0118 on error.
18475         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18476         ResolveFlags.SimpleName.
18477         (Expression.Error118): Added overloaded version of this method which
18478         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18479         which kinds of expressions are allowed.
18480
18481         * expression.cs (Argument.ResolveMethodGroup): New public method.
18482         Resolves an argument, but allows a MethodGroup to be returned.
18483         This is used when invoking a delegate.
18484
18485         * TODO: Updated a bit.
18486
18487 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18488
18489         Fixed compilation with csc.
18490
18491         * ecore.cs: Expression.Error made public. Is this correct? Should
18492         Warning be made public too?
18493
18494         * expression.cs: use ea.Location instead of ea.loc.
18495         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18496
18497 2002-08-06  Martin Baulig  <martin@gnome.org>
18498
18499         * ecore.cs (Expression.loc): Moved the location here instead of
18500         duplicating it in all derived classes.
18501         (Expression.Location): New public property.
18502         (Expression.Error, Expression.Warning): Made them non-static and
18503         removed the location argument.
18504         (Expression.Warning): Added overloaded version which takes an
18505         `int level' argument.
18506         (Expression.Error118): Make this non-static and removed the
18507         expression and location arguments.
18508         (TypeExpr): Added location argument to the constructor.
18509
18510         * expression.cs (StaticCallExpr): Added location argument to
18511         the constructor.
18512         (Indirection, PointerArithmetic): Likewise.
18513         (CheckedExpr, UnCheckedExpr): Likewise.
18514         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18515         (StringPtr): Likewise.
18516
18517
18518 2002-08-05  Martin Baulig  <martin@gnome.org>
18519
18520         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18521
18522         * assign.cs (Assign.DoResolve): Check whether the source
18523         expression is a value or variable.
18524
18525         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18526         while resolving the corresponding blocks.
18527
18528         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18529         an error, don't silently return null.
18530
18531         * statement.cs (Block.AddVariable): Do the error reporting here
18532         and distinguish between CS0128 and CS0136.
18533         (Block.DoResolve): Report all unused labels (warning CS0164).
18534         (LabeledStatement): Pass the location to the constructor.
18535         (LabeledStatement.HasBeenReferenced): New property.
18536         (LabeledStatement.Resolve): Set it to true here.
18537
18538         * statement.cs (Return.Emit): Return success even after reporting
18539         a type mismatch error (CS0126 or CS0127), this is what csc does and
18540         it avoids confusing the users with any consecutive errors.
18541
18542 2002-08-05  Martin Baulig  <martin@gnome.org>
18543
18544         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18545
18546         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18547
18548         * expression.cs (MemberAccess.DoResolve): Silently return if an
18549         error has already been reported.
18550
18551         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18552         error has already been reported.
18553
18554 2002-08-05  Martin Baulig  <martin@gnome.org>
18555
18556         * statement.cs (UsageVector): Only initialize the `parameters'
18557         vector if we actually have any "out" parameters.
18558
18559 2002-08-05  Martin Baulig  <martin@gnome.org>
18560
18561         * expression.cs (Binary.ResolveOperator): When combining delegates,
18562         they must have the same type.
18563
18564 2002-08-05  Martin Baulig  <martin@gnome.org>
18565
18566         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18567         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18568         work with the ms runtime and we also don't need it: if we're a
18569         PropertyBuilder and not in the `indexer_arguments' hash, then we
18570         are a property and not an indexer.
18571
18572         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18573         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18574         since the latter one doesn't work with the ms runtime.
18575
18576 2002-08-03  Martin Baulig  <martin@gnome.org>
18577
18578         Fixed bugs #27998 and #22735.
18579
18580         * class.cs (Method.IsOperator): New public field.
18581         (Method.CheckBase): Report CS0111 if there's already a method
18582         with the same parameters in the current class.  Report CS0508 when
18583         attempting to change the return type of an inherited method.
18584         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18585         and it's not marked abstract or extern.
18586         (PropertyBase): New abstract base class for Property and Indexer.
18587         (PropertyBase.CheckBase): Moved here from Property and made it work
18588         for indexers.
18589         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18590         the same so we can reuse it there.
18591         (Property, Indexer): Derive from PropertyBase.
18592         (MethodSignature.inheritable_property_signature_filter): New delegate
18593         to find properties and indexers.
18594
18595         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18596         argument and improved error reporting.
18597
18598         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18599         EmptyReadOnlyParameters and made it a property.
18600
18601         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18602         version of this method which takes a `PropertyInfo indexer'.
18603         (TypeManager.RegisterIndexer): New method.
18604
18605         * class.cs: Added myself as author of this file :-)
18606
18607 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18608
18609         * class.cs: fixed compilation on windoze.
18610
18611 2002-08-03  Martin Baulig  <martin@gnome.org>
18612
18613         * interface.cs (Interface.GetInterfaceBases): Check whether all
18614         base interfaces are at least as accessible than the current one.
18615
18616         * class.cs (TypeContainer.GetClassBases): Check whether base types
18617         are at least as accessible than the current type.
18618         (TypeContainer.AsAccessible): Implemented and made non-static.
18619         (MemberBase.CheckParameters): Report errors if the accessibility
18620         checks fail.
18621
18622         * delegate.cs (Delegate.Delegate): The default visibility is
18623         internal for top-level types and private for nested types.
18624         (Delegate.Define): Report errors if the accessibility checks fail.
18625
18626         * enum.cs (Enum.Enum): The default visibility is internal for
18627         top-level types and private for nested types.
18628         (Enum.DefineType): Compute the correct visibility.
18629
18630         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18631         function which takes a `bool is_toplevel' instead of a TypeContainer.
18632
18633         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18634         builtin type.
18635
18636 2002-08-02  Martin Baulig  <martin@gnome.org>
18637
18638         * expression.cs (LocalVariableReferenc): Added constructor which
18639         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18640         (LocalVariableReference.IsReadOnly): New property.
18641         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18642         variable is readonly, use our own readonly flag to do this; you can
18643         use the new constructor to get a writable reference to a read-only
18644         variable.
18645
18646         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18647         reference to the local variable.
18648
18649 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18650
18651         * rootcontext.cs (ResolveCore): Also include System.Exception
18652
18653         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18654         we reach an EmptyStatement.
18655
18656         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18657         is also fine.
18658
18659         * expression.cs (Binary.ResolveOperator): Check error result in
18660         two places.
18661
18662         use brtrue/brfalse directly and avoid compares to null.
18663
18664 2002-08-02  Martin Baulig  <martin@gnome.org>
18665
18666         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18667         Fixes bug #28407, added test-155.cs.
18668
18669 2002-08-01  Martin Baulig  <martin@gnome.org>
18670
18671         * class.cs (Event.EmitDefaultMethod): Make this work with static
18672         events.  Fixes #28311, added verify-3.cs.
18673
18674 2002-08-01  Martin Baulig  <martin@gnome.org>
18675
18676         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18677         `is_disposable' fields.
18678         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18679         `hm.is_disposable' if we're using the collection pattern.
18680         (Foreach.EmitCollectionForeach): Use the correct type for the
18681         enumerator's local variable, only emit the try/finally block if
18682         necessary (fixes #27713).
18683
18684 2002-08-01  Martin Baulig  <martin@gnome.org>
18685
18686         * ecore.cs (Expression.report118): Renamed to Error118 and made
18687         it public static.
18688
18689         * statement.cs (Throw.Resolve): Check whether the expression is of
18690         the correct type (CS0118) and whether the type derives from
18691         System.Exception (CS0155).
18692         (Catch.Resolve): New method.  Do the type lookup here and check
18693         whether it derives from System.Exception (CS0155).
18694         (Catch.CatchType, Catch.IsGeneral): New public properties.
18695
18696         * typemanager.cs (TypeManager.exception_type): Added.
18697
18698 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18699
18700         * driver.cs: Updated About function.
18701
18702 2002-07-31  Martin Baulig  <martin@gnome.org>
18703
18704         Implemented Control Flow Analysis.
18705
18706         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18707         (EmitContext.CurrentBranching): Added.
18708         (EmitContext.StartFlowBranching): Added.
18709         (EmitContext.EndFlowBranching): Added.
18710         (EmitContext.KillFlowBranching): Added.
18711         (EmitContext.IsVariableAssigned): Added.
18712         (EmitContext.SetVariableAssigned): Added.
18713         (EmitContext.IsParameterAssigned): Added.
18714         (EmitContext.SetParameterAssigned): Added.
18715         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18716         Added control flow analysis stuff here.
18717
18718         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18719         resolve the expression as lvalue.
18720         (LocalVariableReference.DoResolve): Check whether the variable has
18721         already been assigned.
18722         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18723         the parameter as assigned here.
18724         (ParameterReference.DoResolve): Check whether the parameter has already
18725         been assigned.
18726         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18727         expression as lvalue.
18728
18729         * statement.cs (FlowBranching): New class for the flow analysis code.
18730         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18731         (LabeledStatement.IsDefined): New public property.
18732         (LabeledStatement.AddUsageVector): New public method to tell flow
18733         analyis that the label may be reached via a forward jump.
18734         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18735         flow analysis.
18736         (VariableInfo.Number): New public field.  This is used by flow analysis
18737         to number all locals of a block.
18738         (Block.CountVariables): New public property.  This is the number of
18739         local variables in this block (including the locals from all parent
18740         blocks).
18741         (Block.EmitMeta): Number all the variables.
18742
18743         * statement.cs: Added flow analysis support to all classes.
18744
18745 2002-07-31  Martin Baulig  <martin@gnome.org>
18746
18747         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18748         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18749         then use this argument.
18750
18751         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18752
18753         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18754         use this to specify /define options.
18755
18756 2002-07-29  Martin Baulig  <martin@gnome.org>
18757
18758         * statement.cs (Fixed): Moved all code that does variable lookups
18759         and resolvings from Emit to Resolve.
18760
18761         * statement.cs (For): Moved all code that does variable lookups
18762         and resolvings from Emit to Resolve.
18763
18764         * statement.cs (Using): Moved all code that does variable lookups
18765         and resolvings from Emit to Resolve.
18766
18767 2002-07-29  Martin Baulig  <martin@gnome.org>
18768
18769         * attribute.cs (Attribute.Resolve): Explicitly catch a
18770         System.NullReferenceException when creating the
18771         CustromAttributeBuilder and report a different warning message.
18772
18773 2002-07-29  Martin Baulig  <martin@gnome.org>
18774
18775         * support.cs (ParameterData.ParameterName): Added method to
18776         get the name of a parameter.
18777
18778         * typemanager.cs (TypeManager.IsValueType): New public method.
18779
18780 2002-07-29  Martin Baulig  <martin@gnome.org>
18781
18782         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18783         is a flag which specifies that it's either ref or out.
18784         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18785         the out parameter to `out Parameter.Modifier mod', also set the
18786         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18787
18788         * support.cs (InternalParameters.ParameterModifier): Distinguish
18789         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18790         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18791
18792         * expression.cs (Argument.GetParameterModifier): Distinguish
18793         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18794         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18795
18796 2002-07-29  Martin Baulig  <martin@gnome.org>
18797
18798         * expression.cs (ParameterReference.ParameterReference): Added
18799         `Location loc' argument to the constructor.
18800
18801         * cs-parser.jay: Pass location to ParameterReference.
18802
18803 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * statement.cs (Try): Initialize the location.
18806
18807         * cs-parser.jay: pass location to Try.
18808
18809         * expression.cs (Unary.Reduce): Change the prototype to return
18810         whether a constant fold could be performed or not.  The result is
18811         returned in an out parameters.  In the case of Indirection and
18812         AddressOf, we want to perform the full tests.
18813
18814 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * statement.cs (Statement.Emit): Flag dead code.
18817
18818 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18819
18820         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18821
18822 2002-07-27  Martin Baulig  <martin@gnome.org>
18823
18824         * class.cs (MethodData.Define): Put back call to
18825         TypeManager.AddMethod(), accidentally commented this out.
18826
18827         * report.cs (Debug): New public method to print debugging information,
18828         this is `[Conditional ("DEBUG")]'.
18829
18830 2002-07-26  Martin Baulig  <martin@gnome.org>
18831
18832         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18833         (switch_statement): Push the current_block to the switch_stack and
18834         pop it again when we're done with the switch.
18835         (switch_section): The new block is a child of the current_block.
18836         Fixes bug #24007, added test-152.cs.
18837
18838 2002-07-27  Martin Baulig  <martin@gnome.org>
18839
18840         * expression.cs (Invocation.EmitArguments): When calling a varargs
18841         function with only its fixed arguments, we need to pass an empty
18842         array.
18843
18844 2002-07-27  Martin Baulig  <martin@gnome.org>
18845
18846         Mono 0.13 has been released.
18847
18848 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18849
18850         * driver.cs: Rename --resource to --linkres, because that is what
18851         we do currently, we dont support --resource yet.
18852
18853         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18854
18855 2002-07-25  Martin Baulig  <martin@gnome.org>
18856
18857         * class.cs (MethodData): New public class.  This is a `method builder'
18858         class for a method or one accessor of a Property/Indexer/Event.
18859         (MethodData.GetMethodFlags): Moved here from MemberBase.
18860         (MethodData.ApplyAttributes): Likewise.
18861         (MethodData.ApplyObsoleteAttribute): Likewise.
18862         (MethodData.ApplyConditionalAttribute): Likewise.
18863         (MethodData.ApplyDllImportAttribute): Likewise.
18864         (MethodData.CheckAbstractAndExternal): Likewise.
18865         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18866         (MethodData.Emit): Formerly known as Method.Emit().
18867         (MemberBase): Moved everything which was specific to a single
18868         accessor/method to MethodData.
18869         (Method): Create a new MethodData and call Define() and Emit() on it.
18870         (Property, Indexer, Event): Create a new MethodData objects for each
18871         accessor and call Define() and Emit() on them.
18872
18873 2002-07-25  Martin Baulig  <martin@gnome.org>
18874
18875         Made MethodCore derive from MemberBase to reuse the code from there.
18876         MemberBase now also checks for attributes.
18877
18878         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18879         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18880         as virtual.
18881         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18882         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18883         (MemberBase.ApplyAttributes): New virtual method; applies the
18884         attributes to a method or accessor.
18885         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18886         (MemberBase.ApplyConditionalAttribute): Likewise.
18887         (MemberBase.ApplyDllImportAttribute): Likewise.
18888         (MemberBase.CheckAbstractAndExternal): Likewise.
18889         (MethodCore.ParameterTypes): This is now a property instead of a
18890         method, it's initialized from DoDefineParameters().
18891         (MethodCore.ParameterInfo): Removed the set accessor.
18892         (MethodCore.DoDefineParameters): New protected virtual method to
18893         initialize ParameterTypes and ParameterInfo.
18894         (Method.GetReturnType): We can now simply return the MemberType.
18895         (Method.GetMethodFlags): Override the MemberBase version and add
18896         the conditional flags.
18897         (Method.CheckBase): Moved some code from Define() here, call
18898         DoDefineParameters() here.
18899         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18900         here to avoid some larger code duplication.
18901         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18902         ensure that abstract and external accessors don't declare a body.
18903
18904         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18905         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18906         lookup in the attribute's parent classes, so we need to abort as soon
18907         as we found the first match.
18908         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18909         the attribute has no arguments.
18910
18911         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18912         of a Method.
18913
18914 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18915
18916         * cs-parser.jay: reverted previous patch.
18917
18918 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18919
18920         * cs-parser.jay: fixed bug #22119.
18921
18922 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18923
18924         * attribute.cs: fixed compilation. The error was:
18925         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18926         be assigned to before control leaves the current method."
18927         [FIXME:  Filed as bug #28186: MCS must report this error.]
18928
18929 2002-07-25  Martin Baulig  <martin@gnome.org>
18930
18931         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18932         method to pull the condition name ouf of a Conditional attribute.
18933         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18934         the obsolete message and error flag out of an Obsolete attribute.
18935
18936         * class.cs (Method.GetMethodFlags): New public method to get the
18937         TypeManager.MethodFlags for this method.
18938         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18939         private methods.
18940         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18941         if we're overriding a virtual function, set the new private variable
18942         `parent_method'; call the new TypeManager.AddMethod().
18943
18944         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18945         the MethodBuilder and the Method in a PtrHashtable.
18946         (TypeManager.builder_to_method): Added for this purpose.
18947         (TypeManager.MethodFlags): Added IsObsoleteError.
18948         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18949         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18950         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18951         the message from the attribute.
18952
18953 2002-07-24  Martin Baulig  <martin@gnome.org>
18954
18955         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18956         preprocessor directives, ensure that the argument to #define/#undef is
18957         exactly one identifier and that it's actually an identifier.
18958
18959         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18960         did not work ....
18961
18962 2002-07-24  Martin Baulig  <martin@gnome.org>
18963
18964         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18965         initialize it to TypeManager.object_type in the constructor.
18966         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18967         of the `hm.get_current' method if we're using the collection pattern.
18968         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18969         for the explicit conversion to make it work when we're using the collection
18970         pattern and the `Current' property has a different return type than `object'.
18971         Fixes #27713.
18972
18973 2002-07-24  Martin Baulig  <martin@gnome.org>
18974
18975         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18976         does not match, but don't report any errors.  This method is called in
18977         order for all methods in a MethodGroupExpr until a matching method is
18978         found, so we don't want to bail out if the first method doesn't match.
18979         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18980         matches, report the 123.  Fixes #28070.
18981
18982 2002-07-24  Martin Baulig  <martin@gnome.org>
18983
18984         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18985         TypeManager.TypeToCoreType() to the top of the method so the
18986         following equality checks will work.  Fixes #28107.
18987
18988 2002-07-24  Martin Baulig  <martin@gnome.org>
18989
18990         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18991         operand is of type uint, and the other operand is of type sbyte,
18992         short or int, the operands are converted to type long." -
18993         Actually do what this comment already told us.  Fixes bug #28106,
18994         added test-150.cs.
18995
18996 2002-07-24  Martin Baulig  <martin@gnome.org>
18997
18998         * class.cs (MethodBase): New abstract class.  This is now a base
18999         class for Property, Indexer and Event to avoid some code duplication
19000         in their Define() and DefineMethods() methods.
19001         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19002         generic methods for Define() and DefineMethods().
19003         (FieldBase): Derive from MemberBase, not MemberCore.
19004         (Property): Derive from MemberBase, not MemberCore.
19005         (Property.DefineMethod): Moved all the code from this method to the
19006         new MethodBase.DefineAccessor(), just call it with appropriate
19007         argumetnts.
19008         (Property.Define): Call the new Property.DoDefine(), this does some
19009         sanity checks and we don't need to duplicate the code everywhere.
19010         (Event): Derive from MemberBase, not MemberCore.
19011         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19012         accessors, this will also make them work with interface events.
19013         (Indexer): Derive from MemberBase, not MemberCore.
19014         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19015         (Indexer.Define): Use the new MethodBase functions.
19016
19017         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19018         argument to the constructor.
19019         (Interface.FindMembers): Added support for interface events.
19020         (Interface.PopluateEvent): Implemented.
19021
19022         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19023
19024 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19025
19026         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19027         but this is required to check for a method name being the same as
19028         the containing class.  
19029
19030         Handle this now.
19031
19032 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19033
19034         * interface.cs: initialize variable.
19035
19036 2002-07-23  Martin Baulig  <martin@gnome.org>
19037
19038         Implemented the IndexerName attribute in interfaces.
19039
19040         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19041         name if this is an explicit interface implementation.
19042         (Indexer.InterfaceIndexerName): New public variable.  If we're
19043         implementing an interface indexer, this is the IndexerName in that
19044         interface.  Otherwise, it's the IndexerName.
19045         (Indexer.DefineMethod): If we're implementing interface indexer,
19046         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19047         and Pending.ImplementIndexer methods.
19048         (Indexer.Define): Also define the PropertyBuilder if we're
19049         implementing an interface indexer and this is neither an explicit
19050         interface implementation nor do the IndexerName match the one in
19051         the interface.
19052
19053         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19054         If a method is defined here, then we always need to create a proxy
19055         for it.  This is used when implementing interface indexers.
19056         (Pending.IsInterfaceIndexer): New public method.
19057         (Pending.ImplementIndexer): New public method.
19058         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19059         This is used when implementing interface indexers to define a proxy
19060         if necessary.
19061         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19062         define a proxy if necessary.
19063
19064         * interface.cs (Interface.IndexerName): New public variable.
19065         (Interface.PopulateIndexer): Set the IndexerName.
19066         (Interface.DefineIndexers): New private method.  Populate all the
19067         indexers and make sure their IndexerNames match.
19068
19069         * typemanager.cs (IndexerPropertyName): Added support for interface
19070         indexers.
19071
19072 2002-07-22  Martin Baulig  <martin@gnome.org>
19073
19074         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19075         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19076         ret if HasReturnLabel.
19077         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19078         variables.
19079
19080         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19081         and set the ec.LoopBeginTryCatchLevel.
19082         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19083         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19084         the current ec.TryCatchLevel, the branch goes out of an exception
19085         block.  In this case, we need to use Leave and not Br.
19086
19087 2002-07-22  Martin Baulig  <martin@gnome.org>
19088
19089         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19090         block unless the block does not always return or it is contained in
19091         another try { ... } catch { ... } block.  Fixes bug #26506.
19092         Added verify-1.cs to the test suite.
19093
19094 2002-07-22  Martin Baulig  <martin@gnome.org>
19095
19096         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19097         then we do not always return.  Fixes bug #24985.
19098
19099 2002-07-22  Martin Baulig  <martin@gnome.org>
19100
19101         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19102         lookup on a per-class level; ie. walk up the class hierarchy until we
19103         found at least one applicable method, then choose the best among them.
19104         Fixes bug #24463 and test-29.cs.
19105
19106 2002-07-22  Martin Baulig  <martin@gnome.org>
19107
19108         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19109         return types of the methods.  The return type is not part of the
19110         signature and we must not check it to make the `new' modifier work.
19111         Fixes bug #27999, also added test-147.cs.
19112         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19113
19114         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19115         on the method's return type.
19116
19117 2002-07-21  Martin Baulig  <martin@gnome.org>
19118
19119         * assign.cs: Make this work if the rightmost source is a constant and
19120         we need to do an implicit type conversion.  Also adding a few more tests
19121         to test-38.cs which should have caught this.
19122
19123         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19124         target in the makefile for this.  The makefile.gnu is primarily intended
19125         for end-users who don't want to debug the compiler.
19126
19127 2002-07-21  Martin Baulig  <martin@gnome.org>
19128
19129         * assign.cs: Improved the Assign class so it can now handle embedded
19130         assignments (X = Y = Z = something).  As a side-effect this'll now also
19131         consume less local variables.  test-38.cs now passes with MCS, added
19132         a few new test cases to that test.
19133
19134 2002-07-20  Martin Baulig  <martin@gnome.org>
19135
19136         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19137         instructions.  Fixes bug #27977, also added test-146.cs.
19138
19139 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19140
19141         * cs-tokenizer.cs: fixed getHex ().
19142
19143 2002-07-19  Martin Baulig  <martin@gnome.org>
19144
19145         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19146         not Type.GetType() to lookup the array type.  This is needed when
19147         we're constructing an array of a user-defined type.
19148         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19149         single-dimensional arrays, but also for single-dimensial arrays of
19150         type decimal.
19151
19152 2002-07-19  Martin Baulig  <martin@gnome.org>
19153
19154         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19155         this function is called, it's not allowed to share LocalBuilders
19156         among ILGenerators.
19157
19158 2002-07-19  Martin Baulig  <martin@gnome.org>
19159
19160         * expression.cs (Argument.Resolve): Report an error 118 when trying
19161         to pass a type as argument.
19162
19163 2002-07-18  Martin Baulig  <martin@gnome.org>
19164
19165         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19166         Conv_R_Un for the signed `long' type.
19167
19168 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19169
19170         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19171         `expr' for the temporary result, as that will fail if we do
19172         multiple resolves on the same expression.
19173
19174 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19175
19176         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19177         ec.TypeContainer for looking up aliases. 
19178
19179         * class.cs (TypeContainer): Remove LookupAlias from here.
19180
19181         * decl.cs (DeclSpace); Move here.
19182
19183 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19184
19185         * class.cs (FindMembers): Only call filter if the constructor
19186         bulider is not null.
19187
19188         Also handle delegates in `NestedTypes' now.  Now we will perform
19189         type lookups using the standard resolution process.  This also
19190         fixes a bug.
19191
19192         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19193         This uses Expressions (the limited kind that can be parsed by the
19194         tree) instead of strings.
19195
19196         * expression.cs (ComposedCast.ToString): Implement, used to flag
19197         errors since now we have to render expressions.
19198
19199         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19200         FormArrayType. 
19201
19202         * ecore.cs (SimpleName.ToString): ditto.
19203
19204         * cs-parser.jay: Instead of using strings to assemble types, use
19205         Expressions to assemble the type (using SimpleName, ComposedCast,
19206         MemberAccess).  This should fix the type lookups in declarations,
19207         because we were using a different code path for this.
19208
19209         * statement.cs (Block.Resolve): Continue processing statements
19210         even when there is an error.
19211
19212 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19213
19214         * class.cs (Event.Define): Also remove the `remove' method from
19215         the list of pending items.
19216
19217         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19218         generate more compact code. 
19219
19220 2002-07-17  Martin Baulig  <martin@gnome.org>
19221
19222         * const.cs (Const.LookupConstantValue): Add support for constant
19223         `unchecked' and `checked' expressions.
19224         Also adding test case test-140.cs for this.
19225
19226 2002-07-17  Martin Baulig  <martin@gnome.org>
19227
19228         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19229         check whether mi.ReturnType implements the IEnumerator interface; the
19230         `==' and the IsAssignableFrom() will fail in this situation.
19231
19232 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19233
19234         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19235         here too.
19236
19237 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19238
19239         * expression.cs: fixed bug #27811.
19240
19241 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19242
19243         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19244         Molaro: when we are a ref, the value already contains a pointer
19245         value, do not take the address of it.
19246
19247 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19248         * removed mb-parser.jay and mb-tokenizer.cs
19249
19250 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19251
19252         * expression.cs: check against the building corlib void type.
19253
19254 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19255
19256         * ecore.cs: fix for valuetype static readonly fields: when 
19257         initializing them, we need their address, not the address of a copy.
19258
19259 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19260
19261         * typemanager.cs: register also enum_type in corlib.
19262
19263 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19264
19265         * class.cs: allow calling this (but not base) initializers in structs.
19266
19267 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19268
19269         * ecore.cs: make sure we compare against the building base types
19270         in GetTypeSize ().
19271
19272 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19273
19274         * typemanager.cs: fix TypeToCoreType() to handle void and object
19275         (corlib gets no more typerefs after this change).
19276
19277 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * expression.cs (ArrayCreation.EmitArrayArguments): use
19280         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19281
19282         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19283         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19284         array indexes, the runtime actually forbids them.
19285
19286         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19287         for array arguments here.
19288
19289         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19290         instead of the default for ValueTypes.
19291
19292         (New.DoEmit): Use IsValueType instead of
19293         IsSubclassOf (value_type)
19294         (New.DoResolve): ditto.
19295         (Invocation.EmitCall): ditto.
19296
19297         * assign.cs (Assign): ditto.
19298
19299         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19300         Statements *are* currently doing part of their resolution during
19301         Emit.  
19302
19303         Expressions do always resolve during resolve, but statements are
19304         only required to propagate resolution to their children.
19305
19306 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19309
19310         (LoadAssembly): Do not add the dll if it is already specified
19311
19312         (MainDriver): Add the System directory to the link path at the end,
19313         after all the other -L arguments. 
19314
19315         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19316         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19317         ldelem.u1) and using the opposite for sbytes.
19318
19319         This fixes Digger, and we can finally run it.
19320
19321         * driver.cs (UnixParseOption): Move the option parsing here.  
19322         (CSCParseOption): Implement CSC-like parsing of options.
19323
19324         We now support both modes of operation, the old Unix way, and the
19325         new CSC-like way.  This should help those who wanted to make cross
19326         platform makefiles.
19327
19328         The only thing broken is that /r:, /reference: and /lib: are not
19329         implemented, because I want to make those have the same semantics
19330         as the CSC compiler has, and kill once and for all the confussion
19331         around this.   Will be doing this tomorrow.
19332
19333         * statement.cs (Unsafe.Resolve): The state is checked during
19334         resolve, not emit, so we have to set the flags for IsUnsfe here.
19335
19336 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19339         not catch the Error_ObjectRefRequired in SimpleName (as it is
19340         possible to have a class/instance variable name that later gets
19341         deambiguated), we have to check this here.      
19342
19343 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19344
19345         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19346         make static and put into Expression.
19347
19348         (Event.Define): Register the private field of the event with the 
19349         TypeManager so that GetFieldFromEvent can get at it.
19350
19351         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19352         keep track of the private field associated with an event which
19353         has no accessors.
19354
19355         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19356         private field.
19357
19358         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19359
19360 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * expression.cs (Binary.EmitBranchable): this routine emits the
19363         Binary expression in a branchable context.  This basically means:
19364         we need to branch somewhere, not just get the value on the stack.
19365
19366         This works together with Statement.EmitBoolExpression.
19367
19368         * statement.cs (Statement.EmitBoolExpression): Use
19369         EmitBranchable. 
19370
19371 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19372
19373         * statement.cs (For): Reduce the number of jumps in loops.
19374
19375         (For): Implement loop inversion for the For statement.
19376
19377         (Break): We can be breaking out of a Try/Catch controlled section
19378         (foreach might have an implicit try/catch clause), so we need to
19379         use Leave instead of Br.
19380
19381         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19382         now).  If the instace expression supports IMemoryLocation, we use
19383         the AddressOf method from the IMemoryLocation to extract the
19384         address instead of emitting the instance.
19385
19386         This showed up with `This', as we were emitting the instance
19387         always (Emit) instead of the Address of This.  Particularly
19388         interesting when This is a value type, as we dont want the Emit
19389         effect (which was to load the object).
19390
19391 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19392
19393         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19394
19395         * statement.cs (Checked): Set the CheckedState during the resolve
19396         process too, as the ConvCast operations track the checked state on
19397         the resolve process, and not emit.
19398
19399         * cs-parser.jay (namespace_member_declaration): Flag that we have
19400         found a declaration when we do.  This is used to flag error 1529
19401
19402         * driver.cs: Report ok when we display the help only.
19403
19404 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19405
19406         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19407
19408 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * cs-tokenizer.cs (define): We also have to track locally the
19411         defines.  AllDefines is just used for the Conditional Attribute,
19412         but we also need the local defines for the current source code. 
19413
19414 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19415
19416         * statement.cs (While, For, Do): These loops can exit through a
19417         Break statement, use this information to tell whether the
19418         statement is the last piece of code.
19419
19420         (Break): Flag that we break.
19421
19422         * codegen.cs (EmitContexts): New `Breaks' state variable.
19423
19424 2002-07-03  Martin Baulig  <martin@gnome.org>
19425
19426         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19427         modifiers in method declarations in structs.  Otherwise, you won't
19428         be able to override things like Object.Equals().
19429
19430 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * class.cs (Method, Property, Indexer): Do not allow the public
19433         modifier to be used in explicit interface implementations.
19434
19435         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19436         override modifiers in method declarations in structs
19437
19438 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19439
19440         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19441         integer or real overflow, report an error
19442
19443 2002-07-02  Martin Baulig  <martin@gnome.org>
19444
19445         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19446         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19447         to tell the runtime about our newly created System.Object and
19448         System.ValueType types.
19449
19450 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19453         struct instead of Ldarg/Starg.
19454
19455 2002-07-02  Martin Baulig  <martin@gnome.org>
19456
19457         * expression.cs (Indirection.Indirection): Call
19458         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19459
19460 2002-07-02  Martin Baulig  <martin@gnome.org>
19461
19462         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19463         ValueType, call TypeManager.TypeToCoreType() on it.
19464         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19465         the OpCodes.Newarr argument.
19466
19467 2002-07-02  Martin Baulig  <martin@gnome.org>
19468
19469         * expression.cs (Invocation.EmitCall): When compiling corlib,
19470         replace all calls to the system's System.Array type to calls to
19471         the newly created one.
19472
19473         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19474         System.Array methods.
19475         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19476         from the system's System.Array type which must be replaced.
19477
19478 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19479
19480         * typemanager.cs: load unverifiable_code_ctor so we can build
19481         corlib using the correct type. Avoid using GetTypeCode() with
19482         TypeBuilders.
19483         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19484         TypeManager.object_type to allow building corlib.
19485
19486 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19487
19488         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19489
19490 2002-07-01  Martin Baulig  <martin@gnome.org>
19491
19492         * class.cs: Make the last change actually work, we need to check
19493         whether `ifaces != null' to avoid a crash.
19494
19495 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19496
19497         * class.cs: when we build structs without fields that implement
19498         interfaces, we need to add the interfaces separately, since there is
19499         no API to both set the size and add the interfaces at type creation
19500         time.
19501
19502 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19503
19504         * expression.cs: the dimension arguments to the array constructors
19505         need to be converted if they are a long.
19506
19507 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19508
19509         * class.cs: don't emit ldarg.0 if there is no parent constructor
19510         (fixes showstopper for corlib).
19511
19512 2002-06-29  Martin Baulig  <martin@gnome.org>
19513
19514         MCS now compiles corlib on GNU/Linux :-)
19515
19516         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19517         ie. check for MethodImplOptions.InternalCall.
19518
19519         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19520         and TypeManager.attribute_type are null, so we must explicitly check
19521         whether parent is not null to find out whether it's an attribute type.
19522         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19523         and SetBuilder, not only if the property is neither abstract nor external.
19524         This is necessary to set the MethodImplOptions on the accessor methods.
19525         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19526         SetBuilder, see Property.Emit().
19527
19528         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19529         populate "System.Object", "System.ValueType" and "System.Attribute" since
19530         they've already been populated from BootCorlib_PopulateCoreTypes().
19531
19532 2002-06-29  Martin Baulig  <martin@gnome.org>
19533
19534         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19535         is the NullLiteral, we also need to make sure that target_type is not
19536         an enum type.   
19537
19538 2002-06-29  Martin Baulig  <martin@gnome.org>
19539
19540         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19541         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19542         before calling BootstrapCorlib_ResolveDelegate ().
19543
19544 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19545
19546         * statement.cs: fixed build-breaker. All tests passed ok.
19547
19548 2002-06-27  Martin Baulig  <martin@gnome.org>
19549
19550         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19551         for System.Decimal when compiling corlib.
19552
19553 2002-06-27  Martin Baulig  <martin@gnome.org>
19554
19555         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19556         switch blocks which contain nothing but a default clause.
19557
19558 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19559
19560        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19561
19562 2002-06-27  Martin Baulig  <martin@gnome.org>
19563
19564         * ecore.cs (PropertyExpr.PropertyExpr): Call
19565         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19566
19567         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19568         is already a TypeBuilder.
19569
19570 2002-06-27  Martin Baulig  <martin@gnome.org>
19571
19572         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19573         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19574         the "from an array-type to System.Array" case.  This makes it work
19575         when compiling corlib.
19576
19577 2002-06-27  Martin Baulig  <martin@gnome.org>
19578
19579         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19580         non-static PropertyExpr, set its InstanceExpression.  This makes
19581         the `ICollection.Count' property work in System/Array.cs.
19582
19583 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19584
19585         * driver.cs: Made error handling more consistent.  Errors now
19586         tracked by Report class, so many methods which used to return int
19587         now return void.  Main() now prints success/failure and 
19588         errors/warnings message.
19589
19590         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19591         the magic number return values (123 and 124).  Now, if the
19592         expected error occurs, the compiler exits with success (exit value
19593         0).  If the compilation completes without seeing that particular
19594         error, the compiler exits with failure (exit value 1).  The
19595         makefile in mcs/errors has been changed to handle the new behaviour.
19596
19597         * report.cs: Made 'expected error' number a property and renamed
19598         it from 'Probe' to 'ExpectedError'.
19599
19600         * genericparser.cs: Removed error handling support, since it is
19601         now all done by Report class.
19602
19603         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19604         class, so parse() no longer returns an int.
19605
19606         * namespace.cs: Use Report.Error instead of GenericParser.error
19607
19608 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19609
19610         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19611         TypeContainer.AddOperator): At the front of the list put the
19612         explicit implementations, so they get resolved/defined first. 
19613
19614 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19615
19616         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19617         interface type is implemented by this TypeContainer.  Used during
19618         explicit interface implementation.
19619
19620         (Property.Define, Indexer.Define, Method.Define): Validate that
19621         the given interface in the explicit implementation is one of the
19622         base classes for the containing type.
19623
19624         Also if we are explicitly implementing an interface, but there is
19625         no match in the pending implementation table, report an error.
19626
19627         (Property.Define): Only define the property if we are
19628         not explicitly implementing a property from an interface.  Use the
19629         correct name also for those properties (the same CSC uses,
19630         although that is really not needed).
19631
19632         (Property.Emit): Do not emit attributes for explicitly implemented
19633         properties, as there is no TypeBuilder.
19634
19635         (Indexer.Emit): ditto.
19636
19637         Hiding then means that we do not really *implement* a pending
19638         implementation, which makes code fail.
19639
19640 2002-06-22  Martin Baulig  <martin@gnome.org>
19641
19642         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19643         the return value of Object.GetType().  [FIXME: we need to do this whenever
19644         we get a type back from the reflection library].
19645
19646 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19647
19648         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19649
19650 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * attribute.cs: Return null if we can not look up the type.
19653
19654         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19655         the interface types found.
19656
19657         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19658         interface types found.
19659
19660         * typemanager.cs (GetInterfaces): Make this routine returns alll
19661         the interfaces and work around the lame differences between
19662         System.Type and System.Reflection.Emit.TypeBuilder in the results
19663         result for GetInterfaces.
19664
19665         (ExpandInterfaces): Given an array of interface types, expand and
19666         eliminate repeated ocurrences of an interface.  This expands in
19667         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19668         be IA, IB, IC.
19669
19670 2002-06-21  Martin Baulig  <martin@gnome.org>
19671
19672         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19673         on System.Enum.
19674
19675 2002-06-21  Martin Baulig  <martin@gnome.org>
19676
19677         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19678         and called with one of the core types, return the corresponding typebuilder for
19679         that type.
19680
19681         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19682         element type.
19683
19684 2002-06-21  Martin Baulig  <martin@gnome.org>
19685
19686         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19687         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19688         (Expression.ConvertReferenceExplicit): Likewise.
19689
19690         * expression.cs (ElementAccess.DoResolve): Likewise.
19691         (ElementAccess.DoResolveLValue): Likewise.
19692
19693 2002-06-10  Martin Baulig  <martin@gnome.org>
19694
19695         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19696         add the "value" parameter to the parameter list.
19697
19698         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19699         to our caller.
19700
19701 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19702
19703         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19704         the argument to an int, uint, long or ulong, per the spec.  Also
19705         catch negative constants in array creation.
19706
19707 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19708
19709         * class.cs: do not allow the same interface to appear twice in
19710         the definition list.
19711
19712 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19713
19714         * ecore.cs: don't use ldlen with System.Array.
19715
19716 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19717
19718         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19719
19720 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19721
19722         * modifiers.cs: produce correct field attributes for protected
19723         internal. Easy fix so miguel can work on ther harder stuff:-)
19724
19725 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19726
19727         * pending.cs: New file.  Move the code from class.cs here.
19728         Support clearning the pending flag for all methods (when not doing
19729         explicit interface implementation).
19730
19731 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19732
19733         * rootcontext.cs: added a couple more types needed to bootstrap.
19734
19735 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19738         constructor in the type, instead of any constructor in the type
19739         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19740         a bug in the Mono runtime when applying the params attribute). 
19741
19742 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19743         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19744
19745 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19746
19747         * expression.cs (Unary.ResolveOperator): Use TypeManager
19748         to resolve the type.
19749
19750 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19751
19752         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19753         attached.
19754
19755         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19756         with each member too.
19757
19758         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19759         field builders too - this takes care of the enum member case.
19760
19761 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19762
19763         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19764         address-of operator on both value types and pointers.
19765
19766 2002-06-10  Martin Baulig  <martin@gnome.org>
19767
19768         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19769         PropertyBuilder to the `property_builders' list.
19770
19771         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19772         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19773         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19774         find any indexers which are inherited from an interface.
19775
19776 2002-06-09  Martin Baulig  <martin@gnome.org>
19777
19778         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19779         the same type as the constant if necessary.  There's also a test-130.cs
19780         for this.
19781
19782         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19783
19784         * typemanager.cs (TypeManager.ChangeType): Previously known as
19785         Enum.ChangeEnumType().
19786
19787 2002-06-09  Martin Baulig  <martin@gnome.org>
19788
19789         * expression.cs (Cast.TryReduce): Added support for consts.
19790
19791 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19792
19793         * class.cs (Accessor): Hold attributes information so we can pass
19794         it along.
19795
19796         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19797         Modify to pass in attributes attached to the methods.
19798
19799         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19800
19801         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19802         to handle the Accessor kind :-)
19803
19804         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19805
19806 2002-06-08  Martin Baulig  <martin@gnome.org>
19807
19808         * expression.cs (Unary.TryReduceNegative): Added support for
19809         ULongConstants.
19810
19811 2002-06-08  Martin Baulig  <martin@gnome.org>
19812
19813         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19814         name can't be found in the `defined_names' - the caller will do a
19815         MemberLookup in this case and thus find methods in System.Enum
19816         such as Enum.IsDefined().
19817
19818 2002-06-08  Martin Baulig  <martin@gnome.org>
19819
19820         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19821         Convert.ChangeType() which works with TypeBuilder created types.
19822         (Enum.LookupEnumValue, Enum.Define): Use it here.
19823
19824         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19825         `TypeBuilder.BaseType != null' check.
19826         (TypeContainer.FindMembers): Only lookup parent members if we
19827         actually have a parent.
19828         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19829         (ConstructorInitializer.Resolve): Likewise.
19830
19831         * interface.cs (Interface.FindMembers): Added
19832         `TypeBuilder.BaseType != null' check.
19833
19834         * rootcontext.cs (RootContext.ResolveCore): Added
19835         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19836         classes_second_stage.
19837
19838         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19839         debug_type and trace_type when compiling with --nostdlib.       
19840
19841 2002-06-07  Martin Baulig  <martin@gnome.org>
19842
19843         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19844         (AddField): Set it to true when adding a non-static field.
19845         (DefineType): Use `have_nonstatic_fields' to find out whether we
19846         have non-static fields, not `Fields != null'.
19847
19848 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19849
19850         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19851         dereferencing a null on the static-field code path)
19852
19853 2002-05-30  Martin Baulig  <martin@gnome.org>
19854
19855         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19856         to take command line arguments.  Use reflection to call the new
19857         custom `Initialize' function on the symbol writer and pass it the
19858         command line arguments.
19859
19860         * driver.cs (--debug-args): New command line argument to pass command
19861         line arguments to the symbol writer.
19862
19863 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19866         the target type for indexers and properties.  Thanks to Joe for
19867         catching this.
19868
19869 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19870
19871         * typemanager.cs (MethodFlags): returns the method flags
19872         (Obsolete/ShouldIgnore) that control warning emission and whether
19873         the invocation should be made, or ignored. 
19874
19875         * expression.cs (Invocation.Emit): Remove previous hack, we should
19876         not do this on matching a base type, we should do this based on an attribute
19877
19878         Only emit calls to System.Diagnostics.Debug and
19879         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19880         on the command line.
19881
19882         * rootcontext.cs: Global settings for tracing and debugging.
19883
19884         * cs-tokenizer.cs (define): New utility function to track
19885         defines.   Set the global settings for TRACE and DEBUG if found.
19886
19887 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19888
19889         * interface.cs (Populate*): Pass in the TypeContainer as well as
19890         the DeclSpace as parameters so that we can create EmitContexts and
19891         then use that to apply attributes etc.
19892
19893         (PopulateMethod, PopulateEvent, PopulateProperty)
19894         (PopulateIndexer): Apply attributes everywhere.
19895
19896         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19897         etc.
19898
19899         (ApplyAttributes): Update accordingly.
19900
19901         We now apply interface attributes for all members too.
19902
19903 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * class.cs (Indexer.Define); Correctly check if we are explicit
19906         implementation (instead of checking the Name for a ".", we
19907         directly look up if the InterfaceType was specified).
19908
19909         Delay the creation of the PropertyBuilder.
19910
19911         Only create the PropertyBuilder if we are not an explicit
19912         interface implementation.   This means that explicit interface
19913         implementation members do not participate in regular function
19914         lookups, and hence fixes another major ambiguity problem in
19915         overload resolution (that was the visible effect).
19916
19917         (DefineMethod): Return whether we are doing an interface
19918         implementation. 
19919
19920         * typemanager.cs: Temporary hack until we get attributes in
19921         interfaces (Ravi is working on that) and we get IndexerName
19922         support in interfaces.
19923
19924         * interface.cs: Register the indexers as properties.
19925
19926         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19927         warning, I have verified that this is a bug in the .NET runtime
19928         (JavaScript suffers of the same problem).
19929
19930         * typemanager.cs (MemberLookup): When looking up members for
19931         interfaces, the parent of an interface is the implicit
19932         System.Object (so we succeed in searches of Object methods in an
19933         interface method invocation.  Example:  IEnumerable x;  x.ToString
19934         ()) 
19935
19936 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * class.cs (Event): Events should also register if they do
19939         implement the methods that an interface requires.
19940
19941         * typemanager.cs (MemberLookup); use the new GetInterfaces
19942         method. 
19943
19944         (GetInterfaces): The code used to lookup interfaces for a type is
19945         used in more than one place, factor it here. 
19946
19947         * driver.cs: Track the errors at the bottom of the file, we kept
19948         on going.
19949
19950         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19951         instance if the method we are calling is static!
19952
19953 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * attribute.cs (ApplyAttributes): Make this function filter out
19956         the IndexerName attribute (as that attribute in reality is never
19957         applied) and return the string constant for the IndexerName
19958         attribute. 
19959
19960         * class.cs (TypeContainer.Emit): Validate that all the indexers
19961         have the same IndexerName attribute, and if so, set the
19962         DefaultName attribute on the class. 
19963
19964         * typemanager.cs: The return value might contain other stuff (not
19965         only methods).  For instance, consider a method with an "Item"
19966         property and an Item method.
19967
19968         * class.cs: If there is a problem with the parameter types,
19969         return. 
19970
19971 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19972
19973         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19974         looks at user defined conversion after making a call to 
19975         StandardConversionExists - we need this for overload resolution.
19976
19977         * expression.cs : Update accordingly the various method calls.
19978
19979         This fixes 2 bugs filed against implicit user defined conversions 
19980
19981 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * statement.cs: Track the result of the assignment.
19984
19985 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * expression.cs (MemberAccess): Improved error reporting for
19988         inaccessible members.
19989
19990 2002-05-22  Martin Baulig  <martin@gnome.org>
19991
19992         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19993         itself with debugging support.
19994
19995 2002-05-22  Martin Baulig  <martin@gnome.org>
19996
19997         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19998         Removed, this isn't needed anymore.
19999
20000 2002-05-20  Martin Baulig  <martin@gnome.org>
20001
20002         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20003         be underlying type for an enum.
20004
20005 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20006
20007         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20008         that splits out the loading of just the core types.
20009
20010         * rootcontext.cs (ResolveCore): Split the struct resolution in
20011         two, so we can load the enumeration underlying types before any
20012         enums are used.
20013
20014         * expression.cs (Is): Bandaid until we fix properly Switch (see
20015         bug #24985 for details).
20016
20017         * typemanager.cs (ImplementsInterface): The hashtable will contain
20018         a null if there are no interfaces implemented.
20019
20020 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20021
20022         * cs-parser.jay (indexer_declarator): It is fine to have array
20023         parameters
20024
20025 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * typemanager.cs: (RegisterBuilder): New function used to register
20028         TypeBuilders that implement interfaces.  Since
20029         TypeBuilder.GetInterfaces (as usual) does not work with lame
20030         Reflection.Emit. 
20031         (AddUserType): register interfaces.
20032
20033         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20034         dealing with TypeBuilder.  Also, arrays are showing up as
20035         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20036         methods can not be invoked on them!
20037
20038         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20039         (ImplicitReferenceConversionExists): Split out from
20040         StandardConversionExists. 
20041
20042         * expression.cs (As): We were only implementing one of the three
20043         cases for the as operator.  We now implement them all.
20044         (Is): Implement the various other cases for Is as well.
20045
20046         * typemanager.cs (CACHE): New define used to control if we want or
20047         not the FindMembers cache.  Seems to have a negative impact on
20048         performance currently
20049
20050         (MemberLookup): Nested types have full acess to
20051         enclosing type members
20052
20053         Remove code that coped with instance/static returns for events, we
20054         now catch this in RealFindMembers.
20055
20056         (RealFindMembers): only perform static lookup if the instance
20057         lookup did not return a type or an event.  
20058
20059 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * assign.cs (CompoundAssign): We pass more semantic information
20062         now to Compound Assignments than we did before: now we have all
20063         the information at hand, and now we resolve the target *before* we
20064         do the expression expansion, which allows the "CacheValue" method
20065         to have the effect we intended (before, a [x] += 1 would generate
20066         two differen ArrayAccess expressions from the ElementAccess,
20067         during the resolution process).
20068
20069         (CompoundAssign.DoResolve): Resolve target and original_source here.
20070
20071 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * expression.cs (ArrayAccess): dropped debugging information. 
20074
20075         * typemanager.cs: Small bug fix: I was always returning i_members,
20076         instead of one of i_members or s_members (depending on which had
20077         the content).
20078
20079         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20080         method is invoked before any code generation takes place, and it
20081         is a mechanism to inform that the expression will be invoked more
20082         than once, and that the method should use temporary values to
20083         avoid having side effects
20084
20085         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20086
20087         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20088         implementation.
20089
20090         * expression.cs (Indirection, ArrayAccess): Add support for
20091         CacheTemporaries in these two bad boys. 
20092
20093         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20094         ldobj or ldind_ref.  
20095         (StoreFromPtr): Handle stobj as well.
20096
20097         * expression.cs (UnaryMutator): Share more code.
20098
20099         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20100         down: I was not tracking the Filter function as well, which
20101         was affecting the results of the cache.
20102
20103 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * attribute.cs: Remove the hack to handle the CharSet property on
20106         StructLayouts. 
20107
20108 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * attribute.cs (DoResolve): More uglyness, we now only try to
20111         resolve the attribute partially, to extract the CharSet
20112         information (only if we are a StructLayout attribute).  Otherwise 
20113
20114         (GetExtraTypeInfo): Add some code to conditionally kill in the
20115         future this.   I am more and more convinced that the .NET
20116         framework has special code to handle the attribute setting on
20117         certain elements.
20118
20119         * expression.cs (IsParamsMethodApplicable): Revert my previous
20120         foreach change here, it was wrong.
20121
20122 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20125         (pp_expr): do not abort on unknown input, just return.
20126         (eval): abort if there are pending chars.
20127
20128         * attribute.cs (Attribute.Resolve): Positional parameters are
20129         optional.  Deal with that case.
20130
20131         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20132         the Ansi/Unicode/Auto information for the type.
20133
20134         (TypeContainer.DefineType): instantiate the EmitContext here, as
20135         we will be using it during the type definition (to resolve
20136         attributes) and during the emit phase.
20137
20138         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20139         to pull type information out of the attributes
20140
20141         (Attribute.Resolve): track the constructor builder, and allow for
20142         multiple invocations (structs and classes will use this).
20143
20144         * ecore.cs (MemberLookupFinal): new version with all the
20145         parameters customizable.
20146
20147         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20148         constructors.  Return if the result value is null (as the error
20149         would have been flagged already by MemberLookupFinal)
20150
20151         Do not allow instances of abstract classes or interfaces to be
20152         created.
20153
20154         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20155         We have to compare the assembly property here when dealing with
20156         FamANDAssem and Assembly access modifiers, because we might be
20157         creating an assembly from *modules* (that means that we are not
20158         getting TypeBuilders for types defined in other modules that are
20159         part of this assembly).
20160
20161         (Method.Emit): If the method is marked abstract and has a body,
20162         emit an error. 
20163
20164         (TypeContainer.DefineMembers): If both the defined member and the
20165         parent name match are methods, then do not emit any warnings: let
20166         the Method.Define routine take care of flagging warnings.  But if
20167         there is a mismatch (method overrides something else, or method is
20168         overriwritten by something, then emit warning).
20169
20170         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20171         set to null, this means `do not check for the return type on the
20172         signature'. 
20173
20174         (Method.Define): set the return type for the method signature to
20175         null, so that we get methods with the same name and parameters and
20176         different return types.  This is used to flag warning 114 (you are
20177         hiding a method, and you probably want to use the new/override
20178         keywords instead).
20179
20180         * typemanager.cs (MemberLookup): Implemented proper access
20181         control, closing a long standing set of bug reports.  The problem
20182         was that the Framework only has two bits: Public and NonPublic,
20183         and NonPublic includes private and protected methods, but we need
20184         to enforce the FamANDAssem, FamOrAssem and Family. 
20185
20186 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20187
20188         * statement.cs (GotoCase): Return true: Ammounts to giving up
20189         knowledge on whether we return or not, and letting the other case
20190         be responsible for it.
20191
20192 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * driver.cs: Do not load directories for each file processed, only
20195         do it if there is a pattern.
20196
20197         * ecore.cs: Report readonly assigns here as well, as we might have
20198         been resolved only by MemberAccess.
20199
20200         (SimpleName.SimpleNameResolve): Also be useful for LValue
20201         resolution.   We need this to propagate assign to local readonly variables
20202
20203         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20204         do not want to reuse potential criteria memory.
20205
20206         * class.cs (MyEventBuilder): Set reflected_type;
20207
20208         * ecore.cs (Constantify): Added support for constifying bools.
20209
20210         (RootContext.LookupType): Added a cache for values looked up in
20211         the declaration space.
20212
20213         * typemanager.cs (FindMembers): Now is a front-end to
20214         RealFindMembers, and provides a two-level hashtable-based cache to
20215         the request.  
20216
20217         15% performance improvement: from 22.5 to 19.2 seconds.
20218
20219         * expression.cs (IsParamsMethodApplicable): use foreach.
20220         (Invocation.DoResolve): ditto.
20221         (New.DoResolve): ditto.
20222         (ArrayCreation.DoResolve): ditto.
20223
20224         * ecore.cs (FindMostEncompassingType): use foreach.
20225
20226         * delegate.cs (NewDelegate.DoResolve): Use foreach
20227
20228         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20229         (RemoveMethods): use foreach.
20230
20231         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20232         nested foreach statements instead of for, and also break out of
20233         the inner loop once a match is found.
20234
20235         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20236
20237 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20238
20239         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20240         we actually unwrap the expression to allow for extra information
20241         to be extracted. 
20242
20243         * expression.cs: Use Shr_Un on unsigned operations. 
20244
20245 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20246
20247         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20248         applicable operators was not being considered correctly. This closes
20249         the bug Miguel reported.
20250
20251 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20252
20253         * attribute.cs: check that the type derives from System.Attribute
20254         and report the correct error in that case (moved the duplicate code to
20255         its own method, too).
20256
20257 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20258
20259         * attribute.cs: lookup attribute type name as the spec says: first the
20260         bare attribute name and then name + "Attribute" (nant compiles with
20261         mcs after this fix).
20262
20263 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20264
20265         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20266         Because of the way we parse things, we should try to see if a
20267         UIntConstant can fit in an integer.
20268
20269 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20270
20271         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20272         when we are in an explicit context.
20273
20274         (ConvertReferenceExplicit): When converting from Iface type S to Class
20275         T make sure the rules are implemented as an OR.
20276
20277         * parameter.cs (ParameterType): Make it a property for now although the
20278         purpose really isn't anything immediate.
20279
20280         * expression.cs (Is*Applicable): Do better checking on the parameter type
20281         of a ref/out parameter. The ones from the system assemblies are already 
20282         marked with the correct type so we don't need to do any correction.
20283
20284         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20285         the object type is standard too so include that.
20286
20287 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20288
20289         * ecore.cs (StandardConversionExists): Augment with missing code:
20290         deal with IntConstant, LongConstants and Enumerations.
20291
20292         * assign.cs: Report the error, instead of failing silently
20293
20294         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20295         typecontainer that they are declared, because the
20296         typecontainer/namespace will have the list of using clauses that
20297         need to be applied.
20298
20299         Assembly Attributes were escaping the normal registration
20300         mechanism. 
20301
20302         (EmitCode): Apply attributes within an EmitContext that represents
20303         the container they were declared on.
20304
20305         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20306
20307 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20308
20309         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20310         Revamp completely - make much cleaner as we now operate only
20311         on a set of Types.
20312
20313         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20314         to implement the logic detailed in the spec more correctly.
20315
20316         (UserDefinedConversion): Update accordingly.
20317
20318 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * statement.cs: Return flow analysis information up.
20321
20322         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20323         and the default.
20324
20325         (token): Do not consume an extra character before calling
20326         decimal_digits.
20327
20328 2002-05-06  Piers Haken <piersh@friskit.com>
20329
20330         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20331
20332 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20333
20334         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20335         EmitContext during the instance constructor initializer
20336         resolution, to stop access to instance variables.
20337
20338         This is mandated by the spec, last paragraph of the `constructor
20339         initializers' section. 
20340
20341 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * cs-parser.jay, class.cs (Accessor): new class used to represent
20344         an accessor (get or set).  In the past we used `null' to represent
20345         a missing accessor.  But this is ambiguous because there was no
20346         way to tell in abstract indexers/properties if one of them was
20347         specified.
20348
20349         Now there is a way of addressing that.
20350
20351         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20352         instead of FindMembers.
20353
20354         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20355         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20356
20357         * attribute.cs: Treat indexers and properties as the same in terms
20358         of applying attributes
20359
20360         * ecore.cs (FindMostEncompassedType): Use statically initialized
20361         EmptyExpressions()s like we do elsewhere to avoid creating useless
20362         objects (and we take this out of the tight loop).
20363
20364         (GetConversionOperators): Move the code to extract the actual
20365         operators to a separate routine to clean things up.
20366
20367 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20368
20369         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20370         events are always registered FieldBuilders.
20371
20372         * class.cs (FieldBase): New class shared by Fields 
20373
20374         * delegate.cs: If we are a toplevel delegate, use our full name.
20375         If we are a nested delegate, then only use our tail name.
20376
20377 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20378
20379         * expression.cs (IsApplicable): Ensure that we add the "&" to
20380         ref/out types before comparing it with the type of the argument.
20381
20382         (IsParamsMethodApplicable): Ditto.
20383
20384         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20385         silly me ;-)
20386
20387         * delegate.cs : Handle the case when we have more than one applicable
20388         method. Flag an error only when we finish checking all.
20389
20390 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * expression.cs: Add support for boolean static initializers.
20393
20394 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20395
20396         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20397
20398         * parameter.cs (ComputeParameterTypes,
20399         ComputeAndDefineParameterTypes): Better error handling: now we
20400         clear the `types' cache if we fail during any of the type lookups.
20401         We also return the status code correctly to our caller
20402
20403         * delegate.cs: If we fail to define a delegate, abort the extra
20404         steps. 
20405
20406         * expression.cs (Binary.ResolveOperator): for
20407         operator==(object,object) and operator !=(object, object) we also
20408         have to verify that there is an implicit conversion from one to
20409         the other.
20410
20411         (ArrayAccess.DoResolve): Array Access can operate on
20412         non-variables. 
20413
20414 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20415
20416         * assign.cs (CompoundAssign): A new class used as a "flag" that
20417         the assignment actually is happening as part of a compound
20418         assignment operator.
20419
20420         During compound assignment, a few new rules exist to enable things
20421         like:
20422
20423         byte b |= 1 + 2
20424
20425         From the spec:
20426
20427         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20428         to the type of x) if y is implicitly convertible to the type of x,
20429         and the operator is a builtin operator and the return type of the
20430         operator is explicitly convertible to the type of x. 
20431
20432         * rootcontext.cs: Reset warning level to 2.  4 catches various
20433         "interesting" features in mcs, we must clean this up at some
20434         point, but currently am trying to kill other bugs ;-)
20435
20436         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20437         in container classes as well.  
20438
20439         * expression.cs (Binary.ResolveOperator): Handle string case
20440         before anything else (as operator overloading does emit an error
20441         before doing anything else).
20442
20443         This code could go away when we move to a table driven model, but
20444         i could not come up with a good plan last night.
20445
20446 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20447
20448         * typemanager.cs (CSharpName): reimplementation using regex.
20449         * class.cs: added null check for fields in Emit
20450         * rootcontext.cs: set warninglevel to 4
20451
20452 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20453
20454         * typemanager.cs (CSharpName): reimplemented with Lupus
20455         suggestion.
20456
20457 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * statement.cs (If): correclty implement Resolve, because we were
20460         not catching sem errors in there.  The same process is needed
20461         everywhere else. 
20462         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20463
20464
20465         (Statement.Warning_DeadCodeFound): Factorize code.
20466         (While): Report dead code here too.
20467
20468         (Statement): Added Resolve virtual method to allow
20469         for resolution split from the emit code.
20470
20471 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20472
20473         * statement.cs (EmitBoolExpression): No longer try to resolve the
20474         expression here.    
20475         (MakeBoolean): New utility function that resolve, implicitly
20476         converts to boolean and tags the expression. 
20477
20478
20479         (If, Do): Implement dead code elimination.
20480         (While): Implement loop inversion
20481
20482         (Do, While, For, If): Resolve the expression prior to calling our
20483         code generation.
20484
20485 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20486
20487         * class.cs:
20488           - added method Report28 (warning: program has more than one entry point)
20489           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20490           - modified method Method.Define, the part at the end of the method
20491
20492         * rootcontext.cs: added static public Location EntryPointLocation;
20493           
20494         * ../errors/cs0028.cs : Add test case for the above warning.              
20495
20496         * typemanager.cs:
20497           - modified method CSharpName to allow arrays of primitive type to
20498             be printed nicely (e.g. instead of System.Int32[][] it now prints
20499             int[][])
20500           - added method CSharpSignature: returns the signature of a method
20501             in string format to be used in reporting errors, warnings, etc.
20502
20503         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20504         with String.Empty.
20505
20506 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20507
20508         * delegate.cs (Define): Fix extremely silly bug where I was
20509         setting the type of the 'object' parameter of the BeginInvoke
20510         method to System.IAsyncResult instead of System.Object ;-)
20511
20512 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20513
20514         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20515         here. 
20516
20517         (Constructor.Emit): return if we fail to initialize the
20518         constructor.  Another door closed!  
20519
20520         * expression.cs (New.DoResolve): Improve error message (from -6 to
20521         1501).  Use DeclaredOnly lookup to find the exact constructor.
20522
20523         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20524         loop.  This is useful.
20525
20526         * cs-parser.jay: Adjust the default parameters so that destructors
20527         have the proper signature.
20528
20529 2002-04-26  Martin Baulig  <martin@gnome.org>
20530
20531         * driver.cs (LoadAssembly): If `assembly' contains any characters
20532         which are only valid in path names and not in assembly names
20533         (currently slash, backslash and point), use Assembly.LoadFrom ()
20534         instead of Assembly.Load () on the `assembly' (before iteration
20535         over the link_paths).
20536
20537 2002-04-26  Martin Baulig  <martin@gnome.org>
20538
20539         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20540
20541 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * class.cs (Property): use the new typemanager.MemberLookup
20544
20545         (TypeContainer.MemberLookup): Implement using the
20546         TypeManager.MemberLookup now. 
20547
20548         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20549         and return MemberInfos, so that these can be used without an
20550         EmitContext (what we had before).
20551
20552 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20553
20554         * expression.cs: Fix the case where the argument to params if the
20555         type of the params.  I omitted handling this before.   Fixed
20556
20557 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20558
20559         * driver.cs: Call BootCorlib_PopulateCoreType
20560
20561         * class.cs (Property.CheckBase): Check for properties only, not
20562         for all members. 
20563
20564         * interface.cs: Temporary hack: try/catch around the
20565         CustomAttributeBuilder, because I am getting an exception that I
20566         do not understand.
20567
20568         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20569         types whose definitions are required to be there (attributes are
20570         defined before standard types).
20571
20572         Compute definitions as we boot the various types, as they are used
20573         immediately (value_type class will need object_type, but if we do
20574         not initialize object_type, we will pass a null, which will let
20575         the runtime pick the System.Object from the existing corlib, which
20576         is not what we want).
20577
20578 2002-04-22  Patrik Torstensson <totte@labs2.com>
20579
20580         * cs-tokenizer.cs: fixed a number of trim() issues.
20581
20582 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20583
20584         * expression.cs (Argument.Type): Ensure that we return the correct
20585         type when we have out or ref parameters [in which case we 
20586         append a "&"].
20587
20588 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20589
20590         * class.cs (Property, Indexer): Allow extern modifier in there. 
20591
20592         * typemanager.cs (InitBaseTypes): Initializes object_type and
20593         value_type, since those will be used early on during the bootstrap
20594         process to compile corlib.
20595
20596         (InitCoreTypes): Move code from here to InitBaseTypes.
20597
20598 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20599
20600         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20601         single-dimension arrays as using the ldlen opcode.  
20602
20603         Daniel Lewis discovered this optimization.  
20604
20605         * typemanager.cs: Add signature for System.Array::get_Length
20606
20607 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20608
20609         * statement.cs: report the error when the foreach does not apply to an
20610         array nor a collection.
20611
20612 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20613
20614         * expression.cs: Add implicit conversions to the operator ~.
20615
20616         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20617
20618         * typemanager.cs: Locate the decimal constructor.
20619
20620 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20621
20622         * attribute.cs: use the new property of TypeOf.
20623         * expression.cs: added 'get' property around typearg.
20624
20625         These changes fix a build breaker reported by NickD. Is this the
20626         correct way to fix?  If not, please, revert my changes and make it
20627         work :-).
20628
20629 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * attribute.cs: Add support for typeof in attribute invocations.
20632         I am not sure that this is right though.
20633
20634 2002-04-14  Duncan Mak  <duncan@ximian.com>
20635
20636         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20637         Binary.Operator.Division case.
20638
20639 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20640
20641         * class.cs (DefineType): Ensure that we do a proper check on
20642         attribute types and also register it with the TypeManager.
20643
20644         (TypeContainer.Targets): The default for attribute types is
20645         AttributeTargets.All.
20646
20647         * attribute.cs (ApplyAttributes): Registering the attribute type
20648         is done elsewhere, not when we discover we have a Usage attribute.
20649
20650 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20651
20652         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20653         and get rid of is_delegate parameter.
20654
20655         * everywhere : update.
20656
20657 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20658
20659         * cs-parser.jay (compilation_unit): Revamp completely to use
20660         some new ideas that I got from Rhys' grammar to solve the problems
20661         with assembly level attributes.
20662
20663         (outer_declaration): New grammar production.
20664
20665         (attribute_sections): Add.
20666
20667         (opt_attributes): Base on attribute_sections
20668
20669         (namespace_declaration): Allow opt_attributes to tackle the case
20670         when we have assembly level attributes - we are clever in this
20671         regard now ;-)
20672
20673         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20674         attributes in the non-global context.
20675
20676         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20677         instead of SetGlobalAttributes.
20678
20679         * class.cs, rootcontext.cs : Ensure we define and generate 
20680         attribute types before anything else.
20681
20682         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20683         and flag the new error -20 for the case when the attribute type
20684         does not have valid targets specified. csc does not catch this.
20685
20686         * ../errors/errors.txt : update for error # -20
20687
20688 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20689
20690         * support.cs (InternalParameters.ParameterModifier): Do some null
20691         checking and return sane values.
20692
20693         * class.cs (Method.Define): If we are a PInvoke method, ensure
20694         that we are static and extern. Report error # 601
20695
20696         * ../errors/cs0601.cs : Add test case for the above error.
20697
20698 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20699
20700         * rootcontext.cs (attribute_types): We need to keep type of
20701         all attribute types separately and emit code for them first.
20702
20703         (RegisterAttribute) : Implement.
20704
20705         * class.cs (DefineType): Check if the current Type is a custom
20706         attribute type and register it accordingly.
20707
20708         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20709         adding the first attribute twice and rename to
20710
20711         (SetGlobalAttributes): this.
20712
20713         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20714         lookups.
20715
20716         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20717         if we are processing global arguments. Hmm, I am unsure of this.
20718
20719 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20720
20721         * expression.cs: added static array of strings to avoid calling
20722         Enum.ToString () for Operator in Binary. Significant recover of
20723         performance.
20724
20725 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * class.cs (FindMembers): Allow the Builders of the various
20728         members to be null.  If they are skip them.  This only happens
20729         during the PInvoke declaration.
20730
20731 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20732
20733         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20734         failure, so we do not keep going afterwards.
20735
20736         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20737         wanted to pass `false' as the `is_delegate' argument.  If this is
20738         the case, why not use delegate_type == null to mean `is_delegate =
20739         false' and anything else as is_delegate = true.
20740
20741 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20742
20743         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20744         code for the section, not the beginning of the tests.
20745
20746 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20747
20748         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20749
20750         * expression.cs (Binary): same.  Warn about errors where we have
20751         Enum/Enum in operator + as well.
20752
20753 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20754
20755         * statement.cs:
20756                 - added support for switch(bool)
20757                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20758                 - add TableSwitchEmit() to handle table-based switch statements
20759
20760 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20761
20762         * expression.cs (Invocation.OverloadResolve): Factor out code which
20763         does parameter compatibility checking with arguments so that we can 
20764         re-use the code even from Delegate.VerifyApplicability
20765
20766         (VerifyArgumentsCompat): Move above code here.
20767
20768         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20769         and instead make a call to the above method.
20770
20771 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20772
20773         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20774         We use it to keep track of classes which are attribute types.
20775
20776 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20777
20778         * delegate.cs (Delegate.Define): Correctly define the types in the
20779         presence of fixed and array parameters.
20780
20781         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20782         doing FindMembers.
20783
20784         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20785         include NonPublic after the first iteration.
20786
20787         * class.cs (Indexer.CheckBase): Only check if both parents are
20788         non-null. 
20789
20790         * cs-parser.jay (accessor_body): If empty, set to null.
20791
20792         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20793         same code path here to resolve constants names that we did have in
20794         MemberAccess.DoResolve.  There is too much code duplicated here.
20795
20796 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20799
20800         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20801         to MakeUnionSet.
20802
20803         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20804         tokens, numbers and strings.
20805
20806         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20807         parenthesis.
20808
20809         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20810         asyncronous parameters and the regular parameters.  
20811
20812         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20813         specify the target directory.
20814
20815         * expression.cs: (This.DoResolve): Simplify
20816         (As.Emit): Optimize, do not generate IsInst if the expression is
20817         always of the given type.
20818
20819         (Is.DoResolve): Bug fix, we were reporting both always/never for
20820         the is expression.
20821
20822         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20823         creating too many unnecessary arrays.
20824
20825 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20828         fields instead of rolling our own initializer.   Takes care of all
20829         implicit conversions, and drops unnecessary static checks/argument.
20830
20831 2002-03-31  Dick Porter  <dick@ximian.com>
20832
20833         * driver.cs: use the GetDirectories() return values properly, and
20834         use "/" as path separator.
20835
20836 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20837
20838         * expression.cs (Unary): Optimize - - expr into expr.
20839         (Binary): Optimize a + (-b) into a -b.
20840
20841         * codegen.cs (CodeGen): Made all methods static.
20842
20843 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20844
20845         * rootcontext.cs: 
20846
20847         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20848         TypeBuilder property.
20849
20850         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20851         instead. 
20852
20853         * tree.cs: Removed the various RecordXXXX, and replaced with a
20854         single RecordDecl.  Removed all the accessor methods, and just
20855         left a single access point Type 
20856
20857         * enum.cs: Rename DefineEnum to DefineType.
20858
20859         * decl.cs: New abstract method `DefineType' used to unify the
20860         Defines for Enumerations, Interfaces, TypeContainers and
20861         Delegates.
20862
20863         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20864         LookupBaseClasses method that used to live in class.cs and
20865         interface.cs here, and renamed to FindType.
20866
20867         * delegate.cs: Implement DefineType.  Take advantage of the
20868         refactored pattern for locating the parent builder without taking
20869         the parent_builder argument (which we know does not work if we are
20870         nested, and triggering a toplevel definition).
20871
20872 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20873
20874         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20875         accessibility of a member has changed during override and report
20876         an error if so.
20877
20878         * class.cs (Method.Define, Property.Define): Only complain on
20879         overrides if the method is private, any other accessibility is
20880         fine (and since we just checked the permission is the same, we are
20881         good to go).
20882
20883         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20884         and elif are processed always.  The other pre-processing
20885         directives are only processed if we are "taking" the path
20886
20887 2002-03-29  Martin Baulig  <martin@gnome.org>
20888
20889         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20890         current location is not Null.
20891
20892         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20893         a separate method so we can profile it.
20894
20895         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20896         `span.Seconds' are just seconds, but no minutes or hours.
20897         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20898
20899 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20900
20901         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20902         Remove the gratuitous set of Final:
20903
20904                                 // If an interface implementation, then we can set Final.
20905                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20906                                     implementing.DeclaringType.IsInterface)
20907                                         flags |= MethodAttributes.Final;
20908
20909         I do not know what I was smoking when I used that.
20910
20911
20912         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20913         step into fixing the name resolution issues for delegates and
20914         unifying the toplevel name resolution.
20915
20916 2002-03-28  Martin Baulig  <martin@gnome.org>
20917
20918         * class.cs (Method.Emit): If we have a symbol writer, call its
20919         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20920         tell it about the current method.
20921
20922         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20923         writer that we're going to emit the first byte of IL code for a new
20924         statement (a new source line).
20925         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20926         EmitContext.Mark() before emitting any code.
20927
20928         * location.cs (SymbolDocument): Return null when we're Null.
20929
20930         * statement.cs (Statement): Moved the `Location loc' variable here.
20931         (Statement.EmitBoolExpression): If we have a symbol writer, call
20932         ec.Mark() before emitting any code to tell it that we're at the
20933         beginning of a new statement.
20934         (StatementExpression): Added `Location' argument to the constructor.
20935         (Block): Added public readonly variable `StartLocation' and public
20936         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20937         (Block): Added constructor which takes a start and end location.
20938         (Block.SetEndLocation): New method. This sets the end location.
20939         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20940         local variables we create.
20941         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20942         each statement and do also mark the begin and end of the block.
20943
20944         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20945         tell it the current lexer.Location, use Location.Null for the end of the
20946         block.
20947         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20948         current block, set its end location using SetEndLocation().
20949         (statement_expression): StatementExpression constructor now takes the
20950         lexer.Location as additional argument.
20951         (for_statement, declare_local_variables): Likewise.
20952         (declare_local_variables): When creating a new implicit block, use the
20953         new Block constructor and pass it the lexer.Location.
20954
20955 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20956
20957         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20958         members also on the parent interfaces recursively.
20959
20960 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20961
20962         * report.cs: Use new formats, since Gonzalo finished the missing
20963         bits. 
20964
20965         * expression.cs (Binary.ResolveOperator): added missing operator|
20966         operator& and operator^ for bool/bool.
20967
20968         * cs-parser.jay: CheckDef now takes a Location argument that is
20969         used to report errors more precisly (instead of reporting the end
20970         of a definition, we try to track something which is a lot closer
20971         to the source of the problem).
20972
20973         * cs-tokenizer.cs: Track global token use, so we can properly flag
20974         the use of #define/#undef after the first token has been seen.
20975
20976         Also, rename the reportXXXX to Error_DescriptiveName
20977
20978         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20979         TypeContainer, so that Enum and Interface can use this too.
20980
20981         * class.cs (TypeContainer.LookupInterfaceOrClass,
20982         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20983         `builder' argument.  Typically this was used to pass the parent
20984         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20985         the definition).  
20986
20987         The problem is that a nested class could trigger the definition of
20988         a toplevel class, and the builder would be obviously wrong in that
20989         case. 
20990
20991         So we drop this argument, and we compute dynamically the
20992         TypeBuilder/ModuleBuilder (the correct information was available
20993         to us anyways from DeclSpace.Parent)
20994
20995         * interface.cs (Interface.DefineInterface): Drop builder
20996         parameter cleanup like class.cs
20997
20998         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20999         like class.cs
21000
21001         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21002         values. 
21003
21004         (Try.Emit): Propagate the returns value from the statement.
21005
21006         (Return.Emit): Even if we are leavning 
21007
21008         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21009
21010         * modifiers.cs: Fix the computation of MethodAttributes flags.
21011
21012 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21013
21014         * driver.cs: allow compilation of files that start with '/'.
21015         Add a default case when checking the argument of --target.
21016
21017 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21018
21019         * interface.cs: Implement the same search algorithm for types in
21020         the interface code.
21021
21022         * delegate.cs: Do not allow multiple definition.
21023
21024         * Recovered ChangeLog that got accidentally amputated
21025
21026         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21027
21028         * rootcontext.cs: Load manually enum to allow core classes to
21029         contain enumerations.
21030
21031         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21032         Update to new static methods in TypeManager.
21033
21034         * typemanager.cs (GetMethod, GetConstructor): Use our
21035         implementation of FindMembers to find the members, since during
21036         corlib compilation, the types are TypeBuilders and GetMethod and
21037         GetConstructor do not work.
21038
21039         Make all methods in TypeManager static.
21040
21041         (InitCodeHelpers): Split the functionality from
21042         the InitCodeTypes function.
21043
21044         * driver.cs: Call InitCodeHelpers after we have populated the
21045         types. 
21046
21047         * cs-parser.jay (delegate_declaration): we did not used to compute
21048         the delegate name correctly for void delegates.
21049
21050 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21051
21052         * rootcontext.cs (RootContext): Init the interface_resolve_order
21053         and type_container_resolve_order always.
21054
21055         (ResolveCore, BootstrapCorlib_ResolveClass,
21056         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21057         compiler when compiling with --nostdlib
21058
21059         * class.cs (TypeContainer.DefineType): Check that our parent is
21060         not null.  This test is most important when we are bootstraping
21061         the core types.
21062
21063         * codegen.cs: Split out the symbol writing code.
21064
21065 2002-03-25  Martin Baulig  <martin@gnome.org>
21066
21067         * driver.cs (-g): Made -g an alias for --debug.
21068
21069 2002-03-24  Martin Baulig  <martin@gnome.org>
21070
21071         * codegen.cs (SymbolWriter): New public variable. Returns the
21072         current symbol writer.
21073         (CodeGen): Added `bool want_debugging_support' argument to the
21074          constructor. If true, tell the ModuleBuild that we want debugging
21075         support and ask it for the ISymbolWriter.
21076         (Save): If we have a symbol writer, call it's Close() method after
21077         saving the assembly.
21078
21079         * driver.c (--debug): New command line argument to create a
21080         debugger information file.
21081
21082         * location.cs (SymbolDocument): New public property. Returns an
21083         ISymbolDocumentWriter object for the current source file or null
21084         if we don't have a symbol writer.
21085
21086 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21087
21088         * driver.cs (LoadAssembly): Correctly return when all the paths
21089         have been tried and not before.
21090
21091         * statement.cs (Switch.Emit): return the actual coverage for this
21092         statement (returns/not-returns)
21093
21094         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21095         switch of the statement if we are the last switch section.  That
21096         kills two problems: try/catch problems (we used to emit an empty
21097         nop at the end) and switch statements where all branches would
21098         return. 
21099
21100 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21101
21102         * driver.cs: Add default assemblies (the equivalent to the
21103         Microsoft CSC.RSP file)
21104
21105         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21106         also update tokens_seen and set it to false.
21107
21108         * driver.cs: Implement --recurse for Mike.
21109
21110         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21111         correctly splitting out the paths.
21112
21113 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21114
21115         * interface.cs (Interface.PopulateProperty): Instead of using
21116         `parent' as the declaration space for the set parameters, use
21117         `this' 
21118
21119         * support.cs (InternalParameters): InternalParameters constructor
21120         takes a DeclSpace instead of a TypeContainer.
21121
21122         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21123         types are being initialized, load the address of it before calling
21124         the function.  
21125
21126         (New): Provide a mechanism to disable the generation of local
21127         value type temporaries when the caller will be providing us with
21128         an address to store it.
21129
21130         (ArrayCreation.EmitDynamicInitializers): Use it.
21131
21132 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * expression.cs (Invocation.EmitArguments): Only probe for array
21135         property if there is more than one argument.  Sorry about that.
21136
21137         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21138         empty param arrays.
21139
21140         * class.cs (Method.LabelParameters): Fix incorrect code path that
21141         prevented the `ParamArrayAttribute' from being applied to the
21142         params attribute.
21143
21144 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21145
21146         * support.cs (ReflectionParameters): Correctly compute whether the
21147         last argument is a params array.  Fixes the problem with
21148         string.Split ('a')
21149
21150         * typemanager.cs: Make the assemblies array always be non-null
21151         (empty, but non-null)
21152
21153         * tree.cs (RecordDecl): New function that abstracts the recording
21154         of names.  This reports error 101, and provides a pointer to the
21155         previous declaration.  Fixes a crash in the compiler.
21156
21157         * cs-parser.jay (constructor_declaration): Update to new grammar,
21158         and provide a constructor_body that can be empty.
21159
21160 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21161
21162         * driver.cs: Add support for --resources.
21163
21164         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21165         Make all types for the various array helper methods be integer.
21166
21167         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21168         CheckState to ConvCast.
21169
21170         (ConvCast): Now it takes a `checked' state argument, to avoid
21171         depending on the emit context for the conversion, and just using
21172         the resolve time setting.
21173
21174         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21175         instead of Invocation.EmitArguments.  We do not emit the original
21176         arguments, instead we emit those which have been converted to
21177         unsigned int expressions.
21178
21179         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21180
21181         * codegen.cs: ditto.
21182
21183         * expression.cs (LocalVariableReference): Drop the use of the
21184         Store function that depended on the variable index.
21185
21186         * statement.cs (VariableInfo): Drop the `Idx' property from this
21187         class, as this is not taking into account the indexes for
21188         temporaries tat we generate during the execution, getting the
21189         indexes wrong.
21190
21191         * class.cs: First emit class initializers, then call the parent
21192         constructor. 
21193
21194         * expression.cs (Binary): Fix opcode emision.
21195         (UnaryMutator.EmitCode): Support checked code generation
21196
21197         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21198         matches for events for both the Static and Instance scans,
21199         pointing to the same element.   Fix that.
21200
21201 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21202
21203         * rootcontext.cs (ResolveTree): Always set the
21204         interface_resolve_order, because nested interfaces will be calling
21205         into us.
21206
21207         * class.cs (GetInterfaceOrClass): Track the same resolution
21208         process used by TypeManager.LookupType.  This fixes the nested
21209         type lookups in class declarations (separate path from
21210         LookupType). 
21211
21212         (TypeContainer.DefineType): Also define nested interfaces.
21213         (TypeContainer.RegisterOrder): New public function used to
21214         register the order in which child interfaces need to be closed.
21215
21216         Nested interfaces need to be closed after their parents have been
21217         created. 
21218
21219         * interface.cs (InterfaceAttr): Put all the logic for computing
21220         the interface attribute here. 
21221
21222         (DefineInterface): Register our interface order with the
21223         RootContext or with the TypeContainer depending on the case.
21224
21225 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21226
21227         * cs-parser.jay: rework foreach statement to work with the new
21228         changes to the policy on SimpleNames.
21229
21230         * report.cs: support Stacktrace on warnings as well.
21231
21232         * makefile: drop --unsafe and /unsafe from the compile.
21233
21234 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21235
21236         * ecore.cs (StandardConversionExists): Modify to take an Expression
21237         as the first parameter. Ensure we do null -> reference type conversion
21238         checking.
21239
21240         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21241         temporary Expression objects.
21242
21243 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21244
21245         * interface.cs: workaround bug in method overloading resolution
21246         (there is already a bugzilla bug for it).
21247
21248 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21249
21250         We could also solve this problem by having a separate path for
21251         performing type lookups, instead of DoResolve, we could have a
21252         ResolveType entry point, and only participating pieces of the
21253         production (simplename, deref, array) would implement this. 
21254
21255         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21256         signal SimpleName to only resolve type names and not attempt to
21257         resolve anything else.
21258
21259         * expression.cs (Cast): Set the flag.
21260
21261         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21262
21263         * class.cs: Only report 108 if there is no `new' modifier.
21264
21265         * cs-parser.jay: rework foreach statement to work with the new
21266         changes to the policy on SimpleNames.
21267         
21268         * report.cs: support Stacktrace on warnings as well.
21269
21270         * makefile: drop --unsafe and /unsafe from the compile.
21271
21272 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21273
21274         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21275         lookups here, instead of doing that at parse time.  This means
21276         that our grammar will not introduce `LocalVariableReferences' as
21277         expressions at this point.  That solves the problem of code like
21278         this:
21279
21280         class X {
21281            static void Main ()
21282            { int X = 1;
21283             { X x = null }}}
21284
21285         This is only half the fix.  The full fix requires parameters to
21286         also be handled in this way.
21287
21288         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21289         makes the use more obvious of the DeclSpace.  The
21290         ec.TypeContainer.TypeBuilder is now only used to pull the
21291         TypeBuilder for it.
21292
21293         My theory is that I can get rid of the TypeBuilder completely from
21294         the EmitContext, and have typecasts where it is used (from
21295         DeclSpace to where it matters).  
21296
21297         The only pending problem is that the code that implements Aliases
21298         is on TypeContainer, and probably should go in DeclSpace.
21299
21300         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21301         lookups here, instead of doing that at parse time.  This means
21302         that our grammar will not introduce `LocalVariableReferences' as
21303         expressions at this point.  That solves the problem of code like
21304         this:
21305
21306         class X {
21307            static void Main ()
21308            { int X = 1;
21309             { X x = null }}}
21310
21311         This is only half the fix.  The full fix requires parameters to
21312         also be handled in this way.
21313
21314         * class.cs (Property.DefineMethod): When implementing an interface
21315         method, set newslot, when implementing an abstract method, do not
21316         set the flag (before we tried never setting it, or always setting
21317         it, which is the difference).
21318         (Indexer.DefineMethod): same.
21319         (Method.DefineMethod): same.
21320
21321         * ecore.cs: Only set the status used flag if we get back a Field.
21322
21323         * attribute.cs: Temporary hack, so Paolo can keep working.
21324
21325 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21326
21327         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21328         the unmanaged type in the case we have a MarshalAs attribute.
21329
21330         (Resolve): Handle the case when we are parsing the special MarshalAs
21331         attribute [we need to store the unmanaged type to use later]
21332
21333         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21334         MarshalAs Attribute.
21335
21336         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21337         on parameters and accordingly set the marshalling info.
21338
21339 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21340
21341         * class.cs: Optimizing slightly by removing redundant code after
21342         we switched to the `NoTypes' return value.
21343         (Property.DefineMethod): use NoTypes here too.
21344
21345         This fixes the bug I introduced in my last batch of changes.
21346
21347 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21348
21349         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21350
21351         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21352         Enums since those are types too. 
21353
21354         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21355
21356         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21357         thanks to a call during the lookup process.
21358
21359 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21360
21361         * statement.cs (Foreach): Lots of work to accomodate a particular
21362         kind of foreach statement that I had not kept in mind.  It is
21363         possible to have foreachs on classes that provide a GetEnumerator
21364         method that return objects that implement the "pattern" for using
21365         a foreach, there is no need to support GetEnumerator
21366         specifically. 
21367
21368         This is needed to compile nant.
21369
21370         * decl.cs: Only report 114 if the member is not `Finalize' and if
21371         the warning level is at least 2.
21372
21373         * class.cs: Moved the compare function from Method to
21374         MethodSignature. 
21375
21376         (MethodSignature.InheritableMemberSignatureCompare): Add new
21377         filter function that is used to extract inheritable methods from a
21378         class. 
21379
21380         (Method.Define): Use the new `inheritable_method_signature_filter'
21381         delegate
21382
21383         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21384         command. 
21385
21386 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21387
21388         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21389
21390         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21391
21392         * expression.cs: Pass location information to
21393         ConvertImplicitStandard. 
21394
21395         * class.cs: Added debugging code to track return values from
21396         interfaces. 
21397
21398 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * expression.cs (Is.DoResolve): If either side of the `is' is an
21401         interface, do not flag the warning.
21402
21403         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21404         for interfaces
21405
21406         * report.cs: Allow for --fatal to be used with --probe.
21407
21408         * typemanager.cs (NoTypes): Move the definition for the empty Type
21409         array here. 
21410
21411         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21412         properties. 
21413         (TypeContainer.DefineProxy): New function used to proxy to parent
21414         implementations when implementing interfaces.
21415         (TypeContainer.ParentImplements): used to lookup if our parent
21416         implements a public function that is required by an interface.
21417         (TypeContainer.VerifyPendingMethods): Hook this up.
21418
21419         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21420         `modules' and `assemblies' arraylists into arrays.  We only grow
21421         these are the very early start up of the program, so this improves
21422         the speedof LookupType (nicely measured).
21423
21424         * expression.cs (MakeByteBlob): Replaced unsafe code with
21425         BitConverter, as suggested by Paolo.
21426
21427         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21428         folding of string concatenation, but if either side is a string,
21429         and the other is not, then return null, and let the runtime use
21430         the concatenation on the string plus the object (using
21431         `Object.ToString'). 
21432
21433 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21434
21435         Constant Folding has been implemented now.
21436
21437         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21438         the error instead on types that are not supported in one's
21439         complement. 
21440
21441         * constant.cs (Constant and all children): New set of functions to
21442         perform implict and explicit conversions.
21443
21444         * ecore.cs (EnumConstant): Implement the new functions to perform
21445         conversion by proxying to the child expression.
21446
21447         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21448         own separate setting that can not be turned off from the command
21449         line using --unchecked or --checked and is only controlled using
21450         the checked/unchecked statements and expressions.  This setting is
21451         used by the constant folder to flag errors.
21452
21453         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21454         ConstantCheckState as well.   
21455
21456         During Resolve, they also have to flag the state, because the
21457         constant folder runs completely in the Resolve phase.
21458
21459         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21460         well.
21461
21462 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21463
21464         * cfold.cs: New file, this file contains the constant folder.
21465
21466         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21467         argument to track whether we are using the resulting address to
21468         load or store a value and provide better error messages. 
21469
21470         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21471         new AddressOf arguments.
21472
21473         * statement.cs (Foreach.EmitCollectionForeach): Update
21474
21475         * expression.cs (Argument.Emit): Call AddressOf with proper
21476         arguments to track usage.
21477
21478         (New.DoEmit): Call AddressOf with new arguments.
21479
21480         (Unary.Emit): Adjust AddressOf call.
21481
21482 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21483
21484         * cs-parser.jay (member_access): Change the case for pre-defined types
21485         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21486         this suggestion.
21487
21488         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21489         a method body.
21490
21491         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21492         essentially like methods and apply attributes like MethodImplOptions to them too.
21493
21494         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21495         not being null.
21496
21497         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21498         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21499         is the DeclSpace.
21500
21501         * Update code everywhere accordingly.
21502
21503         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21504
21505         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21506
21507 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21508
21509         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21510         try performing lookups against those instead of jumping straight into using
21511         the 'using' clauses.
21512
21513         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21514
21515         (LookupType): Perform lookups in implicit parents too.
21516
21517         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21518         sequence as RootContext.LookupType. 
21519
21520         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21521         the various cases of namespace lookups into this method.
21522
21523 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21524
21525         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21526         in positional arguments)
21527
21528         * class.cs (Operator): Update the AllowedModifiers to contain
21529         extern. 
21530
21531         * cs-parser.jay: Update operator declaration to allow for the
21532         operator body to be empty.
21533
21534         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21535         values. 
21536
21537 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21538
21539         * class.cs (Method.Emit): Label parameters.
21540
21541         * driver.cs: Return 1 or 0 as the program exit code.
21542
21543 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * expression.cs: Special case the `null' object when trying to
21546         auto-compute the type, as anything can be explicitly converted to
21547         that. 
21548
21549         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21550         spotting this Paolo.
21551
21552         (Expression.ImplicitNumericConversion): Perform comparissions of
21553         the type using the underlying type in the case of an enumeration
21554         rather than using the enumeration type for the compare.
21555
21556         Cope with the underlying == type case, which is not possible to
21557         catch before. 
21558
21559         (Expression.ConvertNumericExplicit): Perform comparissions of
21560         the type using the underlying type in the case of an enumeration
21561         rather than using the enumeration type for the compare.
21562
21563         * driver.cs: If the user does not supply an extension, assume .exe
21564
21565         * cs-parser.jay (if_statement): Rewrote so that we can track the
21566         location for the if statement.
21567
21568         * expression.cs (Binary.ConstantFold): Only concat strings when
21569         the operation is "+", not everything ;-)
21570
21571         * statement.cs (Statement.EmitBoolExpression): Take a location
21572         argument. 
21573         (If, While, Do): Track location.
21574
21575         * expression.cs (Binary.ResolveOperator): In the object + string
21576         case, I was missing a call to ConvertImplicit
21577
21578 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21579
21580         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21581         Location arguments. Ensure we use RootContext.LookupType to do our work
21582         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21583
21584         * interface.cs (PopulateMethod): Handle the type of the parameter being
21585         null gracefully.
21586
21587         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21588         have a params method with no fixed arguments and a call is made with no
21589         arguments.
21590
21591 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21592
21593         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21594         the verbatim-string-literal
21595
21596         * support.cs (InternalParameters.ParameterModifier): handle null
21597         fixed parameters.
21598         (InternalParameters.ParameterType): ditto.
21599
21600         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21601         duplicating the name of the variable parameter.
21602         (GetParameterByName): Fix bug where we were not looking up array
21603         paramters if they were the only present (thanks Paolo!).
21604         (GetParameterInfo): We only have an empty set of types if both
21605         fixed and array are set to null.
21606         (GetParameterInfo-idx): Handle FixedParameter == null
21607
21608         * cs-parser.jay: Handle the case where there is no catch
21609         statements (missing null test).
21610
21611 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21612
21613         * driver.cs (MainDriver): Be conservative on our command line
21614         handling.
21615
21616         Catch DirectoryNotFoundException when calling GetFiles.
21617
21618         (SplitPathAndPattern): Used to split the input specification into
21619         a path and a pattern that we can feed to Directory.GetFiles.
21620
21621 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * statement.cs (Fixed): Implement the last case of the Fixed
21624         statement (string handling).
21625
21626         * expression.cs (StringPtr): New class used to return a char * to
21627         a string;  Used by the Fixed statement.
21628
21629         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21630
21631         * expression.cs (Binary.ResolveOperator): Remove redundant
21632         MemberLookup pn parent type.
21633         Optimize union call, we do not need a union if the types are the same.
21634         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21635         type.
21636
21637         Specialize the use of MemberLookup everywhere, instead of using
21638         the default settings. 
21639
21640         (StackAlloc): Implement stackalloc keyword.
21641
21642         * cs-parser.jay: Add rule to parse stackalloc.
21643
21644         * driver.cs: Handle /h, /help, /?
21645
21646         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21647         before we supported unsafe code.
21648
21649         * makefile: add --unsafe to the self compilation of mcs.
21650
21651 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21652
21653         * expression.cs (PointerArithmetic): New class that is used to
21654         perform pointer arithmetic.
21655         (Binary.Resolve): Handle pointer arithmetic
21656         Handle pointer comparission.
21657         (ArrayPtr): Utility expression class that is used to take the
21658         address of an array.
21659
21660         (ElementAccess): Implement array access for pointers
21661
21662         * statement.cs (Fixed): Implement fixed statement for arrays, we
21663         are missing one more case before we are done.
21664
21665         * expression.cs (Indirection): Implement EmitAssign and set the
21666         ExprClass to Variable.  This allows pointer dereferences to be
21667         treated as variables, and to have values assigned to them.
21668
21669         * ecore.cs (Expression.StoreFromPtr): New utility function to
21670         store values dereferencing.
21671
21672 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21673
21674         * expression.cs (Binary.ResolveOperator): Ensure that we are
21675         not trying to operate on a void type - this fixes the reported
21676         bug.
21677
21678         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21679         the parent implementation is sealed.
21680
21681         * ../errors/cs0239.cs : Add.
21682
21683         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21684
21685         * typemanager.cs (unverifiable_code_type): Corresponds to 
21686         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21687         which have unsafe code in them.
21688
21689         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21690         unsafe context.
21691
21692 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21693
21694         * cs-tokenizer.cs: Add support for @"litreal strings"
21695
21696         Make tokenizer accept pre-processor directives
21697         on any column (remove the old C-like limitation). 
21698
21699         * rootcontext.cs (EmitCode): Emit any global attributes.
21700         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21701
21702         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21703
21704         * cs-parser.jay: Add support for global attributes.  
21705
21706 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21707
21708         * expression.cs (Indirection): New helper class.  Unary will
21709         create Indirection classes to be able to implement the
21710         IMemoryLocation interface on it.
21711
21712 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21713
21714         * cs-parser.jay (fixed_statement): reference the right statement.
21715
21716         * statement.cs (Fixed.Emit): Finish implementing the fixed
21717         statement for the &x case.
21718
21719 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21720
21721         * class.cs (Property.Define, Method.Define): Remove newslot when
21722         `implementing'.  
21723
21724         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21725         wrong.  NewSlot should only be used if the `new' keyword is present.
21726
21727         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21728         locating our system dir.  Sorry about this.
21729
21730 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21731
21732         * driver.cs (GetSystemDir): Compute correctly the location of our
21733         system assemblies.  I was using the compiler directory instead of
21734         the library directory.
21735
21736 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21737
21738         * expression.cs (BetterFunction): Put back in what Miguel commented out
21739         since it is the correct fix. The problem is elsewhere ;-)
21740
21741         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21742         parameters of the parms method are themselves compatible or not !
21743
21744         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21745         to check that a class implements an interface before saying that an implicit
21746         conversion was allowed. Use ImplementsInterface to do the checking.
21747
21748 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21749
21750         * class.cs (Method.Define): Track whether we are an explicit
21751         implementation or not.  And only call DefineMethodOverride if we
21752         are an explicit implementation.
21753
21754         (Property.DefineMethod): Ditto.
21755
21756 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21757
21758         * expression.cs (BetterFunction): Catch hideous bug which was
21759          preventing us from detecting ambiguous calls due to implicit casts i.e
21760         cs0121.
21761
21762 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * support.cs (Pair): Remove un-needed method.  I figured why I was
21765         getting the error in cs-parser.jay, the variable in a foreach loop
21766         is readonly, and the compiler does not really treat this as a variable.
21767
21768         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21769         instead of EQUALS in grammar.  
21770
21771         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21772
21773         * expression.cs (Unary.DoResolve): Check whether the argument is
21774         managed or not.
21775
21776 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21777
21778         * support.cs: Api for Pair to set a value.  Despite the fact that
21779         the variables are public the MS C# compiler refuses to compile
21780         code that accesses the field if the variable is part of a foreach
21781         statement. 
21782
21783         * statement.cs (Fixed): Begin implementation of the fixed
21784         statement.
21785
21786         (Block.AddVariable): Return the VariableInfo on success and null
21787         on failure instead of true/false. 
21788
21789         * cs-parser.jay (foreach): Catch errors on variables already
21790         defined (we were ignoring this value before) and properly unwind
21791         the block hierarchy
21792
21793         (fixed_statement): grammar for the fixed statement.
21794
21795 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21798         pointer types to be incretemented.
21799
21800         (SizeOf): Implement.
21801
21802         * cs-parser.jay (pointer_member_access): Implement
21803         expr->IDENTIFIER production.
21804
21805         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21806         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21807         on safe contexts.
21808
21809         (Unary): Implement indirection.
21810
21811         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21812         use in non-unsafe context).
21813
21814         (SimpleName.DoResolve): Check for pointers in field access on safe
21815         contexts. 
21816
21817         (Expression.LoadFromPtr): Factor the load-indirect code in this
21818         function.  This was duplicated in UnboxCast and ParameterReference
21819
21820 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21821
21822         * expression.cs (ComposedCast): report an error if a pointer cast
21823         is used in a safe region.
21824
21825         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21826         pointer type casts in unsafe context.
21827
21828         * codegen.cs (EmitContext): Set up IsUnsafe.
21829
21830         * cs-parser.jay (non_expression_type): Add productions for pointer
21831         casts. 
21832
21833         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21834         code.  We should not use force into static mode if the method is
21835         not virtual.  Fixes bug in MIS
21836
21837         * statement.cs (Do.Emit, While.Emit, For.Emit,
21838         Statement.EmitBoolExpression): Add support to Do and While to
21839         propagate infinite loop as `I do return' semantics.
21840
21841         Improve the For case to also test for boolean constants.
21842
21843         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21844         to the list of attributes we can add.
21845
21846         Remove `EmitContext' argument.
21847
21848         * class.cs (Method.Define): Apply parameter attributes.
21849         (Constructor.Define): Apply parameter attributes.
21850         (MethodCore.LabelParameters): Move here the core of labeling
21851         parameters. 
21852
21853         * support.cs (ReflectionParameters.ParameterModifier,
21854         InternalParameters.ParameterModifier): Use IsByRef on the type and
21855         only return the OUT bit for these parameters instead of in/out/ref
21856         flags.
21857
21858         This is because I miss-understood things.  The ParameterInfo.IsIn
21859         and IsOut represent whether the parameter has the [In] and [Out]
21860         attributes set.  
21861
21862 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21863
21864         * ecore.cs (FieldExpr.Emit): Release temporaries.
21865
21866         * assign.cs (LocalTemporary.Release): new function.
21867
21868         * codegen.cs (EmitContext.GetTemporaryStorage,
21869         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21870         temporary storage.  Now we can "put back" localbuilders when we
21871         are done with them
21872
21873 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21874
21875         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21876         need to make a copy of the variable to generate verifiable code.
21877
21878 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21879
21880         * driver.cs: Compute dynamically the system directory.
21881
21882         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21883         Slower, but more generally useful.  Used by the abstract
21884         registering implementation. 
21885
21886         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21887         the rules for the special rule on Type/instances.  First check if
21888         we have the same name, and if so, try that special static path
21889         rather than the instance path.
21890
21891 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21892
21893         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21894         for, while and if.
21895
21896         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21897         Enum, ValueType, Delegate or Array for non-corlib compiles.
21898
21899         * cs-tokenizer.cs: Catch long identifiers (645)
21900
21901         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21902         piece of code.
21903
21904         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21905         fix, we were returning too early, so we were not registering
21906         pending methods from abstract classes.
21907
21908         Do not register pending methods if the class is abstract.
21909
21910         * expression.cs (Conditional.DoResolve): Report circular implicit
21911         conversions when we neecd to compute it for conditional
21912         expressions. 
21913
21914         (Is.DoResolve): If the expression is always of the provided type,
21915         flag warning 183.  If the expression can not ever be of the
21916         provided type flag warning 184.
21917
21918         * class.cs: Catch 169 as well.
21919
21920         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21921         read. 
21922
21923 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21924
21925         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21926
21927 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21928
21929         * interface.cs: (PopulateMethod): Check for pointers being defined
21930         only if the unsafe context is active.
21931         (PopulateProperty): ditto.
21932         (PopulateIndexer): ditto.
21933
21934         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21935         specified.  If pointers are present, make sure that they are
21936         present in an unsafe context.
21937         (Constructor, Constructor.Define): ditto.
21938         (Field, Field.Define): ditto.
21939         (Property, Property.Define): ditto.
21940         (Event, Event.Define): ditto.
21941
21942         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21943         hashtable if there are classes or structs defined.
21944
21945         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21946         code, as the constant resolution moved.
21947
21948         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21949         the metadata, so we can flag error 133. 
21950
21951         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21952         pointer is being declared in an unsafe context.
21953
21954 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * modifiers.cs (Modifiers.Check): Require a Location argument.
21957         Report error 227 for Unsafe use.
21958
21959         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21960
21961         * statement.cs (For.Emit): If the test is null, then report that
21962         we do `return', as we wont reach anything afterwards.
21963
21964         (Switch.SwitchGoverningType): Track the expression that matched
21965         the conversion.
21966
21967         * driver.cs: Allow negative numbers as an error code to flag.
21968
21969         * cs-parser.jay: Handle 1551.
21970
21971         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21972
21973 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21974
21975         * cs-parser.jay: Report 1518 (type declaration can only contain
21976         class, struct, interface, enum or delegate)
21977
21978         (switch_label): Report 1523 (keywords `case' or `default' must
21979         preced code)
21980
21981         (opt_switch_sections): Report 1522 (empty switch)
21982
21983         * driver.cs: Report 1515 (response file specified multiple times)
21984         Report 1516 (Source file specified multiple times).
21985
21986         * expression.cs (Argument.Resolve): Signal 1510
21987
21988         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21989         access not allowed in static code)
21990
21991 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21992
21993         * typemanager.cs (IsPointerType): Utility method which we are going
21994         to need a lot.
21995
21996         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21997         the object type, so we take care of that.
21998
21999         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22000
22001         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22002         added to non-params parameters :-)
22003
22004         * typemanager.cs (CSharpName): Include 'void' type too. 
22005
22006         (void_ptr_type): Include in the set of core types.
22007
22008         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22009         duplicating code.
22010
22011         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22012         an unsafe context.
22013
22014         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22015         completely forgotten about it.
22016
22017 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22018
22019         * cs-parser.jay (pointer_type): Add. This begins our implementation
22020         of parsing rules for unsafe code.
22021
22022         (unsafe_statement): Implement.
22023
22024         (embedded_statement): Modify to include the above.
22025
22026         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22027
22028         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22029         if the current context is an unsafe one.
22030
22031         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22032         are handled differently, we need separate rules for them.
22033
22034         (local_variable_declaration): Update to use local_variable_pointer_type
22035         to allow variable declarations of unmanaged pointer types.
22036
22037         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22038         in unsafe contexts.
22039
22040         * ../errors/cs0214.cs : Add.
22041
22042 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22043
22044         * makefile: remove 'response' file when cleaning.
22045
22046 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22047
22048         * cs-parser.jay: Report 1524.
22049
22050 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22051
22052         * typemanager.cs (RegisterMethod): drop checking if we have
22053         registered this from here
22054
22055 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22056
22057         * class.cs (Method.EmitDestructor): Implement calling our base
22058         destructor. 
22059
22060         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22061         value of InFinally.
22062
22063         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22064         this routine and will wrap the call in a try/catch block.  Deal
22065         with the case.
22066
22067 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22068
22069         * ecore.cs (Expression.MemberLookup): instead of taking a
22070         parameter `same_type' that was used to tell whether we could
22071         access private members we compute our containing type from the
22072         EmitContext.
22073
22074         (FieldExpr): Added partial support for volatile fields.  This does
22075         not work for volatile fields exposed from assemblies, as I can not
22076         figure out how to extract the modreq from it.
22077
22078         Updated all the source files to use this.
22079
22080         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22081         because it is referenced by MemberLookup very often. 
22082
22083 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22084
22085         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22086         TypeBuilder.GetCustomAttributes to retrieve what we need.
22087
22088         Get rid of redundant default_member_attr_type as this is the same as
22089         default_member_type which already exists.
22090
22091         * interface.cs, attribute.cs : Update accordingly.
22092
22093 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22094
22095         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22096         work for TYpeBuilders though.  Ravi, can you please fix this?
22097
22098         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22099
22100         * expression.cs (Argument.Emit): Handle the case of ref objects
22101         being passed to ref functions;  
22102
22103         (ParameterReference.EmitLoad): Loads the content of the pointer
22104         without dereferencing.
22105
22106 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22107
22108         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22109
22110 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22111
22112         * class.cs (Indexer.DefineMethod): Incorporate the interface
22113         type in the name of the method if we are doing explicit interface
22114         implementation.
22115
22116         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22117
22118         (BetterConversion): Fix extremely trivial bug where we were referring to
22119         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22120         again !
22121
22122         * ../errors/bug16.cs : Add although we have fixed it.
22123
22124 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22125
22126         * expression.cs (BaseIndexer): Begin implementation.
22127
22128         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22129
22130         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22131         production directly to remove a shift/reduce, and implement
22132         explicit interface implementation.
22133
22134         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22135         after a floating point suffix.
22136
22137         * expression.cs (DoNumericPromotions): Improved the conversion for
22138         uint/uint.  If we have a constant, we avoid doing a typecast to a
22139         larger type.
22140
22141         * class.cs (Indexer): Implement explicit interface implementation
22142         for indexers.
22143
22144 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22145
22146         * class.cs: make the default instance constructor public and hidebysig.
22147
22148 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22149
22150         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22151         so we can call it from elsewhere.
22152
22153         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22154         we emit it internally if the class has a defined indexer; otherwise the user
22155         emits it by decorating the class definition with the DefaultMemberAttribute.
22156
22157         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22158         attribute is not used on a type which defines an indexer.
22159
22160         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22161         character when we skip whitespace.
22162
22163         * ../errors/cs0646.cs : Add.
22164
22165 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22168         again. 
22169
22170         * makefile: Add practical target `mcs3.exe' which builds the third
22171         generation compiler. 
22172
22173         * expression.cs (New): Fix structures constructor calling.
22174
22175         * class.cs (Property, Method, Indexer): Emit Final flag on the
22176         method if we are an interface implementation and we are not
22177         abstract. 
22178
22179         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22180         whether this property is referencing a `base' method.
22181
22182         * expression.cs (Invocation.EmitCall): take an extra argument:
22183         is_base, this is used to determine whether the `call' or
22184         `callvirt' opcode should be used.
22185
22186
22187         * delegate.cs: update EmitCall.
22188
22189         * class.cs (Method.Define): Set NewSlot for the cases where we are
22190         not implementing an interface method.
22191
22192         (Property.Define): ditto.
22193
22194 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22195
22196         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22197         'r'.  Allows mcs to parse itself fully.
22198
22199 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22200
22201         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22202         of the number of initializers that require the InitializeArray method.
22203
22204         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22205         update the above field where necessary.
22206
22207         (MakeByteBlob): Update accordingly.
22208
22209         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22210         greater than 2.
22211
22212         (EmitDynamicInitializers): Update in accordance with the new optimization.
22213
22214         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22215         same OpCode applies.
22216
22217         * cs-parser.jay : Fix some glaring errors I introduced.
22218
22219 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22220
22221         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22222         so that we can check for name clashes there too.
22223
22224         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22225         for interface indexers.
22226
22227         * interfaces.cs (Define): Emit the default member attribute.
22228
22229         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22230         variable was being referred to while setting the value ;-)
22231
22232 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22235         byte-by-byte information when we know the data is zero.
22236
22237         Make the block always a multiple of 4, because
22238         DefineInitializedData has a bug.
22239
22240         * assign.cs: Fix, we should assign from the temporary, not from
22241         the source. 
22242
22243         * expression.cs (MakeByteBlob): Fix my incorrect code.
22244
22245 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22246
22247         * typemanager.cs (EnumToUnderlying): This function is used to get
22248         the underlying type from an enumeration, because it does not
22249         always work. 
22250
22251         * constant.cs: Use the I4_S form for values between -128 and 127.
22252
22253         * statement.cs (Block.LookupLabel): Looks up a label.
22254         (Block): Drop support for labeled blocks.
22255
22256         (LabeledStatement): New kind of statement that represents a label
22257         only.
22258
22259         (Goto): Finally implement this bad boy.
22260
22261         * cs-parser.jay: Update to reflect new mechanism to implement
22262         labels.
22263
22264 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22265
22266         * codegen.cs (EmitContext.This): a codegen property that keeps the
22267         a single instance of this instead of creating many different this
22268         instances. 
22269
22270         * delegate.cs (Delegate.DoResolve): Update to use the property;
22271
22272         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22273
22274         * expression.cs (BaseAccess.DoResolve): Ditto.
22275
22276 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22277
22278         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22279         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22280
22281         (InitCoreTypes): Update accordingly.
22282
22283         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22284         so we can quickly store the state.
22285
22286         (ApplyAttributes): Set the correct implementation flags
22287         for InternalCall methods.
22288
22289 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22290
22291         * expression.cs (EmitCall): if a method is not virtual, then do
22292         not use callvirt on it.
22293
22294         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22295         user defined stuff) requires the use of stobj, which takes an
22296         address on the stack instead of an array and an index.  So emit
22297         the Ldelema operation for it.
22298
22299         (EmitStoreOpcode): Use stobj for valuetypes.
22300
22301         (UnaryMutator.EmitCode): Use the right 1 value depending on
22302         whether we are dealing with int64/uint64, float or doubles.
22303
22304         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22305         constructors that I implemented last night.
22306
22307         (Constructor.IsDefault): Fix to work properly for static
22308         constructors.
22309
22310         * cs-parser.jay (CheckDef): report method signature errors.
22311         Update error number 103 to be 132.
22312
22313         * decl.cs: New AdditionResult enumeration value: MethodExists.
22314         Although we do this check for methods later on in the semantic
22315         analysis, catching repeated default constructors is so easy that
22316         we catch these here. 
22317
22318         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22319         promotions code.
22320
22321         (ParameterReference.EmitAssign, Emit): handle
22322         bools as bytes.
22323
22324         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22325         (ArrayAccess.EmitStoreOpcode): ditto.
22326
22327         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22328
22329         * expression.cs (MakeByteBlob): Complete all the missing types
22330         (uint, short, ushort, byte, sbyte)
22331
22332         * class.cs: Only init instance field initializers on instance
22333         constructors. 
22334
22335         Rename `constructors' to instance_constructors. 
22336
22337         (TypeContainer.AddConstructor): Only add constructors to the list
22338         if it is not static.
22339
22340         Make sure that we handle default_static_constructor independently
22341         everywhere where we handle instance_constructors
22342
22343 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22344
22345         * class.cs: Do not lookup or create a base initializer for a
22346         static constructor.
22347
22348         (ConstructorInitializer.Resolve): use the proper type to lookup
22349         for constructors.
22350
22351         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22352
22353         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22354         in DeclSpace. 
22355
22356         * decl.cs: CloseType is now an virtual method, the default
22357         implementation just closes this type.
22358
22359 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22360
22361         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22362         to PreserveSig by default. Also emit HideBySig on such methods.
22363
22364         Basically, set the defaults to standard values.
22365
22366         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22367         argument, if candidate is better, it can't be worse than the best !
22368
22369         (Invocation): Re-write bits to differentiate between methods being
22370         applicable in their expanded form and their normal form - for params
22371         methods of course.
22372
22373         Get rid of use_standard everywhere as only standard conversions are allowed
22374         in overload resolution. 
22375
22376         More spec conformance.
22377
22378 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22379
22380         * driver.cs: Add --timestamp, to see where the compiler spends
22381         most of its time.
22382
22383         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22384         `this' in static code.
22385
22386         (SimpleName.DoResolve): Implement in terms of a helper function
22387         that allows static-references to be passed upstream to
22388         MemberAccess.
22389
22390         (Expression.ResolveWithSimpleName): Resolve specially simple
22391         names when called by MemberAccess to implement the special
22392         semantics. 
22393
22394         (Expression.ImplicitReferenceConversion): Handle conversions from
22395         Null to reference types before others, as Null's type is
22396         System.Object. 
22397
22398         * expression.cs (Invocation.EmitCall): Handle the special case of
22399         calling methods declared on a reference type from a ValueType
22400         (Base classes System.Object and System.Enum)
22401
22402         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22403         the left hand side is a TypeExpr, not on every enumeration. 
22404
22405         (Binary.Resolve): If types are reference types, then do a cast to
22406         object on operators != and == of both arguments.
22407
22408         * typemanager.cs (FindMembers): Extract instance and static
22409         members if requested.
22410
22411         * interface.cs (PopulateProperty): Use void_type instead of null
22412         as the return type for the setter method.
22413
22414         (PopulateIndexer): ditto.
22415
22416 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22417
22418         * support.cs (ReflectionParameters): Fix minor bug where we
22419         were examining the wrong parameter for the ParamArray attribute.
22420
22421         Cope with requests for the type of the parameter at position
22422         greater than the params parameter's. We now return the element
22423         type of the params array as that makes more sense.
22424
22425         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22426         accordingly as we no longer have to extract the element type
22427         ourselves.
22428
22429         (Invocation.OverloadResolve): Update.
22430
22431 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22432
22433         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22434         against IEnumerator, test whether the return value is a descendant
22435         of the IEnumerator interface.
22436
22437         * class.cs (Indexer.Define): Use an auxiliary method to implement
22438         the other bits of the method definition.  Begin support for
22439         explicit interface implementation.
22440
22441         (Property.DefineMethod): Use TypeManager.void_type instead of null
22442         for an empty return value.
22443
22444 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22445
22446         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22447         dealing with a FieldExpr which is composed of a FieldBuilder, in
22448         the code path we did extract the constant, but we should have
22449         obtained the underlying value to be able to cast it (otherwise we
22450         end up in an infinite loop, this is what Ravi was running into).
22451
22452         (ArrayCreation.UpdateIndices): Arrays might be empty.
22453
22454         (MemberAccess.ResolveMemberAccess): Add support for section
22455         14.5.4.1 that deals with the special case of E.I when E is a type
22456         and something else, that I can be a reference to a static member.
22457
22458         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22459         handle a particular array type to create byte blobs, it is just
22460         something we dont generate byteblobs for.
22461
22462         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22463         arguments. 
22464
22465         * location.cs (Push): remove the key from the hashtable that we
22466         are about to add.   This happens for empty files.
22467
22468         * driver.cs: Dispose files after we have parsed them.
22469
22470         (tokenize): new function that only runs the tokenizer on its
22471         input, for speed testing.
22472
22473 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22474
22475         * class.cs (Event.Define): Define the private field only if there
22476         are no accessors defined.
22477
22478         * expression.cs (ResolveMemberAccess): If there is no associated
22479         field with the event, that means we have an event defined with its
22480         own accessors and we should flag error cs0070 since transforming
22481         ourselves into a field is not valid in that case.
22482
22483         * ecore.cs (SimpleName.DoResolve): Same as above.
22484
22485         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22486         and charset to sane values.
22487
22488 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22489
22490         * assign.cs (DoResolve): Perform check on events only if they 
22491         are being accessed outside the declaring type.
22492
22493         * cs-parser.jay (event_declarations): Update rules to correctly
22494         set the type of the implicit parameter etc.
22495
22496         (add_accessor, remove_accessor): Set current local parameters.
22497
22498         * expression.cs (Binary): For delegate addition and subtraction,
22499         cast the return value from the method into the appropriate delegate
22500         type.
22501
22502 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22503
22504         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22505         of these as the workaround is unnecessary.
22506
22507         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22508         delegate data - none of that is needed at all.
22509
22510         Re-write bits to extract the instance expression and the delegate method
22511         correctly.
22512
22513         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22514         on delegates too.
22515
22516         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22517         of attaching attributes instead of duplicating code everywhere.
22518
22519         * everywhere : Update code to do attribute emission using the above method.
22520
22521 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22522
22523         * expression.cs (IsParamsMethodApplicable): if there are not
22524         parameters, return immediately.
22525
22526         * ecore.cs: The 0 literal can be implicity converted to an enum
22527         type. 
22528
22529         (SimpleName.DoResolve): First lookup the type, then lookup the
22530         members. 
22531
22532         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22533         want to get its address.  If the InstanceExpression is not
22534         addressable, store the result in a temporary variable, then get
22535         the address of it.
22536
22537         * codegen.cs: Only display 219 errors on warning level or above. 
22538
22539         * expression.cs (ArrayAccess): Make it implement the
22540         IMemoryLocation interface.
22541
22542         (Binary.DoResolve): handle the operator == (object a, object b)
22543         and operator != (object a, object b) without incurring into a
22544         BoxedCast (because 5 != o should never be performed).
22545
22546         Handle binary enumerator operators.
22547
22548         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22549         value type, otherwise use Ldelem_ref.
22550
22551         Use precomputed names;
22552
22553         (AddressOf): Implement address of
22554
22555         * cs-parser.jay (labeled_statement): Fix recursive block
22556         addition by reworking the production.
22557
22558         * expression.cs (New.DoEmit): New has a special case:
22559                 
22560                  If we are dealing with a ValueType, we have a few
22561                  situations to deal with:
22562                 
22563                     * The target of New is a ValueType variable, that is
22564                       easy, we just pass this as the variable reference
22565                 
22566                     * The target of New is being passed as an argument,
22567                       to a boxing operation or a function that takes a
22568                       ValueType.
22569                 
22570                       In this case, we need to create a temporary variable
22571                       that is the argument of New.
22572
22573
22574 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22575
22576         * rootcontext.cs (LookupType): Check that current_type is not null before
22577         going about looking at nested types.
22578
22579         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22580         not implement the IAssignMethod interface any more.
22581
22582         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22583         where we tranform them into FieldExprs if they are being resolved from within
22584         the declaring type.
22585
22586         * ecore.cs (SimpleName.DoResolve): Do the same here.
22587
22588         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22589
22590         * ../errors/bug10.cs : Add.
22591
22592         * ../errors/cs0070.cs : Add.
22593
22594         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22595
22596         * assign.cs : Get rid of EventIsLocal everywhere.
22597
22598 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22599
22600         * ecore.cs (ConvertIntLiteral): finished the implementation.
22601
22602         * statement.cs (SwitchLabel): Convert the value we are using as a
22603         key before looking up the table.
22604
22605 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22606
22607         * codegen.cs (EmitTopBlock): Require a Location argument now.
22608
22609         * cs-parser.jay (constructor_declarator): We need to setup
22610         current_local_parameters before we parse the
22611         opt_constructor_initializer, to allow the variables to be bound
22612         to the constructor arguments.
22613
22614         * rootcontext.cs (LookupType): First lookup nested classes in our
22615         class and our parents before we go looking outside our class.
22616
22617         * expression.cs (ConstantFold): Extract/debox the values at the
22618         beginnning. 
22619
22620         * rootcontext.cs (EmitCode): Resolve the constants first before we
22621         resolve the types.  This is not really needed, but it helps debugging.
22622
22623         * statement.cs: report location.
22624
22625         * cs-parser.jay: pass location to throw statement.
22626
22627         * driver.cs: Small bug fix.
22628
22629         * report.cs: Updated format to be 4-zero filled digits.
22630
22631 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22632
22633         * expression.cs (CheckIndices): Fix minor bug where the wrong
22634         variable was being referred to ;-)
22635
22636         (DoEmit): Do not call EmitStaticInitializers when the 
22637         underlying type is System.Object.
22638
22639 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22640
22641         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22642         and do the usual workaround for SRE.
22643
22644         * class.cs (MyEventBuilder.EventType): New member to get at the type
22645         of the event, quickly.
22646
22647         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22648
22649         * assign.cs (Assign.DoResolve): Handle the case when the target
22650         is an EventExpr and perform the necessary checks.
22651
22652         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22653         interface.
22654
22655         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22656
22657         (EventExpr): Set the type in the constructor itself since we 
22658         are meant to be born fully resolved.
22659
22660         (EventExpr.Define): Revert code I wrote earlier.
22661                 
22662         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22663         instance expression is null. The instance expression is a This in that case
22664         or a null, depending on whether it is a static method or not.
22665
22666         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22667         refers to more than one method.
22668
22669         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22670         and accordingly flag errors.
22671
22672 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22673
22674         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22675
22676 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22677
22678         * location.cs (ToString): Provide useful rutine.
22679
22680 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22681
22682         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22683         objects, return the actual integral boxed.
22684
22685         * statement.cs (SwitchLabel): define an ILLabel for each
22686         SwitchLabel. 
22687
22688         (Switch.CheckSwitch): If the value is a Literal, extract
22689         the underlying literal.
22690
22691         Also in the unused hashtable we had, add the SwitchLabel so we can
22692         quickly look this value up.
22693
22694         * constant.cs: Implement a bunch of new constants.  Rewrite
22695         Literal based on this.  Made changes everywhere to adapt to this.
22696
22697         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22698         dereferencing array only once, and also copes with enumrations.
22699
22700         bytes are two bytes wide, not one.
22701
22702         (Cast): Perform constant conversions.
22703
22704         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22705         wrappers to the literals here.
22706
22707         * expression.cs (DoNumericPromotions): long literals can converted
22708         to ulong implicity (this is taken care of elsewhere, but I was
22709         missing this spot).
22710
22711         * ecore.cs (Expression.Literalize): Make the return type Literal,
22712         to improve type checking.
22713
22714         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22715
22716 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22717
22718         * literal.cs: Revert code from ravi that checked the bounds.  The
22719         bounds are sane by the definition of the type itself. 
22720
22721         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22722         need to actually look up in our parent hierarchy for interfaces
22723         implemented. 
22724
22725         * const.cs: Use the underlying type for enumerations
22726
22727         * delegate.cs: Compute the basename for the delegate creation,
22728         that should fix the delegate test case, and restore the correct
22729         Type Lookup semantics in rootcontext
22730
22731         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22732         referencing a nested type with the Reflection API is using the "+"
22733         sign. 
22734
22735         * cs-parser.jay: Do not require EOF token at the end.
22736
22737 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22738
22739         * rootcontext.cs (LookupType): Concatenate type names with
22740         a '.' instead of a '+' The test suite passes again.
22741
22742         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22743         field of the enumeration.
22744
22745         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22746         the case when the member is an EventExpr.
22747
22748         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22749         static has an associated instance expression.
22750
22751         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22752
22753         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22754
22755         * class.cs (Event.Define): Register event and perform appropriate checks
22756         for error #111.
22757
22758         We define the Add and Remove methods even if the use provides none because
22759         in that case, we provide default implementations ourselves.
22760
22761         Define a private field of the type of the event. This is done by the CSC compiler
22762         and we should be doing it too ;-)
22763
22764         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22765         More methods we use in code we generate.
22766
22767         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22768         is important.
22769
22770         (InitCoreTypes): Update accordingly for the above.
22771
22772         * class.cs (Event.Emit): Generate code for default accessors that we provide
22773
22774         (EmitDefaultMethod): Do the job in the above.
22775
22776         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22777         appropriate place.
22778
22779 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22780
22781         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22782         builders even if we were missing one.
22783
22784         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22785         pass the Basename as our class name instead of the Name.  The
22786         basename will be correctly composed for us.
22787
22788         * parameter.cs (Paramters): Now takes a Location argument.
22789
22790         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22791         make all the code call directly LookupType in RootContext and take
22792         this chance to pass the Location information everywhere.
22793
22794         * Everywhere: pass Location information.
22795
22796 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22797
22798         * class.cs (Constructor.Define): Updated way of detecting the
22799         length of the parameters.
22800
22801         (TypeContainer.DefineType): Use basename as the type name for
22802         nested types.
22803
22804         (TypeContainer.Define): Do not recursively define types here, as
22805         definition is taken care in order by the RootContext.
22806
22807         * tree.cs: Keep track of namespaces in a per-file basis.
22808
22809         * parameter.cs (Parameter.ComputeSignature): Update to use
22810         DeclSpace. 
22811
22812         (Parameters.GetSignature): ditto.
22813
22814         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22815         instead of a TypeContainer.
22816
22817         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22818         resolve names.  Because we need to be resolve in our context, not
22819         our parents.
22820
22821         * driver.cs: Implement response files.
22822
22823         * class.cs (TypeContainer.DefineType): If we are defined, do not
22824         redefine ourselves.
22825
22826         (Event.Emit): Emit the code for add/remove handlers.
22827         (Event.Define): Save the MethodBuilders for add/remove.
22828
22829         * typemanager.cs: Use pair here too.
22830
22831         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22832         DictionaryEntry requires the first argument to be non-null.  
22833
22834         (enum_declaration): Compute full name for registering the
22835         enumeration.
22836
22837         (delegate_declaration): Instead of using
22838         formal_parameter_list, use opt_formal_parameter_list as the list
22839         can be empty.
22840
22841         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22842         (EventParsing): New property that controls whether `add' and
22843         `remove' are returned as tokens or identifiers (for events);
22844
22845 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22846
22847         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22848         use MyEventBuilder only and let it wrap the real builder for us.
22849
22850         (MyEventBuilder): Revamp constructor etc.
22851
22852         Implement all operations that we perform on EventBuilder in precisely the same
22853         way here too.
22854
22855         (FindMembers): Update to use the EventBuilder member.
22856
22857         (Event.Emit): Update accordingly.
22858
22859 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22860
22861         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22862         by calling the appropriate methods.
22863
22864         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22865         useful.
22866
22867         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22868
22869 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22870
22871         * delegate.cs (Delegate.Populate): Check that the return type
22872         and various parameters types are indeed accessible.
22873
22874         * class.cs (Constructor.Define): Same here.
22875
22876         (Field.Define): Ditto.
22877
22878         (Event.Define): Ditto.
22879
22880         (Operator.Define): Check that the underlying Method defined itself
22881         correctly - so it's MethodBuilder should not be null.
22882
22883         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22884         expression happens to be null.
22885
22886         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22887         members but as of now we don't seem to be able to do anything really useful with it.
22888
22889         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22890         not the EventBuilder.
22891
22892 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22893
22894         * cs-tokenizer.cs: Add support for defines.
22895         Add support for #if, #elif, #else, #endif
22896
22897         (eval_var): evaluates a variable.
22898         (eval): stubbed for evaluating functions.
22899
22900         * cs-parser.jay: Pass the defines information
22901
22902         * driver.cs: Add --define command line option.
22903
22904         * decl.cs: Move MemberCore here.
22905
22906         Make it the base class for DeclSpace.  This allows us to catch and
22907         report 108 and 109 for everything now.
22908
22909         * class.cs (TypeContainer.Define): Extract all the members
22910         before populating and emit the warning 108 (new keyword required
22911         to override) instead of having each member implement this.
22912
22913         (MemberCore.Define): New abstract method, we will be using this in
22914         the warning reporting engine in Populate.
22915
22916         (Operator.Define): Adjust to new MemberCore protocol. 
22917
22918         * const.cs (Const): This does not derive from Expression, it is a
22919         temporary object we use to create fields, it is a MemberCore. 
22920
22921         * class.cs (Method.Define): Allow the entry point to be in a
22922         specific class.
22923
22924         * driver.cs: Rewrite the argument handler to clean it up a bit.
22925
22926         * rootcontext.cs: Made it just an auxiliary namespace feature by
22927         making everything static.
22928
22929         * driver.cs: Adapt code to use RootContext type name instead of
22930         instance variable.
22931
22932         * delegate.cs: Remove RootContext argument.
22933
22934         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22935         argument. 
22936
22937         * class.cs (Event.Define): The lookup can fail.
22938
22939         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22940
22941         * expression.cs: Resolve the this instance before invoking the code.
22942
22943 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22944
22945         * cs-parser.jay: Add a production in element_access that allows
22946         the thing to become a "type" reference.  This way we can parse
22947         things like "(string [])" as a type.
22948
22949         Note that this still does not handle the more complex rules of
22950         casts. 
22951
22952
22953         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22954
22955         * ecore.cs: (CopyNewMethods): new utility function used to
22956         assemble the list of methods from running FindMembers.
22957
22958         (MemberLookup): Rework FindMembers so that 
22959
22960 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * class.cs (TypeContainer): Remove Delegates who fail to be
22963         defined.
22964
22965         * delegate.cs (Populate): Verify that we dont get null return
22966         values.   TODO: Check for AsAccessible.
22967
22968         * cs-parser.jay: Use basename to emit error 574 (destructor should
22969         have the same name as container class), not the full name.
22970
22971         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22972         possible representation.  
22973
22974         Also implements integer type suffixes U and L.
22975
22976 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22977
22978         * expression.cs (ArrayCreation.DoResolve): We need to do the
22979         argument resolution *always*.
22980
22981         * decl.cs: Make this hold the namespace.  Hold the root context as
22982         well.
22983         (LookupType): Move here.
22984
22985         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22986
22987         * location.cs (Row, Name): Fixed the code, it was always returning
22988         references to the first file.
22989
22990         * interface.cs: Register properties defined through interfaces.
22991
22992         * driver.cs: Add support for globbing on the command line
22993
22994         * class.cs (Field): Make it derive from MemberCore as well.
22995         (Event): ditto.
22996
22997 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22998
22999         * class.cs (Event::Define): Check that the type of the event is a delegate
23000         type else flag error #66.
23001
23002         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23003         same.
23004
23005         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23006         values of EntryPoint, CharSet etc etc.
23007
23008         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23009
23010         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23011         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23012         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23013         which needs this to do its work.
23014
23015         * ../errors/cs0066.cs : Add.
23016
23017 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23018
23019         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23020         helper functions.
23021
23022         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23023         clears out the parameters field.
23024         (MemberSignatureCompare): Cleanup
23025
23026         (MemberCore): New base class used to share code between MethodCore
23027         and Property.
23028
23029         (RegisterRequiredImplementations) BindingFlags.Public requires
23030         either BindingFlags.Instace or Static.  Use instance here.
23031
23032         (Property): Refactored code to cope better with the full spec.
23033
23034         * parameter.cs (GetParameterInfo): Return an empty array instead
23035         of null on error.
23036
23037         * class.cs (Property): Abstract or extern properties have no bodies.
23038
23039         * parameter.cs (GetParameterInfo): return a zero-sized array.
23040
23041         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23042         method modifier validation to the typecontainer so we can reuse
23043         this on properties.
23044
23045         (MethodCore.ParameterTypes): return an empty sized array of types.
23046
23047         (Property.Define): Test property modifier validity.
23048
23049         Add tests for sealed/override too.
23050
23051         (Method.Emit): abstract or extern methods have no bodies.
23052
23053 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23054
23055         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23056         thing.
23057
23058         (Method::Define, ::Emit): Modify accordingly.
23059
23060         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23061
23062         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23063
23064         * makefile: Pass in /unsafe.
23065
23066 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23067
23068         * class.cs (MakeKey): Kill routine.
23069
23070         * class.cs (TypeContainer.Define): Correctly define explicit
23071         method implementations (they require the full interface name plus
23072         the method name).
23073
23074         * typemanager.cs: Deply the PtrHashtable here and stop using the
23075         lame keys.  Things work so much better.
23076
23077         This of course broke everyone who depended on `RegisterMethod' to
23078         do the `test for existance' test.  This has to be done elsewhere.
23079
23080         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23081         the object stupid Equals method (because, that like fails all over
23082         the place).  We still do not use it.
23083
23084         * class.cs (TypeContainer.SetRequiredInterface,
23085         TypeContainer.RequireMethods): Killed these two routines and moved
23086         all the functionality to RegisterRequiredImplementations.
23087
23088         (TypeContainer.RegisterRequiredImplementations): This routine now
23089         registers all the implementations required in an array for the
23090         interfaces and abstract methods.  We use an array of structures
23091         which can be computed ahead of time to reduce memory usage and we
23092         also assume that lookups are cheap as most classes will not
23093         implement too many interfaces.
23094
23095         We also avoid creating too many MethodSignatures.
23096
23097         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23098         clear the "pending" bit if we find that there are problems with
23099         the declaration.
23100
23101         (TypeContainer.VerifyPendingMethods): Update to report errors of
23102         methods that look like implementations but are not.
23103
23104         (TypeContainer.Define): Add support for explicit interface method
23105         implementation. 
23106
23107 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23108
23109         * typemanager.cs: Keep track of the parameters here instead of
23110         being a feature of the TypeContainer.
23111
23112         * class.cs: Drop the registration of parameters here, as
23113         InterfaceMethods are also interface declarations.
23114
23115         * delegate.cs: Register methods with the TypeManager not only with
23116         the TypeContainer.  This code was buggy.
23117
23118         * interface.cs: Full registation here.
23119
23120 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23121
23122         * expression.cs: Remove reducer for binary expressions, it can not
23123         be done this way.
23124
23125         * const.cs: Put here the code that used to go into constant.cs
23126
23127         * constant.cs: Put here the code for constants, this is a new base
23128         class for Literals.
23129
23130         * literal.cs: Make Literal derive from Constant.
23131
23132 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23133
23134         * statement.cs (Return.Emit): Report error 157 if the user
23135         attempts to return from a finally block.
23136
23137         (Return.Emit): Instead of emitting a return, jump to the end of
23138         the function.
23139
23140         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23141         LocalBuilder to store the result of the function.  ReturnLabel is
23142         the target where we jump.
23143
23144
23145 2001-12-09  Radek Doulik  <rodo@ximian.com>
23146
23147         * cs-parser.jay: remember alias in current namespace
23148
23149         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23150         namespaces
23151
23152         * class.cs (LookupAlias): lookup alias in my_namespace
23153
23154         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23155         aliases hashtable
23156         (LookupAlias): lookup alias in this and if needed in parent
23157         namespaces
23158
23159 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23160
23161         * support.cs: 
23162
23163         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23164         making things static.  I need this to avoid passing the
23165         TypeContainer when calling ParameterType.
23166
23167         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23168         that did string manipulation to compute the type and then call
23169         GetType.  Use Parameter.ParameterType instead.
23170
23171         * cs-tokenizer.cs: Consume the suffix for floating values.
23172
23173         * expression.cs (ParameterReference): figure out whether this is a
23174         reference parameter or not.  Kill an extra variable by computing
23175         the arg_idx during emission.
23176
23177         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23178         function that returns whether a parameter is an out/ref value or not.
23179
23180         (Parameter.ParameterType): The type of the parameter (base,
23181         without ref/out applied).
23182
23183         (Parameter.Resolve): Perform resolution here.
23184         (Parameter.ExternalType): The full type (with ref/out applied).
23185
23186         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23187         support for expressions on the using statement.
23188
23189 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23190
23191         * statement.cs (Using.EmitLocalVariableDecls): Split the
23192         localvariable handling of the using statement.
23193
23194         (Block.EmitMeta): Keep track of variable count across blocks.  We
23195         were reusing slots on separate branches of blocks.
23196
23197         (Try.Emit): Emit the general code block, we were not emitting it. 
23198
23199         Check the type of the declaration to be an IDisposable or
23200         something that can be implicity converted to it. 
23201
23202         Emit conversions if required.
23203
23204         * ecore.cs (EmptyExpression): New utility class.
23205         (Expression.ImplicitConversionExists): New utility function.
23206
23207 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23208
23209         * statement.cs (Using): Implement.
23210
23211         * expression.cs (LocalVariableReference): Support read only variables.
23212
23213         * statement.cs: Remove the explicit emit for the Leave opcode.
23214         (VariableInfo): Add a readonly field.
23215
23216 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23217
23218         * ecore.cs (ConvCast): new class used to encapsulate the various
23219         explicit integer conversions that works in both checked and
23220         unchecked contexts.
23221
23222         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23223         properly generate the overflow opcodes.
23224
23225 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23226
23227         * statement.cs: The correct type for the EmptyExpression is the
23228         element_type, not the variable type.  Ravi pointed this out.
23229
23230 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23231
23232         * class.cs (Method::Define): Handle PInvoke methods specially
23233         by using DefinePInvokeMethod instead of the usual one.
23234
23235         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23236         above to do the task of extracting information and defining the method.
23237
23238 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23239
23240         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23241         of the condition for string type.
23242
23243         (Emit): Move that here. 
23244
23245         (ArrayCreation::CheckIndices): Keep string literals in their expression
23246         form.
23247
23248         (EmitDynamicInitializers): Handle strings appropriately.
23249
23250 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23251
23252         * codegen.cs (EmitContext): Replace multiple variables with a
23253         single pointer to the current Switch statement.
23254
23255         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23256         EmitContext.
23257
23258 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23259
23260         * statement.cs 
23261
23262         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23263         default'.
23264
23265         (Foreach.Emit): Foreach on arrays was not setting
23266         up the loop variables (for break/continue).
23267
23268         (GotoCase): Semi-implented.
23269
23270 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23271
23272         * attribute.cs (CheckAttribute): Handle system attributes by using
23273         Attribute.GetAttributes to examine information we need.
23274
23275         (GetValidPlaces): Same here.
23276
23277         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23278
23279         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23280
23281         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23282
23283         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23284
23285         (Method::Emit): Handle the case when we are a PInvoke method.
23286
23287 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23288
23289         * expression.cs: Use ResolveWithSimpleName on compound names.
23290
23291 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23292
23293         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23294         before trying to reduce it.
23295
23296         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23297
23298         * constant.cs (LookupConstantValue): Implement.
23299
23300         (EmitConstant): Use the above in emitting the constant.
23301
23302         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23303         that are user-defined by doing a LookupConstantValue on them.
23304
23305         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23306         too, like above.
23307
23308 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23309
23310         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23311
23312         (BaseAccess.DoResolve): Implement.
23313
23314         (MemberAccess.DoResolve): Split this routine into a
23315         ResolveMemberAccess routine that can be used independently
23316
23317 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23320         As that share bits of the implementation.  Is returns a boolean,
23321         while As returns the Type that is being probed.
23322
23323 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23324
23325         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23326         instead of a Literal - much easier.
23327
23328         (EnumInTransit): Remove - utterly useless :-)
23329
23330         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23331
23332         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23333
23334         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23335         chain when we have no associated expression.
23336
23337 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23338
23339         * constant.cs (Define): Use Location while reporting the errror.
23340
23341         Also emit a warning when 'new' is used and there is no inherited
23342         member to hide.
23343
23344         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23345         populated.
23346
23347         (LookupEnumValue): Implement to lookup an enum member's value and define it
23348         if necessary.
23349
23350         (Populate): Re-write accordingly to use the above routine.
23351
23352 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23353
23354         * expression.cs (This): Fix prototype for DoResolveLValue to
23355         override the base class DoResolveLValue.
23356
23357         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23358         declarations) 
23359
23360         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23361         (we need to load the address of the field here).  This fixes
23362         test-22. 
23363
23364         (FieldExpr.DoResolveLValue): Call the DoResolve
23365         function to initialize the Instance expression.
23366
23367         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23368         correctly the GetEnumerator operation on a value type.
23369
23370         * cs-parser.jay: Add more simple parsing error catches.
23371
23372         * statement.cs (Switch): Add support for string switches.
23373         Handle null specially.
23374
23375         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23376
23377 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23378
23379         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23380
23381         (declare_local_constant): New helper function.
23382
23383         * statement.cs (AddConstant): Keep a separate record of constants
23384
23385         (IsConstant): Implement to determine if a variable is a constant.
23386
23387         (GetConstantExpression): Implement.
23388
23389         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23390
23391         * statement.cs (IsVariableDefined): Re-write.
23392
23393 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23394
23395         * class.cs (TypeContainer::FindMembers): Look for constants
23396         in the case when we are looking for MemberTypes.Field
23397
23398         * expression.cs (MemberAccess::DoResolve): Check that in the
23399         case we are a FieldExpr and a Literal, we are not being accessed
23400         by an instance reference.
23401
23402         * cs-parser.jay (local_constant_declaration): Implement.
23403
23404         (declaration_statement): Implement for constant declarations.
23405
23406 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23407
23408         * statement.cs (Switch): Catch double defaults.
23409
23410         (Switch): More work on the switch() statement
23411         implementation.  It works for integral values now, need to finish
23412         string support.
23413
23414
23415 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23416
23417         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23418         integer literals into other integer literals.  To be used by
23419         switch. 
23420
23421 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23422
23423         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23424         some memory.
23425
23426         (EmitDynamicInitializers): Cope with the above since we extract data
23427         directly from ArrayData now.
23428
23429         (ExpectInitializers): Keep track of whether initializers are mandatory
23430         or not.
23431
23432         (Bounds): Make it a hashtable to prevent the same dimension being 
23433         recorded for every element in that dimension.
23434
23435         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23436         from being found.
23437
23438         Also fix bug which was causing the indices to be emitted in the reverse
23439         order.
23440
23441 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23442
23443         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23444         unfinished.  They do not work, because the underlying code is
23445         sloppy.
23446
23447 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23448
23449         * cs-parser.jay: Remove bogus fixme.
23450
23451         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23452         on Switch statement.
23453
23454 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23455
23456         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23457         the same. 
23458
23459         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23460         parameter. Apparently, any expression is allowed. 
23461
23462         (ValidateInitializers): Update accordingly.
23463
23464         (CheckIndices): Fix some tricky bugs thanks to recursion.
23465
23466         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23467         I was being completely brain-dead.
23468
23469         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23470         and re-write acordingly.
23471
23472         (DelegateInvocation): Re-write accordingly.
23473
23474         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23475
23476         (MakeByteBlob): Handle types more correctly.
23477
23478         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23479         initialization from expressions but it is incomplete because I am a complete
23480         Dodo :-|
23481
23482 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23483
23484         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23485         on If.  Basically, we have to return `true' (ie, we do return to
23486         our caller) only if both branches of the if return.
23487
23488         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23489         short-circuit operators, handle them as short circuit operators. 
23490
23491         (Cast.DoResolve): Resolve type.
23492         (Cast.Cast): Take an expression as the target type.
23493
23494         * cs-parser.jay (cast_expression): Remove old hack that only
23495         allowed a limited set of types to be handled.  Now we take a
23496         unary_expression and we resolve to a type during semantic
23497         analysis.
23498
23499         Use the grammar productions from Rhys to handle casts (this is
23500         not complete like Rhys syntax yet, we fail to handle that corner
23501         case that C# has regarding (-x), but we will get there.
23502
23503 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23504
23505         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23506         field which is an array type.
23507
23508         * cs-parser.jay (declare_local_variables): Support array initialization too.
23509
23510         * typemanager.cs (MakeKey): Implement.
23511
23512         (everywhere): Use the above appropriately.
23513
23514         * cs-parser.jay (for_statement): Update for array initialization while
23515         declaring variables.
23516
23517         * ecore.cs : The error message was correct, it's the variable's names that
23518         were misleading ;-) Make the code more readable.
23519
23520         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23521         the correct type etc.
23522
23523         (ConvertExplicit): Handle Enum types by examining the underlying type.
23524
23525 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23526
23527         * parameter.cs (GetCallingConvention): Always return
23528         CallingConventions.Standard for now.
23529
23530 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23531
23532         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23533         and `r' after calling DoNumericPromotions.
23534
23535         * ecore.cs: Fix error message (the types were in the wrong order).
23536
23537         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23538         BindingFlags.Instance as well 
23539
23540         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23541         implicit int literal conversion in an empty cast so that we
23542         propagate the right type upstream.
23543
23544         (UnboxCast): new class used to unbox value types.
23545         (Expression.ConvertExplicit): Add explicit type conversions done
23546         by unboxing.
23547
23548         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23549         the target type before applying the implicit LongLiterals to ULong
23550         literal cast.
23551
23552 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23553
23554         * cs-parser.jay (for_statement): Reworked the way For works: now
23555         we declare manually any variables that are introduced in
23556         for_initializer to solve the problem of having out-of-band code
23557         emition (that is what got for broken).
23558
23559         (declaration_statement): Perform the actual variable declaration
23560         that used to be done in local_variable_declaration here.
23561
23562         (local_variable_declaration): Do not declare anything, just pass
23563         the information on a DictionaryEntry
23564
23565 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23566
23567         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23568         re-write of the logic to now make it recursive.
23569
23570         (UpdateIndices): Re-write accordingly.
23571
23572         Store element data in a separate ArrayData list in the above methods.
23573
23574         (MakeByteBlob): Implement to dump the array data into a byte array.
23575
23576 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23577
23578         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23579         into CheckIndices.
23580
23581         * constant.cs (Define): Implement.
23582
23583         (EmitConstant): Re-write fully.
23584
23585         Pass in location info.
23586
23587         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23588         respectively.
23589
23590         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23591         DictionaryEntry since we need location info too.
23592
23593         (constant_declaration): Update accordingly.
23594
23595         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23596         code into another method : UpdateIndices.
23597
23598 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23599
23600         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23601         some type checking etc.
23602
23603 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23604
23605         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23606         bits to provide dimension info if the user skips doing that.
23607
23608         Update second constructor to store the rank correctly.
23609
23610 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23611
23612         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23613         and try to implement.
23614
23615         * ../errors/cs0150.cs : Add.
23616
23617         * ../errors/cs0178.cs : Add.
23618
23619 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23620
23621         * statement.cs: Implement foreach on multi-dimensional arrays. 
23622
23623         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23624         name of the params argument.
23625
23626         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23627         initializing the array.
23628
23629         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23630         we can use this elsewhere.
23631
23632         * statement.cs: Finish implementation of foreach for single
23633         dimension arrays.
23634
23635         * cs-parser.jay: Use an out-of-band stack to pass information
23636         around, I wonder why I need this.
23637
23638         foreach_block: Make the new foreach_block the current_block.
23639
23640         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23641         function used to return a static Parameters structure.  Used for
23642         empty parameters, as those are created very frequently.
23643
23644         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23645
23646 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23647
23648         * interface.cs : Default modifier is private, not public. The
23649         make verify test passes again.
23650
23651 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23652
23653         * support.cs (ReflectionParameters): Fix logic to determine
23654         whether the last parameter is a params one. Test 9 passes again.
23655
23656         * delegate.cs (Populate): Register the builders we define with
23657         RegisterParameterForBuilder. Test 19 passes again.
23658
23659         * cs-parser.jay (property_declaration): Reference $6 instead
23660         of $$ to get at the location.
23661
23662         (indexer_declaration): Similar stuff.
23663
23664         (attribute): Ditto.
23665
23666         * class.cs (Property): Register parameters for the Get and Set methods
23667         if they exist. Test 23 passes again.
23668
23669         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23670         call to EmitArguments as we are sure there aren't any params arguments. 
23671         Test 32 passes again.
23672
23673         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23674         IndexOutOfRangeException. 
23675
23676         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23677         Test 33 now passes again.
23678
23679 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23680
23681         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23682         broke a bunch of things.  Will have to come up with a better way
23683         of tracking locations.
23684
23685         * statement.cs: Implemented foreach for single dimension arrays.
23686
23687 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23688
23689         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23690         an error.  This removes the lookup from the critical path.
23691
23692         * cs-parser.jay: Removed use of temporary_loc, which is completely
23693         broken. 
23694
23695 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23696
23697         * support.cs (ReflectionParameters.ParameterModifier): Report
23698         whether the argument is a PARAMS argument or not.
23699
23700         * class.cs: Set the attribute `ParamArrayAttribute' on the
23701         parameter argument.
23702
23703         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23704         and cons_param_array_attribute (ConstructorInfo for
23705         ParamArrayAttribute)., 
23706
23707         * codegen.cs: Emit the return using the `Return' statement, that
23708         way we can report the error correctly for missing return values. 
23709
23710         * class.cs (Method.Emit): Clean up.
23711
23712         * expression.cs (Argument.Resolve): Take another argument: the
23713         location where this argument is used.  Notice that this is not
23714         part of the "Argument" class as to reduce the size of the
23715         structure (we know the approximate location anyways).
23716
23717         Test if the argument is a variable-reference, if not, then
23718         complain with a 206.
23719
23720         (Argument.Emit): Emit addresses of variables.
23721
23722         (Argument.FullDesc): Simplify.
23723
23724         (Invocation.DoResolve): Update for Argument.Resolve.
23725
23726         (ElementAccess.DoResolve): ditto.
23727
23728         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23729         method should be virtual, as this method is always virtual.
23730
23731         (NewDelegate.DoResolve): Update for Argument.Resolve.
23732
23733         * class.cs (ConstructorInitializer.DoResolve): ditto.
23734
23735         * attribute.cs (Attribute.Resolve): ditto.
23736
23737 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23738
23739         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23740
23741         * expression.cs (ParameterReference): Drop IStackStorage and implement
23742         IAssignMethod instead. 
23743
23744         (LocalVariableReference): ditto.
23745
23746         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23747         IAssignMethod instead. 
23748
23749 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23750
23751         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23752         enumerations that are used in heavily used structures derive from
23753         byte in a laughable and pathetic attempt to reduce memory usage.
23754         This is the kind of pre-optimzations that you should not do at
23755         home without adult supervision.
23756
23757         * expression.cs (UnaryMutator): New class, used to handle ++ and
23758         -- separatedly from the other unary operators.  Cleans up the
23759         code, and kills the ExpressionStatement dependency in Unary.
23760
23761         (Unary): Removed `method' and `Arguments' from this class, making
23762         it smaller, and moving it all to SimpleCall, so I can reuse this
23763         code in other locations and avoid creating a lot of transient data
23764         strucutres when not required.
23765
23766         * cs-parser.jay: Adjust for new changes.
23767
23768 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23769
23770         * enum.cs (Enum.Populate): If there is a failure during
23771         definition, return
23772
23773         * cs-parser.jay (opt_enum_base): we used to catch type errors
23774         here, but this is really incorrect.  The type error should be
23775         catched during semantic analysis.
23776
23777 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23778
23779         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23780         current_local_parameters as expected since I, in my stupidity, had forgotten
23781         to do this :-)
23782
23783         * attribute.cs (GetValidPlaces): Fix stupid bug.
23784
23785         * class.cs (Method::Emit): Perform check on applicability of attributes.
23786
23787         (Constructor::Emit): Ditto.
23788
23789         (Field::Emit): Ditto.
23790
23791         (Field.Location): Store location information.
23792
23793         (Property, Event, Indexer, Operator): Ditto.
23794
23795         * cs-parser.jay (field_declaration): Pass in location for each field.
23796
23797         * ../errors/cs0592.cs : Add.
23798
23799 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23800
23801         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23802
23803         (InitCoreTypes): Update accordingly.
23804
23805         (RegisterAttrType, LookupAttr): Implement.
23806
23807         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23808         info about the same.
23809
23810         (Resolve): Update to populate the above as necessary.
23811
23812         (Error592): Helper.
23813
23814         (GetValidPlaces): Helper to the above.
23815
23816         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23817
23818         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23819
23820 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23821
23822         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23823
23824         * ../errors/cs0617.cs : Add.
23825
23826 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23827
23828         * enum.cs (Emit): Rename to Populate to be more consistent with what
23829         we expect it to do and when exactly it is called.
23830
23831         * class.cs, rootcontext.cs : Update accordingly.
23832
23833         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23834         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23835
23836         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23837
23838         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23839         of a fieldinfo using the above, when dealing with a FieldBuilder.
23840
23841 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23842
23843         * ../errors/cs0031.cs : Add.
23844
23845         * ../errors/cs1008.cs : Add.
23846
23847         * ../errrors/cs0543.cs : Add.
23848
23849         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23850         enum type.
23851
23852         (FindMembers): Implement.
23853
23854         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23855         enums and delegates too.
23856
23857         (enum_types): Rename to builder_to_enum.
23858
23859         (delegate_types): Rename to builder_to_delegate.
23860
23861         * delegate.cs (FindMembers): Implement.
23862
23863 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23864
23865         * typemanager.cs (IsEnumType): Implement.
23866
23867         * enum.cs (Emit): Re-write parts to account for the underlying type
23868         better and perform checking etc.
23869
23870         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23871         of the underlying type.
23872
23873         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23874         value
23875
23876         * enum.cs (error31): Helper to report error #31.
23877
23878         * cs-parser.jay (enum_declaration): Store location of each member too.
23879
23880         * enum.cs (member_to_location): New hashtable. 
23881
23882         (AddEnumMember): Update location hashtable.
23883
23884         (Emit): Use the location of each member while reporting errors.
23885
23886 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23887
23888         * cs-parser.jay: A for_initializer if is a
23889         local_variable_declaration really ammount to have an implicit
23890         block with the variable declaration and no initializer for for.
23891
23892         * statement.cs (For.Emit): Cope with null initializers.
23893
23894         This fixes the infinite loop on for initializers.
23895
23896 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23897
23898         * enum.cs: More cleanup.
23899
23900         * ecore.cs: Remove dead code.
23901
23902         * class.cs (Property.Emit): More simplification.
23903         (Event.Emit): ditto.
23904
23905         Reworked to have less levels of indentation.
23906
23907 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23908
23909         * class.cs (Property): Emit attributes.
23910
23911         (Field): Ditto.
23912
23913         (Event): Ditto.
23914
23915         (Indexer): Ditto.
23916
23917         (Operator): Ditto.
23918
23919         * enum.cs (Emit): Ditto.
23920
23921         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23922         Enums too.
23923
23924         * class.cs (Field, Event, etc.): Move attribute generation into the
23925         Emit method everywhere.
23926
23927         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23928         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23929         as we had no way of defining nested enums !
23930
23931         * rootcontext.cs : Adjust code accordingly.
23932
23933         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23934
23935 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23936
23937         * expression.cs (EvalConstantExpression): Move into ecore.cs
23938
23939         * enum.cs (Enum): Rename some members and make them public and readonly
23940         according to our convention.
23941
23942         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23943         nothing else.
23944
23945         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23946
23947         (Enum::Emit): Write a simple version for now which doesn't try to compute
23948         expressions. I shall modify this to be more robust in just a while.
23949
23950         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23951
23952         (TypeContainer::CloseType): Create the Enum types too.
23953
23954         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23955
23956         * expression.cs (EvalConstantExpression): Get rid of completely.
23957
23958         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23959         user-defined values and other cases.
23960
23961         (IsValidEnumLiteral): Helper function.
23962
23963         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23964         out there in the case we had a literal FieldExpr.
23965
23966         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23967
23968         (Literalize): Revamp a bit to take two arguments.
23969
23970         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23971
23972 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23973
23974         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23975
23976         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23977
23978         (Resolve): Use the above to ensure we have proper initializers.
23979
23980 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23981
23982         * expression.cs (Expression::EvalConstantExpression): New method to 
23983         evaluate constant expressions.
23984
23985         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23986
23987 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23988
23989         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23990         in an array.
23991
23992         (Binary.ResolveOperator): Handle operator != (object a, object b)
23993         and operator == (object a, object b);
23994
23995         (Binary.DoNumericPromotions): Indicate whether the numeric
23996         promotion was possible.
23997
23998         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23999         Implement.  
24000
24001         Made the ArrayAccess implement interface IAssignMethod instead of
24002         IStackStore as the order in which arguments are passed reflects
24003         this.
24004
24005         * assign.cs: Instead of using expr.ExprClass to select the way of
24006         assinging, probe for the IStackStore/IAssignMethod interfaces.
24007
24008         * typemanager.cs: Load InitializeArray definition.
24009
24010         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24011         static data that can be used to initialize arrays. 
24012
24013 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24014
24015         * expression.cs: Handle operator== and operator!= for booleans.
24016
24017         (Conditioal.Reduce): Implement reducer for the ?: operator.
24018
24019         (Conditional.Resolve): Implement dead code elimination.
24020
24021         (Binary.Resolve): Catch string literals and return a new
24022         concatenated string.
24023
24024         (Unary.Reduce): Implement reduction of unary expressions.
24025
24026         * ecore.cs: Split out the expression core handling here.
24027
24028         (Expression.Reduce): New method used to perform constant folding
24029         and CSE.  This is needed to support constant-expressions. 
24030
24031         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24032         targets, and optimize for !x.
24033
24034 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24035
24036         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24037         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24038         set custom atttributes.
24039
24040         * literal.cs (Literal::GetValue): New abstract method to return the actual
24041         value of the literal, cast as an object.
24042
24043         (*Literal): Implement GetValue method.
24044
24045         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24046         expressions to the arraylist but objects of type Argument.
24047
24048         * class.cs (TypeContainer::Emit): Emit our attributes too.
24049
24050         (Method::Emit, Constructor::Emit): Ditto.
24051
24052         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24053         to be ignoring earlier.
24054
24055 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24056
24057         * attribute.cs (AttributeSection::Define): Implement to do the business
24058         of constructing a CustomAttributeBuilder.
24059
24060         (Attribute): New trivial class. Increases readability of code.  
24061
24062         * cs-parser.jay : Update accordingly.
24063
24064         (positional_argument_list, named_argument_list, named_argument): New rules
24065
24066         (attribute_arguments): Use the above so that we are more correct.
24067
24068 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24069
24070         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24071         to perform all checks for a method with a params parameter.
24072
24073         (Invocation::OverloadResolve): Update to use the above method and therefore
24074         cope correctly with params method invocations.
24075
24076         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24077         params too.
24078
24079         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24080         constructors in our parent too because we can't afford to miss out on 
24081         protected ones ;-)
24082
24083         * attribute.cs (AttributeSection): New name for the class Attribute
24084
24085         Other trivial changes to improve readability.
24086
24087         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24088         use the new class names.
24089
24090 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24091
24092         * class.cs (Method::Define): Complete definition for params types too
24093
24094         (Indexer::Define): Ditto.
24095
24096         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24097         Cope everywhere with a request for info about the array parameter.
24098
24099 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24100
24101         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24102
24103         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24104         local_variable_type to extract the string corresponding to the type.
24105
24106         (local_variable_type): Fixup the action to use the new helper method.
24107
24108         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24109         go.
24110
24111         * expression.cs : Clean out code which uses the above.
24112
24113 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24114
24115         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24116         and bale out if necessary by returning a false.
24117
24118         (RegisterProperty): Ditto.
24119
24120         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24121         and print out appropriate error messages.
24122
24123         * interface.cs (everywhere): Ditto.
24124
24125         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24126         location to constructor.
24127
24128         * class.cs (Property, Event, Indexer): Update accordingly.
24129
24130         * ../errors/cs111.cs : Added.
24131
24132         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24133         of a method, as laid down by the spec.
24134
24135         (Invocation::OverloadResolve): Use the above method.
24136
24137 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24138
24139         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24140         now take a TypeContainer and a Parameters object.
24141
24142         (ParameterData): Modify return type of ParameterModifier method to be 
24143         Parameter.Modifier and not a string.
24144
24145         (ReflectionParameters, InternalParameters): Update accordingly.
24146
24147         * expression.cs (Argument::GetParameterModifier): Same here.
24148
24149         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24150         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24151         symbol in it at all so maybe this is only for now.
24152
24153 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24154
24155         * support.cs (InternalParameters): Constructor now takes an extra argument 
24156         which is the actual Parameters class.
24157
24158         (ParameterDesc): Update to provide info on ref/out modifiers.
24159
24160         * class.cs (everywhere): Update call to InternalParameters to pass in
24161         the second argument too.
24162
24163         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24164         to return the modifier info [ref/out etc]
24165
24166         (InternalParameters, ReflectionParameters): Implement the above.
24167
24168         * expression.cs (Argument::ParameterModifier): Similar function to return
24169         info about the argument's modifiers.
24170
24171         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24172         too.
24173
24174         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24175         a new SetFormalParameters object which we pass to InternalParameters.
24176
24177 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24178
24179         * expression.cs (NewArray): Merge into the ArrayCreation class.
24180
24181 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24182
24183         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24184         NewUserdefinedArray into one as there wasn't much of a use in having
24185         two separate ones.
24186
24187         * expression.cs (Argument): Change field's name to ArgType from Type.
24188
24189         (Type): New readonly property which returns the proper type, taking into 
24190         account ref/out modifiers.
24191
24192         (everywhere): Adjust code accordingly for the above.
24193
24194         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24195         whether we are emitting for a ref or out parameter.
24196
24197         * expression.cs (Argument::Emit): Use the above field to set the state.
24198
24199         (LocalVariableReference::Emit): Update to honour the flag and emit the
24200         right stuff.
24201
24202         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24203
24204         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24205
24206         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24207
24208         (ReflectionParameters, InternalParameters): Implement the above method.
24209
24210         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24211         reporting errors.
24212
24213         (Invocation::FullMethodDesc): Ditto. 
24214
24215 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24216
24217         * cs-parser.jay: Add extra production for the second form of array
24218         creation. 
24219
24220         * expression.cs (ArrayCreation): Update to reflect the above
24221         change. 
24222
24223         * Small changes to prepare for Array initialization.
24224
24225 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24226
24227         * typemanager.cs (ImplementsInterface): interface might be null;
24228         Deal with this problem;
24229
24230         Also, we do store negative hits on the cache (null values), so use
24231         this instead of calling t.GetInterfaces on the type everytime.
24232
24233 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24234
24235         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24236
24237         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24238         split functionality out into different classes.
24239
24240         (New::FormArrayType): Move into NewBuiltinArray.
24241
24242         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24243         quite useless.
24244
24245         (NewBuiltinArray): New class to handle creation of built-in arrays.
24246
24247         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24248         account creation of one-dimensional arrays.
24249
24250         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24251
24252         (NewUserdefinedArray::DoResolve): Implement.
24253
24254         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24255
24256         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24257         we maintain inside the TypeManager. This is necessary to perform lookups on the
24258         module builder.
24259
24260         (LookupType): Update to perform GetType on the module builders too.     
24261
24262         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24263
24264         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24265
24266 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24267
24268         * expression.cs (New::DoResolve): Implement guts of array creation.
24269
24270         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24271
24272 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24273
24274         * expression.cs: Fix bug I introduced lsat night that broke
24275         Delegates. 
24276
24277         (Expression.Resolve): Report a 246 error (can not resolve name)
24278         if we find a SimpleName in the stream.
24279
24280         (Expression.ResolveLValue): Ditto.
24281
24282         (Expression.ResolveWithSimpleName): This function is a variant of
24283         ResolveName, this one allows SimpleNames to be returned without a
24284         warning.  The only consumer of SimpleNames is MemberAccess
24285
24286 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24287
24288         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24289         might arrive here.  I have my doubts that this is correct.
24290
24291         * statement.cs (Lock): Implement lock statement.
24292
24293         * cs-parser.jay: Small fixes to support `lock' and `using'
24294
24295         * cs-tokenizer.cs: Remove extra space
24296
24297         * driver.cs: New flag --checked, allows to turn on integer math
24298         checking. 
24299
24300         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24301         Threading.Monitor.Exit 
24302
24303 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24304
24305         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24306         Expression Class to be IndexerAccess.
24307
24308         Notice that Indexer::DoResolve sets the eclass to Value.
24309
24310 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24311
24312         * class.cs (TypeContainer::Emit): Emit code for indexers.
24313
24314         * assign.cs (IAssignMethod): New interface implemented by Indexers
24315         and Properties for handling assignment.
24316
24317         (Assign::Emit): Simplify and reuse code. 
24318
24319         * expression.cs (IndexerAccess, PropertyExpr): Implement
24320         IAssignMethod, clean up old code. 
24321
24322 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24323
24324         * typemanager.cs (ImplementsInterface): New method to determine if a type
24325         implements a given interface. Provides a nice cache too.
24326
24327         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24328         method.
24329
24330         (ConvertReferenceExplicit): Ditto.
24331
24332         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24333         various methods, with correct names etc.
24334
24335         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24336         Operator.UnaryNegation.
24337
24338         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24339         we have a unary plus or minus operator.
24340
24341         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24342         UnaryMinus.
24343
24344         * everywhere : update accordingly.
24345
24346         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24347         respectively.
24348
24349         * class.cs (Method::Define): For the case where we are implementing a method
24350         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24351         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24352
24353 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24354
24355         * interface.cs (FindMembers): Implement to work around S.R.E
24356         lameness.
24357
24358         * typemanager.cs (IsInterfaceType): Implement.
24359
24360         (FindMembers): Update to handle interface types too.
24361
24362         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24363         use IsAssignableFrom as that is not correct - it doesn't work.
24364
24365         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24366         and accordingly override EmitStatement.
24367
24368         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24369         using the correct logic :-)
24370
24371 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24372
24373         * ../errors/cs-11.cs : Add to demonstrate error -11 
24374
24375 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24376
24377         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24378         then pass this as a hint to ResolveLValue.
24379
24380         * expression.cs (FieldExpr): Add Location information
24381
24382         (FieldExpr::LValueResolve): Report assignment to readonly
24383         variable. 
24384
24385         (Expression::ExprClassFromMemberInfo): Pass location information.
24386
24387         (Expression::ResolveLValue): Add new method that resolves an
24388         LValue. 
24389
24390         (Expression::DoResolveLValue): Default invocation calls
24391         DoResolve. 
24392
24393         (Indexers): New class used to keep track of indexers in a given
24394         Type. 
24395
24396         (IStackStore): Renamed from LValue, as it did not really describe
24397         what this did.  Also ResolveLValue is gone from this interface and
24398         now is part of Expression.
24399
24400         (ElementAccess): Depending on the element access type
24401
24402         * typemanager.cs: Add `indexer_name_type' as a Core type
24403         (System.Runtime.CompilerServices.IndexerNameAttribute)
24404
24405         * statement.cs (Goto): Take a location.
24406
24407 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24408
24409         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24410         if two delegates are compatible.
24411
24412         (NewDelegate::DoResolve): Update to take care of the case when
24413         we instantiate a delegate from another delegate.
24414
24415         * typemanager.cs (FindMembers): Don't even try to look up members
24416         of Delegate types for now.
24417
24418 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24419
24420         * delegate.cs (NewDelegate): New class to take care of delegate
24421         instantiation.
24422
24423         * expression.cs (New): Split the delegate related code out into 
24424         the NewDelegate class.
24425
24426         * delegate.cs (DelegateInvocation): New class to handle delegate 
24427         invocation.
24428
24429         * expression.cs (Invocation): Split out delegate related code into
24430         the DelegateInvocation class.
24431
24432 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24433
24434         * expression.cs (New::DoResolve): Implement delegate creation fully
24435         and according to the spec.
24436
24437         (New::DoEmit): Update to handle delegates differently.
24438
24439         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24440         because of which we were printing out arguments in reverse order !
24441
24442         * delegate.cs (VerifyMethod): Implement to check if the given method
24443         matches the delegate.
24444
24445         (FullDelegateDesc): Implement.
24446
24447         (VerifyApplicability): Implement.
24448
24449         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24450         delegate invocations too.
24451
24452         (Invocation::Emit): Ditto.
24453
24454         * ../errors/cs1593.cs : Added.
24455
24456         * ../errors/cs1594.cs : Added.
24457
24458         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24459
24460 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24461
24462         * typemanager.cs (intptr_type): Core type for System.IntPtr
24463
24464         (InitCoreTypes): Update for the same.
24465
24466         (iasyncresult_type, asynccallback_type): Ditto.
24467
24468         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24469         correct.
24470
24471         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24472         too.
24473
24474         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24475         the builders for the 4 members of a delegate type :-)
24476
24477         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24478         type.
24479
24480         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24481
24482         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24483
24484 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24485
24486         * statement.cs (Break::Emit): Implement.   
24487         (Continue::Emit): Implement.
24488
24489         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24490         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24491         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24492         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24493         end loop
24494
24495         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24496         properties that track the label for the current loop (begin of the
24497         loop and end of the loop).
24498
24499 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24500
24501         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24502         use of emitting anything at all.
24503
24504         * class.cs, rootcontext.cs : Get rid of calls to the same.
24505
24506         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24507
24508         (Populate): Define the constructor correctly and set the implementation
24509         attributes.
24510
24511         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24512         have been defined.
24513
24514         (AddDelegateType): Implement.
24515
24516         (IsDelegateType): Implement helper method.
24517
24518         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24519
24520         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24521         and accordingly handle it.
24522
24523         * delegate.cs (Populate): Take TypeContainer argument.
24524         Implement bits to define the Invoke method. However, I still haven't figured out
24525         how to take care of the native int bit :-(
24526
24527         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24528         Qualify the name of the delegate, not its return type !
24529
24530         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24531         conversion.
24532
24533         (StandardConversionExists): Checking for array types turns out to be recursive.
24534
24535         (ConvertReferenceExplicit): Implement array conversion.
24536
24537         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24538
24539 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24540
24541         * cs-parser.jay (delegate_declaration): Store the fully qualified
24542         name as it is a type declaration.
24543
24544         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24545         readonly.
24546
24547         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24548         as TypeContainer::DefineType.
24549
24550         (Populate): Method in which all the definition of the various methods (Invoke)
24551         etc is done.
24552
24553         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24554         see.
24555
24556         (CloseDelegate): Finally creates the delegate.
24557
24558         * class.cs (TypeContainer::DefineType): Update to define delegates.
24559         (Populate, Emit and CloseType): Do the same thing here too.
24560
24561         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24562         delegates in all these operations.
24563
24564 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24565
24566         * expression.cs: LocalTemporary: a new expression used to
24567         reference a temporary that has been created.
24568
24569         * assign.cs: Handle PropertyAccess back here, so that we can
24570         provide the proper semantic access to properties.
24571
24572         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24573         a few more explicit conversions. 
24574
24575         * modifiers.cs: `NEW' modifier maps to HideBySig.
24576
24577         * expression.cs (PropertyExpr): Make this into an
24578         ExpressionStatement, and support the EmitStatement code path. 
24579
24580         Perform get/set error checking, clean up the interface.
24581
24582         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24583         them into toplevel access objects.
24584
24585 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24586
24587         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24588         SRE.
24589
24590         * typemanager.cs: Keep track here of our PropertyBuilders again to
24591         work around lameness in SRE.
24592
24593 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * expression.cs (LValue::LValueResolve): New method in the
24596         interface, used to perform a second resolution pass for LValues. 
24597
24598         (This::DoResolve): Catch the use of this in static methods.
24599
24600         (This::LValueResolve): Implement.
24601
24602         (This::Store): Remove warning, assigning to `this' in structures
24603         is 
24604
24605         (Invocation::Emit): Deal with invocation of
24606         methods on value types.  We need to pass the address to structure
24607         methods rather than the object itself.  (The equivalent code to
24608         emit "this" for structures leaves the entire structure on the
24609         stack instead of a pointer to it). 
24610
24611         (ParameterReference::DoResolve): Compute the real index for the
24612         argument based on whether the method takes or not a `this' pointer
24613         (ie, the method is static).
24614
24615         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24616         value types returned from functions when we need to invoke a
24617         method on the sturcture.
24618
24619
24620 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24621
24622         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24623         defining the type in the Modulebuilder or Typebuilder. This is to take
24624         care of nested types which need to be defined on the TypeBuilder using
24625         DefineNestedMethod.
24626
24627         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24628         methods in RootContext, only ported to be part of TypeContainer.
24629
24630         (TypeContainer::GetInterfaceOrClass): Ditto.
24631
24632         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24633
24634         * interface.cs (Interface::DefineInterface): New method. Does exactly
24635         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24636         too.
24637
24638         (Interface::GetInterfaces): Move from RootContext here and port.
24639
24640         (Interface::GetInterfaceByName): Same here.
24641
24642         * rootcontext.cs (ResolveTree): Re-write.
24643
24644         (PopulateTypes): Re-write.
24645
24646         * class.cs (TypeContainer::Populate): Populate nested types too.
24647         (TypeContainer::Emit): Emit nested members too.
24648
24649         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24650         instead just use the name argument passed in as it is already fully
24651         qualified.
24652
24653         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24654         to TypeContainer mapping to see if a type is user-defined.
24655
24656         * class.cs (TypeContainer::CloseType): Implement. 
24657
24658         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24659         the default constructor.
24660
24661         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24662         twice.
24663
24664         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24665
24666         * interface.cs (CloseType): Create the type here.
24667
24668         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24669         the hierarchy.
24670
24671         Remove all the methods which are now in TypeContainer.
24672
24673 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24674
24675         * delegate.cs (Define): Re-write bits to define the delegate
24676         correctly.
24677
24678 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24679
24680         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24681
24682         * expression.cs (ImplicitReferenceConversion): handle null as well
24683         as a source to convert to any reference type.
24684
24685         * statement.cs (Return): Perform any implicit conversions to
24686         expected return type.  
24687
24688         Validate use of return statement.  
24689
24690         * codegen.cs (EmitContext): Pass the expected return type here.
24691
24692         * class.cs (Method, Constructor, Property): Pass expected return
24693         type to EmitContext.
24694
24695 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * expression.cs: Make DoResolve take an EmitContext instead of a
24698         TypeContainer.
24699
24700         Replaced `l' and `location' for `loc', for consistency.
24701
24702         (Error, Warning): Remove unneeded Tc argument.
24703
24704         * assign.cs, literal.cs, constant.cs: Update to new calling
24705         convention. 
24706
24707         * codegen.cs: EmitContext now contains a flag indicating whether
24708         code is being generated in a static method or not.
24709
24710         * cs-parser.jay: DecomposeQI, new function that replaces the old
24711         QualifiedIdentifier.  Now we always decompose the assembled
24712         strings from qualified_identifier productions into a group of
24713         memberaccesses.
24714
24715 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * rootcontext.cs: Deal with field-less struct types correctly now
24718         by passing the size option to Define Type.
24719
24720         * class.cs: Removed hack that created one static field. 
24721
24722 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24723
24724         * statement.cs: Moved most of the code generation here. 
24725
24726 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24727
24728         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24729         seem very right.
24730
24731         (ElementAccess): Remove useless bits for now - keep checks as the spec
24732         says.
24733
24734 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24735
24736         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24737         and start performing checks according to the spec.
24738
24739 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24740
24741         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24742         rank_specifiers instead.
24743
24744         (rank_specifiers): Change the order in which the rank specifiers are stored
24745
24746         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24747
24748         * expression.cs (ElementAccess): Implement the LValue interface too.
24749
24750 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24751
24752         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24753         except that user defined conversions are not included.
24754
24755         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24756         perform the conversion of the return type, if necessary.
24757
24758         (New::DoResolve): Check whether we are creating an array or an object
24759         and accordingly do the needful.
24760
24761         (New::Emit): Same here.
24762
24763         (New::DoResolve): Implement guts of array creation.
24764
24765         (New::FormLookupType): Helper function.
24766
24767 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24768
24769         * codegen.cs: Removed most of the code generation here, and move the
24770         corresponding code generation bits to the statement classes. 
24771
24772         Added support for try/catch/finalize and throw.
24773
24774         * cs-parser.jay: Added support for try/catch/finalize.
24775
24776         * class.cs: Catch static methods having the flags override,
24777         virtual or abstract.
24778
24779         * expression.cs (UserCast): This user cast was not really doing
24780         what it was supposed to do.  Which is to be born in fully resolved
24781         state.  Parts of the resolution were being performed at Emit time! 
24782
24783         Fixed this code.
24784
24785 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24786
24787         * expression.cs: Implicity convert the result from UserCast.
24788
24789 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24790
24791         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24792         prevented it from working correctly. 
24793
24794         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24795         merely ConvertImplicit.
24796
24797 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24798
24799         * typemanager.cs: Make the LookupTypeContainer function static,
24800         and not per-instance.  
24801
24802         * class.cs: Make static FindMembers (the one that takes a Type
24803         argument). 
24804
24805         * codegen.cs: Add EmitForeach here.
24806
24807         * cs-parser.jay: Make foreach a toplevel object instead of the
24808         inline expansion, as we need to perform semantic analysis on it. 
24809
24810 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24811
24812         * expression.cs (Expression::ImplicitUserConversion): Rename to
24813         UserDefinedConversion.
24814
24815         (Expression::UserDefinedConversion): Take an extra argument specifying 
24816         whether we look for explicit user conversions too.
24817
24818         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24819
24820         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24821
24822         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24823         with the appropriate arguments.
24824
24825         * cs-parser.jay (cast_expression): Record location too.
24826
24827         * expression.cs (Cast): Record location info.
24828
24829         (Expression::ConvertExplicit): Take location argument.
24830
24831         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24832         to determine if we are doing explicit conversions.
24833
24834         (UserCast::Emit): Update accordingly.
24835
24836         (Expression::ConvertExplicit): Report an error if everything fails.
24837
24838         * ../errors/cs0030.cs : Add.
24839
24840 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24841
24842         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24843         virtual and newslot bits. 
24844
24845         * class.cs (TypeContainer::RegisterRequiredImplementations):
24846         Record methods we need.
24847
24848         (TypeContainer::MakeKey): Helper function to make keys for
24849         MethodBases, since the Methodbase key is useless.
24850
24851         (TypeContainer::Populate): Call RegisterRequiredImplementations
24852         before defining the methods.   
24853
24854         Create a mapping for method_builders_to_methods ahead of time
24855         instead of inside a tight loop.
24856
24857         (::RequireMethods):  Accept an object as the data to set into the
24858         hashtable so we can report interface vs abstract method mismatch.
24859
24860 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24861
24862         * report.cs: Make all of it static.
24863
24864         * rootcontext.cs: Drop object_type and value_type computations, as
24865         we have those in the TypeManager anyways.
24866
24867         Drop report instance variable too, now it is a global.
24868
24869         * driver.cs: Use try/catch on command line handling.
24870
24871         Add --probe option to debug the error reporting system with a test
24872         suite. 
24873
24874         * report.cs: Add support for exiting program when a probe
24875         condition is reached.
24876
24877 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24878
24879         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24880         we do a forcible conversion regardless of type, to check if 
24881         ForceConversion returns a null.
24882
24883         (Binary::error19): Use location to report error.
24884
24885         (Unary::error23): Use location here too.
24886
24887         * ../errors/cs0019.cs : Check in.
24888
24889         * ../errors/cs0023.cs : Check in.
24890
24891         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24892         case of a non-null MethodInfo object with a length of 0 !
24893
24894         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24895         an applicable member - according to the spec :-)
24896         Also fix logic to find members in base types.
24897
24898         (Unary::ResolveOperator): Same here.
24899
24900         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24901         as I was getting thoroughly confused between this and error19 :-)
24902
24903         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24904         (::FindMostEncompassedType): Implement.
24905         (::FindMostEncompassingType): Implement.
24906         (::StandardConversionExists): Implement.
24907
24908         (UserImplicitCast): Re-vamp. We now need info about most specific
24909         source and target types so that we can do the necessary conversions.
24910
24911         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24912         mathematical union with no duplicates.
24913
24914 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24915
24916         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24917         in order from base classes to child classes, so that we can in
24918         child classes look up in our parent for method names and
24919         attributes (required for handling abstract, virtual, new, override
24920         constructs: we need to instrospect our base class, and if we dont
24921         populate the classes in order, the introspection might be
24922         incorrect.  For example, a method could query its parent before
24923         the parent has any methods and would determine that the parent has
24924         no abstract methods (while it could have had them)).
24925
24926         (RootContext::CreateType): Record the order in which we define the
24927         classes.
24928
24929 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24930
24931         * class.cs (TypeContainer::Populate): Also method definitions can
24932         fail now, keep track of this.
24933
24934         (TypeContainer::FindMembers): Implement support for
24935         DeclaredOnly/noDeclaredOnly flag.
24936
24937         (Constructor::Emit) Return the ConstructorBuilder.
24938
24939         (Method::Emit) Return the MethodBuilder. 
24940         Check for abstract or virtual methods to be public.
24941
24942         * rootcontext.cs (RootContext::CreateType): Register all the
24943         abstract methods required for the class to be complete and the
24944         interface methods that must be implemented. 
24945
24946         * cs-parser.jay: Report error 501 (method requires body if it is
24947         not marked abstract or extern).
24948
24949         * expression.cs (TypeOf::Emit): Implement.
24950
24951         * typemanager.cs: runtime_handle_type, new global type.
24952
24953         * class.cs (Property::Emit): Generate code for properties.
24954
24955 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24956
24957         * expression.cs (Unary::ResolveOperator): Find operators on base type
24958         too - we now conform exactly to the spec.
24959
24960         (Binary::ResolveOperator): Same here.
24961
24962         * class.cs (Operator::Define): Fix minor quirk in the tests.
24963
24964         * ../errors/cs0215.cs : Added.
24965
24966         * ../errors/cs0556.cs : Added.
24967
24968         * ../errors/cs0555.cs : Added.
24969
24970 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24971
24972         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24973         single integer which is really efficient
24974
24975 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24976
24977         *  expression.cs (Expression::ImplicitUserConversion): Use location
24978         even in the case when we are examining True operators.
24979  
24980         * class.cs (Operator::Define): Perform extensive checks to conform
24981         with the rules for operator overloading in the spec.
24982
24983         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24984         some of the other conversions mentioned in the spec.
24985
24986         * typemanager.cs (array_type): New static member for the System.Array built-in
24987         type.
24988
24989         (cloneable_interface): For System.ICloneable interface.
24990
24991         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24992         we start resolving the tree and populating types.
24993
24994         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24995  
24996 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * expression.cs (Expression::ExprClassFromMemberInfo,
24999         Expression::Literalize): Create literal expressions from
25000         FieldInfos which are literals.
25001
25002         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25003         type casts, because they were wrong.  The test suite in tests
25004         caught these ones.
25005
25006         (ImplicitNumericConversion): ushort to ulong requires a widening
25007         cast. 
25008
25009         Int32 constant to long requires widening cast as well.
25010
25011         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25012         for integers because the type on the stack is not i4.
25013
25014 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25015
25016         * expression.cs (report118): require location argument. 
25017
25018         * parameter.cs: Do not dereference potential null value.
25019
25020         * class.cs: Catch methods that lack the `new' keyword when
25021         overriding a name.  Report warnings when `new' is used without
25022         anything being there to override.
25023
25024         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25025
25026         * class.cs: Only add constructor to hashtable if it is non-null
25027         (as now constructors can fail on define).
25028
25029         (TypeManager, Class, Struct): Take location arguments.
25030
25031         Catch field instance initialization in structs as errors.
25032
25033         accepting_filter: a new filter for FindMembers that is static so
25034         that we dont create an instance per invocation.
25035
25036         (Constructor::Define): Catch errors where a struct constructor is
25037         parameterless 
25038
25039         * cs-parser.jay: Pass location information for various new
25040         constructs. 
25041
25042         * delegate.cs (Delegate): take a location argument.
25043
25044         * driver.cs: Do not call EmitCode if there were problesm in the
25045         Definition of the types, as many Builders wont be there. 
25046
25047         * decl.cs (Decl::Decl): Require a location argument.
25048
25049         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25050         into integers, and find the most appropiate integer for it.
25051
25052         * literal.cs: Implement ULongLiteral.
25053
25054         * rootcontext.cs: Provide better information about the location of
25055         failure when CreateType fails.
25056
25057 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25058
25059         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25060         as well.
25061
25062         * expression.cs (Binary::CheckShiftArguments): Add missing type
25063         computation.
25064         (Binary::ResolveOperator): Add type to the logical and and logical
25065         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25066         before.
25067
25068         (Binary::DoNumericPromotions): In the case where either argument
25069         is ulong (and most signed types combined with ulong cause an
25070         error) perform implicit integer constant conversions as well.
25071
25072 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25073
25074         * expression.cs (UserImplicitCast): Method should always be
25075         non-null. 
25076         (Invocation::BetterConversion): Simplified test for IntLiteral.
25077
25078         (Expression::ImplicitNumericConversion): Split this routine out.
25079         Put the code that performs implicit constant integer conversions
25080         here. 
25081
25082         (Expression::Resolve): Become a wrapper around DoResolve so we can
25083         check eclass and type being set after resolve.
25084
25085         (Invocation::Badness): Remove this dead function
25086
25087         (Binary::ResolveOperator): Do not compute the expensive argumnets
25088         unless we have a union for it.
25089
25090         (Probe::Emit): Is needs to do an isinst and then
25091         compare against null.
25092
25093         (::CanConvert): Added Location argument.  If the Location argument
25094         is null (Location.Null), then we do not report errors.  This is
25095         used by the `probe' mechanism of the Explicit conversion.  We do
25096         not want to generate an error for something that the user
25097         explicitly requested to be casted.  But the pipeline for an
25098         explicit cast first tests for potential implicit casts.
25099
25100         So for now, if the Location is null, it means `Probe only' to
25101         avoid adding another argument.   Might have to revise this
25102         strategy later.
25103
25104         (ClassCast): New class used to type cast objects into arbitrary
25105         classes (used in Explicit Reference Conversions).
25106
25107         Implement `as' as well.
25108
25109         Reverted all the patches from Ravi below: they were broken:
25110
25111                 * The use of `level' as a mechanism to stop recursive
25112                   invocations is wrong.  That was there just to catch the
25113                   bug with a strack trace but not as a way of addressing
25114                   the problem.
25115
25116                   To fix the problem we have to *understand* what is going
25117                   on and the interactions and come up with a plan, not
25118                   just get things going.
25119
25120                 * The use of the type conversion cache that I proposed
25121                   last night had an open topic: How does this work across
25122                   protection domains.  A user defined conversion might not
25123                   be public in the location where we are applying the
25124                   conversion, a different conversion might be selected
25125                   (ie, private A->B (better) but public B->A (worse),
25126                   inside A, A->B applies, but outside it, B->A will
25127                   apply).
25128
25129                 * On top of that (ie, even if the above is solved),
25130                   conversions in a cache need to be abstract.  Ie, `To
25131                   convert from an Int to a Short use an OpcodeCast', not
25132                   `To convert from an Int to a Short use the OpcodeCast on
25133                   the variable 5' (which is what this patch was doing).
25134
25135 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25136
25137         * expression.cs (Invocation::ConversionExists): Re-write to use
25138         the conversion cache
25139
25140         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25141         cache all conversions done, not just user-defined ones.
25142
25143         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25144         to determine if a conversion exists instead of acutually trying to 
25145         perform the conversion. It's faster too.
25146
25147         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25148         and only then attempt the implicit conversion.
25149
25150 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25151
25152         * expression.cs (ConvertImplicit): Use a cache for conversions
25153         already found. Check level of recursion and bail out if necessary.
25154
25155 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25156
25157         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25158         Export standard methods that we expect for string operations.
25159
25160         * statement.cs (Block::UsageWarning): Track usage of variables and
25161         report the errors for not used variables.
25162
25163         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25164         operator. 
25165
25166 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25167
25168         * codegen.cs: remove unnneded code 
25169
25170         * expression.cs: Removed BuiltinTypeAccess class
25171
25172         Fix the order in which implicit conversions are
25173         done.  
25174
25175         The previous fixed dropped support for boxed conversions (adding a
25176         test to the test suite now)
25177
25178         (UserImplicitCast::CanConvert): Remove test for source being null,
25179         that code is broken.  We should not feed a null to begin with, if
25180         we do, then we should track the bug where the problem originates
25181         and not try to cover it up here.
25182
25183         Return a resolved expression of type UserImplicitCast on success
25184         rather than true/false.  Ravi: this is what I was talking about,
25185         the pattern is to use a static method as a "constructor" for
25186         objects. 
25187
25188         Also, do not create arguments until the very last minute,
25189         otherwise we always create the arguments even for lookups that
25190         will never be performed. 
25191
25192         (UserImplicitCast::Resolve): Eliminate, objects of type
25193         UserImplicitCast are born in a fully resolved state. 
25194
25195         * typemanager.cs (InitCoreTypes): Init also value_type
25196         (System.ValueType). 
25197
25198         * expression.cs (Cast::Resolve): First resolve the child expression.
25199
25200         (LValue): Add new method AddressOf to be used by
25201         the `&' operator.  
25202
25203         Change the argument of Store to take an EmitContext instead of an
25204         ILGenerator, because things like FieldExpr need to be able to call
25205         their children expression to generate the instance code. 
25206
25207         (Expression::Error, Expression::Warning): Sugar functions for
25208         reporting errors.
25209
25210         (Expression::MemberLookup): Accept a TypeContainer instead of a
25211         Report as the first argument.
25212
25213         (Expression::ResolvePrimary): Killed.  I still want to improve
25214         this as currently the code is just not right.
25215
25216         (Expression::ResolveMemberAccess): Simplify, but it is still
25217         wrong. 
25218
25219         (Unary::Resolve): Catch errors in AddressOf operators.
25220
25221         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25222         index to a byte for the short-version, or the compiler will choose
25223         the wrong Emit call, which generates the wrong data.
25224
25225         (ParameterReference::Emit, ::Store): same.
25226
25227         (FieldExpr::AddressOf): Implement.
25228
25229         * typemanager.cs: TypeManager: made public variable instead of
25230         property.
25231
25232         * driver.cs: document --fatal.
25233
25234         * report.cs (ErrorMessage, WarningMessage): new names for the old
25235         Error and Warning classes.
25236
25237         * cs-parser.jay (member_access): Turn built-in access to types
25238         into a normal simplename
25239
25240 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25241
25242         * expression.cs (Invocation::BetterConversion): Fix to cope
25243         with q being null, since this was introducing a bug.
25244
25245         * expression.cs (ConvertImplicit): Do built-in conversions first.
25246
25247 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25248
25249         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25250
25251 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25252
25253         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25254         I had introduced long ago (what's new ?).
25255
25256         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25257         the work of all the checking. 
25258         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25259         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25260
25261         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25262         that is the right way. 
25263
25264         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25265         overloading resolution. Use everywhere instead of cutting and pasting code.
25266
25267         (Binary::ResolveOperator): Use MakeUnionSet.
25268
25269         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25270         we have to convert to bool types. Not complete yet.
25271
25272 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25273
25274         * typemanager.cs (TypeManager::CSharpName): support ushort.
25275
25276         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25277         to provide an expression that performsn an implicit constant int
25278         conversion (section 6.1.6).
25279         (Expression::ConvertImplicitRequired): Reworked to include
25280         implicit constant expression conversions.
25281
25282         (Expression::ConvertNumericExplicit): Finished.
25283
25284         (Invocation::Emit): If InstanceExpression is null, then it means
25285         that we perform a call on this.
25286
25287 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * expression.cs (Unary::Emit): Remove some dead code.
25290         (Probe): Implement Resolve and Emit for `is'.
25291         (Expression::ConvertImplicitRequired): Attempt to do constant
25292         expression conversions here.  Maybe should be moved to
25293         ConvertImplicit, but I am not sure.
25294         (Expression::ImplicitLongConstantConversionPossible,
25295         Expression::ImplicitIntConstantConversionPossible): New functions
25296         that tell whether is it possible to apply an implicit constant
25297         expression conversion.
25298
25299         (ConvertNumericExplicit): Started work on explicit numeric
25300         conversions.
25301
25302         * cs-parser.jay: Update operator constants.
25303
25304         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25305         (Parameters::GetSignature): Hook up VerifyArgs here.
25306         (Parameters::VerifyArgs): Verifies that no two arguments have the
25307         same name. 
25308
25309         * class.cs (Operator): Update the operator names to reflect the
25310         ones that the spec expects (as we are just stringizing the
25311         operator names).
25312
25313         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25314         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25315         previous usage did only work for our methods.
25316         (Expression::ConvertImplicit): Handle decimal implicit numeric
25317         conversions as well.
25318         (Expression::InternalTypeConstructor): Used to invoke constructors
25319         on internal types for default promotions.
25320
25321         (Unary::Emit): Implement special handling for the pre/post
25322         increment/decrement for overloaded operators, as they need to have
25323         the same semantics as the other operators.
25324
25325         (Binary::ResolveOperator): ditto.
25326         (Invocation::ConversionExists): ditto.
25327         (UserImplicitCast::Resolve): ditto.
25328
25329 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25330
25331         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25332         operator, return after emitting body. Regression tests pass again !
25333
25334         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25335         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25336         (Invocation::OverloadResolve): Ditto.
25337         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25338
25339         * everywhere : update calls to the above methods accordingly.
25340
25341 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25342
25343         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25344
25345         * expression.cs (ExpressionStatement): New base class used for
25346         expressions that can appear in statements, so that we can provide
25347         an alternate path to generate expression that do not leave a value
25348         on the stack.
25349
25350         (Expression::Emit, and all the derivatives): We no longer return
25351         whether a value is left on the stack or not.  Every expression
25352         after being emitted leaves a single value on the stack.
25353
25354         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25355         facilties of ExpressionStatement if possible.
25356
25357         * cs-parser.jay: Update statement_expression.
25358
25359 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25360
25361         * driver.cs: Change the wording of message
25362
25363 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25364
25365         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25366         the type of the expression to the return type of the method if
25367         we have an overloaded operator match ! The regression tests pass again !
25368         (Unary::ResolveOperator): Ditto.
25369
25370         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25371         to find "op_Implicit", not "implicit" ;-)
25372         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25373         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25374
25375         * everywhere : Correct calls to the above accordingly.
25376
25377         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25378         (ConvertImplicit): Do user-defined conversion if it exists.
25379
25380 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25381
25382         * assign.cs: track location.
25383         (Resolve): Use implicit conversions on assignment.
25384
25385         * literal.cs: Oops.  Not good, Emit of short access values should
25386         pass (Bytes) or the wrong argument will be selected.
25387
25388         * expression.cs (Unary::Emit): Emit code for -expr.
25389
25390         (Unary::ResolveOperator): Handle `Substract' for non-constants
25391         (substract from zero from the non-constants).
25392         Deal with Doubles as well. 
25393
25394         (Expression::ConvertImplicitRequired): New routine that reports an
25395         error if no implicit conversion exists. 
25396
25397         (Invocation::OverloadResolve): Store the converted implicit
25398         expressions if we make them
25399
25400 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25401
25402         * class.cs (ConstructorInitializer): Take a Location argument.
25403         (ConstructorBaseInitializer): Same here.
25404         (ConstructorThisInitializer): Same here.
25405
25406         * cs-parser.jay : Update all calls accordingly.
25407
25408         * expression.cs (Unary, Binary, New): Take location argument.
25409         Update accordingly everywhere.
25410
25411         * cs-parser.jay : Update all calls to the above to take a location
25412         argument.
25413
25414         * class.cs : Ditto.
25415
25416 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25417
25418         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25419         (Invocation::BetterConversion): Same here
25420         (Invocation::ConversionExists): Ditto.
25421
25422         (Invocation::ConversionExists): Implement.
25423
25424 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25425
25426         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25427         Also take an additional TypeContainer argument.
25428
25429         * All over : Pass in TypeContainer as argument to OverloadResolve.
25430
25431         * typemanager.cs (CSharpName): Update to check for the string type and return
25432         that too.
25433
25434         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25435         a given method.
25436
25437 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25438
25439         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25440         (Invocation::BetterFunction): Implement.
25441         (Invocation::BetterConversion): Implement.
25442         (Invocation::ConversionExists): Skeleton, no implementation yet.
25443
25444         Okay, things work fine !
25445
25446 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25447
25448         * typemanager.cs: declare and load enum_type, delegate_type and
25449         void_type. 
25450
25451         * expression.cs (Expression::Emit): Now emit returns a value that
25452         tells whether a value is left on the stack or not.  This strategy
25453         might be reveted tomorrow with a mechanism that would address
25454         multiple assignments.
25455         (Expression::report118): Utility routine to report mismatches on
25456         the ExprClass.
25457
25458         (Unary::Report23): Report impossible type/operator combination
25459         utility function.
25460
25461         (Unary::IsIncrementableNumber): Whether the type can be
25462         incremented or decremented with add.
25463         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25464         complemented. 
25465         (Unary::ResolveOperator): Implement ++, !, ~,
25466
25467         (Invocation::Emit): Deal with new Emit convetion.
25468
25469         * All Expression derivatives: Updated their Emit method to return
25470         whether they leave values on the stack or not.
25471
25472         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25473         stack for expressions that are statements. 
25474
25475 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25476
25477         * expression.cs (LValue): New interface.  Must be implemented by
25478         LValue objects.
25479         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25480         LValue interface.
25481
25482         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25483         interface for generating code, simplifies the code.
25484
25485 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25486
25487         * expression.cs (everywhere): Comment out return statements in ::Resolve
25488         methods to avoid the warnings.
25489
25490 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25491
25492         * driver.cs (parse): Report error 2001 if we can not open the
25493         source file.
25494
25495         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25496         not resolve it.
25497
25498         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25499         object. 
25500
25501         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25502         otherwise nested blocks end up with the same index.
25503
25504         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25505
25506         * expression.cs:  Instead of having FIXMEs in the Resolve
25507         functions, throw exceptions so it is obvious that we are facing a
25508         bug. 
25509
25510         * cs-parser.jay (invocation_expression): Pass Location information.
25511
25512         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25513         Use a basename for those routines because .NET does not like paths
25514         on them. 
25515
25516         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25517         already defined.
25518
25519 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25520
25521         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25522         are loading the correct data types (throws an exception if not).
25523         (TypeManager::InitCoreTypes): Use CoreLookupType
25524
25525         * expression.cs (Unary::ResolveOperator): return the child
25526         expression for expressions which are just +expr.
25527         (Unary::ResolveOperator): Return negative literals for -LITERAL
25528         expressions (otherwise they are Unary {Literal}).
25529         (Invocation::Badness): Take into account `Implicit constant
25530         expression conversions'.
25531
25532         * literal.cs (LongLiteral): Implement long literal class.
25533         (IntLiteral): export the `Value' of the intliteral. 
25534
25535 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25536
25537         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25538
25539         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25540         instead of 'Operator'
25541
25542         * expression.cs (Binary::ResolveOperator): Update accordingly.
25543         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25544         and 'Minus'
25545
25546         * cs-parser.jay (unary_expression): Update to use the new names.
25547
25548         * gen-treedump.cs (GetUnary): Same here.
25549
25550         * expression.cs (Unary::Resolve): Implement.
25551         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25552         operators are found instead of making noise ;-)
25553         (Unary::ResolveOperator): New method to do precisely the same thing which
25554         Binary::ResolveOperator does for Binary expressions.
25555         (Unary.method, .Arguments): Add.
25556         (Unary::OperName): Implement.   
25557         (Unary::ForceConversion): Copy and Paste !
25558
25559         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25560         a unary operator.
25561
25562         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25563         for the inbuilt operators. Only overloading works for now ;-)
25564
25565 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25566
25567         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25568         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25569
25570         * expression.cs (This::Emit): Implement. 
25571         (This::Resolve): Implement.
25572         (TypeOf:Resolve): Implement.
25573         (Expression::ResolveSimpleName): Add an implicit this to instance
25574         field references. 
25575         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25576         Bind instance variable to Field expressions.
25577         (FieldExpr::Instance): New field used to track the expression that
25578         represents the object instance.
25579         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25580         binding 
25581         (FieldExpr::Emit): Implement.
25582
25583         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25584         the last instruction contains a return opcode to avoid generating
25585         the last `ret' instruction (this generates correct code, and it is
25586         nice to pass the peverify output).
25587
25588         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25589         initializer for static and instance variables.
25590         (Constructor::Emit): Allow initializer to be null in the case of
25591         static constructors.  Only emit initializer for instance
25592         constructors. 
25593
25594         (TypeContainer::FindMembers): Return a null array if there are no
25595         matches.
25596
25597         Also fix the code for the MemberTypes.Method branch, as it was not
25598         scanning that for operators (or tried to access null variables before).
25599
25600         * assign.cs (Assign::Emit): Handle instance and static fields. 
25601
25602         * TODO: Updated.
25603
25604         * driver.cs: Stop compilation if there are parse errors.
25605
25606         * cs-parser.jay (constructor_declaration): Provide default base
25607         initializer for non-static constructors.
25608         (constructor_declarator): Do not provide a default base
25609         initializers if none was specified.
25610         Catch the fact that constructors should not have parameters.
25611
25612         * class.cs: Do not emit parent class initializers for static
25613         constructors, that should be flagged as an error.
25614
25615 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25616
25617         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25618         Move back code into TypeContainer::Populate.
25619
25620 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25621
25622         * class.cs (TypeContainer::AddConstructor): Fix the check to
25623         compare against Name, not Basename. 
25624         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25625
25626         * cs-parser.jay : Update accordingly.
25627
25628         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25629         for methods, don't forget to look into the operators too.
25630         (RegisterMethodBuilder): Helper method to take care of this for
25631         methods, constructors and operators.
25632         (Operator::Define): Completely revamp.
25633         (Operator.OperatorMethod, MethodName): New fields.
25634         (TypeContainer::Populate): Move the registering of builders into
25635         RegisterMethodBuilder.
25636         (Operator::Emit): Re-write.
25637
25638         * expression.cs (Binary::Emit): Comment out code path to emit method
25639         invocation stuff for the case when we have a user defined operator. I am
25640         just not able to get it right !
25641
25642 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25643
25644         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25645         argument. 
25646
25647         (Expression::MemberLookup): Provide a version that allows to
25648         specify the MemberTypes and BindingFlags. 
25649
25650         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25651         so it was not fetching variable information from outer blocks.
25652
25653         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25654         Beforefieldinit as it was buggy.
25655
25656         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25657         that Ravi put here.  
25658
25659         * class.cs (Constructor::Emit): Only emit if block is not null.
25660         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25661         deal with this by semantically definining it as if the user had
25662         done it.
25663
25664         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25665         constructors as we now "emit" them at a higher level.
25666
25667         (TypeContainer::DefineDefaultConstructor): Used to define the
25668         default constructors if none was provided.
25669
25670         (ConstructorInitializer): Add methods Resolve and Emit. 
25671
25672         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25673
25674 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25675
25676         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25677         the default constructor builder with our hashtable for methodbuilders
25678         to methodcores.
25679
25680         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25681         and argument_count is 0 in which case we have a match.
25682         (Binary::ResolveOperator): More null checking and miscellaneous coding
25683         style cleanup.
25684
25685 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25686
25687         * rootcontext.cs (IsNameSpace): Compare against null.
25688
25689         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25690
25691         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25692         and Unary::Operator.
25693
25694         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25695         accordingly.
25696
25697         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25698         we have overloaded operators.
25699         (Binary::ResolveOperator): Implement the part which does the operator overload
25700         resolution.
25701
25702         * class.cs (Operator::Emit): Implement.
25703         (TypeContainer::Emit): Emit the operators we have too.
25704
25705         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25706         the case when we have a user-defined operator.
25707
25708 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25709
25710         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25711
25712 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25713
25714         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25715         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25716         (Constructor::Emit): Implement.
25717         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25718         if we have no work to do. 
25719         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25720         Emit method.
25721
25722         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25723         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25724
25725         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25726         of parent.parent.
25727
25728 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25729
25730         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25731         in the source.
25732         (Tree::RecordNamespace): Method to do what the name says ;-)
25733         (Tree::Namespaces): Property to get at the namespaces hashtable.
25734
25735         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25736         keep track.
25737
25738         * rootcontext.cs (IsNamespace): Fixed it :-)
25739
25740 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25741
25742         * class.cs (TypeContainer::FindMembers): Add support for
25743         constructors. 
25744         (MethodCore): New class that encapsulates both the shared aspects
25745         of a Constructor and a Method.  
25746         (Method, Constructor): Factored pieces into MethodCore.
25747
25748         * driver.cs: Added --fatal which makes errors throw exceptions.
25749         Load System assembly as well as part of the standard library.
25750
25751         * report.cs: Allow throwing exceptions on errors for debugging.
25752
25753         * modifiers.cs: Do not use `parent', instead use the real type
25754         container to evaluate permission settings.
25755
25756         * class.cs: Put Ravi's patch back in.  He is right, and we will
25757         have to cope with the
25758
25759 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25760
25761         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25762         FamORAssem, not FamANDAssem.
25763
25764 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25765
25766         * driver.cs: Added --parse option that only parses its input files
25767         and terminates.
25768
25769         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25770         incorrect.  IsTopLevel is not used to tell whether an object is
25771         root_types or not (that can be achieved by testing this ==
25772         root_types).  But to see if this is a top-level *class* (not
25773         necessarly our "toplevel" container). 
25774
25775 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25776
25777         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25778         parent instead of a direct call to GetType.
25779
25780 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25781
25782         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25783         Modifiers.TypeAttr. This should just be a call to that method.
25784
25785         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25786         object so that we can determine if we are top-level or not.
25787
25788         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25789         TypeContainer too.
25790
25791         * enum.cs (Enum::Define): Ditto.
25792
25793         * modifiers.cs (FieldAttr): Re-write.
25794
25795         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25796         (TypeContainer::HaveStaticConstructor): New property to provide access
25797         to precisely that info.
25798
25799         * modifiers.cs (MethodAttr): Re-write.
25800         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25801
25802         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25803         of top-level types as claimed.
25804
25805 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25806
25807         * expression.cs (MemberLookup): Fruitless attempt to lookup
25808         constructors.  Maybe I need to emit default constructors?  That
25809         might be it (currently .NET emits this for me automatically).
25810         (Invocation::OverloadResolve): Cope with Arguments == null.
25811         (Invocation::EmitArguments): new function, shared by the new
25812         constructor and us.
25813         (Invocation::Emit): Handle static and instance methods.  Emit
25814         proper call instruction for virtual or non-virtual invocations.
25815         (New::Emit): Implement.
25816         (New::Resolve): Implement.
25817         (MemberAccess:Resolve): Implement.
25818         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25819         to track instances.
25820         (FieldExpr::Resolve): Set type.
25821
25822         * support.cs: Handle empty arguments.
25823                 
25824         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25825         SimpleLookup): Auxiliary routines to help parse a qualifier
25826         identifier.  
25827
25828         Update qualifier_identifier rule.
25829
25830         * codegen.cs: Removed debugging messages.
25831
25832         * class.cs: Make this a global thing, this acts just as a "key" to
25833         objects that we might have around.
25834
25835         (Populate): Only initialize method_builders_to_methods once.
25836
25837         * expression.cs (PropertyExpr): Initialize type from the
25838         PropertyType. 
25839
25840         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25841         Resolve pattern.  Attempt to implicitly convert value to boolean.
25842         Emit code.
25843
25844         * expression.cs: Set the type for the int32/int32 argument case.
25845         (Binary::ResolveOperator): Set the return type to boolean for
25846         comparission operators
25847
25848         * typemanager.cs: Remove debugging print code.
25849
25850         (Invocation::Resolve): resolve type.
25851
25852         * class.cs: Allocate a MemberInfo of the correct size, as the code
25853         elsewhere depends on the test to reflect the correct contents.
25854
25855         (Method::) Keep track of parameters, due to System.Reflection holes
25856
25857         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25858         mapping here.
25859
25860         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25861         of the exact size and return that.
25862
25863         (Class::LookupMethodByBuilder): New function that maps
25864         MethodBuilders to its methods.  Required to locate the information
25865         on methods because System.Reflection bit us again.
25866
25867         * support.cs: New file, contains an interface ParameterData and
25868         two implementations: ReflectionParameters and InternalParameters
25869         used to access Parameter information.  We will need to grow this
25870         as required.
25871
25872         * expression.cs (Invocation::GetParameterData): implement a cache
25873         and a wrapper around the ParameterData creation for methods. 
25874         (Invocation::OverloadResolve): Use new code.
25875
25876 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25877
25878         * class.cs (TypeContainer::EmitField): Remove and move into 
25879         (Field::Define): here and modify accordingly.
25880         (Field.FieldBuilder): New member.
25881         (TypeContainer::Populate): Update accordingly.
25882         (TypeContainer::FindMembers): Implement.
25883
25884 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25885
25886         * statement.cs: (VariableInfo::VariableType): New field to be
25887         initialized with the full type once it is resolved. 
25888
25889 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25890
25891         * parameter.cs (GetParameterInfo): Use a type cache to compute
25892         things only once, and to reuse this information
25893
25894         * expression.cs (LocalVariableReference::Emit): Implement.
25895         (OpcodeCast::Emit): fix.
25896
25897         (ParameterReference::Resolve): Implement.
25898         (ParameterReference::Emit): Implement.
25899
25900         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25901         that are expressions need to stay as Expressions.
25902
25903         * typemanager.cs (CSharpName): Returns the C# name of a type if
25904         possible. 
25905
25906         * expression.cs (Expression::ConvertImplicit): New function that
25907         implements implicit type conversions.
25908
25909         (Expression::ImplicitReferenceConversion): Implements implicit
25910         reference conversions.
25911
25912         (EmptyCast): New type for transparent casts.
25913
25914         (OpcodeCast): New type for casts of types that are performed with
25915         a sequence of bytecodes.
25916
25917         (BoxedCast): New type used for casting value types into reference
25918         types.  Emits a box opcode.
25919
25920         (Binary::DoNumericPromotions): Implements numeric promotions of
25921         and computation of the Binary::Type.
25922
25923         (Binary::EmitBranchable): Optimization.
25924
25925         (Binary::Emit): Implement code emission for expressions.
25926
25927         * typemanager.cs (TypeManager): Added two new core types: sbyte
25928         and byte.
25929
25930 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25931
25932         * class.cs (TypeContainer::FindMembers): Method which does exactly
25933         what Type.FindMembers does, only we don't have to use reflection. No
25934         implementation yet.
25935
25936         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25937         typecontainer objects as we need to get at them.
25938         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25939
25940         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25941         typecontainer object.
25942
25943         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25944         of just a Report object.
25945
25946 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25947
25948         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25949         "remove_"
25950         (TypeContainer::Populate): Now define the delegates of the type too.
25951         (TypeContainer.Delegates): Property to access the list of delegates defined
25952         in the type.
25953
25954         * delegates.cs (Delegate::Define): Implement partially.
25955
25956         * modifiers.cs (TypeAttr): Handle more flags.
25957
25958 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25959
25960         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25961         and not <=
25962         (Operator::Define): Re-write logic to get types by using the LookupType method
25963         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25964         (Indexer::Define): Ditto.
25965         (Event::Define): Ditto.
25966         (Property::Define): Ditto.
25967
25968 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25969
25970         * class.cs (TypeContainer::Populate): Now define operators too. 
25971         (TypeContainer.Operators): New property to access the list of operators
25972         in a type.
25973         (Operator.OperatorMethodBuilder): New member to hold the method builder
25974         for the operator we are defining.
25975         (Operator::Define): Implement.
25976
25977 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25978
25979         * class.cs (Event::Define): Make the prefixes of the accessor methods
25980         addOn_ and removeOn_ 
25981
25982         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25983         of the location being passed in too. Ideally, this should go later since all
25984         error reporting should be done through the Report object.
25985
25986         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25987         (Populate): Iterate thru the indexers we have and define them too.
25988         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25989         for the get and set accessors.
25990         (Indexer::Define): Implement.
25991
25992 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25993
25994         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25995         my previous implementation, did not work.
25996
25997         * typemanager.cs: Add a couple of missing types (the longs).
25998
25999         * literal.cs: Use TypeManager.bool_type instead of getting it.
26000
26001         * expression.cs (EventExpr): New kind of expressions.
26002         (Expressio::ExprClassFromMemberInfo): finish
26003
26004 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26005
26006         * assign.cs: Emit stores to static fields differently.
26007
26008 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26009
26010         * Merge in changes and adjust code to tackle conflicts. Backed out my
26011         code in Assign::Resolve ;-) 
26012
26013 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26014
26015         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26016         instead Report.Error and also pass in the location.
26017         (CSharpParser::Lexer): New readonly property to return the reference
26018         to the Tokenizer object.
26019         (declare_local_variables): Use Report.Error with location instead of plain 
26020         old error.
26021         (CheckDef): Ditto.
26022
26023         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26024         (Operator.CheckBinaryOperator): Ditto.
26025
26026         * cs-parser.jay (operator_declarator): Update accordingly.
26027
26028         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26029         (CheckBinaryOperator): Same here.
26030
26031         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26032         on the name without any prefixes of namespace names etc. This is because we
26033         already might have something already fully qualified like 
26034         'System.Console.WriteLine'
26035
26036         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26037
26038 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26039
26040         * cs-tokenizer.cs (location): Return a string which also contains
26041         the file name.
26042
26043         * expression.cs (ElementAccess): New class for expressions of the
26044         type 'element access.'
26045         (BaseAccess): New class for expressions of the type 'base access.'
26046         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26047         respectively.
26048
26049         * cs-parser.jay (element_access): Implement action.
26050         (base_access): Implement actions.
26051         (checked_expression, unchecked_expression): Implement.
26052
26053         * cs-parser.jay (local_variable_type): Correct and implement.
26054         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26055
26056         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26057
26058         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26059         name and the specifiers.
26060
26061         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26062
26063         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26064         making them all public ;-)
26065
26066         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26067         class anyways.
26068
26069 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26070
26071         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26072         PropertyExprs.
26073         (FieldExpr, PropertyExprs): New resolved expressions.
26074         (SimpleName::MemberStaticCheck): Perform static checks for access
26075         to non-static fields on static methods. Maybe this should be
26076         generalized for MemberAccesses. 
26077         (SimpleName::ResolveSimpleName): More work on simple name
26078         resolution. 
26079
26080         * cs-parser.jay (primary_expression/qualified_identifier): track
26081         the parameter index.
26082
26083         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26084         (EmitContext::EmitBoolExpression): Chain to expression generation
26085         instead of temporary hack.
26086         (::EmitStatementExpression): Put generic expression code generation.
26087
26088         * assign.cs (Assign::Emit): Implement variable assignments to
26089         local variables, parameters and fields.
26090
26091 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26092
26093         * statement.cs (Block::GetVariableInfo): New method, returns the
26094         VariableInfo for a variable name in a block.
26095         (Block::GetVariableType): Implement in terms of GetVariableInfo
26096
26097         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26098         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26099
26100 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26101
26102         * cs-parser.jay (operator_declaration): Continue on my quest : update
26103         to take attributes argument.
26104         (event_declaration): Ditto.
26105         (enum_declaration): Ditto.
26106         (indexer_declaration): Ditto.
26107
26108         * class.cs (Operator::Operator): Update constructor accordingly.
26109         (Event::Event): Ditto.
26110
26111         * delegate.cs (Delegate::Delegate): Same here.
26112
26113         * enum.cs (Enum::Enum): Same here.
26114
26115 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26116
26117         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26118
26119         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26120
26121         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26122         being passed around as an arraylist.
26123         (Attributes::AddAttribute): Method to add attribute sections.
26124
26125         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26126         (struct_declaration): Update accordingly.
26127         (constant_declaration): Update.
26128         (field_declaration): Update.
26129         (method_header): Update.
26130         (fixed_parameter): Update.
26131         (parameter_array): Ditto.
26132         (property_declaration): Ditto.
26133         (destructor_declaration): Ditto.
26134
26135         * class.cs (Struct::Struct): Update constructors accordingly.
26136         (Class::Class): Ditto.
26137         (Field::Field): Ditto.
26138         (Method::Method): Ditto.
26139         (Property::Property): Ditto.
26140         (TypeContainer::OptAttribute): update property's return type.
26141
26142         * interface.cs (Interface.opt_attributes): New member.
26143         (Interface::Interface): Update to take the extra Attributes argument.
26144
26145         * parameter.cs (Parameter::Parameter): Ditto.
26146
26147         * constant.cs (Constant::Constant): Ditto.
26148
26149         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26150         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26151         the attributes as a parameter.
26152         (InterfaceProperty): Update constructor call.
26153         (InterfaceEvent): Ditto.
26154         (InterfaceMethod): Ditto.
26155         (InterfaceIndexer): Ditto.
26156
26157         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26158         pass the attributes too.
26159         (interface_event_declaration): Ditto.
26160         (interface_property_declaration): Ditto.
26161         (interface_method_declaration): Ditto.
26162         (interface_declaration): Ditto.
26163
26164 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26165
26166         * class.cs (Method::Define): Track the "static Main" definition to
26167         create an entry point. 
26168
26169         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26170         EntryPoint if we find it. 
26171
26172         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26173         (EmitContext::ig): Make this variable public.
26174
26175         * driver.cs: Make the default output file be the first file name
26176         with the .exe extension.  
26177
26178         Detect empty compilations
26179
26180         Handle various kinds of output targets.  Handle --target and
26181         rename -t to --dumper.
26182
26183         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26184         methods inherited from Expression return now an Expression.  This
26185         will is used during the tree rewriting as we resolve them during
26186         semantic analysis.
26187
26188         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26189         the spec.  Missing entirely is the information about
26190         accessability of elements of it.
26191
26192         (Expression::ExprClassFromMemberInfo): New constructor for
26193         Expressions that creates a fully initialized Expression based on
26194         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26195         a Type.
26196
26197         (Invocation::Resolve): Begin implementing resolution of invocations.
26198
26199         * literal.cs (StringLiteral):  Implement Emit.
26200
26201 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26202
26203         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26204         member.
26205
26206 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26207
26208         * cs-parser.jay (attribute_arguments): Implement actions.
26209         (attribute): Fix bug in production. Implement action.
26210         (attribute_list): Implement.
26211         (attribute_target): Implement.
26212         (attribute_target_specifier, opt_target_specifier): Implement
26213         (CheckAttributeTarget): New method to check if the attribute target
26214         is valid.
26215         (attribute_section): Implement.
26216         (opt_attributes): Implement.
26217
26218         * attribute.cs : New file to handle attributes.
26219         (Attribute): Class to hold attribute info.
26220
26221         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26222         (attribute_section): Modify production to use 2 different rules to 
26223         achieve the same thing. 1 s/r conflict down !
26224         Clean out commented, useless, non-reducing dimension_separator rules.
26225
26226         * class.cs (TypeContainer.attributes): New member to hold list
26227         of attributes for a type.
26228         (Struct::Struct): Modify to take one more argument, the attribute list.
26229         (Class::Class): Ditto.
26230         (Field::Field): Ditto.
26231         (Method::Method): Ditto.
26232         (Property::Property): Ditto.
26233
26234         * cs-parser.jay (struct_declaration): Update constructor call to
26235         pass in the attributes too.
26236         (class_declaration): Ditto.
26237         (constant_declaration): Ditto.
26238         (field_declaration): Ditto.
26239         (method_header): Ditto.
26240         (fixed_parameter): Ditto.
26241         (parameter_array): Ditto.
26242         (property_declaration): Ditto.
26243
26244         * constant.cs (Constant::Constant): Update constructor similarly.
26245         Use System.Collections.
26246
26247         * parameter.cs (Parameter::Parameter): Update as above.
26248
26249 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26250
26251         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26252         (TypeContainer.delegates): New member to hold list of delegates.
26253
26254         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26255         this time as I seem to be on crack ;-)
26256
26257 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26258
26259         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26260         tell whether an identifier represents a namespace.
26261
26262         * expression.cs (NamespaceExpr): A namespace expression, used only
26263         temporarly during expression resolution.
26264         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26265         utility functions to resolve names on expressions.
26266
26267 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26268
26269         * codegen.cs: Add hook for StatementExpressions. 
26270
26271         * class.cs: Fix inverted test for static flag in methods.
26272
26273 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26274
26275         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26276         to make it coincide with MS' number.
26277         (Operator::CheckBinaryOperator): Ditto.
26278
26279         * ../errors/errors.txt : Remove error numbers added earlier.
26280
26281         * ../errors/cs1019.cs : Test case for error # 1019
26282
26283         * ../errros/cs1020.cs : Test case for error # 1020
26284
26285         * cs-parser.jay : Clean out commented cruft.
26286         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26287         used anywhere - non-reducing rule.
26288         (namespace_declarations): Non-reducing rule - comment out.
26289
26290         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26291         with TypeContainer::AddEnum.
26292
26293         * delegate.cs : New file for delegate handling classes.
26294         (Delegate): Class for declaring delegates.
26295
26296         * makefile : Update.
26297
26298         * cs-parser.jay (delegate_declaration): Implement.
26299
26300 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26301
26302         * class.cs (Event::Define): Implement.
26303         (Event.EventBuilder): New member.
26304
26305         * class.cs (TypeContainer::Populate): Update to define all enums and events
26306         we have.
26307         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26308         readonly fields for all these cases ?
26309
26310 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26311
26312         * class.cs (Property): Revamp to use the convention of making fields readonly.
26313         Accordingly modify code elsewhere.
26314
26315         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26316         the Define method of the Property class.
26317
26318         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26319         trivial bug.
26320         (TypeContainer::Populate): Update to define all the properties we have. Also
26321         define all enumerations.
26322
26323         * enum.cs (Define): Implement.
26324
26325 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26326
26327         * cs-parser.jay (overloadable_operator): The semantic value is an
26328         enum of the Operator class.
26329         (operator_declarator): Implement actions.
26330         (operator_declaration): Implement.
26331
26332         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26333         validity of definitions.
26334         (Operator::CheckBinaryOperator): Static method to check for binary operators
26335         (TypeContainer::AddOperator): New method to add an operator to a type.
26336
26337         * cs-parser.jay (indexer_declaration): Added line to actually call the
26338         AddIndexer method so it gets added ;-)
26339
26340         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26341         already taken care of by the MS compiler ?  
26342
26343 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26344
26345         * class.cs (Operator): New class for operator declarations.
26346         (Operator::OpType): Enum for the various operators.
26347
26348 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26349
26350         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26351         ostensibly handle this in semantic analysis.
26352
26353         * cs-parser.jay (general_catch_clause): Comment out
26354         (specific_catch_clauses, specific_catch_clause): Ditto.
26355         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26356         (catch_args, opt_catch_args): New productions.
26357         (catch_clause): Rewrite to use the new productions above
26358         (catch_clauses): Modify accordingly.
26359         (opt_catch_clauses): New production to use in try_statement
26360         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26361         and re-write the code in the actions to extract the specific and
26362         general catch clauses by being a little smart ;-)
26363
26364         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26365         Hooray, try and catch statements parse fine !
26366
26367 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26368
26369         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26370         string from the hashtable of variables.
26371
26372         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26373         I end up making that mistake ;-)
26374         (catch_clauses): Fixed gross error which made Key and Value of the 
26375         DictionaryEntry the same : $1 !!
26376
26377 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26378
26379         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26380
26381         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26382         when the add and remove accessors are specified. 
26383
26384 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26385
26386         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26387         information about indexer_declarator.
26388         (indexer_declarator): Implement actions.
26389         (parsing_indexer): New local boolean used to keep track of whether
26390         we are parsing indexers or properties. This is necessary because 
26391         implicit_parameters come into picture even for the get accessor in the 
26392         case of an indexer.
26393         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26394
26395         * class.cs (Indexer): New class for indexer declarations.
26396         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26397         (TypeContainer::indexers): New member to hold list of indexers for the
26398         type.
26399
26400 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26401
26402         * cs-parser.jay (add_accessor_declaration): Implement action.
26403         (remove_accessor_declaration): Implement action.
26404         (event_accessors_declaration): Implement
26405         (variable_declarators): swap statements for first rule - trivial.
26406
26407         * class.cs (Event): New class to hold information about event
26408         declarations.
26409         (TypeContainer::AddEvent): New method to add an event to a type
26410         (TypeContainer::events): New member to hold list of events.
26411
26412         * cs-parser.jay (event_declaration): Implement actions.
26413
26414 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26415
26416         * cs-parser.jay (dim_separators): Implement. Make it a string
26417         concatenating all the commas together, just as they appear.
26418         (opt_dim_separators): Modify accordingly
26419         (rank_specifiers): Update accordingly. Basically do the same
26420         thing - instead, collect the brackets here.
26421         (opt_rank_sepcifiers): Modify accordingly.
26422         (array_type): Modify to actually return the complete type string
26423         instead of ignoring the rank_specifiers.
26424         (expression_list): Implement to collect the expressions
26425         (variable_initializer): Implement. We make it a list of expressions
26426         essentially so that we can handle the array_initializer case neatly too.
26427         (variable_initializer_list): Implement.
26428         (array_initializer): Make it a list of variable_initializers
26429         (opt_array_initializer): Modify accordingly.
26430
26431         * expression.cs (New::NType): Add enumeration to help us
26432         keep track of whether we have an object/delegate creation
26433         or an array creation.
26434         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26435         members to hold data about array creation.
26436         (New:New): Modify to update NewType
26437         (New:New): New Overloaded contructor for the array creation
26438         case.
26439
26440         * cs-parser.jay (array_creation_expression): Implement to call
26441         the overloaded New constructor.
26442
26443 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26444
26445         * class.cs (TypeContainer::Constructors): Return member
26446         constructors instead of returning null.
26447
26448 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26449
26450         * typemanager.cs (InitCoreTypes): Initialize the various core
26451         types after we have populated the type manager with the user
26452         defined types (this distinction will be important later while
26453         compiling corlib.dll)
26454
26455         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26456         on Expression Classification.  Now all expressions have a method
26457         `Resolve' and a method `Emit'.
26458
26459         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26460         generation from working.     Also add some temporary debugging
26461         code. 
26462
26463 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26464
26465         * codegen.cs: Lots of code generation pieces.  This is only the
26466         beginning, will continue tomorrow with more touches of polish.  We
26467         handle the fundamentals of if, while, do, for, return.  Others are
26468         trickier and I need to start working on invocations soon.
26469
26470         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26471         s.InitStatement. 
26472
26473         * codegen.cs (EmitContext): New struct, used during code
26474         emission to keep a context.   Most of the code generation will be
26475         here. 
26476
26477         * cs-parser.jay: Add embedded blocks to the list of statements of
26478         this block.  So code generation proceeds in a top down fashion.
26479
26480 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26481
26482         * statement.cs: Add support for multiple child blocks.
26483
26484 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26485
26486         * codegen.cs (EmitCode): New function, will emit the code for a
26487         Block of code given a TypeContainer and its ILGenerator. 
26488
26489         * statement.cs (Block): Standard public readonly optimization.
26490         (Block::Block constructors): Link children. 
26491         (Block::Child): Child Linker.
26492         (Block::EmitVariables): Emits IL variable declarations.
26493
26494         * class.cs: Drop support for MethodGroups here, delay until
26495         Semantic Analysis.
26496         (Method::): Applied the same simplification that I did before, and
26497         move from Properties to public readonly fields.
26498         (Method::ParameterTypes): Returns the parameter types for the
26499         function, and implements a cache that will be useful later when I
26500         do error checking and the semantic analysis on the methods is
26501         performed.
26502         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26503         and made a method, optional argument tells whether this is a class
26504         or a structure to apply the `has-this' bit.
26505         (Method::GetCallingConvention): Implement, returns the calling
26506         convention. 
26507         (Method::Define): Defines the type, a second pass is performed
26508         later to populate the methods.
26509
26510         (Constructor::ParameterTypes): implement a cache similar to the
26511         one on Method::ParameterTypes, useful later when we do semantic
26512         analysis. 
26513
26514         (TypeContainer::EmitMethod):  New method.  Emits methods.
26515
26516         * expression.cs: Removed MethodGroup class from here.
26517
26518         * parameter.cs (Parameters::GetCallingConvention): new method.
26519
26520 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26521
26522         * class.cs (TypeContainer::Populate): Drop RootContext from the
26523         argument. 
26524
26525         (Constructor::CallingConvention): Returns the calling convention.
26526         (Constructor::ParameterTypes): Returns the constructor parameter
26527         types. 
26528
26529         (TypeContainer::AddConstructor): Keep track of default constructor
26530         and the default static constructor.
26531
26532         (Constructor::) Another class that starts using `public readonly'
26533         instead of properties. 
26534
26535         (Constructor::IsDefault): Whether this is a default constructor. 
26536
26537         (Field::) use readonly public fields instead of properties also.
26538
26539         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26540         track of static constructors;  If none is used, turn on
26541         BeforeFieldInit in the TypeAttributes. 
26542
26543         * cs-parser.jay (opt_argument_list): now the return can be null
26544         for the cases where there are no arguments. 
26545
26546         (constructor_declarator): If there is no implicit `base' or
26547         `this', then invoke the default parent constructor. 
26548
26549         * modifiers.cs (MethodAttr): New static function maps a set of
26550         modifiers flags into a MethodAttributes enum
26551         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26552         MethodAttr, TypeAttr to represent the various mappings where the
26553         modifiers are used.
26554         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26555
26556 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26557
26558         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26559         method arguments.
26560
26561         * interface.cs (PopulateIndexer): Implemented the code generator
26562         for interface indexers.
26563
26564 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26565
26566         * interface.cs (InterfaceMemberBase): Now we track the new status
26567         here.  
26568
26569         (PopulateProperty): Implement property population.  Woohoo!  Got
26570         Methods and Properties going today. 
26571
26572         Removed all the properties for interfaces, and replaced them with
26573         `public readonly' fields. 
26574
26575 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26576
26577         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26578         initialize their hashtables/arraylists only when they are needed
26579         instead of doing this always.
26580
26581         * parameter.cs: Handle refs and out parameters.
26582
26583         * cs-parser.jay: Use an ArrayList to construct the arguments
26584         instead of the ParameterCollection, and then cast that to a
26585         Parameter[] array.
26586
26587         * parameter.cs: Drop the use of ParameterCollection and use
26588         instead arrays of Parameters.
26589
26590         (GetParameterInfo): Use the Type, not the Name when resolving
26591         types. 
26592
26593 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26594
26595         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26596         and instead use public readonly fields.
26597
26598         * class.cs: Put back walking code for type containers.
26599
26600 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26601
26602         * class.cs (MakeConstant): Code to define constants.
26603
26604         * rootcontext.cs (LookupType): New function.  Used to locate types 
26605
26606
26607 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26608
26609         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26610         this System.Reflection code is.  Kudos to Microsoft
26611
26612         * typemanager.cs: Implement a type cache and avoid loading all
26613         types at boot time.  Wrap in LookupType the internals.  This made
26614         the compiler so much faster.  Wow.  I rule!
26615
26616         * driver.cs: Make sure we always load mscorlib first (for
26617         debugging purposes, nothing really important).
26618
26619         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26620         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26621
26622         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26623         on namespaces that have been imported using the `using' keyword.
26624
26625         * class.cs (TypeContainer::TypeAttr): Virtualize.
26626         (Class::TypeAttr): Return attributes suitable for this bad boy.
26627         (Struct::TypeAttr): ditto.
26628         Handle nested classes.
26629         (TypeContainer::) Remove all the type visiting code, it is now
26630         replaced with the rootcontext.cs code
26631
26632         * rootcontext.cs (GetClassBases): Added support for structs. 
26633
26634 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26635
26636         * interface.cs, statement.cs, class.cs, parameter.cs,
26637         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26638         Drop use of TypeRefs, and use strings instead.
26639
26640 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26641
26642         * rootcontext.cs: 
26643
26644         * class.cs (Struct::Struct): set the SEALED flags after
26645         checking the modifiers.
26646         (TypeContainer::TypeAttr): new property, returns the
26647         TypeAttributes for a class.  
26648
26649         * cs-parser.jay (type_list): Oops, list production was creating a
26650         new list of base types.
26651
26652         * rootcontext.cs (StdLib): New property.
26653         (GetInterfaceTypeByName): returns an interface by type name, and
26654         encapsulates error handling here.
26655         (GetInterfaces): simplified.
26656         (ResolveTree): Encapsulated all the tree resolution here.
26657         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26658         types. 
26659
26660         * driver.cs: Add support for --nostdlib, to avoid loading the
26661         default assemblies.
26662         (Main): Do not put tree resolution here. 
26663
26664         * rootcontext.cs: Beginning of the class resolution.
26665
26666 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26667
26668         * rootcontext.cs: Provide better error reporting. 
26669
26670         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26671
26672         * rootcontext.cs (CreateInterface): Handle the case where there
26673         are no parent interfaces.
26674
26675         (CloseTypes): Routine to flush types at the end.
26676         (CreateInterface): Track types.
26677         (GetInterfaces): Returns an array of Types from the list of
26678         defined interfaces.
26679
26680         * typemanager.c (AddUserType): Mechanism to track user types (puts
26681         the type on the global type hash, and allows us to close it at the
26682         end). 
26683
26684 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26685
26686         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26687         RecordInterface instead.
26688
26689         * cs-parser.jay: Updated to reflect changes above.
26690
26691         * decl.cs (Definition): Keep track of the TypeBuilder type that
26692         represents this type here.  Not sure we will use it in the long
26693         run, but wont hurt for now.
26694
26695         * driver.cs: Smaller changes to accomodate the new code.
26696
26697         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26698         when done. 
26699
26700         * rootcontext.cs (CreateInterface):  New method, used to create
26701         the System.TypeBuilder type for interfaces.
26702         (ResolveInterfaces): new entry point to resolve the interface
26703         hierarchy. 
26704         (CodeGen): Property, used to keep track of the code generator.
26705
26706 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26707
26708         * cs-parser.jay: Add a second production for delegate_declaration
26709         with `VOID'.
26710
26711         (enum_body): Put an opt_comma here instead of putting it on
26712         enum_body or enum_member_declarations so we can handle trailing
26713         commas on enumeration members.  Gets rid of a shift/reduce.
26714
26715         (type_list): Need a COMMA in the middle.
26716
26717         (indexer_declaration): Tell tokenizer to recognize get/set
26718
26719         * Remove old targets.
26720
26721         * Re-add the parser target.
26722
26723 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26724
26725         * cs-parser.jay: Add precendence rules for a number of operators
26726         ot reduce the number of shift/reduce conflicts in the grammar.
26727
26728 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26729
26730         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26731         and put it here.
26732
26733         Get rid of old crufty code.
26734
26735         * rootcontext.cs: Use this to keep track of the parsed
26736         representation and the defined types available to the program. 
26737
26738         * gen-treedump.cs: adjust for new convention.
26739
26740         * type.cs: Split out the type manager, and the assembly builder
26741         from here. 
26742
26743         * typemanager.cs: the type manager will live here now.
26744
26745         * cil-codegen.cs: And the code generator here. 
26746
26747 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26748
26749         * makefile: Fixed up for easy making.
26750
26751 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26752
26753         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26754         the 
26755
26756         (unary_expression): Expand pre_increment_expression and
26757         post_decrement_expression to reduce a shift/reduce.
26758
26759 2001-07-11  Simon Cozens
26760
26761         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26762
26763         Improve allow_keyword_as_indent name.
26764
26765 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26766
26767         * Adjustments for Beta2. 
26768
26769 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26770
26771         * decl.cs: Added `Define' abstract method.
26772         (InTransit): new property, used to catch recursive definitions. 
26773
26774         * interface.cs: Implement `Define'. 
26775
26776         * modifiers.cs: Map Modifiers.constants to
26777         System.Reflection.TypeAttribute flags.
26778
26779         * class.cs: Keep track of types and user-defined types.
26780         (BuilderInit): New method for creating an assembly
26781         (ResolveType): New function to launch the resolution process, only
26782         used by interfaces for now.
26783
26784         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26785         that are inserted into the name space. 
26786
26787 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26788
26789         * ARGH.  I have screwed up my tree so many times due to the use of
26790         rsync rather than using CVS.  Going to fix this at once. 
26791
26792         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26793         load types.
26794
26795 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26796
26797         * Experiment successful: Use System.Type rather that our own
26798         version of Type.  
26799
26800 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26801
26802         * cs-parser.jay: Removed nsAliases from here.
26803
26804         Use new namespaces, handle `using XXX;' 
26805
26806         * namespace.cs: Reimplemented namespace handling, use a recursive
26807         definition of the class.  Now we can keep track of using clauses
26808         and catch invalid using clauses.
26809
26810 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26811
26812         * gen-treedump.cs: Adapted for all the renaming.
26813
26814         * expression.cs (Expression): this class now has a Type property
26815         which returns an expression Type.
26816
26817         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26818         `Type', as this has a different meaning now in the base
26819
26820 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26821
26822         * interface.cs, class.cs: Removed from all the sources the
26823         references to signature computation, as we can not do method
26824         signature computation during the parsing time, as we are not
26825         trying to solve at that point distinguishing:
26826
26827         class X {
26828                 void a (Blah x) {}
26829                 void a (NS.Blah x) {}
26830         }
26831
26832         Which depending on the context might be valid or not, as we do not
26833         know if Blah is the same thing as NS.Blah at that point.
26834
26835         * Redid everything so the code uses TypeRefs now instead of
26836         Types.  TypeRefs are just temporary type placeholders, that need
26837         to be resolved.  They initially have a pointer to a string and the
26838         current scope in which they are used.  This is used later by the
26839         compiler to resolve the reference to an actual Type. 
26840
26841         * DeclSpace is no longer a CIR.Type, and neither are
26842         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26843         are all DeclSpaces, but no Types. 
26844
26845         * type.cs (TypeRefManager): This implements the TypeRef manager,
26846         which keeps track of all the types that need to be resolved after
26847         the parsing has finished. 
26848
26849 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26850
26851         * ARGH.  We are going to have to store `foreach' as a class rather
26852         than resolving it, as we need to verify error 1579 after name
26853         resolution.   *OR* we could keep a flag that says `This request to
26854         IEnumerator comes from a foreach statement' which we can then use
26855         to generate the error.
26856
26857 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26858
26859         * class.cs (TypeContainer.AddMethod): we now add methods to the
26860         MethodGroup instead of the method hashtable.  
26861
26862         * expression.cs: Add MethodGroup abstraction, which gets us one
26863         step closer to the specification in the way we handle method
26864         declarations.  
26865
26866         * cs-parser.jay (primary_expression): qualified_identifier now
26867         tried to match up an identifier to a local variable reference or
26868         to a parameter reference.
26869
26870         current_local_parameters is now a parser global variable that
26871         points to the current parameters for the block, used during name
26872         lookup.
26873
26874         (property_declaration): Now creates an implicit `value' argument to
26875         the set accessor.
26876
26877 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26878
26879         * parameter.cs: Do not use `param' arguments as part of the
26880         signature, per the spec.
26881
26882 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26883
26884         * decl.cs: Base class for classes, structs and interfaces.  This
26885         is the "Declaration Space" 
26886
26887         * cs-parser.jay: Use CheckDef for checking declaration errors
26888         instead of having one on each function.
26889
26890         * class.cs: Factor out some code for handling error handling in
26891         accordance to the "Declarations" section in the "Basic Concepts"
26892         chapter in the ECMA C# spec.
26893
26894         * interface.cs: Make all interface member classes derive from
26895         InterfaceMemberBase.
26896
26897 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26898
26899         * Many things: all interfaces are parsed and generated in
26900         gen-treedump.  Support for member variables, constructors,
26901         destructors, properties, constants is there.
26902
26903         Beginning of the IL backend, but very little done, just there for
26904         testing purposes. 
26905
26906 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26907
26908         * cs-parser.jay: Fix labeled statement.
26909
26910         * cs-tokenizer.cs (escape): Escape " and ' always.
26911         ref_line, ref_name: keep track of the line/filename as instructed
26912         by #line by the compiler.
26913         Parse #line.
26914
26915 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26916
26917         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26918         to match the values in System.CodeDOM.
26919
26920         Divid renamed to Divide.
26921
26922         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26923         statements. 
26924         (Statements.set): remove.
26925
26926         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26927         statements. 
26928
26929         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26930         falseStatements always have valid values. 
26931
26932         * cs-parser.jay: Use System.CodeDOM now.
26933