Grasshopper now uses csproj instead of vmwcsproj
[mono.git] / mcs / gmcs / ChangeLog
1 2007-02-11  Miguel de Icaza  <miguel@novell.com>
2
3         * cs-parser.jay (lambda_expression_body): when the body is an
4         expression add a statement of the form:
5
6                 contextual-return expression.
7
8         Where `contextual-return' is similar to `return', the difference
9         being that if the delegate that the lambda will be converted to
10         has a void return type, it will check that the result is a
11         ExpressionStatement and the result is a plain ret (no return
12         values on the stack).  If the return type of the delegate is of a
13         given type, this turns into a return with a value and does the
14         regular checking to check that the computed value can be
15         implicitly converted to the delegate return.
16
17 2007-01-30  Miguel de Icaza  <miguel@novell.com>
18
19         * cs-parser.jay (anonymous_method_expression): move the
20         before/after productions to the start_anonymous and end_anonymous
21         methods so the code can be reused for lambda functions.
22
23         (lambda_expression_body): wrap expressions implicitly into a
24         block.
25
26         (block): factor out the setup/teardown of parsing a block so we
27         can reuse that in lambda_expression_body
28
29         (lambda_expression): use new anonymous method helper methods.
30
31 2007-01-29  Miguel de Icaza  <miguel@novell.com>
32
33         * cs-parser.jay: oob_stack make it static (am guessing that is why
34         we no longer initialize it anymore) and reuse it across
35         instances.
36
37 2007-01-28  Miguel de Icaza  <miguel@novell.com>
38
39         * cs-parser.jay (open_parens): Introduce new non-terminal that
40         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
41         be returned in places where types are followed by identifiers
42         (this is expected in declaration, fixed, using, foreach and catch
43         clauses). 
44
45         Use open_parens in those places, keep OPEN_PARENS in the
46         expressions.  
47
48         cs-parser.jay: New grammar bits for parsing lambda expressions. 
49
50 2007-01-28  Raja R Harinath  <rharinath@novell.com>
51
52         Fix #80534, gtest-309.cs
53         * generic.cs (UnifyType): Rename from InferType.  Make unification
54         of generic insts simpler and don't insist on inferring all generic
55         parameters in a single generic inst unification.
56         (UnifyTypes): New.
57         (InferGenericInstance): Remove.
58         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
59
60 2007-01-20  Marek Safar  <marek.safar@gmail.com>
61
62         * cs-parser.jay: Better parameter error handling.
63
64 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
65             Raja R Harinath  <rharinath@novell.com>
66
67         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
68         Note the order in which accessors are declared in the source.
69
70 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
71
72         * generic.cs (TypeParameter.FindMembers): Use the generic
73         constraints, not the constraints to check for methods (first fix
74         of 80518).
75
76 2006-12-30  Marek Safar  <marek.safar@gmail.com>
77
78         * cs-parser.jay: Better syntax errors handling.
79
80 2006-11-21  Marek Safar  <marek.safar@gmail.com>
81
82         * cs-parser.jay: Tiny change to work with mcs tokenizer.
83
84         * cs-tokenizer.cs: Remove after unification with mcs.
85
86 2006-10-28  Marek Safar  <marek.safar@gmail.com>
87
88         A fix for bug #78998
89         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
90         arguments as well.
91
92 2006-10-26  Marek Safar  <marek.safar@gmail.com>
93
94         A fix for bug #76591
95         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
96
97 2006-10-25  Brian Crowell  <brian@fluggo.com>
98
99         Fix #79703
100         * generic.cs (CheckConstraints): Allow generic parameters with
101         inheritance constraints to satisfy reference type constraints.
102
103 2006-10-09  Martin Baulig  <martin@ximian.com>
104
105         * generic.cs
106         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
107
108 2006-09-25  Martin Baulig  <martin@ximian.com>
109
110         * class.cs: Remove after unification with mcs source.
111
112 2006-09-24  Raja R Harinath  <harinath@gmail.com>
113
114         * convert.cs: Remove after unification with mcs source.
115
116 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
117
118         * class.cs (MemberBase.VerifyClsCompliance): When method has type
119         parameters verify them as well.
120
121         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
122         the type parameter constraints.
123         (Generics.VerifyClsCompliance): Ditto.
124
125 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
126
127         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
128         for anonymous block with out argument.
129
130 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
131
132         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
133         not used private events only.
134
135 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
136
137         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
138
139         * cs-parser.jay: Parse correctly cast of default (T).
140
141         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
142         Store original type via EmptyConstantCast.
143
144 2006-09-22  Martin Baulig  <martin@ximian.com>
145
146         * delegate.cs: Removed; this file is now shared with mcs.
147
148         * attribute.cs: Removed; this file is now shared with mcs.
149
150 2006-09-22  Martin Baulig  <martin@ximian.com>
151
152         * ecore.cs: Removed; this file is now shared with mcs.
153
154 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
155
156         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
157
158         * ecore.cs (NullCast): Derives from NullConstant.
159
160         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
161         results.
162
163 2006-09-21  Martin Baulig  <martin@ximian.com>
164
165         * decl.cs: Removed; this file is now shared with mcs.
166
167 2006-09-21  Raja R Harinath  <rharinath@novell.com>
168
169         * rootcontext.cs: Remove after unification with mcs source.
170
171         * report.cs: Remove after unification with mcs source.
172         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
173         mcs/typemanager.cs.
174         (InitGenerics, CleanUpGenerics): Remove.
175
176         * support.cs: Remove after unification with mcs source.
177
178 2006-09-20  Raja R Harinath  <rharinath@novell.com>
179
180         * codegen.cs: Remove after unification with mcs source.
181
182 2006-09-19  Martin Baulig  <martin@ximian.com>
183
184         * expression.cs: Removed; this file is now shared with mcs.
185
186 2006-09-19  Martin Baulig  <martin@ximian.com>
187
188         * generic.cs
189         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
190         (TypeManager.DropGenericTypeArguments): Likewise.
191         (TypeManager.DropGenericMethodArguments): Likewise.
192         (TypeManager.GetTypeArguments): Likewise.
193         (TypeManager.HasGenericArguments): Likewise.
194
195 2006-09-19  Martin Baulig  <martin@ximian.com>
196
197         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
198
199 2006-09-19  Martin Baulig  <martin@ximian.com>
200
201         * typemanager.cs: Removed; this file is now shared with mcs.
202
203 2006-09-16  Raja R Harinath  <rharinath@novell.com>
204
205         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
206         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
207
208 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
209
210         A fix for #79401
211         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
212         only if parent type is class.
213         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
214         update.
215
216 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
217
218         * cs-parser.jay,
219         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
220         keywords are used.
221         * typemanager.cs(CSharpName): Converts NullType to null.
222
223 2006-09-15  Martin Baulig  <martin@ximian.com>
224
225         * pending.cs: Removed; this file is now shared with mcs.
226
227 2006-09-15  Martin Baulig  <martin@ximian.com>
228
229         * statement.cs: Removed; this file is now shared with mcs.
230
231 2006-09-15  Martin Baulig  <martin@ximian.com>
232
233         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
234
235         * driver.cs: Removed the `--broken-cycles' argument.
236
237 2006-09-15  Martin Baulig  <martin@ximian.com>
238
239         * namespace.cs: Removed; this file is now shared with mcs.
240
241 2006-09-15  Martin Baulig  <martin@ximian.com>
242
243         * decl.cs (MemberName): Minor code cleanups.
244
245 2006-09-15  Martin Baulig  <martin@ximian.com>
246
247         * parameter.cs: Removed; this file is now shared with mcs.
248
249 2006-09-15  Martin Baulig  <martin@ximian.com>
250
251         * enum.cs: Removed; this file is now shared with mcs.
252
253 2006-09-15  Martin Baulig  <martin@ximian.com>
254
255         * Makefile: Define `GMCS_SOURCE'.
256
257         * flowanalysis.cs: Removed; this file is now shared with mcs.
258
259 2006-09-15  Martin Baulig  <martin@ximian.com>
260
261         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
262         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
263         doc.cs - they are now shared with mcs.
264
265         * gmcs.exe.sources: Include these files from ../mcs/.
266
267 2006-09-15  Martin Baulig  <martin@ximian.com>
268
269         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
270         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
271
272 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
273
274         * assign.cs, ecore.cs, expression.cs: Share error message text.
275         * class.cs (FieldMember.Define): Check for variable of static type.
276         * decl.cs (check_type_parameter): Report correct type name.
277         * driver.cs (LoadAssembly): Uses error output for errors.
278         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
279         (TypeArguments.Resolve): Static class cannot be used as an argument.
280         * statement.cs (ResolveMeta): Constants cannot be generic types.
281
282 2006-09-12  Martin Baulig  <martin@ximian.com>
283
284         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
285
286         * convert.cs (Convert.Array_To_IList): Moved here and correctly
287         implement it; fixes #79345.
288
289 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
290
291         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
292         parameter.
293         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
294         types.
295         * generic.cs: Improved error messages.
296         * typemanager.cs (RemoveGenericArity): Made public.
297
298 2006-09-08  Martin Baulig  <martin@ximian.com>
299
300         * typemanager.cs (TypeManager.interlocked_type): New public field.
301         (TypeManager.int_interlocked_compare-exchange): New public field.
302         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
303         enumerator types here and call InitGenericCoreTypes().
304         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
305         after calling InitEnumUnderlyingTypes().
306
307         * rootcontext.cs
308         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
309         `classes_second_stage'. 
310
311 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
312  
313         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
314         collisions.
315         * statement.cs (Block.Variables): Made public.
316
317 2006-09-07  Martin Baulig  <martin@ximian.com>
318
319         * driver.cs
320         (MainDriver): Revert r62663 from Marek; see #70506 for details.
321
322 2006-09-01  Martin Baulig  <martin@ximian.com>
323
324         * generic.cs
325         (TypeManager.IsIList): Also handle base classes and interfaces. 
326
327 2006-09-01  Raja R Harinath  <rharinath@novell.com>
328
329         Fix #79238
330         * expression.cs (Invocation.MoreSpecific): Check for reference
331         types earlier.
332
333 2006-08-29  Miguel de Icaza  <miguel@novell.com>
334
335         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
336
337 2006-08-17  Miguel de Icaza  <miguel@novell.com>
338
339         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
340         #52019 and #79064, the use of the \uXXXX sequence in source code
341         to represent unicode characters.
342
343 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
344  
345         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
346         support.
347         * class.cs, ecore.cs, statement.cs: Merged to one error message.
348
349 2006-08-14  Raja R Harinath  <rharinath@novell.com>
350
351         Fix #79067
352         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
353         parameter too.  This only avoids a parse error -- the semantic
354         error is caught elsewhere.
355
356 2006-08-13  Miguel de Icaza  <miguel@novell.com>
357
358         * assign.cs: Catch attempts to assign to a method groups in += and
359         report as 1656
360
361 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
362
363         A fix for #79056
364         * cs-parser.jay: Don't destroy current array type by typeof of array's.
365
366 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
367
368         * cs-parser.jay: Check whether a constraint clause has already been
369         specified for type parameter.
370         * generic.cs (Constraints): Exposed location.
371
372 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
373
374         * class.cs (Method.Define): Issue a warning when generic method looks like
375         an entry point.
376         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
377         as well.
378         * report.cs: New warning number.
379
380 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
381  
382         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
383         looking for ctor.
384         * decl.cs (MemberCache.FindMembers): When container is interface we need to
385         search all base interfaces as a member can be ambiguous.
386         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
387         Constructor member type filter. 
388         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
389         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
390         reporting for returned memberinfos.
391         * report.cs: Updated.
392         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
393         version to work on all runtimes.
394         (TypeManager.RealMemberLookup): Removed members filtering.
395
396 2006-08-08  Raja R Harinath  <rharinath@novell.com>
397
398         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
399         (PropertyExpr.EmitAssign): Likewise.
400         * expression.cs (Indirection.EmitAssign): Likewise.
401         (LocalVariableReference.EmitAssign): Likewise.
402         (ParameterReference.EmitAssign): Likewise.
403         (Invocation.EmitArguments): Likewise.
404         (ArrayAccess.EmitAssign): Likewise.
405         (IndexerAccess.EmitAssign): Likewise.
406         (This.EmitAssign): Likewise.
407         (ConditionalLogicalOperator.Emit): Likewise.
408
409         Fix #79026
410         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
411         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
412         leave it in after returning it.
413         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
414
415 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
416
417         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
418         message.
419
420 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
421
422         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
423         with different type names.
424         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
425
426 2006-08-03  Raja R Harinath  <rharinath@novell.com>
427
428         Fix cs0146-3.cs and cs0146-4.cs.
429         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
430         enclosing types don't depend on the current type.
431
432 2006-08-02  Raja R Harinath  <rharinath@novell.com>
433
434         Fix #77963
435         * class.cs (TypeContainer.DoDefineMembers): Use
436         FindBaseMemberWithSameName on Parent, since we're interested in
437         whether we hide inherited members or not.
438         (FindBaseMemberWithSameName): Make slightly more robust.
439
440         Fix #77396
441         * codegen.cs (IResolveContext.GenericDeclContainer): New.
442         (EmitContext): Implement new interface requirement.
443         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
444         * decl.cs (MemberCore): Likewise.
445         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
446         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
447         ec.GenericDeclContainer to check for generic parameters.
448         (SimpleName.DoSimpleNameResolve): Likewise.
449         * generic.cs (TypeParameter.DeclContainer): Remove override.
450
451         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
452         declspaces for doppelgangers too.
453         (UsingEntry): Implement IResolveContext.
454         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
455         'this' as the resolve context.
456         (LocalAliasEntry): Likewise.
457
458         Implement parts of #77403
459         * roottypes.cs (RootDeclSpace): New.  Used to represent the
460         toplevel declaration space.  Each namespace declaration introduces
461         a "partial" root declaretion space.
462         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
463         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
464         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
465         from 'current_namespace.SlaveDeclSpace'.
466         (namespace_declaration): Likewise.
467         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
468         check.  It can't happen now.
469         * decl.cs (DeclSpace.LookupType): Likewise.
470         * driver.cs (MainDriver): Sanity check.
471
472 2006-08-01  Raja R Harinath  <rharinath@novell.com>
473
474         * decl.cs (DeclSpace.FindNestedType): Remove.
475         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
476         LookupTypeContainer to get the container of the nested type.
477         * class.cs (TypeContainer.FindNestedType): Make non-override.
478
479 2006-07-31  Raja R Harinath  <rharinath@novell.com>
480
481         * decl.cs (DeclSpace.PartialContainer): Move field from ...
482         * class.cs (TypeContainer.PartialContainer): ... here.
483         (TypeContainer.AddBasesForPart): New helper.
484         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
485         instead.
486         * cs-parser.jay (current_class): Convert to DeclSpace.
487         (struct_declaration, interface_declaration, class_declaration):
488         Use AddBasesForPart instead of .Bases directly.
489         * const.cs, iterators.cs: Update to changes.
490
491 2006-07-28  Raja R Harinath  <rharinath@novell.com>
492
493         * class.cs (TypeContainer.AddMemberType): Rename from
494         AddToTypeContainer.
495         (TypeContainer.AddMember): Rename from AddToMemberContainer.
496         (AddTypeContainer): New.  Combine AddClassOrStruct and
497         AddInterface.
498         (AddPartial): Update.  Add 'is_partial' argument.
499         * roottypes.cs: Update to changes.
500         * cs-parser.jay (push_current_class): New helper for handling
501         current_container and current_class.
502         (struct_declaration, interface_declaration, class_declaration):
503         Use it.
504
505 2006-07-26  Raja R Harinath  <rharinath@novell.com>
506
507         * roottypes.cs: Rename from tree.cs.
508
509         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
510         * tree.cs (Tree, ITreeDump): Remove types.
511         * rootcontext.cs (tree, Tree): Remove fields.
512         (root, ToplevelTypes): New.
513         * *.cs: Update to rename.
514
515         * tree.cs (Tree.RecordDecl): Remove.
516         (RootTypes.AddToTypeContainer): Record the toplevel type in its
517         namespace here.
518         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
519
520 2006-07-23  Raja R Harinath  <harinath@gmail.com>
521
522         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
523         DoFlowAnalysis and OmitStructFlowAnalysis here.
524         (ec.With): Rename from WithUnsafe and generalize.
525         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
526         (ec.WithFlowAnalyis): New.
527         * ecore.cs, expression.cs, statement.cs: Update.
528
529 2006-07-22  Raja R Harinath  <harinath@gmail.com>
530
531         * statement.cs (Block.ResolveMeta): Simplify slightly.
532
533         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
534         multiple boolean fields.  Convert InUnsafe, constant_check_state,
535         check_state to flags.
536         (CheckState, ConstantCheckState): Update.
537         (InUnsafe): New read-only property.
538         (FlagsHandle): Rename from CheckStateHandle and convert to handle
539         arbitrary flags.
540         (WithUnsafe): New helper similar to WithCheckState.
541         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
542         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
543
544 2006-07-21  Raja R Harinath  <rharinath@novell.com>
545
546         Make comparisons use the same IL irrespective of whether they're
547         in a 'checked' or 'unchecked' context: one of the issues in #78899
548         * codegen.cs (EmitContext.CheckState): Make read-only property.
549         (EmitContext.ConstantCheckState): Likewise.
550         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
551         helper that implement a save/restore stack for CheckState
552         values.  This is the only way to change check-state.
553         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
554         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
555         (CheckedExpr.EmitBranchable): New forwarding method.
556         (UnCheckedExpr): Likewise.
557         * statement.cs (Block.ResolveMeta): Use WithCheckState.
558         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
559         (Checked.Resolve, checked.DoEmit): Likewise.
560
561 2006-07-21  Martin Baulig  <martin@ximian.com>
562
563         * generic.cs (TypeManager.InferType): When inferring an array
564         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
565
566 2006-07-21  Martin Baulig  <martin@ximian.com>
567
568         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
569         and allow IList`1 and all its base interfaces.
570
571         * convert.cs (Convert.ImplicitReferenceConversion): Allow
572         converting from an array-type of T to IList<T>.
573
574 2006-07-21  Martin Baulig  <martin@ximian.com>
575
576         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
577
578 2006-07-20  Miguel de Icaza  <miguel@novell.com>
579
580         * anonymous.cs: Cache the resolved anonymous delegate, and return
581         this so that the ResolveTopBlock is only triggered once, not
582         twice.
583
584         Currently we trigger ResolvetopBlock twice due to a first pass of
585         argument check compatibility, and a second pass that does the
586         actual resolution.   
587
588 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
589
590         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
591         modifiers.
592         * rootcontext.cs (Reset): Add helper_classes.
593
594 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
595
596         A fix for #78860
597         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
598         correctly.
599
600 2006-07-13  Miguel de Icaza  <miguel@novell.com>
601
602         * statement.cs (Lock): Handle expressions of type
603         TypeManager.null_type specially.  Fixes #78770
604
605 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
606
607         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
608         to an event.
609
610 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
611
612         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
613         for accessors as well.
614         * ecore.cs (EventExpr): Add AccessorTable.
615
616 2006-07-03  Martin Baulig  <martin@ximian.com>
617
618         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
619         instances of value types.
620
621         * convert.cs (Convert.ExplicitConversion): Correctly handle
622         object->nullable conversions.   
623
624 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
625
626         A fix for #78738
627         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
628         for CS0122 where appropriate.
629         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
630         level attributes.
631         (Filter): Assembly can be null in the case of top level attributes.
632
633 2006-06-28  Raja R Harinath  <rharinath@novell.com>
634
635         Fix #78716
636         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
637         no arguments, return 'false': nothing can be inferred.
638
639 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
640
641         A fix for #78690
642
643         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
644         is done at global level.
645
646 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
647
648         A fix for #77002, Implemented TypeForwarder support.
649
650         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
651         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
652         attribute handling.
653         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
654         * typemanager.cs (): Add type_forwarder_attr_type.
655
656 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
657
658         * report.cs: Add CS0469 warning.
659
660 2006-06-22  Martin Baulig  <martin@ximian.com>
661
662         * class.cs
663         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
664         for interfaces; fixes #78686, which is a modification of #78380
665         with interfaces instead of classes.
666
667 2006-06-21  Martin Baulig  <martin@ximian.com>
668
669         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
670         the `try'-block, so we also report CS0016 etc. there.
671
672 2006-06-21  Martin Baulig  <martin@ximian.com>
673
674         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
675         handle SetAssigned() and SetMemberIsUsed() for generic types;
676         fixes #77545.
677
678 2006-06-21  Martin Baulig  <martin@ximian.com>
679
680         * delegate.cs
681         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
682
683 2006-06-21  Martin Baulig  <martin@ximian.com>
684
685         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
686         also report CS1686 for parameters.
687
688 2006-06-21  Martin Baulig  <martin@ximian.com>
689
690         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
691         instead of an error if the value is not implicitly convertible to
692         the switch types; fixes #77964.
693
694 2006-06-21  Raja R Harinath  <rharinath@novell.com>
695
696         Fix #78673
697         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
698         FieldBuilder is null.
699
700         Fix #78662
701         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
702         'left' and 'right' before error-checking.
703
704 2006-06-19  Martin Baulig  <martin@ximian.com>
705
706         * convert.cs
707         (Convert.ImplicitConversionStandard): Cleanup and correctly
708         implement nullable conversions.
709         (Convert.ImplicitStandardConversionExists): Likewise.
710         (Convert.ExplicitConversion): Likewise.
711
712 2006-06-19  Martin Baulig  <martin@ximian.com>
713
714         * generic.cs
715         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
716         methods; make the ctors protected.
717
718 2006-06-19  Martin Baulig  <martin@ximian.com>
719
720         Fixed #78380; added gtest-273.cs.
721
722         * ecore.cs
723         (Expression.ResolveAsBaseTerminal): Move the constraint checking
724         into ResolveAsTypeTerminal().
725
726         * generic.cs
727         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
728         TypeManager.FindMembers() to check for the default ctor.
729
730 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
731
732         * generic.cs: Fixed NullableInfo accessibility.
733
734 2006-06-16  Martin Baulig  <martin@ximian.com>
735
736         * generic.cs
737         (Constraints.InflatedConstraints.inflate): Correctly inflate
738         generic types; fixes #78400.
739
740 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
741
742         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
743         Fixed bug #78601.
744         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
745         (FieldExpr.DoResolve): likewise.
746         (PropertyExpr.InstanceResolve): likewise.
747         (EventExpr.InstanceResolve): likewise. 
748
749 2006-06-15  Martin Baulig  <martin@ximian.com>
750
751         * statement.cs
752         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
753         argument; always allow a `null' label if true.
754         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
755         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
756         we have a `null' label and mark the new `null_target' label;
757         default to the `default' label.
758         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
759
760 2006-06-15  Martin Baulig  <martin@ximian.com>
761
762         * class.cs (Operator.Define): Allow an implicit/explicit operator
763         to convert to/from a nullable value of the enclosing type.
764
765         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
766         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
767
768         * convert.cs
769         (Convert.ImplicitStandardConversionExists): Add support for lifted
770         implicit/explicit conversions.
771         (Convert.ImplicitConversionStandard): Likewise.
772
773 2006-06-13  Martin Baulig  <martin@ximian.com>
774
775         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
776         type arguments and create a ConstructedType if necessary.  Fixes #78400.
777
778 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
779
780         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
781         attribute applicable tests for attribute argument.
782
783 2006-06-02  Raja R Harinath  <rharinath@novell.com>
784
785         Fix #78079
786         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
787         (Binary.OverloadResolve_PredefinedIntegral): New.
788         (Binary.OverloadResolve_PredefinedFloating): New.
789         (Binary.OverloadResolve_PredefinedString): New.
790         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
791         Follow the standard more closely, and treat numeric promotions in
792         terms of overload resolution.
793         (Binary.CheckShiftArguments): Simplify.
794
795 2006-06-01  Raja R Harinath  <rharinath@novell.com>
796
797         * flowanalysis.cs (MyBitVector): Simplify representation.
798         (MyBitVector.Clone): Avoid allocating BitArray.
799         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
800         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
801         (*): Update.  Change all references to MyBitVector.And and
802         MyBitVector.Or to &= and |=.
803
804 2006-05-31  Raja R Harinath  <rharinath@novell.com>
805
806         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
807         Use bne.un instead of ceq+brfalse.
808
809         Fix cs0208-[23].cs
810         * typemanager.cs (IsUnmanagedType): Disallow generic types and
811         generic parameters.
812
813 2006-05-29  Raja R Harinath  <rharinath@novell.com>
814
815         Fix cs0231-[34].cs.
816         * cs-parser.jay (formal_parameter_list): Extend the pattern below
817         to param arguments too.
818
819 2006-05-26  Miguel de Icaza  <miguel@novell.com>
820
821         * cs-parser.jay: Catch another parsing form for arglist being
822         followed by other arguments.  Fixes #78313.
823
824 2006-05-25  Raja R Harinath  <rharinath@novell.com>
825
826         Fix #78324
827         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
828         also when one of the operands is a null literal.
829         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
830         to improve clarity, and generate slightly better code.
831
832 2006-05-24  Raja R Harinath  <rharinath@novell.com>
833
834         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
835         checking of out parameters to ...
836         (FlowBranchingToplevel.Merge): ... here.
837         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
838         set, propagate the origin upward, and only complain if there was
839         no other error.
840         (FlowBranchingException.AddContinueOrigin): Likewise.
841         (FlowBranchingException.AddReturnOrigin): Likewise.
842         (FlowBranchingException.AddGotoOrigin): Likewise.       
843
844 2006-05-23  Raja R Harinath  <rharinath@novell.com>
845
846         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
847         unreachable, skip it.
848         (FlowBranchingException.Merge): Always propagate jumps, even if
849         the finally block renders subsequent code unreachable.
850
851 2006-05-18  Raja R Harinath  <rharinath@novell.com>
852
853         Fix #77601
854         * statement.cs (Goto.Resolve): Move responsibility for resolving
855         'goto' to FlowBranching.AddGotoOrigin.
856         (Goto.SetResolvedTarget): New.  Callback to set the
857         LabeledStatement that's the target of the goto.
858         (Goto.DoEmit): Use Leave instead of Br when crossing an
859         unwind-protect boundary.
860         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
861         LookupLabel and adjust to new semantics.
862         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
863         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
864         Goto.SetResolvedTarget to update target.
865         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
866         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
867         AddBreakOrigin & co.  Delay propagation until ...
868         (FlowBranchingException.Merge): ... this.
869
870         * statement.cs (Block.Resolve): Always depend on flow-branching to
871         determine unreachability.  Kill workaround that originally emitted
872         only one statement after an "unreachable" label (see infloop in
873         test-515.cs).
874
875         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
876         This is still "wrong", but anything better would probably need a
877         multi-pass algorithm.
878         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
879         usage vector.  Force current usage vector to be reachable, to
880         optimistically signify backward jumps.
881         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
882         detected.
883         (FlowBranchingLabeled.Merge): New.  If no backward jump was
884         detected, return the original salted-away usage vector instead,
885         updated with appropriate changes.  Print unreachable warning if
886         necessary.
887         * statement.cs (Block.Resolve): Don't print unreachable warning on
888         a labeled statement.
889
890 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
891
892         * driver.cs: Pass filename without path to AssemblyBuilder's
893         AddResourceFile. Fixes bug #78407.
894
895 2006-05-17  Raja R Harinath  <rharinath@novell.com>
896
897         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
898         * flowanalysis.cs (FlowBranchingLabeled): ... here.
899         (FlowBranching.MergeChild): Overwrite
900         reachability information from Labeled branchings too.
901
902 2006-05-16  Raja R Harinath  <rharinath@novell.com>
903
904         * statement.cs (Goto.Resolve): Merge jump origins here ...
905         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
906
907         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
908         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
909         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
910         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
911         here, ...
912         * statement.cs (Goto.Resolve): ... not here.
913         (Goto.Emit): Remove CS1632 check.
914
915 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
916
917         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
918         error message.
919
920 2006-05-11  Raja R Harinath  <rharinath@novell.com>
921
922         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
923         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
924         (FlowBranchingException.Label): Likewise.
925
926         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
927         given value.
928         (MyBitVector.Or): Use it to avoid losing information (Count).
929         (FlowBranching.MergeOrigins): Likewise.
930
931         * flowanalysis.cs (UsageVector.IsDirty): Remove.
932         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
933         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
934         (UsageVector.ToString): Simplify.
935         (UsageVector.MergeSiblings): Move here from ...
936         (FlowBranching.Merge): ... here.
937         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
938         not a MyBitVector.
939
940 2006-05-10  Raja R Harinath  <rharinath@novell.com>
941
942         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
943         null bitvector is treated as all-true.
944
945         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
946         (MyBitVector): Rationalize invariants.  'vector != null' implies
947         that we have our own copy of the bitvector.  Otherwise,
948         'InheritsFrom == null' implies all inherited bits are true.
949
950 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
951
952         * statement.cs (LocalInfo): Add IsConstant.
953         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
954         local variable for constants.
955
956 2006-05-09  Raja R Harinath  <rharinath@novell.com>
957
958         * flowanalysis.cs (MyBitVector.Empty): New.
959         (MyBitVector): Don't allow InheritedFrom to be null.
960         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
961         (UsageVector, FlowBranching): Update to changes.
962
963         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
964         recursion.  The 'Parent == null' condition isn't sufficient for
965         anonymous methods.
966         (FlowBranching.AddBreakOrigin): Likewise.
967         (FlowBranching.AddContinueOrigin): Likewise.
968         (FlowBranching.AddReturnOrigin): Likewise.
969         (FlowBranching.StealFinallyClauses): Likewise.
970         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
971         (FlowBranching.CheckOutParameters): Likewise.
972         (FlowBranchingToplevel): Terminate all the above recursions here.
973         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
974         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
975
976         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
977         toplevel block.
978         (FlowBranchingToplevel): New.  Empty for now.
979         (FlowBranching.MergeTopBlock): Update.
980         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
981         branching for the anonymous delegate.
982         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
983
984         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
985         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
986         information at the start of the merge.  Reorganize.
987
988 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
989
990         * class.cs (MethodData.Define): Method cannot implement interface accessor.
991
992 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
993
994         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
995         to newly introduced ctor.
996
997         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
998         message to one place.
999         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1000         global namespace.
1001
1002 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1003
1004         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1005
1006         * ecore.cs (Expression.ResolveAsConstant): Updated.
1007
1008         * statement.cs (ResolveMeta): Updated.
1009
1010 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1011
1012         * cs-parser.jay: __arglist cannot be used in initializer.
1013
1014 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1015
1016         A fix for #77879
1017         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1018         private types.
1019
1020 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1021
1022         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1023         (LabeledStatement): Add 'name' parameter.
1024         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1025         (Block.AddLabel): Update to changes.
1026         * cs-parser.jay (labeled_statement): Likewise.
1027
1028         * flowanalysis.cs (BranchingType.Labeled): New.
1029         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1030         (FlowBranchingLabeled): New.  Does nothing for now, but will
1031         eventually handle 'goto' flows.
1032         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1033         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1034         that's terminated ...
1035         (Block.Resolve): ... here.
1036
1037         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1038         (UsageVector.MergeFinallyOrigins): Likewise.
1039         (FlowBranching.InTryOrCatch): Likewise.
1040         (FlowBranching.AddFinallyVector): Likewise.
1041         (FlowBranchingException): Update to changes.
1042
1043         Fix #78290
1044         * statement.cs (Return.Resolve): Move error checking to ...
1045         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1046         (FlowBranchingException): Handle return origins like break and
1047         continue origins.
1048         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1049
1050 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1051
1052         A fix for #76122
1053         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1054         filter.
1055
1056 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1057
1058         A fix for #77543
1059         * class.cs (MethodData.Define): Do public accessor check only when method
1060         implements an interface.
1061
1062 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1063
1064         Remove special handling of 'break'
1065         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1066         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1067         (UsageVector.Break): Remove.
1068         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1069         reachability.
1070         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1071
1072         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1073         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1074
1075 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1076
1077         A fix for #75726
1078         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1079         be the interface member.
1080
1081 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1082
1083         A fix for #60069
1084         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1085         for emitting small (int) values.
1086
1087 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1088
1089         Fix #59427
1090         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1091         control-flow passes through the 'finally' after merging-in all the
1092         control-flows from 'try' and the 'catch' clauses.
1093
1094         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1095         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1096         always true at the only non-recursive entry point.
1097         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1098         FlowBranchingBreakable.
1099         (FlowBranchingLoop): Remove.
1100         * statement.cs (Return.DoResolve): Update to changes.
1101
1102         Fix #76471, #76665
1103         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1104         (FlowBranching.CreateBranching): Handle it: create a
1105         FlowBranchingContinuable.
1106         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1107         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1108         except that it handles the 'continue' command.
1109         (FlowBranching.UsageVector.MergeOrigins): Rename from
1110         MergeBreakOrigins.
1111         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1112         except that it overrides AddContinueOrigin.
1113         (FlowBranchingException): Override AddContinueOrigin, similar to
1114         AddBreakOrigin.
1115         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1116         Create a new branching around the embedded statement.
1117         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1118         control flow after the embedded statement.
1119         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1120
1121         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1122         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1123         FlowBranchingBreakable.
1124         (FlowBranchingSwitch): Remove.
1125
1126         Fix test-503.cs
1127         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1128         error reporting to ...
1129         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1130         Rename from 'AddBreakVector'.  Add new location argument.  Return
1131         a bool indicating whether the 'break' crosses an unwind-protect.
1132         (FlowBranchingException.AddBreakOrigin): Add.
1133         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1134         flowbranching after updating with the effects of the 'finally'
1135         clause.
1136         (FlowBranchingBreakable): New common base class for
1137         FlowBranchingLoop and FlowBranchingSwitch.
1138
1139         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1140         embedded statement.
1141         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1142
1143 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1144
1145         * statement.cs (Do.Resolve): If the loop is infinite, set the
1146         barrier.
1147         (While.Resolve, For.Resolve): Set a barrier after the embedded
1148         statement.  There's no direct control flow that goes from the end
1149         of the embedded statement to the end of the loop.
1150         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1151         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1152         above ensure that the reachability is correctly computed.
1153
1154         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1155         (UsageVector.MergeBreakOrigins): If the current path is
1156         unreachable, treat it as if all parameters/locals are initialized.
1157         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1158         infinite loops before merging-in break origins.
1159
1160         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1161         (Reachability.Reachable): Split part into ...
1162         (Reachability.Unreachable): ... this.  Simplify.
1163         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1164
1165         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1166         (Reachability.SetThrowsSometimes): Likewise.
1167         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1168         TriState.Always, use corresponding property.
1169         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1170         (Block.Resolve): Likewise.  Remove some redundant checks.
1171
1172 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1173
1174         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1175         (Reachability.Meet): Don't bother checking AlwaysThrows --
1176         barrier is always set.
1177         (FlowBranchingBlock.Merge): Likewise.
1178
1179 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1180
1181         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1182         defined, so it's references should also compile only for NET_2_0
1183         (as occurs in mcs version)
1184
1185 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1186
1187         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1188         checks for unreachable.
1189
1190 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1191
1192         A fix for #77980
1193         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1194
1195         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1196         whether field is really assigned.
1197
1198 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1199
1200         * flowanalysis.cs (Reachability): Make 4-argument constructor
1201         private.
1202         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1203         (Reachability.Always): Rename from the highly misleading
1204         'Reachability.Never'.
1205         (FlowBranching.Merge): Update to changes.  Mark an impossible
1206         situation with a 'throw'.
1207         (*): Update to changes.
1208
1209 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1210
1211         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1212         Remove 'Undefined'.
1213         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1214         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1215         (*): Update to changes.
1216         * statement.cs: Update to changes.
1217
1218 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1219
1220         A fix for #78049
1221         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1222
1223 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1224
1225         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1226         dummy UsageVector.
1227
1228         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1229         argument to two arguments: an usage-vector and a bool.  Move call
1230         to FlowBranching.Merge () ...
1231         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1232
1233         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1234         handling of loop and switch reachability to ...
1235         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1236
1237 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1238
1239         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1240         handling to FlowBranchingLoop.InLoop.
1241         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1242
1243 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1244
1245         A fix for #78115
1246         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1247         anonymous method is allowed from AnonymousContainer here.
1248
1249         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1250
1251 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1252
1253         Fix #78156
1254         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1255
1256 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1257
1258         A fix for #49011.
1259         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1260         (DoubleConstant.Reduce): Ditto.
1261
1262 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1263
1264         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1265         Remove 'lvalue_right_side' argument.  Move parts to ...
1266         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1267         (LocalVariable.DoResolveLValue): ... these.
1268
1269 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1270
1271         Fix cs1655.cs
1272         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1273         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1274         (LocalVariableReference.DoResolveBase): Use it to implement new
1275         CS1655 check.
1276         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1277         (Argument.Resolve): Simplify.  Move CS1510 check ...
1278         * ecore.cs (Expression.ResolveLValue): ... here.
1279         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1280         (PropertyExpr.DoResolveLValue): Likewise.
1281         (FieldExpr.Report_AssignToReadonly): Likewise.
1282         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1283         LValueMemberAccess or LValueMemberOutAccess on instance depending
1284         on it.
1285         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1286         DoResolve as appropriate.
1287
1288 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1289
1290         Fix #75800
1291         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1292         implicit conversions on 'out' and 'ref' arguments.
1293
1294         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1295         improve clarity.  Remove dead code.
1296
1297         Fix #66031
1298         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1299         (Catch.Resolve): Resolve VarBlock if it exists.
1300
1301 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1302
1303         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1304         twice, this was some residual code, the enumerator was emitted
1305         properly in the two branche of if later.
1306
1307         Fixes #78031
1308         
1309         Thanks to Martin for finding the source of the problem
1310         
1311 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1312
1313         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1314         cast is never an lvalue.
1315         (Cast.DoResolve, Cast.ResolveRest): Combine.
1316         (Argument.Emit): Simplify slightly.  Move 'Expr is
1317         IMemoryLocation' check ...
1318         (Argument.Resolve): ... here.
1319         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1320
1321         Simplifications.  Fix cs0191-2.cs
1322         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1323         CS1649 and CS1651 to ...
1324         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1325         the actual selection of the error code and message to a lookup
1326         table.  Add a dummy return value to simplify callsites.
1327         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1328         readonly fields of other instances of the same type.  Move CS0197
1329         warning from ...
1330         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1331         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1332         resolution of an out or ref argument.  The code simplification
1333         above uses this invariant.
1334
1335 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1336
1337         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1338         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1339         CheckMarshallByRefAccess.  Drop parameter.
1340         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1341         warning.
1342         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1343         InstanceExpression.
1344         * report.cs (AllWarnings): Add CS1690.
1345         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1346         for ref access too.
1347         (LocalVariableReference.DoResolveBase): Update.
1348
1349 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1350
1351         * class.cs (MethodOrOperator): Moved common parts from method class.
1352         detect obsolete attributes.
1353         (Method.Define): Simplified as it reuses code from base.
1354         (Constructor.ValidAttributeTargets): Fixed issue found during
1355         refactoring.
1356         (Destructor.ValidAttributeTargets): Fixed issue found during
1357         refactoring.
1358         (Operator): Finished refactoring set off by #78020. Operator class is now
1359         ordinary method class.
1360
1361         * anonymous.cs: Updated.
1362
1363 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1364
1365         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1366
1367 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1368
1369         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1370         detect obsolete attributes.
1371         (Method.CreateEmitContext): Moved to MethodOrOperator.
1372
1373 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1374
1375         A fix for #78048.
1376         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1377         customized exception to make crash detection easier.
1378         (MethodOrOperator): Started to work on new base class for methods and
1379         operators.
1380         (Method): Derives from MethodOrOperator.
1381         (Constructor.Emit): Emits its own attributes.
1382         (AbstractPropertyEventMethod.Emit): Ditto.
1383         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1384         patch.
1385         (Operator.Emit): It's temporary more tricky than should be.
1386         
1387         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1388
1389         * report.cs (InternalErrorException): Add ctor with inner exception.
1390
1391 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1392
1393         A fix for #76744.
1394         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1395         only not visible.
1396
1397 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1398
1399         A fix for #77916.
1400         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1401         array.
1402
1403 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1404
1405         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1406         attribute is present and Guid not.
1407         (Interface.ApplyAttributeBuilder): Ditto.
1408
1409         * attribute.cs: Add error message.
1410
1411 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1412
1413         A fix for #78020.
1414
1415         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1416         sources (it's composite) so hold them in extra array as they are used in
1417         Emit phase only. It worked in the previous versions by mistake.
1418         (Attribute.Emit): Emit attribute for more owners when exist.
1419
1420         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1421         it has now different behaviour.
1422
1423 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1424
1425         * constant.cs (Constant.IsDefaultInitializer): New method.
1426
1427         * class.cs: Updated.
1428
1429         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1430         re-initialize default values. It saves KBs almost for every assembly.
1431         Thanks Zoltan for the idea.
1432         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1433         (ArrayCreation.DoResolve): Resolve only once.
1434         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1435         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1436
1437 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1438
1439         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1440         From #77961.
1441
1442 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1443
1444         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1445         in an embedded statement too.
1446
1447 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1448
1449         Fix #77929
1450         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1451         testing.
1452
1453         Fix #77958
1454         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1455
1456         Fix #77962
1457         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1458         arguments before checking whether a type is reflected or not.
1459
1460         Fix #77954
1461         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1462         definition doesn't take part in overload resolution.
1463         (Invocation.IsParamsMethodApplicable): Likewise.
1464         (Invocation.OverloadResolve): When replacing a reflected override
1465         method with its base definition, ensure that type arguments are
1466         applied.
1467
1468 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1469
1470         A fix for #77966.
1471
1472         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1473         was not specified.
1474
1475         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1476
1477 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1478
1479         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1480         phase.
1481
1482         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1483         LocalTemporary change.
1484
1485         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1486         TypeContainer.
1487         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1488         initializers optimization.
1489         (ClassOrStruct.TypeAttr): Moved from modifiers.
1490         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1491         (FieldBase.ResolveInitializer): Resolves initializer.
1492         (FieldBase.HasDefaultInitializer): New property.
1493
1494         * cs-parser.jay: Removed message.
1495
1496         * expression.cs (CompilerGeneratedThis): New specialization.
1497
1498         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1499
1500 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1503
1504 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1505
1506         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1507         be now EnumConstants only.
1508
1509 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1510
1511         * attribute.cs, driver.cs: Reset more caches.
1512
1513 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1514
1515         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1516
1517 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1518
1519         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1520         for easier reuse. Updated all overrides.
1521         (IntegralConstant): New base class for all integral constants.
1522         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1523         of the constant range, report custom error.
1524         (UIntConstant.Reduce): Fixed uint conversion.
1525
1526         * ecore.cs, literal.cs: Reduce updates.
1527
1528 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1529
1530         A fix for #75813.
1531
1532         * class.cs (Constructor.Define): Removed extra if for default ctors.
1533         A patch from Atsushi Enomoto.
1534
1535 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1536
1537         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1538         GetAttributableValue.
1539
1540         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1541         when required.
1542
1543         * convert.cs (ImplicitConversionRequired): Error message moved to
1544         DoubleLiteral.
1545
1546         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1547         automatic implicit conversion of an output value.
1548         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1549
1550         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1551         conversion.
1552         (TypeOf.GetAttributableValue): Add extra handling for object type.
1553
1554         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1555         special error message.
1556
1557 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1558
1559         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1560         InternalCall.
1561         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1562         compatible with MS runtime.
1563
1564 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1565
1566         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1567         attribute arguments here.
1568
1569         * class.cs (Indexer.Define): The check was moved to attribute class.
1570
1571 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1572
1573         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1574
1575 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1576
1577         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1578
1579         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1580         the blocks too.
1581
1582 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1583
1584         * doc-bootstrap.cs : fix build.
1585
1586 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1587
1588         * expression.cs (StringConcat.Append): Issue a warning when empty string
1589         is going to append.
1590
1591 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1592
1593         * assign.cs (CompoundAssign.ResolveSource): Removed.
1594
1595         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1596         clean up.
1597
1598         * class.cs (TypeContainer.FindMethods): Removed.
1599         (TypeContainer.CheckMemberUsage): Made static.
1600
1601         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1602
1603         * constant.cs (CheckRange): Removed unused type argument.
1604         (CheckUnsigned): Removed unused type argument.
1605
1606         * cs-parser.jay: Updated after MemberAccess clean up.
1607         Uses Length for empty string test.
1608
1609         * cs-tokenizer.cs: Uses Length for empty string test.
1610         (IsCastToken): Made static.
1611         (is_hex): Made static.
1612         (real_type_suffix): Made static.
1613
1614         * decl.cs (SetupCache): Made static.
1615         (OnGenerateDocComment): Removed unused ds argument.
1616
1617         * delegate.cs (VerifyDelegate): Removed unused argument.
1618
1619         * doc.cs: Uses Length for empty string test.
1620
1621         * driver.cs: Uses Length for empty string test.
1622
1623         * enum.cs (IsValidEnumType): Made static
1624
1625         * expression.cs (EnumLiftUp): Removed unused argument.
1626         (ResolveMethodGroup): Ditto.
1627         (BetterConversion): Ditto.
1628         (GetVarargsTypes): Ditto.
1629         (UpdateIndices): Ditto.
1630         (ValidateInitializers): Ditto.
1631         (MemberAccess.ctor): Ditto.
1632         (GetIndexersForType): Ditto.
1633
1634         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1635
1636         * iterators.cs: Updated after MemberAccess clean up.
1637
1638         * location.cs: Uses Length for empty string test.
1639
1640         * namespace.cs: Uses Length for empty string test.
1641
1642          * report.cs (CheckWarningCode): Made static.
1643
1644         * statement.cs (LabeledStatement): Removed unused argument.
1645
1646         * typemanager.cs (FilterNone): Removed.
1647
1648 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1649
1650         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1651         obsolete.
1652
1653         * class.cs: Updated.
1654
1655 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1656
1657         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1658
1659 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1660
1661         A fix for #77816.
1662
1663         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1664         host container.
1665         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1666         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1667         Add more error reporting; Fixed issue with params.
1668
1669         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1670
1671         * cs-parser.jay: AnonymousMethod requires host container.
1672
1673         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1674
1675 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1676
1677         * class.cs: Change 'TypeContainer ds' constructor argument to
1678         'DeclSpace parent'.  Some classes were missed below due to
1679         different naming convention.
1680
1681         * class.cs (MemberCore.Parent): Delete.  This makes the
1682         ParentContainer changes below enforceable by the compiler.
1683
1684         Treat pointers to enclosing declaration space as 'DeclSpace', not
1685         'TypeContainer'.
1686         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1687         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1688
1689         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1690         of TypeContainer.
1691         (Block.AddThisVariable): Likewise.
1692         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1693         (AbstractPropertyEventMethod.Emit): Likewise.
1694         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1695         (GetMethod.Define, SetMethod.Define): Likewise.
1696         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1697         (DelegateMethod.EmitMethod): Likewise.
1698
1699         Fix regression test-partial-13.cs.
1700         Rationalize use of PartialContainer.  Ensure that the partial
1701         class semantics can be tied to type-correctness, i.e., any
1702         violation will cause a compile error.
1703         * class.cs, const.cs: Access all fields that belong to class
1704         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1705         Resolve()-like functions still use 'Parent'.
1706
1707         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1708         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1709         (PropertyMethod.CheckModifiers): Remove unused argument.
1710         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1711         DeclSpace.
1712
1713 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1714
1715         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1716
1717 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1718
1719         Make semantics of PartialContainer simpler.
1720         * decl.cs (DeclSpace.IsPartial): Remove.
1721         * class.cs (TypeContainer.IsPartial): Likewise.
1722         (TypeContainer..ctor): Set PartialContainer to point to self.
1723         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1724         (TypeContainer.FindNestedType): Likewise.
1725         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1726
1727 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1728
1729         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1730
1731 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1732
1733         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1734         classes.
1735
1736 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1737
1738         * class.cs (Operator.Define): An error for base conversion was not
1739         reported correctly.
1740
1741 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1742
1743         A fix for #77593, #77574.
1744
1745         * class.cs (MethodCore.CheckBase): Another if for operator.
1746
1747 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1748
1749         A fix for #77822.
1750
1751         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1752         reporting, it's more tricky than I thought.
1753
1754 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1755
1756         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1757         were not resolved
1758
1759         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1760         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1761         conversion test.
1762         
1763         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1764         not needed.
1765
1766 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1767
1768         A fix for #77353.
1769
1770         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1771         (Event.Define): ditto
1772         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1773
1774         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1775         Removed redundant code and set NewSlot for Invoke method too.
1776
1777         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1778         (Parameters.MergeGenerated): New method. Use this method when you merge
1779         compiler generated argument with user arguments.
1780
1781 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1782
1783         * attribute.cs (ResolveAsTypeTerminal): Removed.
1784
1785         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1786         specialization for predefined types; 30% speed up.
1787         Finally placed obsolete check to right place.
1788         (Expression.ResolveType): Removed.
1789
1790         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1791         Updated after ResolveType was removed.
1792
1793         * expression.cs (Cast.ctor): Check void cast.
1794         (Binary.ResolveAsTypeTerminal): Is never type.
1795         (Conditional.ResolveAsTypeTerminal): Is never type.
1796
1797         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1798
1799 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1800
1801         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1802
1803 2006-03-23  Martin Baulig  <martin@ximian.com>
1804
1805         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1806         type check if either of the types is an open generic type.
1807
1808 2006-03-23  Martin Baulig  <martin@ximian.com>
1809
1810         * convert.cs
1811         (Convert.ExplicitTypeParameterConversion): New method; implement
1812         explicit type parameter conversions.
1813
1814 2006-03-23  Martin Baulig  <martin@ximian.com>
1815
1816         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1817         blindly allow all conversions if we do not have any constraints.
1818
1819 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1820
1821         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1822         these two separated members to simplify the code.
1823         (Attribute.Resolve): Refactored to use new fields and methods.
1824         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1825         implemented obsolete attribute checking.
1826         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1827         implemented obsolete checking again. It look line never ending quest ;-)
1828         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1829
1830         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1831
1832         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1833
1834         *class.cs (Property.Define): Add RegisterProperty call.
1835
1836         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1837         argument groups (only 2).
1838
1839         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1840         encoding expression to arguments.
1841         (Expression.ExprClassToResolveFlags): Just turned to property.
1842
1843         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1844         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1845         optimized as well as implemented support for zero-length attributes.
1846
1847         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1848         Add caching of PropertyInfo's.
1849
1850 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1851
1852         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1853         error multiple times.
1854
1855 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1856
1857         New partial class implementation.
1858         A fix for #77027, #77029, #77403
1859
1860         * attribute.cs (Attributable): Made attributes protected.
1861
1862         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1863         the replacements of ClassPart and PartialContainer.
1864         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1865         (TypeContainer.AddInterface): Ditto.
1866         (TypeContainer.AddPartial): The main method for partial classes. It checks
1867         for errors and merges ModFlags and attributes. At the end class is added to
1868         partial_parts list.
1869         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1870         required here.
1871         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1872         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1873         from the rest of partial classes.
1874         (TypeContainer.GetClassBases): Simplified.
1875         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1876         DefineType.
1877         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1878         (TypeContainer.HasExplicitLayout): Uses Flags now.
1879         (PartialContainer): Removed.
1880         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1881         (StaticClass): Was merged with Class.
1882         (Class.GetClassBases): class and static class bases are verified here.
1883         (Class.TypeAttr): Added static attributes when class is static.
1884         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1885         (MemberBase): In some cases we need to call parent container for partial
1886         class. It should be eliminated but it's not easy now.
1887
1888         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1889
1890         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1891         partial classed to accumulate class comments.
1892         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1893
1894         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1895
1896         * driver.cs (MainDriver): Tree.GetDecl was removed.
1897
1898         * modifiers.cs (Modifiers): Add partial modifier.
1899
1900         * tree.cs (Tree.decl): Removed.
1901         (RootTypes): Started to use this class more often for root types
1902         specializations.
1903
1904 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1905
1906         * generic.cs (TypeParameter.UpdateConstraints): Update
1907         'constraints' if null.
1908
1909 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1910
1911         A fix for #77615
1912
1913         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1914         external interface does not have an attribute.
1915
1916 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1917
1918         Another prerequisites for new partial classs implementation.
1919         
1920         * attribute.cs (Attribute.Equal): Implemented.
1921         (Attribute.Emit): Changed as attributes can be applied more than twice.
1922         (Attributes.Emit): Check for duplicate attributes here.
1923
1924         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1925         as a parameter, clean-up.
1926
1927 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1928
1929         A fix for #77485
1930
1931         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1932         contains obsolete attribute check which can in some cases look for base
1933         type of current class which is not initialized yet.
1934         (TypeContainer.BaseType): Replacement of ptype.
1935
1936         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1937
1938 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1939
1940         First of prerequisites for new partial classs implemention.
1941         
1942         * attribute.cs (Attributable): Extended by ResolveContext;
1943         Attributes finally have correct context for resolving in all cases.
1944         (AttachTo): Attribute owner is assigned here.
1945
1946         * codegen.cs (IResolveContext): Introduce new interface to hold
1947         all information needed in resolving phase.
1948         (EmitContext): Implements IResolveContext; more clean-up needed here.
1949         
1950         * decl.cs (MemberCore): Implemented IResolveContext.
1951
1952         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1953         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1954         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1955         Refactored to use new IResolveContext instead of EmitContext; cleanup
1956
1957 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1958
1959         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1960         mcs to keep code differences small.
1961         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1962         * typemanager.cs (parameter_default_value_attribute_type): New.
1963         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1964         CS1908 check.
1965
1966 2006-03-22  Martin Baulig  <martin@ximian.com>
1967
1968         * generic.cs
1969         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1970
1971         * convert.cs
1972         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1973         instead of the normal `NullLiteral'.
1974
1975 2006-03-21  Martin Baulig  <martin@ximian.com>
1976
1977         Fix #77583.
1978         * generic.cs (TypeManager.InferType): If `pt' is a generic
1979         parameter, don't check whether `pt == at'.
1980
1981 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1982
1983         Fix #77852
1984         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1985         (TypeParameter.Resolve): Update to change.
1986         (ConstraintChecker.CheckConstraints): Resolve type-argument
1987         constraints before use.
1988
1989 2006-03-16  Martin Baulig  <martin@ximian.com>
1990
1991         * generic.cs
1992         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1993         and don't have any instance constructors, also lookup in the base class.
1994         (TypeManager.IsNullableValueType): New public method.
1995
1996         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1997         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1998         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1999
2000         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2001         instead of just TypeManager.IsNullableType() to determine whether
2002         a lifted operator exists.
2003         (UnaryMutator.DoResolve): Likewise.
2004         (Conditional.DoResolve): Likewise.
2005         (Binary.DoResolve): A lifted operator only exists if both operands
2006         are valuetypes and at least one of them is a nullable type.
2007
2008 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2009
2010         * iterator.cs : yield break is allowed in try statement which has
2011           catch clauses. Fixed bug #77767.
2012
2013 2006-03-12  Martin Baulig  <martin@ximian.com>
2014
2015         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2016         private IsSignatureEqual() to compare types; see the comment in
2017         that method; fixes #77674.
2018
2019 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2020
2021         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2022         (Expression.ResolveAsTypeTerminal): Likewise.
2023         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2024         * expression.cs, generic.cs, iterators.cs: Likewise.
2025         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2026
2027 2006-03-09  Martin Baulig  <martin@ximian.com>
2028
2029         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2030         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2031
2032 2006-03-09  Martin Baulig  <martin@ximian.com>
2033
2034         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2035         `prepared' flag is set.
2036
2037         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2038         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2039         issues; see gtest-254.cs.
2040
2041 2006-03-07  Martin Baulig  <martin@ximian.com>
2042
2043         * generic.cs (TypeManager.InferType): Allow infering
2044         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2045
2046 2006-03-06  Martin Baulig  <martin@ximian.com>
2047
2048         * generic.cs
2049         (TypeManager.InferType): Fix gtest-250.cs.
2050
2051         * typemanager.cs
2052         (TypeManager.IsSubclassOf): Also check the base class.
2053
2054         * expression.cs
2055         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2056         fixes gtest-249.cs.
2057
2058 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2059
2060         Fix #77679.
2061         * expression.cs (ParameterReference.DoResolveBase): Change return
2062         type to bool.
2063         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2064         Update.
2065
2066         Fix #77628.
2067         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2068
2069         Fix #77642.
2070         * typemanager.cs (GetFullNameSignature): Don't nullref on
2071         protected accessors.
2072
2073 2006-02-16  Martin Baulig  <martin@ximian.com>
2074
2075         * generic.cs
2076         (TypeManager.GetGenericFieldDefinition): New public method; use it
2077         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2078
2079 2006-02-14  Martin Baulig  <martin@ximian.com>
2080
2081         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2082
2083 2006-02-14  Martin Baulig  <martin@ximian.com>
2084
2085         * generic.cs
2086         (TypeManager.DropGenericMethodArguments): New public method; don't
2087         use GetGenericMethodDefinition() on something which is not a
2088         generic method.
2089
2090 2006-02-14  Martin Baulig  <martin@ximian.com>
2091
2092         * generic.cs
2093         (ConstraintChecker.CheckConstraints): If a type parameter has the
2094         `struct' constraint, the type must be a non-nullable valuetype.
2095
2096 2006-02-10  Martin Baulig  <martin@ximian.com>
2097
2098         * typemanager.cs
2099         (TypeManager.IsOverride): Make this work for instantiated methods
2100         in a generic class; fixes #77509.
2101         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2102         rather than calling it directly; fixes #77488.  
2103
2104 2006-02-08  Martin Baulig  <martin@ximian.com>
2105
2106         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2107         reporting into CheckConstraint() so we can use the correctly
2108         instantiated type.
2109
2110 2006-02-08  Martin Baulig  <martin@ximian.com>
2111
2112         * expression.cs (BaseAccess): Add support for generic methods.
2113
2114         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2115         the new MethodGroupExpr.
2116
2117 2006-02-07  Martin Baulig  <martin@ximian.com>
2118
2119         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2120         also reference types; fixes #77483.
2121
2122 2006-02-07  Martin Baulig  <martin@ximian.com>
2123
2124         * generic.cs
2125         (TypeManager.IsGenericMethod): We now return whether something is
2126         an instantiated generic method (and not a generic method def).
2127         (TypeManager.IsGenericMethodDefinition): New public method.
2128
2129         * typemanager.cs
2130         (TypeManager.CSharpSignature): Only include type arguments for
2131         "real" generic methods, not for any instantiated method.
2132         (TypeManager.GetMethodName): Likewise, but also allow generic
2133         method definitions here.
2134
2135 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2136
2137         * codegen.cs (EmitScopeInitFromBlock): check here the
2138         capture_context, there is no need to make two calls to the
2139         EmitContext. 
2140
2141         * anonymous.cs: Add some debugging messages that might help me
2142         track other instances of this problem in the future (the
2143         regression of test 467).
2144
2145         * cs-parser.jay: track the variable block, as we need to initalize
2146         any captured variables declared in this block for the "catch"
2147         portion of the "Try" statement.
2148
2149         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2150         scope initialization for captured variables. 
2151
2152         Also, move the emit for the variables after the block location has
2153         been marked.
2154
2155 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2156
2157        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2158         
2159 2006-02-06  Martin Baulig  <martin@ximian.com>
2160
2161         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2162         `TypeManager.value_type' as parent type to
2163         ModuleBuilder.DefineType().  Fixes #77358.      
2164
2165 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2166
2167         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2168         commit yesterday, the initialization for the roots is necessary.
2169         What is not necessary is the scope activation.
2170
2171 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2172
2173         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2174         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2175         CS0206 checks.
2176         (Argument.Resolve): Remove CS0206 checks.
2177
2178 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2179
2180         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2181         scopes for all the roots, the scopes will now be emitted when the
2182         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2183
2184         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2185         code.  This reduces a lot of existing cruft.
2186         
2187         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2188         that the ScopeInfo is generated as we enter the scope, not at the
2189         time of use, which is what we used to do before.
2190
2191         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2192         every time a Block is about to be emitted if we have a
2193         CaptureContext. 
2194
2195 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2196
2197         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2198         attribute for mscorlib too.
2199
2200         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2201         (Reset): Update.
2202         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2203
2204         * typemanager.cs (cons_param_array_attribute): Make private.
2205         (Reset): Set it to null.
2206         (InitCoreHelpers): Don't initialize it.
2207         (ConsParamArrayAttribute): New.  Initialize it as needed.
2208         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2209
2210 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2211
2212         * expression.cs: There might be errors reported during the
2213         selection of applicable methods.  If there are errors, do not
2214         continue execution as it will lead the compiler to crash.
2215
2216 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2217
2218         * expression.cs: Member access is not allowed on anonymous
2219         methods.  Fixes #77402.
2220
2221 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2222
2223         Fix #77401
2224         * cs-parser.jay (VariableDeclaration): Don't set
2225         current_array_type to null.
2226         (field_declaration, event_declaration, declaration_statement):
2227         Set it to null here.
2228
2229 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2230
2231         Fix part of #77397
2232         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2233
2234 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2235
2236         * typemanager.cs (GenericParameterPosition): New.
2237         * doc.cs: Use it.
2238
2239 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2240
2241         * doc.cs : To process "include" elements, first we should create
2242           another list than XmlNodeList, because it could result in node
2243           removal, which could result in that the XmlNodeList gives up
2244           yielding next node.
2245
2246 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2247
2248         * expression.cs: Introduce an error report that we were not
2249         catching before.   Gonzalo ran into it.
2250
2251 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2252
2253         A fix for bug: #76957
2254         
2255         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2256         ComputeMethodHost before creating the method, this is a new
2257         requirement. 
2258
2259         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2260         that this method references (RegisterScope).  The actual scope
2261         where the method is hosted is computed with the ComputeMethodHost
2262         before we create the method.
2263
2264         Moved the Deepest routine here.
2265
2266         (AnonymousContainer.ComputeMethodHost): New routine used to
2267         compute the proper ScopeInfo that will host the anonymous method.
2268
2269         (ScopeInfo): Deal with multiple roots.  The problem was that we
2270         did not have a unique root where all ScopeInfos could be hanged
2271         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2272         of roots.  
2273
2274         Remove AdjustMethodScope which is now computed at the end.  Remove
2275         LinkScope which did a partial link, instead link all ScopeInfos
2276         before code generation from the new "LinkScopes" routine. 
2277
2278         Simplify all the Add* routines as they no longer need to maintain
2279         the tree, they just need to record that they are using variables
2280         from a ScopeInfo.
2281
2282         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2283         routines to produce the forest of ScopeInfo trees.
2284
2285         * class.cs (TypeContainer.AppendMethod): This is just like
2286         AddMethod, but ensures that an interface implementation method
2287         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2288         methods, but at the end.
2289
2290         We use this functionality to ensure that the generated MoveNext
2291         method in the iterator class is resolved/emitted before the
2292         enumerator methods created.   
2293
2294         This is required because the MoveNext method computes the right
2295         ScopeInfo for the method.  And the other methods will eventually
2296         need to resolve and fetch information computed from the anonymous
2297         method. 
2298
2299         
2300 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2301
2302         Improve implementation of section 14.4.2.2 (Better function member).
2303         * expression.cs (Invocation.MoreSpecific): Compare all type
2304         arguments before deciding if one type is more specific than
2305         another.  Handle array types too.  Return the more specific type.
2306         (Invocation.BetterFunction): Add more tie-breaking rules from
2307         section 14.4.2.2.  Perform "more specific" check after
2308         other tie-breaking rules.  Compare all parameter types before
2309         choosing the "more specific" method.
2310
2311 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2312             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2313
2314         Fix rest of #76995.
2315         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2316         the 'aliases' hash.
2317         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2318         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2319
2320 2006-01-18  Martin Baulig  <martin@ximian.com>
2321
2322         * class.cs (TypeContainer.AddToMemberContainer): Use
2323         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2324         fixes #77124.
2325
2326 2006-01-18  Martin Baulig  <martin@ximian.com>
2327
2328         Fix #76417: a generic class may now have methods which may unify
2329         for some type parameter substitutions.
2330
2331         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2332         for methods which may unify anymore.
2333
2334         * expression.cs (Invocation.MoreSpecific): New private static
2335         method; checks whether one method is more specific than another
2336         according to 14.4.2.2 of the spec.
2337         (Invocation.BetterFunction): Implement the tie-breaking rules from
2338         14.4.2.2 of the spec: if two methods unify for some type parameter
2339         substitution, we need to pick the more specific one.
2340
2341 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2342
2343         Fix #76656, cs0231-2.cs.
2344         * cs-parser.jay (formal_parameter_list): Make error case catch
2345         more issues.
2346         (parenthesized_expression_0): Add CS1026 check.
2347         (invocation_expression): Remove unused { $$ = lexer.Location }.
2348
2349 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2350
2351         Fix #76824.
2352         * cs-parser.jay (statement_expression): Don't list out the
2353         individual statement-expressions.  Convert syntax error into
2354         CS0201 check.
2355
2356 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2357
2358         Fix #76874.
2359         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2360         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2361         CheckIntermediateModification.
2362         (FieldExpr.DoResolve): Add new two-argument version that
2363         allows us to resolve the InstanceExpression as an lvalue.
2364         The one-argument variant is now just a wrapper.
2365         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2366         Resolve the lhs as an lvalue if the it has a value type.
2367         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2368         from Assign.DoResolve.
2369         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2370         resolved as an lvalue.
2371         (PropertyExpr.DoResolve): Update.
2372         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2373         has a value type.  Move CS1612 check here from
2374         CheckIntermediateModification.
2375         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2376         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2377         'right_side' of a ResolveLValue on an 'out' argument.
2378         (EmptyExpression.LValueMemberAccess): New.  Used as the
2379         'right_side' of a propagated ResolveLValue on a value type.
2380         (LocalVariableReference.DoResolveBase): Recognize
2381         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2382         Add CS1654 check.
2383         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2384         EmptyExpression.Null.
2385
2386 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2387
2388         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2389           Type.IsGenericParameter(). Fixed bug #77183.
2390         * doc.cs : it is now identical to doc.cs in mcs.
2391
2392 2006-01-16  Martin Baulig  <martin@ximian.com>
2393
2394         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2395
2396 2006-01-16  Martin Baulig  <martin@ximian.com>
2397
2398         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2399         ctors; fixes #77250.
2400
2401 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2402
2403         This fixes the problem where we used ldfld instead of ldflda to
2404         load the "THIS" pointer on captured parameters, when THIS is a
2405         value type.  See bug #77205.
2406         
2407         * iterators.cs (CapturedThisReference.Emit): Pass false to
2408         EmitThis (we do not need the address).
2409
2410         * codegen.cs (EmitThis): it needs to know whether we need the
2411         address of `this' or not.  This is used by value types.  
2412
2413         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2414         every other call passes false.
2415
2416 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2417
2418         Fix #77221.
2419         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2420         GetOverride.
2421         * expression.cs (Invocation.OverloadResolve): Update.
2422         (Invocation.DoResolve): Avoid double resolution of invocation.
2423
2424 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2425
2426         Fix #77180.
2427         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2428         unary negation of floating point types as 0-expr; negation cannot
2429         overflow in floating point types.
2430
2431         Fix #77204.
2432         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2433         on operands of 'void' type.
2434
2435         Fix #77200.
2436         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2437         and ExclusiveOr for boolean constants too.
2438
2439 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2440
2441         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2442
2443 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2444
2445         * cs-tokenizer.cs (Position): New class used to save and restore
2446         the position state in the tokenizer.  Before this patch the save
2447         and restore was not complete enough so the line and columns would
2448         start to drift and the debugger and stack traces will get the
2449         wrong data.
2450
2451 2006-01-10  Martin Baulig  <martin@ximian.com>
2452
2453         * generic.cs
2454         (TypeParameter.InflateConstraints): New public method.
2455
2456         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2457         constraints; fixes #77042.
2458
2459 2006-01-10  Martin Baulig  <martin@ximian.com>
2460
2461         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2462         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2463         #77061. 
2464
2465 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2466
2467         Fix #75636.
2468         * expression.cs (Invocation.OverloadResolve): Replace reflected
2469         override methods with their base virtual methods, rather than
2470         skipping over them.
2471         * typemanager.cs (TypeManager.GetOverride): New.
2472
2473 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2474
2475         * driver.cs: Report the case of no source files and no -out:
2476         argument provided.
2477
2478 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2479
2480         Fix #77035.
2481         * expression.cs (ComposedCast.GetSignatureForError): Define.
2482
2483 2006-01-05  Jb Evain  <jbevain@gmail.com>
2484
2485         * class.cs (Property.Define, Indexer.Define): do not tag the
2486         properties as SpecialName | RTSpecialName.
2487
2488 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2489
2490         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2491         doing a low-level comparission of parameter types.  It was lacking
2492         a check for __argslist. 
2493
2494 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2495
2496         * expression.cs (ParameterReference.DoResolveBase): Allow
2497         reference parameters if they are local to this block. 
2498
2499         This allows the ref and out parameters of a delegate to be used in
2500         an anonymous method, for example:
2501
2502         delegate void set (out int x);
2503
2504         set s = delegate (out int x){
2505                 x = 0;
2506         };
2507
2508         This is used by functionality introduced late in the C# language.
2509         
2510         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2511         method that take ref and out parameters. 
2512
2513         Fixes #77119 which was a late change in the spec.
2514
2515 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2516
2517         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2518         parent if its the same scope.  Fixes #77060.
2519
2520 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2521
2522         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2523
2524 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2525
2526         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2527         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2528         that doesn't contain the full public key. This is a update of the
2529         friend assemblies in .Net 2.0 release.
2530         
2531 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2532
2533         Fix #76995
2534
2535         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2536         ListDictionary, to contain the ExternAliasEntry entries (in
2537         addition to the NamespaceEntry.aliases hashtable). This field is
2538         shared between the original entry and its doppelganger (bodyless 
2539         copy of it).
2540         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2541         extern_aliases field.
2542         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2543         lookup in extern_aliases.
2544
2545 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2546
2547         Fix #77006.
2548         * class.cs (TypeContainer.Mark_HasEquals): New.
2549         (TypeContainer.Mark_HasGetHashCode): New.
2550         (ClassPart): Override them.
2551         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2552
2553         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2554         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2555         DeclSpace.
2556
2557         Fix #77008.
2558         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2559         'parent' argument to the base constructor.
2560
2561         Remove all mention of TypeContainer from decl.cs.
2562         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2563         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2564         (DeclSpace.DeclSpace): Likewise.
2565         (DeclSpace.DefineMembers): Remove unused argument.
2566         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2567         debugging check -- we don't care if the debug code throws an
2568         InvalidCastException instead of an InternalErrorException.
2569         * class.cs (TypeContainer.DefineMembers): Update to changes.
2570         (TypeContainer.DoDefineMembers): Likewise.
2571         (TypeContainer.GetMethods): Likewise.
2572         (PropertyMember.Define): Likewise.
2573         (MemberBase.Parent): New property that forwards to
2574         MemberCore.Parent, but ensures that we get a TypeContainer.
2575         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2576         (RootContext.PopulateTypes): Likewise.  Remove special case code
2577         for !RootContext.StdLib: DefineMembers is idempotent.
2578
2579 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2582
2583 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2584
2585         * doc.cs : The search for referenced namespace was insufficient to
2586           get global one as it used to do. Fixed bug #76965.
2587
2588 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2589
2590         * doc.cs : check name in cref in the last phase that whether it is
2591           namespace or not.
2592
2593 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2594
2595         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2596           Mono.C5.
2597
2598 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2599
2600         * doc.cs : so it turned out that we cannot skip override check for 
2601           interface members. Fixed bug #76954.
2602
2603 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2604
2605         * cs-tokenizer.cs : fixed bug #75984:
2606           - #warning and #error should not be handled when the source line
2607             is disabled.
2608           - #line is not checked strictly when the source line is disabled.
2609           - #define and #undef is on the other hand checked strictly at any
2610             state.
2611
2612 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2613
2614         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2615           CS1027 report.
2616
2617 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2618
2619         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2620
2621         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2622         nested types.
2623
2624 2005-12-14  Martin Baulig  <martin@ximian.com>
2625
2626         * typemanager.cs (TypeManager.GetFullName): Make this public;
2627         `Type.Fullname' now never returns null.
2628
2629         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2630         explicit interface implementations; we're now using the same
2631         naming convention than csc does.
2632
2633 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2634
2635         * convert.cs (ExplicitConversionCore): Check the return value from
2636         ExplicitConversionCore which can return null on failure.  Fixes #76914
2637
2638 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2639
2640         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2641         instead of IsGenericInstance.
2642         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2643         code that's now covered by the more general test.
2644         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2645
2646         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2647         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2648         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2649         * generic.cs, report.cs, typemanager.cs: Likewise.
2650
2651 2005-12-08  Martin Baulig  <martin@ximian.com>
2652
2653         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2654
2655         * typemanager.cs (TypeManager.CSharpSignature): Include type
2656         arguments in the signature of a generic method.
2657
2658 2005-12-07  Martin Baulig  <martin@ximian.com>
2659
2660         Add support for custom attributes on type parameters.
2661
2662         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2663
2664         * generic.cs (TypeParameterName): New public class; we use this
2665         instead of a `string' to store the name of a type parameter, so we
2666         can also have `Attributes'.
2667         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2668         array instead of a `string[]' array.
2669         (TypeParameter.ctor): We now also take an `Attributes' argument.
2670         (TypeParameter.EmitAttributes): New public method; emit our
2671         `OptAttributes' here.
2672         (GenericMethod.EmitAttributes): New public method; emit the custom
2673         attributes on all our type parameters.
2674
2675         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2676         our type parameters.
2677         (MethodData.Define): If we're a generic method, call
2678         EmitAttributes() on it.
2679
2680 2005-12-07  Martin Baulig  <martin@ximian.com>
2681
2682         * generic.cs
2683         (ConstraintChecker): New public abstract class; move the
2684         constraint checking here from `ConstructedType' and also do
2685         constraint checking for generic methods here.
2686
2687         * expression.cs (Invocation.OverloadResolve): Use
2688         ConstraintChecker.CheckConstraints() if we resolved to a generic
2689         method.  Fix #76806.
2690
2691 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2692
2693         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2694
2695         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2696         event initializers.
2697         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2698         (FieldBase.Initializer): Initializer is now optional.
2699         (EventField.Define): Only event field can have initializer.
2700
2701         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2702
2703         * const.cs (Const): Reuse initializer.
2704
2705         * cs-parser.jay: Updated after FieldBase changes.
2706         Added current_array_type to simplify array initializers.
2707
2708         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2709
2710         * expression.cs, iterators.cs: Updated.
2711
2712         * namespace.cs (NamespaceEntry): Made UsingFound private.
2713
2714 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2715
2716         * parameterCollection.cs: Obsolete, removed.
2717         * parser.cs: Obsolete, removed.
2718
2719 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2720
2721         Fix #76849.
2722         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2723
2724         * enum.cs (Enum.Define): Set obsolete context here.
2725
2726 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2727
2728         * doc.cs :
2729           - FindDocumentedMember() now expects 1) paramList as null
2730             when "we don't have to check the number of parameters" and
2731             2) Type.EmptyTypes when "there is no arguments".
2732           - Introduced FoundMember struct to hold the exact type which was
2733             used to find the documented member (the above change broke
2734             test-xml-044; it might be better just to use DeclaringType than
2735             what MS does, like this change does, but it depends on usage.)
2736
2737 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2738
2739         * doc.cs : documented member might be from DeclaringType for nested
2740           types. Fixed bug #76782.
2741
2742 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2743
2744         * anonymous.cs: Have the param code handle leaving copies on the
2745         stack etc. Allows anonymous params to take part in the assignment
2746         code (++, +=, etc). Fixes bug #76550
2747
2748         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2749         it down to the anon code.
2750
2751         * iterators.cs: Use dummy var here
2752
2753         * codegen.cs: Handle new vars
2754
2755 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2756
2757         Fix #76849.
2758         * class.cs (MethodData.Define): Set proper Obsolete context.
2759
2760         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2761         obsolete context.
2762         (FieldExpr.DoResolve): Ditto.
2763
2764 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2765
2766         Fix #76849.
2767         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2768         parent is not obsolete.
2769
2770 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2771
2772         * doc.cs : (FindDocumentedMember) find parameterless members first
2773           and get CS0419 in the early stage. Fixed first case of bug #76727.
2774
2775 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2776
2777         Fix #76859.
2778         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2779         no error was reported.
2780
2781         *expression.cs (Binary.DoResolve): left can be null.
2782
2783 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2784
2785         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2786         abstract method and all overrides.
2787         * support.cs (ParameterData.GenericConstraints): Delete.
2788         (ReflectionParameters.type_params): Delete.
2789         (ReflectionParameters.ReflectionParameters): Make private.
2790         (ReflectionParameters.GetConstaints): New factory method.
2791         * generic.cs (TypeParameterDefineType): Use it.
2792         (TypeManager.GetTypeParameterConstraints): Likewise.
2793
2794 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2795
2796         Fix #76783.
2797         * class.cs (MethodData.Emit): Parameters should be labeled first.
2798
2799 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2800
2801         Fix #76761.
2802         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2803
2804 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2805
2806         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2807
2808         * class.cs (MethodCore): Parameter clean up.
2809         (IMethodData): Added ParameterInfo.
2810         (MethodData): Parameter clean up.
2811         (Indexer.Define): Parameter clean up.
2812
2813         * anonymous.cs,
2814         * codegen.cs,
2815         * cs-parser.jay,
2816         * decl.cs,
2817         * doc.cs,
2818         * ecore.cs,
2819         * flowanalysis.cs,
2820         * iterators.cs,
2821         * pending.cs,
2822         * statement.cs,
2823         * typemanager.cs: Parameter clean up.
2824
2825         * delegate.cs (Define): Get rid of duplicated code.
2826
2827         * expression.cs (ParameterReference): Removed useless parameters
2828         and simplified.
2829         (Invocation): Ditto.
2830
2831         * parameter.cs (ParamsParameter): New class, params specialization.
2832         (ArglistParameter): Attemp to separate arglist.
2833         (Parameter): Refactored to be reusable and faster.
2834         (Parameter.Modifier): Made understandable.
2835         (Parameters): Changed to be used as a class for `this' assembly
2836         parameters. Refactored to use new specialized classes.
2837
2838         * support.cs (ParameterData): Added Types property.
2839         (InternalParameters): Deleted.
2840
2841 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2842
2843         * doc.cs : the previous patch does not actually fix the bug.
2844           PropertyInfo override check is now implemented and really fixed it.
2845         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2846
2847 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2848
2849         * doc.cs : apply "override filter" also to properties.
2850           Fixed bug #76730.
2851
2852 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2853
2854         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2855           no need to check overrides. For classes, omit those results from 
2856           interfaces since they must exist in the class. Fixed bug #76726.
2857
2858 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2859
2860         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2861           with different parameters. Fixed the second problem in #76685.
2862
2863 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2864
2865         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2866           get expected 'protected' access in CheckValidFamilyAccess()).
2867           Fixed bug #76692.
2868
2869 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2870
2871         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2872           Fixed bug #76705.  CS1569 was incorrectly commented out.
2873
2874 2005-11-23  Martin Baulig  <martin@ximian.com>
2875
2876         * generic.cs (Constraints.Define): Removed.
2877         (TypeParameter.DefineConstraints): Removed.
2878         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2879         on the GenericTypeParameterBuilder here.
2880
2881 2005-11-23  Martin Baulig  <martin@ximian.com>
2882
2883         * typemanager.cs (TypeManager.GetProperty): Make this public.
2884
2885         * generic.cs (Nullable.NullableInfo.ctor): Use
2886         TypeManager.GetProperty() rather than using reflection directly.
2887
2888 2005-11-17  Martin Baulig  <martin@ximian.com>
2889
2890         * expression.cs (Indexers.GetIndexersForType): Added support for
2891         generic parameters; fixes #76587.
2892
2893 2005-11-17  Martin Baulig  <martin@ximian.com>
2894
2895         * anonymous.cs
2896         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2897         inherit the scope from our parent.  Fixes #76653.
2898
2899 2005-11-15  Martin Baulig  <martin@ximian.com>
2900
2901         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2902         instead of `ScopeTypeBuilder' to refer to the "current" type.
2903         (AnonymousMethod.CreateScopeType): Correctly create the helper
2904         class if we're inside a generic type definition.
2905
2906 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2907
2908         * doc.cs : use Invocation.IsOverride() to do real override check.
2909         * expression.cs : made Invocation.IsOverride() internal.
2910
2911 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2912
2913         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2914           TypeBuilder.FindMembers() and filter overriden base members out.
2915           Fixed bug #76990.
2916
2917 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2918
2919         * doc.cs : ref/out parameters are represented as '@' (instead of
2920           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2921
2922 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2923
2924         * doc.cs : when there was no '.' in cref to methods in doc comment,
2925           then parameters were missing in the output. Fixed bug #76691.
2926
2927 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2928
2929         * driver.cs : don't output docs when there is an error.
2930           Fixed bug #76693.
2931
2932 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2933
2934         * doc.cs :
2935           Now it should detect indexers. Fixed primary concern in bug #76685.
2936           Fixed CS0419 message to not show the identical member signature in
2937           the message.
2938
2939 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2940
2941         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2942           instead of Type.FindMembers() since it does not handle events.
2943           Fixed bug #71604.
2944
2945 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2946
2947         * codegen.cs: Fixed typo (speficied -> specified).
2948
2949 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2950
2951         Fix #76369.
2952         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2953
2954 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2955
2956         * attribute.cs: Changed error message.
2957
2958         * cs-tokenizer.cs: One more check.
2959
2960 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2961
2962         * statement.cs (Block.Resolve): Ignore empty statement.
2963
2964 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2965
2966         * report.cs: Made error/warning methods more strict to avoid
2967         their misuse.
2968
2969         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2970         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2971         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2972         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2973
2974 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2975
2976         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2977         Use the more explicit AssemblyName.FullName instead of 
2978         AssemblyName.Name to report errors.
2979         
2980 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2981
2982         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2983         with mcs.
2984
2985 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2986
2987         * class.cs,
2988         * convert.cs,
2989         * cs-parser.jay,
2990         * decl.cs,
2991         * enum.cs,
2992         * expression.cs,
2993         * generic.cs,
2994         * pending.cs,
2995         * report.cs: Fixed error reporting and typos.
2996
2997         * generic.cs (TypeParameter.GetSignatureForError): New method.
2998         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2999
3000         * typemanager.cs (GetFullName): Refactored.
3001
3002 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3003
3004         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3005         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3006
3007         * class.cs (TypeContainer.IsComImport): New property.
3008         (Constructor.Define): Create proper ctor for ComImport types.
3009
3010         * expression.cs (New.CheckComImport): Fixed.
3011
3012 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3013
3014         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3015         that a parameter has been captured does not mean that we do not
3016         have to do the rest of the processing.  This fixes the second part
3017         of #76592.  If there was another anonymous method capturing
3018         values in the past, the Scope would never be set for the second
3019         method that captured the same parameter.
3020
3021         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3022         properly manipulate the stack.   Second part of fix for #76592.
3023
3024         * expression.cs (New): Add support for invoking "new" on
3025         interfaces that have been flagged with the ComImport attribute and
3026         the CoClass.  Fixes #76637 
3027
3028         * statement.cs (Try.DoEmit): When a variable is captured, do not
3029         try to emit the vi.LocalBuilder variable as it has been captured.
3030         Create a temporary variable and store the results on the
3031         FieldBuilder.  Fixes #76642
3032
3033 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3034
3035         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3036
3037         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3038
3039         * expression.cs (Binary.DoResolve): Added && optimalization.
3040     
3041         * typemanager.cs (AddUserType): Removed useless argument.
3042
3043 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3044
3045         * statement.cs (Block.variables): Uses ListDictionary.
3046
3047 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3048
3049         Fix #75969.
3050         * class.cs (PartialContainer.EmitType): Customized to emit
3051         security attributes.
3052         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3053         for partial classes.
3054
3055 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3056
3057         Fix #76599.
3058         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3059         access has to be fixed.
3060         
3061         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3062
3063 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3064
3065         Fix #76590.
3066         * ecore.cs (NullCast.Reduce): Implemented.
3067
3068         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3069         constant type.
3070         
3071         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3072         properly.
3073         (Foreach.Resolve): Catch null properly.
3074
3075 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3076  
3077         * cs-tokenizer.cs: Warning text fix.
3078
3079         * driver.cs: AllWarningNumbers exposed on public interface.
3080
3081         * report.cs (): Reviewed warning numbers.
3082         (IsValidWarning): Use binary search.
3083
3084 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3085  
3086         * driver.cs: Implemeted resource visibility.
3087         (Resources): New class for code sharing between /res: and
3088         /linkres:
3089  
3090 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3091
3092         decl.cs (CurrentTypeParameters): Fixed to be public.
3093
3094 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3095
3096         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3097
3098 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3099
3100         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3101
3102 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3103
3104         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3105
3106 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3107
3108         Add friend assembly access support.
3109         * typemanager.cs: assembly_internals_vis_attrs
3110         cache for friend assembly access. 
3111         (TypeManager.IsFriendAssembly): New method for
3112         checking friend assembly access.
3113         (TypeManager.Error_FriendAccessNameNotMatching): New
3114         helper method.
3115         (TypeManager.CompareKeyTokens): Likewise.
3116         (TypeManager.Filter): Handle friend accessible
3117         members.
3118
3119         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3120         friend accessible types.
3121
3122         * ecore.cs (Expression.IsAccessorAccessible): Handle
3123         friend accessible properties.
3124
3125         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3126         accessible types.
3127         
3128 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3129
3130         Fix #76568.
3131         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3132         folding.
3133         
3134         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3135         contants only.
3136         
3137         * ecore.cs (NullCast): Child is contant only.
3138         
3139         * literal.cs (NullLiteral.Reduce): null can be converted to any
3140         reference type.
3141
3142 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3143
3144         * driver.cs: Use Encoding.Default as default code page instead
3145           of ISO-28591.
3146
3147 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3148
3149         Fix #76085.
3150         * expression.cs (Invocation.Error_InvalidArguments): Handle
3151         __arglist parameters.
3152         (Invocation.VerifyArgumentsCompat): Likewise.
3153         * support.cs (ReflectionParameters.GetSignatureForError): Print
3154         __arglist parameters.
3155         (InternalParamters.GetSignatureForError): Likewise.
3156         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3157
3158 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3159
3160         * attribute.cs (GetPropertyValue): Made public.
3161
3162         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3163         Resolve.
3164         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3165         attribute.
3166         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3167         is not defined.
3168         
3169         * driver.cs: Reflect method name change.
3170         
3171         * statement.cs (Try.Resolve): Warn when try has both general
3172         exception handlers.
3173         
3174         * typemanager.cs: runtime_compatibility_attr_type new predefined
3175         type.
3176
3177 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3178
3179         Fix #76419.
3180         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3181         treat it as an empty parameter list.
3182
3183 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3184
3185         Fix #76271.     
3186         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3187         ResolveAsTypeStep silent.
3188         * statement.cs (Block.AddConstant): Mark block as used.
3189         (Block.ResolveMeta): Avoid piling on error messages
3190         if a constant initializer resolution fails.
3191
3192 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3193
3194         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3195         Remove.
3196         (NamespaceEntry.VerifyAllUsing): New.
3197         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3198         behaviour.  Delegates actual resolution of alias to ...
3199         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3200         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3201         Update.
3202         * driver.cs (Driver.MainDriver): Update.
3203         
3204         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3205         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3206         property.
3207         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3208         Remove.
3209         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3210         RootNamespace.DefineNamespacesForAll.
3211
3212 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3213
3214         * typemanager.cs (assemblies, external_aliases, modules)
3215         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3216         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3217         overhead.  Move resposibility ...
3218         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3219         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3220
3221 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3222
3223         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3224         cached_namespaces.  Improve usage.
3225         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3226         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3227         Move from GlobalRootNamespace and simplify.
3228         (RootNamespace.Global): Make instance variable.
3229         (RootNamespace.RootNamespace): Add "alias name" parameter.
3230         (GlobalRootNamespace): Simplify drastically.
3231         (Namespace.Lookup): Don't use GetNamespace.
3232         * typemanager.cs (GetRootNamespace): Rename from
3233         ComputeNamespaceForAlias.
3234         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3235
3236 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3237
3238         * anonymous.cs (AnonymousContainer): Don't crash when container
3239         doesn't exist.
3240
3241 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3242
3243         * expression.cs (Binary.DoResolve): Warn when comparing same
3244         values.
3245
3246 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3247
3248         Fix #76486.
3249         * expression.cs (Binary.DoResolve): It looks like there are no
3250         convetsion rules in enum context.
3251
3252 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3253
3254         Add support for extern alias qualifiers.
3255         * typemanager.cs: Move some LookupTypeReflection code
3256         to namespace.cs, to have cleaner code. Added some methods
3257         to help us keep track of the extern aliased references.
3258         * driver.cs: Add suport for extern alias assemblies on command
3259         line and check for their warnings/errors. Also keep track of the
3260         extern aliased assemblies.
3261         * namespace.cs: Move the global functionality of Namespace
3262         to GlobalRootNamespace/RootNamespace. Now the global namespace
3263         is GlobalRootNamespace.Globa. Also the code moved from 
3264         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3265         Finally added LocalAliasEntry (AliasEntry before) and
3266         ExternAliasEntry, to handle alias statements.
3267         * cs-parser.jay: Add support in the grammar for extern alias
3268         statement.
3269         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3270         Update callings to Namespace (now in GlobalRootNamespace).
3271
3272 2005-10-25  Martin Baulig  <martin@ximian.com>
3273
3274         * convert.cs (ImplicitTypeParameterConversion): Make base
3275         interfaces actually work; fixes #76557.
3276
3277 2005-10-25  Martin Baulig  <martin@ximian.com>
3278
3279         * generic.cs
3280         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3281         all the type parameters; fixes #76551.
3282
3283 2005-10-25  Martin Baulig  <martin@ximian.com>
3284
3285         Fix #76472.
3286
3287         * generic.cs
3288         (GenericMethod.ctor): Added `Expression return_type' and
3289         `Parameters parameters' arguments.
3290         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3291         parameter and return types to check their constraints if they're
3292         generic types.
3293
3294         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3295         boolean field.
3296
3297         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3298         constraints of a generic type if `ec.ResolvingGenericMethod'.
3299
3300         * class.cs (MethodCore.DoDefineParameters): Set
3301         `ec.ResolvingGenericMethod' if we're a generic method.
3302         (MemberBase.MemberType): Likewise.
3303
3304 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3305
3306         * typemanager.cs (TypeManager): Added 
3307         TypeManager.internals_visible_attr_type to cache
3308         S.R.CompilerServices.InternalsVisibleToAttribute.
3309
3310         * codegen.cs (AssemblyClass): Added checks for 
3311         InternalsVisibleToAttribute in new method 
3312         CheckInternalsVisibleAttribute () and also cache the
3313         AssemblyName in AssemblyClass.Name.
3314         
3315 2005-10-24  Martin Baulig  <martin@ximian.com>
3316
3317         * typemanager.cs
3318         (TypeManager.ExpandInterfaces): Added overloaded version which
3319         just takes a `Type[]' array.
3320
3321         * generic.cs
3322         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3323         just use the interfaces which were explicitly specified and not
3324         the interfaces they inherit.  Fixes #76482.
3325         (TypeParameter.FindMembers): Expand the interfaces here.
3326
3327 2005-10-21  Martin Baulig  <martin@ximian.com>
3328
3329         * generic.cs
3330         (Constraints.Resolve): Also resolve the actual types here.
3331         (Constraints.ResolveTypes): Just check the constraints here.
3332         Fixes #76363; see gtest-218.cs.
3333
3334 2005-10-21  Martin Baulig  <martin@ximian.com>
3335
3336         * convert.cs
3337         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3338         instead of a `BoxedCast'; fixes gtest-217.cs.
3339
3340 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3341
3342         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3343           1) "new()" is specified as generic parameter constraint and 2) the
3344           type is TypeBuilder and 3) the type is abstract even if it has a
3345           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3346
3347 2005-10-20  Martin Baulig  <martin@ximian.com>
3348
3349         * generic.cs
3350         (GenericConstraints.TypeParameter): New public property.
3351         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3352         (TypeParameter.DeclSpace): New public property.
3353         (TypeParameter.DefineType): Inflate the constraints if our
3354         `DeclSpace' is an `Iterator'.   
3355
3356 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3357
3358         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3359           GenericMethod argument to compare methods' generic type arguments.
3360           Fixed bug #76382.
3361
3362 2005-10-19  Martin Baulig  <martin@ximian.com>
3363
3364         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3365         not ResolveType() when resolving the base type, so we're not
3366         checking the constraints here.
3367         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3368         if we have any.
3369
3370 2005-10-19  Martin Baulig  <martin@ximian.com>
3371
3372         * generic.cs (ConstructedType.CheckConstraints): Committing
3373         untested fix for #76441.
3374
3375 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix #76371.
3378         * class.cs (TypeContainer.DefineType): Move updating of
3379         topological sort earlier in the code.
3380         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3381
3382 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3383
3384         Fix #76273.
3385         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3386         
3387         * constant.cs (Constant.TryReduce): Moved from Cast class.
3388         (Reduce): Made little bit more OO and fixed missing conversions.
3389         
3390         * ecore.cs (Reduce): Implemented.
3391         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3392         
3393         * literal.cs (Reduce): Implemented.
3394         
3395         * class.cs: Reverted Miguel's wrong commit.
3396
3397 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3398
3399         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3400
3401 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3402
3403         * cs-parser.jay, expression.cs : CS0214 was missing error location
3404           for constants. Fixed bug #76404.
3405
3406 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3407
3408         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3409         InstanceExpression.
3410         (PropertyExpr.EmitCall): Likewise.
3411         * expression.cs (Invocation.EmitArguments): Handle case where
3412         arguments == null.
3413         (Invocation.EmitCall): Avoid allocating temporary variable if
3414         there are no arguments.
3415
3416 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3417
3418         Fix #76370.
3419         * convert.cs (ExplicitConversionCore): Fixed object->enum
3420         conversion.
3421
3422 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3423
3424         Fix #76323.
3425         * convert.cs (ImplicitConversionStandard): Move conversion of
3426         void* to arbitrary pointer types ...
3427         (ExplicitConversionStandard): .. here.
3428         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3429         error to always print typenames.
3430
3431 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3432
3433         * convert.cs (GetConversionOperator): Rename from
3434         GetConversionOperators.  Move operator selection code from ...
3435         (UserDefinedConversion): ... here.
3436
3437 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3438
3439         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3440         conversion.
3441
3442 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3443
3444         * assign.cs (Assign.DoResolve): Error method changed.
3445
3446         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3447         
3448         * const.cs (ResolveValue): Reset in_transit immediately.
3449         
3450         * constant.cs: Error method changed.
3451         
3452         * convert.cs: Removed useless location parameter.
3453         (ExplicitNumericConversion): Don't do double enum check.
3454         (ExplicitConversionCore): Renamed from ExplicitConversion.
3455         (ExplicitUnsafe): Extracted from ExplicitConversion.
3456         (ExplicitConversion): Uses for error reporting.
3457         
3458         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3459         error messages.
3460         (ResolveBoolean): Uses common error method.
3461         (CastToDecimal): Get rid of ec.
3462         (CastFromDecimal): Optimized.
3463         (ConvCast): Get rid of ec.
3464         
3465         * enum.cs (ResolveValue): Reset in_transit immediately.
3466         (Emit): Return after first error.
3467         
3468         * expression.cs: Convert changes.
3469         
3470         * literal.cs: Error method changed.
3471         
3472         * statement.cs: Error method changed.
3473
3474 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3475
3476         Fix gtest-131.cs and gtest-211.cs.
3477         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3478         Only emit code for a label if it is used.  Unreachable code can
3479         violate ECMA evaluation stack invariants.
3480
3481 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3482
3483         * anonymous.cs: Implemented ExprClassName.
3484         
3485         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3486         delegate.
3487         
3488         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3489         check.
3490         
3491         * class.cs (StaticClass.DefineContainerMembers): Report protected
3492         members as error.
3493         
3494         * codegen.cs: if(ed) PRODUCTION.
3495         
3496         * convert.cs (Error_CannotImplicitConversion): Better error
3497         distinction.
3498         
3499         * cs-parser.jay: More error checks.
3500         
3501         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3502         
3503         * driver.cs (CSCParseOption): Enabled wrong option check.
3504         
3505         * ecore.cs (Expression.ExprClassName): Turned to property.
3506         (MemberExpr.CheckIntermediateModification): For checking boxed
3507         value types     modification.
3508         
3509         * statement.cs (Fixed.Resolve): Expression type must be
3510         convertible to fixed type.
3511         (CollectionForeach.GetEnumeratorFilter,TryType):
3512         Small refactoring for easier error checking.
3513
3514 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3515
3516         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3517         attributes.
3518         
3519         * class.cs (GeneratedBaseInitializer): New class for customization
3520         compiler generated initializers.
3521         (MemberBase.DoDefine): Check Obsolete attribute here.
3522         (FieldMember.DoDefine): Ditto.
3523         
3524         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3525         constants.
3526         
3527         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3528         (MemberCore.GetObsoleteAttribute): Removed argument.
3529         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3530         (MemberCore.CheckObsoleteType): New helper.
3531         
3532         * delegate.cs,
3533         * enum.cs,
3534         * statement.cs: Updates after MemberCore changes.
3535         
3536         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3537         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3538         
3539         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3540         obsolete attribute for compiler construct.
3541         (As.DoResolve): Cache result.
3542         
3543         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3544
3545 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3546
3547         * expression.cs (Probe): instead of having a "Type probe_type"
3548         keep the extra information as a TypeExpr probe_type_expr since the
3549         "As" operator needs to perform some type checks.
3550
3551         * (As.DoResolve): If the type is a type parameter, ensure that it
3552         is constrained by a class.
3553
3554 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3555
3556         * statement.cs (Lock): Use the TemporaryVariable class instead of
3557         manually using local variables as those do not work when variables
3558         are captured.
3559
3560         * ecore.cs: Moved the TemporaryVariable class from being a nested
3561         class inside Foreach to be a public class that can be employed in
3562         other places. 
3563
3564 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3565
3566         * cs-parser.jay: interface_accessors replaced by
3567         accessor_declarations.
3568
3569         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3570         location.
3571         
3572         * statement.cs (GotoCase.Resolve): Convert null constant to
3573         null case.
3574         (SwitchLabel.ResolveAndReduce): Ditto.
3575         (SwitchLabel.NullStringCase): Custom null stamp.
3576         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3577         
3578         typemanager.cs (CSharpSignature): Don't skip first argument
3579         for full names.
3580
3581 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3582
3583         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3584         expression.cs, iterators.cs, literal.cs: Store constants and
3585         literals location.
3586         
3587         * class.cs (MemberBase.ShortName): Pass location.
3588         
3589         * cs-parser.jay: Some location fixes.
3590         
3591         * ecore.cs (Expression.Location): Made virtual.
3592
3593 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3594
3595         Fix #72930.
3596         * const.cs (Const.ResolveValue): Check for assigning non-null
3597         value to reference type.
3598
3599 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3600
3601         Fix #76133.
3602         * expression.cs (This.VerifyFixed): In a value type T, the type of
3603         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3604         value type R, 'this' is treated as a value parameter.
3605
3606 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3607
3608         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3609         if the underlying types are the same, otherwise we need to produce
3610         code that will do the proper cast.
3611
3612         This was exposed by Marek's constant rewrite which produced
3613         invalid code for the call site:
3614
3615         enum X : long { a }
3616         void Method (X v) {}
3617
3618         Method ((X) 5)
3619
3620         This fixes test-49.cs
3621
3622 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3623
3624         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3625           Type/Object should be allowed as well. Fixed bug #75968.
3626
3627 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3628
3629         * expression.cs : (Binary.DoResolve): when one is enum constant and
3630           another is constant 0, then return enum one *as enum type*.
3631           Fixed bug 74846.
3632
3633 2005-10-04  Martin Baulig  <martin@ximian.com>
3634
3635         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3636         `SetMemberIsUsed()' work for generics, too.
3637
3638 2005-10-04  Martin Baulig  <martin@ximian.com>
3639
3640         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3641         for corlib.  Fixes #75691.
3642
3643 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3644
3645         Fix #76255.
3646         * driver.cs: Fix compilation files with full root path.
3647
3648 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3649
3650         * report.cs (SymbolRelatedToPreviousError): Format the output so
3651         it does not use an open parenthesis that is never closed. 
3652
3653         * driver.cs: Follow coding guidelines
3654
3655 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3656
3657         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3658
3659         * location.cs (InEmacs): in this mode, do not report column
3660         location as it confuses Emacs.
3661
3662 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3663
3664         * support.cs (SeekableStreamReader.Position): Don't error out when
3665         the requested position is just beyond the end of the current
3666         buffered data.
3667
3668 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3669
3670         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3671         try to keep in sync with the byte count of the underlying Stream.
3672         However, this limits us to a window size of 2048 characters: i.e.,
3673         the maximum lookahead of our lexer/parser can be 2048 characters.
3674
3675 2005-09-22  Martin Baulig  <martin@ximian.com>
3676
3677         * driver.cs: Removed a debugging FIXME.
3678
3679 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3680
3681         * cs-parser.jay (type_arguments): Add CS1644 check.
3682         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3683
3684 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3685
3686         * Makefile (PROGRAM): Make profile specific.
3687         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3688         the current directory.
3689
3690         Fix test-455.cs.
3691         * expression.cs (Invocation.EmitCall): Remove optimization on
3692         this_call since it doesn't handle 'this' being a value type.
3693
3694 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3695
3696         * driver.cs: Ensure file handles are closed after parsing
3697
3698 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3699
3700         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3701         if the underlying types are the same, otherwise we need to produce
3702         code that will do the proper cast.
3703
3704         This was exposed by Marek's constant rewrite which produced
3705         invalid code for the call site:
3706
3707         enum X : long { a }
3708         void Method (X v) {}
3709
3710         Method ((X) 5)
3711
3712         This fixes test-49.cs
3713
3714 2005-09-05  Martin Baulig  <martin@ximian.com>
3715
3716         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3717         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3718
3719         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3720
3721 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3722
3723         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3724           to be a pointer type due to the spec 25.2, so check if declaring
3725           type is generic type definition. Fixed bug #75772.
3726
3727 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3728
3729         Fixed bug #75957.
3730         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3731           both types are not defined by methods.
3732         * expression.cs : (Invocation.IsApplicable): it should work when
3733           the argument type is equal to the parameter type, not only when
3734           ImplicitConversionExists() returns true.
3735
3736 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3737
3738         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3739         internal.
3740
3741         Fix #75941.
3742         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3743         flow-branching for LocalVariableReferences in case we were invoked
3744         from a MemberAccess.
3745         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3746         Carved out of ...
3747         (LocalVariableReference.DoResolveBase): ... this.
3748         (MemberAccess.Resolve): Do the check that was disabled during
3749         SimpleNameResolve.
3750
3751 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3752
3753         * class.cs :
3754           (PartialContainer.Create): check abstract/sealed/static strictly
3755           but abstract/sealed can exist only at one side. Fixed bug #75883.
3756
3757 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3758
3759         Fix #75945.
3760         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3761         specified, don't default to UnmanagedType.I4.
3762
3763 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3764
3765         * expression.cs : conditional operator should check possibly
3766           incorrect assign expression. Fixed bug #75946.
3767
3768 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3769
3770         Fix #75934.
3771         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3772         (ScopeInfo.EmitScopeType): Use it to construct field names from
3773         names of captured locals.
3774
3775         Fix #75929.
3776         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3777         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3778         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3779         (ExplicitConversion): Remove enum cases already handled by
3780         implicit conversion.  Move implicit conversion check to the beginning.
3781         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3782         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3783         Don't treat System.Enum as a struct.
3784
3785 2005-08-30  Jb Evain  <jbevain@gmail.com>
3786
3787         * attribute.cs: handles as expression in parameters.
3788
3789 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3790
3791         Fix #75802.
3792         * class.cs (TypeContainer.VerifyClsName): Don't use a
3793         PartialContainer when verifying CLS compliance.
3794         (AbstractPropertyEventMethod): Set Parent here, ...
3795         (PropertyMethod): ... not here.
3796
3797 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3798
3799         * attribute.cs : escaped attribute name should not be allowed to be
3800           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3801
3802 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3803
3804         Fix #75927.
3805         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3806         when converting a long constant to unsigned long.
3807         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3808         detect where IsApplicable and VerifyArgumentsCompat disagree.
3809
3810 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3811         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3812
3813         Fix #75848.
3814         * class.cs (TypeContainer.CanElideInitializer): New helper.
3815         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3816         can safely emitting the initializer of a field.
3817
3818 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3819
3820         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3821           allowed inside a switch (without loop). Fixed bug #75433.
3822
3823 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3824
3825         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3826         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3827
3828 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3829
3830         * driver.cs : kinda reverting the default encoding changes (not exact 
3831           revert since I noticed that "codepage:reset" might not work fine).
3832
3833 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3834
3835         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3836           Location. Now getter and setter store location correctly.
3837           (errors/cs0111-12.cs now reports the expected location.)
3838
3839 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3840
3841         * driver.cs : Use default encoding on the environment.
3842           Removed (now that) extra parameter for SeekableStreamReader.
3843         * support.cs : (SeekableStreamReader) third .ctor() argument for
3844           StreamReader is not required (always true). preamble size could
3845           be acquired in simpler and safe way.
3846
3847 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3848
3849         * cs-parser.jay: report CS0642 at warning level 3
3850           and report CS0642 for an if else statement also
3851           fixes bug #74745. Patch by John Luke (and a bit
3852           modified by me).
3853           Removed extra CS0642 warning check for "while",
3854           "for" and "fixed".
3855         * statement.cs: In Block.Resolve(), CS0642 check
3856           is reimplemented to check a sequence of an empty
3857           statement and a block.
3858
3859           Both fix bug #66777.
3860
3861 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3862
3863         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3864         detection until I fix it.
3865         
3866         * cs-tokenizer.cs: Changed error message.
3867         
3868         * cs-parser.jay: Fixed 2 error locations.
3869         
3870         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3871         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3872         properties.
3873         
3874         * enum.cs (GetSignatureForError): Fixed.
3875         
3876         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3877         method detection.
3878         
3879         * class.cs,
3880         * typemanager.cs (RegisterProperty): Removed.
3881         
3882         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3883
3884 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3885
3886         Fix #75874.
3887         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3888         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3889
3890 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3891
3892         * expression.cs : tiny fix is required for not warning positive ulong.
3893           See test-441.cs.
3894
3895 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3896
3897         * expression.cs : add CS0652 check for constant and integral
3898           expression. Fixed bug #53974.
3899
3900 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3901
3902         * expression.cs : in DoNumericPromotions(), check if there is implicit
3903           conversion overload for string (to check CS0034). Fixed bug #52492.
3904
3905 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3906
3907         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3908
3909 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3910
3911         * ecore.cs : report location when it is *not* Null.
3912
3913 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3914
3915         * codegen.cs,
3916           ecore.cs,
3917           flowanalysis.cs,
3918           expression.cs:
3919           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3920           correctly. Fixed bug #75721.
3921
3922 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3923
3924         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3925         loop that performs 'min (pos, char_count)'.
3926
3927         Fix #75862.
3928         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3929         converted value in Operator.OnesComplement.
3930
3931 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3932
3933         * anonymous.cs: If the anon method is pulled into a helper class,
3934         it needs to be `internal' not `private'. Fixes runtime behavior on
3935         msft. bug #75704
3936
3937 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3938
3939         Fix #75803
3940         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3941         is a partial class.
3942
3943 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3944
3945         The big constants rewrite
3946         Fix #75746, #75685 and more
3947         As a side effect saved 1MB for MWF ;-)
3948         
3949         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3950         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3951         enum based for corlib compilation.
3952         
3953         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3954         subtractions.
3955         
3956         * class.cs (FixedField.Define): Use ResolveAsConstant.
3957         
3958         * const.cs (IConstant): Interface constants and enums.
3959         (Const.ResolveValue): New method for constant resolvning.
3960         (ExternalConstant): Constants from imported assemblies.
3961         
3962         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3963         conversion; like enums.
3964         (Constant.ToType): Converts this constant to different type.
3965         (Constant.Increment): Adds 1.
3966         
3967         * convert.cs (ImplicitConversionRequired): Simplified.
3968         
3969         * cs-parser.jay: Create EnumMember directly.
3970         
3971         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3972         
3973         * doc.cs (GenerateEnumDocComment): Removed.
3974         
3975         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3976         (ConvertIntLiteral): Removed.
3977         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3978         
3979         * enum.cs (EnumMember): Implement IConstant.
3980         (Enum.IsValidEnumConstant): Removed.
3981         (Enum.GetNextDefaultValue): Removed.
3982         (Enum.FindMembers): Updated.
3983         (Enum.GenerateDocComment): Iterate enum members.
3984         
3985         * expression.cs (Cast.TryReduce): Handle enums correctly.
3986         (New.Constantify): Made public.
3987         (MemberAccess.DoResolve): Removed contant specific if(s).
3988         
3989         * literal.cs (NullLiteral): Implement new abstract methods.
3990         
3991         * statement.cs (GotoCase.Resolve): Use new constant methods.
3992         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3993         
3994         * typemanager.cs (LookupEnum): Removed.
3995         (IsEnumType): Fixed to work with corlib.
3996         (RegisterConstant): Removed.
3997         (LookupConstant): Removed.
3998         (GetConstant): Changed to work with IConstant.
3999
4000 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4001
4002         * location.cs : Fixed overflown (>255) column number.
4003
4004 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4005
4006         First cut of the qualified-alias-member feature.
4007         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4008         token.
4009         * cs-parser.jay (DOUBLE_COLON): New token.
4010         (namespace_or_type_name): Add rule for recognizing
4011         qualified-alias-members.
4012         (primary_expression): Likewise.
4013         (element_access): Allow QualifiedAliasMember as a possible
4014         type-bearing expression.
4015         (local_variable_type, local_variable_pointer_type): Likewise.
4016         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4017         aliases in the current and enclosing namespace declarations.
4018         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4019         * decl.cs (MemberName.is_double_colon): New.
4020         (MemberName.MemberName): Add new constructor for alias-member.
4021         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4022         * expression.cs (QualifiedAliasMember): New expression type.
4023
4024 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4025
4026         * location.cs : it borked when no argument was specified.
4027
4028 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4029
4030         * location.cs : tiny ToString() format fix.
4031
4032 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4033
4034         * statement.cs : oops, it was missing.
4035
4036 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4037
4038         A set of fixes for precise line/column location.
4039
4040         * location.cs :
4041           "token" field now holds a file/line "delta", a line number offset 
4042           from the segment, and a column number. See also:
4043           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4044           December/009508.html
4045           Removed static IsNull. Use instance IsNull property instead.
4046         * cs-tokenizer.cs :
4047           For some tokens it stores Location. For Identifier it stores
4048           LocatedToken which is a pair of string name and location.
4049           Column numbers are adjusted only at getChar().
4050         * report.cs :
4051           Use Location.ToString() for reporting (it now contains column).
4052         * cs-parser.jay :
4053           Largely modified to use LocatedToken instead of
4054           string (IDENTIFIER), and to acquire Location from some tokens.
4055         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4056           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4057           codegen.cs :
4058           Now MemberName holds Location. DeclSpace.ctor() receives Location
4059           as a parameter. Removed extra parameters to all derived classes.
4060           Replaced Location.IsNull() with instance property.
4061         * assign.cs, expression.cs :
4062           Added .ctor() overload that omits Location.
4063         * attribute.cs :
4064           Added "nameEscaped" flag that indicates the identifier was escaped
4065           in the source file. This fixes bug #57047.
4066
4067 2005-09-02  Martin Baulig  <martin@ximian.com>
4068
4069         * class.cs: Make CS3005 a warning, not an error.
4070
4071 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4072
4073         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4074         New method, looking for lo-case imported cls type.
4075
4076         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4077         here.
4078
4079         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4080
4081         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4082
4083         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4084         all_imported_types.
4085         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4086
4087         Optimized to save 3.5 MB for SWF compilation.
4088
4089 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4090
4091         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4092         (PartialContainer.Create): Moved logic AddToContainer.
4093         (PartialContainer.MarkForDuplicationCheck): Shares name.
4094         
4095         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4096         place.
4097         
4098         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4099         initialization.
4100         (Namespace.GetSignatureForError): New method.
4101         
4102         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4103         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4104
4105 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4106
4107         Fix #75669.
4108         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4109         member lookup rather than qualifier_type, since qualifier_type can
4110         be null.
4111
4112 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4113
4114         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4115         enum member.
4116
4117 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4118
4119         * statement.cs: Copy the local exception into the exception
4120         captured local.  Fixes 75674
4121
4122 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4123
4124         Fix #75658.
4125         * expression.cs (Invocation.OverloadResolve): Don't report error
4126         CS1501 if error CS1502 has been reported.
4127         (New.DoResolve): Delegate CS1501 reporting to
4128         Invocation.OverloadResolve.
4129
4130         Fix #75656.
4131         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4132         invariant-meaning-in-block property in an enclosing block if
4133         necessary.
4134
4135 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4136
4137         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4138         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4139         (Switch.CheckSwitch): Just save 50kb for SWF.
4140
4141 2005-07-27  Martin Baulig  <martin@ximian.com>
4142
4143         * anonymous.cs (CaptureContext.AddField): Added
4144         `AnonymousContainer am' argument; compute its toplevel scope if
4145         it's not already computed.  Fixes #75649.
4146
4147 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4148
4149         Fix #75628.
4150         * class.cs (Constructor.Emit): Reset block to null if the block
4151         resolve fails.
4152
4153 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4154
4155         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4156
4157 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4158
4159         * class.cs (MethodData.Define): Check whether accessor implementing
4160         interface is public.
4161
4162         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4163
4164 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4165
4166         Fix #57245
4167         * namespace.cs (LookupType): Moved same type check to...
4168         
4169         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4170         with the same name.
4171
4172 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4173
4174         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4175         already found a typebuilder.
4176         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4177         MemberNames, not strings.
4178
4179         * const.cs (Error_ExpressionMustBeConst): 
4180         Rename from Error_EpressionMustBeConst.
4181         * const.cs, class.cs, statement.cd: Update.
4182
4183 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4184
4185         Fix #65573
4186
4187         * const.cs (Const.LookupConstantValue): Report missing contant expression
4188         everytime.
4189         (Error_EpressionMustBeConstant): Only one error method.
4190
4191         * class.cs, statement.c: Updated.
4192
4193 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4194
4195         * statement.cs (Block.Flags): Add back HasVarargs.
4196         (Block.flags): Make protected.
4197         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4198
4199         * typemanager.cs (types, typecontainers, user_types): Remove.
4200         (UserTypes, TypeContainers): Likewise.
4201         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4202         (CleanUp, Reset): Update.
4203         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4204         (GetNestedType): Use Type.GetNestedType.
4205         (CoreLookupType): Take two arguments, the namespace and the
4206         basename of the type.  Update to use the Namespace.Lookup
4207         mechanism.
4208         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4209         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4210         string concatenation and substring matches.
4211         * class.cs, enum.cs, delegate.cs: Update to changes.
4212
4213 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4214
4215         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4216         Expression and made virtual.
4217
4218         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4219         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4220
4221         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4222
4223         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4224         error message.
4225
4226         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4227         change.
4228
4229 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4230
4231         Fix #57707
4232         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4233         AssemblyCultureAttribute is not used on executable.
4234
4235         * rootcontext.cs,
4236         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4237
4238 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4239
4240         Fix #60638.
4241         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4242         New.  Reports CS0252/CS0253.
4243         Mostly taken from preliminary patch by Duncak Mak.
4244         (Binary.DoResolveOperator): Store results of operator lookup.
4245         Use them to detect if we need to warn about unintended reference
4246         comparisons.
4247
4248 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4249
4250         Fix #72969.
4251         * namespace.cs (Namespace.Lookup): Add back location parameter.
4252         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4253         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4254
4255         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4256         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4257         (Namespace.LookupType): ... this.
4258         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4259         of namespaces.
4260         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4261         purported to handle pointers.
4262         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4263         CoreLookupType.
4264
4265 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4266
4267         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4268         type as namespace.
4269
4270 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4271
4272         * namespace.cs (Namespace.Lookup): Drop location parameter.
4273         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4274         (NamespaceEntry.Lookup): ... this.
4275         (NamespaceEntry.Error_AmbiguousTypeReference):
4276         Move here from DeclSpace.
4277         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4278         names ...
4279         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4280         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4281         Move to NamespaceEntry.
4282         * delegate.cs, expression.cs: Update to changes.
4283
4284 2005-08-31  Martin Baulig  <martin@ximian.com>
4285
4286         Committing a patch from Atsushi Enomoto for #75850.
4287
4288         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4289         Prefer a generic enumerator over a non-generic one.
4290
4291 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4292
4293         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4294         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4295
4296 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4297
4298         * driver.cs : reverting default encoding change as well as mcs.
4299
4300 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4301
4302         * driver.cs, support.cs : merged r48826.
4303           Marek Safer wrote:
4304           > could you integrate your mcs changes to gmcs otherwise
4305           > gmcs cannot compile some files.
4306
4307 2005-08-20  Martin Baulig  <martin@ximian.com>
4308
4309         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4310         scope if we don't already have it.
4311
4312         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4313         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4314         fixes #75867.
4315
4316 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4317
4318         * statement.cs: Copy the local exception into the exception
4319         captured local.  Fixes 75674
4320
4321 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4322
4323         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4324         type as namespace.
4325
4326 2005-08-12  Martin Baulig  <martin@ximian.com>
4327
4328         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4329         for nested types here to avoid hitting the cache too early.
4330
4331 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4332
4333         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4334         an error. 
4335
4336 2005-08-03  Martin Baulig  <martin@ximian.com>
4337
4338         Make iterators in generic methods work; see gtest-191.cs.
4339
4340         * generic.cs
4341         (Constraints.Resolve): Protect against being called twice.
4342
4343         * class.cs
4344         (TypeContainer.GetClassBases): Make this `protected virtual'.
4345
4346         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4347         (Iterator.GetClassBases): Override this and compute the base
4348         classes here.
4349         (Iterator.DefineNestedTypes): If we're a generic method, all our
4350         method type parameters become class type parameters on the proxy
4351         class.
4352
4353         * statement.cs
4354         (ToplevelBlock.Parameters): Make this a property, not a field.
4355         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4356
4357 2005-08-03  Martin Baulig  <martin@ximian.com>
4358
4359         * typemanager.cs (TypeManager.IsSubclassOf): Use
4360         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4361         (TypeManager.GetFullName_recursed): Improved.
4362
4363 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4364
4365         Fix #75417
4366         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4367         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4368         invocation_type == mi.DeclaringType, since the first one also checks
4369         other condition used by generic instances.
4370         
4371 2005-07-27  Martin Baulig  <martin@ximian.com>
4372
4373         * anonymous.cs (CaptureContext.AddField): Added
4374         `AnonymousContainer am' argument; compute its toplevel scope if
4375         it's not already computed.  Fixes #75649.
4376
4377 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4378
4379         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4380         CheckAttributeType and refactored.
4381         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4382         ResolveAsTypeTerminal error handling.
4383         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4384         handling.
4385         (GetSignatureForError): Print errors in same way.
4386
4387         * class.cs,
4388         * codegen.cs: Reflect attribute GetSignatureForError change.
4389
4390         * ecore.cs,
4391         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4392
4393         * namespace.cs (UsingEntry): Refactored to make fields private.
4394
4395         * assign.cs,
4396         statement.cs: Error_UnexpectedKind has extra parameter.
4397
4398 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4399
4400         * ecore.cs (IAlias): Remove.
4401         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4402         that implement the interface.
4403         * namespace.cs (Namespace): Likewise.
4404         (Namespace.declspaces): Renamed from 'defined_names'.
4405         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4406         DeclSpace instead of an IAlias.
4407         * tree.cs (Tree.AddDecl): Update.
4408
4409 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4410
4411         * statement.cs (Block.Flags); Remove HasVarargs.
4412         (Block.HasVarargs): Move to ToplevelBlock.
4413         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4414         (Block.Variables): Make protected.  Initialize variable hashtable
4415         if necessary.
4416         (Block.AddVariable): Update.
4417         (Block.Resolve): Update to changes.
4418         (ToplevelBlock.HasVarargs): New boolean.
4419         (ToplevelBlock.ThisVariable): Move here from Block.
4420         (ToplevelBlock.AddThisVariable): Likewise.
4421         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4422         * expression.cs (This.ResolveBase): Update to changes.
4423         (ArglistAccess.DoResolve): Likewise.
4424
4425 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4426
4427         Fix #75321
4428         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4429
4430         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4431         not used and not used & assigned.
4432         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4433
4434 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4435
4436         Fix #75053
4437         * expression.cs (Is.DoResolve): null is never provided type.
4438
4439 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4440
4441         Fix #52496
4442         * cs-parser.jay: Less strict event error rule to catch more errors.
4443
4444 2005-07-11  Martin Baulig  <martin@ximian.com>
4445
4446         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4447         for the constructor constraint: we do not only have to check
4448         whether the class has a public constructor, but also ensure that
4449         it's parameterless.  Fixes #75492.
4450
4451 2005-07-11  Martin Baulig  <martin@ximian.com>
4452
4453         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4454         between type parameters if they either have the reference type
4455         constraint or the class constraint.
4456
4457 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4458
4459         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4460
4461 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4462
4463         Fix #74975
4464         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4465         (ExtractSecurityPermissionSet): Cope with self referencing security
4466         attributes properly.
4467
4468         * driver.cs (SetOutputFile): Made public property OutputFile.
4469
4470 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4471
4472         Fix #75486.
4473         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4474         has_nonstatic_fields.  Make into a FieldBase pointer.
4475         (TypeContainer.AddField): Add CS0282 check.
4476         (TypeContainer.EmitType): Update.
4477
4478 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4479
4480         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4481         compare if they start with __.
4482
4483 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4484
4485         * statement.cs (Switch.SwitchGoverningType): Only look at
4486         UserCasts that don't need implicit standard conversions to one of
4487         the allowed switch types (Fixes test-322.cs).
4488         (LocalInfo.Resolve): Re-enable sanity-test.
4489
4490 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4491
4492         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4493         
4494         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4495         
4496         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4497
4498 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4499
4500         Fix #75472.
4501         * ecore.cs (SimpleName.GetSignatureForError): Add.
4502         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4503         (MemberAccess.GetSignatureForError): Add.
4504
4505 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4506  
4507         The big error and warning messages review.
4508         
4509         * anonymous.cs,
4510         * assign.cs,
4511         * attribute.cs,
4512         * class.cs,
4513         * codegen.cs,
4514         * convert.cs,
4515         * cs-parser.jay,
4516         * cs-tokenizer.cs,
4517         * decl.cs,
4518         * delegate.cs,
4519         * doc.cs,
4520         * driver.cs,
4521         * ecore.cs,
4522         * enum.cs,
4523         * expression.cs,
4524         * flowanalysis.cs,
4525         * iterators.cs,
4526         * literal.cs,
4527         * location.cs,
4528         * modifiers.cs,
4529         * namespace.cs,
4530         * parameter.cs,
4531         * pending.cs,
4532         * report.cs,
4533         * rootcontext.cs,
4534         * statement.cs,
4535         * support.cs,
4536         * tree.cs,
4537         * typemanager.cs: Updated.
4538         
4539         * class.cs: (MethodCore.SetYields): Moved here to share.
4540         (PropertyMethod.Define): Moved iterator setup here.
4541         
4542         * iterators.cs: Add orig_method to have full access to parent
4543         container.
4544
4545 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4546
4547         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4548         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4549         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4550         variable of struct type.
4551         * expression.cs (Unary.ResolveOperator): Update to change.
4552         (Indirection.VerifyFixed): Likewise.
4553         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4554         (ParameterReference.VerifyFixed): Value parameters are fixed.
4555         (This.VerifyFixed): Treat 'this' as a value parameter.
4556         * statement.cs (LocalInfo.IsFixed): Remove.
4557
4558 2005-07-01  Martin Baulig  <martin@ximian.com>
4559
4560         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4561         `ec.EmitThis ()' to get the correct scope.
4562
4563 2005-07-01  Martin Baulig  <martin@ximian.com>
4564
4565         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4566         instance is a ParameterReference; fixes #75299.
4567
4568 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4569
4570         Fix #75412.
4571         * expression.cs (Indexers.map): Remove.
4572         (Indexers.Append): Filter out inaccessible setters and getters.
4573         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4574
4575         Fix #75283.
4576         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4577         Refactored from ...
4578         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4579         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4580         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4581         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4582
4583 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4584
4585         Fix #75322
4586         * class.cs (FieldBase.GetInitializerExpression): One more field
4587         for backup.
4588
4589 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4590
4591         * pending.cs: Do not define a proxy if the base method is virtual,
4592         it will be picked up by the runtime (bug 75270).
4593
4594 2005-07-08  Martin Baulig  <martin@ximian.com>
4595
4596         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4597         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4598
4599 2005-07-07  Martin Baulig  <martin@ximian.com>
4600
4601         * generic.cs (ConstructedType.CheckConstraint): Use
4602         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4603         called recursively; fixes #75329.
4604
4605 2005-07-06  Martin Baulig  <martin@ximian.com>
4606
4607         * generic.cs (TypeManager.InferTypeArguments): Added support for
4608         anonymous methods; fixes #75461.
4609
4610 2005-07-01  Martin Baulig  <martin@ximian.com>
4611
4612         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4613         `ec.EmitThis ()' to get the correct scope.
4614
4615 2005-07-01  Martin Baulig  <martin@ximian.com>
4616
4617         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4618         instance is `This'; fixes #75299.
4619
4620 2005-06-30  Martin Baulig  <martin@ximian.com>
4621
4622         * class.cs (Indexer): Implement IIteratorContainer; added support
4623         for iterators in indexers.
4624
4625         * codegen.cs
4626         (EmitContext.CurrentIterator): Make this a property, not a field.
4627
4628         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4629
4630 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4631
4632         * pending.cs: Do not define a proxy if the base method is virtual,
4633         it will be picked up by the runtime (bug 75270).
4634
4635 2005-06-28  Martin Baulig  <martin@ximian.com>
4636
4637         * cs-parser.jay (interface_method_declaration): Avoid a
4638         reduce/reduce conflict by moving some of the code into a separate
4639         `interface_method_declaration_body' rule; fixes #75368.
4640
4641 2005-06-28  Martin Baulig  <martin@ximian.com>
4642
4643         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4644         array check after the check for TypeBuilder's.
4645
4646 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4647
4648         * convert.cs (FindMostEncompassedType): Add two trivial special
4649         cases (number_of_types == 0 || number_of_types == 1).
4650         (FindMostEncompasingType): Likewise.
4651
4652 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4653
4654         Some cleanups preparing for the fix of #75283.
4655         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4656         error testing.
4657         (EventExpr.InstanceResolve): Likewise.
4658         (EventExpr.DoResolve): Remove redundant checks.
4659
4660 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4661
4662         * class.cs: Small fix.
4663
4664 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4665
4666         Fix #75160.
4667         * class.cs (GetPartialBases): Fix return value check of
4668         part.GetClassBases.
4669
4670 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4671
4672         Ensure that partial classes are registered in their enclosing
4673         namespace.  Initial part of fix of #75160.
4674         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4675         Register declspace with namespace here, not in
4676         DeclSpace.RecordDecl.
4677         * cs-parser.jay: Pass namespace to RecordDecl.
4678         * class.cs (PartialContainer.Create): Likewise.
4679         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4680         called.
4681         * decl.cs (Declspace.RecordDecl): Remove.
4682         * namespace.cs (NamespaceEntry.DefineName): Remove.
4683
4684 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4685
4686         * rootcontext.cs: Reset TargetExt as well.
4687
4688 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4689
4690         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4691         -langversion:ISO-1.
4692
4693 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4694
4695         Fix #75080, cs0119.cs.
4696         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4697         of ...
4698         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4699         allowing ExprClass.Type and ExprClass.Namespace for
4700         ResolveFlags.VariableOrValue.
4701         (Expression.Resolve) [1-argument variant]: Change default resolve
4702         flags based on language version.
4703         (Expression.Error_UnexpectedKind): Use a simple string array
4704         rather than an ArrayList.
4705         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4706         not ExprClass.Type.
4707         (TypeOfVoid.DoResolve): Likewise.
4708         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4709         flags argument -- it always has the same value.
4710
4711 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4712
4713         Fix #75081.
4714         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4715         Use it in the error message.
4716         * assign.cs, expression.cs, statement.cs: Update.
4717
4718 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4719
4720         Fix #75088.
4721         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4722         the "almostMatchedMember" case too.
4723         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4724         that failed the accessibility checks to 'almost_match'.
4725
4726 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4727
4728         * attribute.cs: Use internal MethodBuilder methods to set
4729         ExactSpelling and SetLastError on PInvoke methods, instead
4730         of passing them via charset.  Fixes #75060.
4731
4732 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4733
4734         * parameter.cs (Parameter): Remove TODO comment.
4735         (Parameter.DefineParameter): Remove Location parameter.
4736         (Parameters.LabelParameters): Likewise.
4737         * class.cs (Constructor.Emit): Update to change.
4738         (MethodData.Emit): Likewise.
4739         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4740         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4741
4742 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4743
4744         * parameter.cs,
4745           Removed Parameters.Location and added Parameter.Location instead.
4746           Removed Location parameter from Emit() and GetSignature().
4747         * anonymous.cs,
4748           class.cs,
4749           cs-parser.jay,
4750           delegate.cs,
4751           iterators.cs,
4752           statement.cs :
4753           Modified all related calls.
4754
4755 2005-06-21  Martin Baulig  <martin@ximian.com>
4756
4757         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4758         left-hand side is not a nullable type; fixes #75328.
4759
4760 2005-06-21  Martin Baulig  <martin@ximian.com>
4761
4762         * typemanager.cs
4763         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4764         (TypeManager.GetFullNameSignature): Likewise.
4765
4766         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4767         `source.FullName' and `target.FullName' to check whether there are
4768         two conflicting definitions.
4769
4770 2005-06-21  Martin Baulig  <martin@ximian.com>
4771
4772         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4773         a BoxedCast - also for reference types - to be compatible with csc.
4774
4775 2005-06-21  Martin Baulig  <martin@ximian.com>
4776
4777         * expression.cs (MemberAccess.DoResolve): Add support for nested
4778         types in a generic instance; fixes #75320.
4779
4780 2005-06-20  Martin Baulig  <martin@ximian.com>
4781
4782         * generic.cs (TypeManager.InferType): Also walk the class
4783         hierarchy for generic instances; fixes #75261.
4784
4785 2005-06-17  Martin Baulig  <martin@ximian.com>
4786
4787         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4788         to make things work for corlib.
4789
4790 2005-06-15  Martin Baulig  <martin@ximian.com>
4791
4792         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4793         obsolete `SecurityAction' values.
4794
4795 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4796
4797         * rootcontext.cs: Reset TargetExt as well.
4798         
4799 2005-06-09  Martin Baulig  <martin@ximian.com>
4800
4801         * delegate.cs (Delegate.VerifyMethod): Added
4802         `MethodGroupExpr old_mg' argument; inherit its
4803         `HasTypeParameters'; fix #75085.
4804
4805 2005-06-09  Martin Baulig  <martin@ximian.com>
4806
4807         * expression.cs (Invocation.OverloadResolve): Correctly handle
4808         generic methods for the SetMemberIsUsed(); fix #75064.
4809
4810 2005-06-09  Martin Baulig  <martin@ximian.com>
4811
4812         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4813         fixes #75062.
4814
4815 2005-06-08  Martin Baulig  <martin@ximian.com>
4816
4817         * cs-parser.jay (nullable_type_or_conditional): If we put the
4818         nullable back and our `type' is a `ComposedCast', remove the
4819         nullable from it.  Fixes #75156.
4820
4821         * expression.cs (ComposedCast.RemoveNullable): New public method.
4822
4823 2005-06-08  Martin Baulig  <martin@ximian.com>
4824
4825         The big Iterators rewrite :-)
4826
4827         * iterators.cs: Rewrite this to use the anonymous methods framework.
4828
4829         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4830         before the TypeContainers; see 2test-21.cs.
4831
4832         * class.cs
4833         (TypeContainer.DefineType): Don't create a new EmitContext if we
4834         already have one (this only happens if we're an Iterator).
4835         (TypeContainer.Define): Also call Define() on all our iterators.
4836         (Method.CreateEmitContext): Added support for iterators.
4837
4838         * anonymous.cs
4839         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4840         (AnonymousContainer.CreateMethodHost): Moved here from
4841         AnonymousMethod and made abstract.
4842         (AnonymousContainer.CreateScopeType): New abstract method.
4843         (AnonymousContainer.IsIterator): New public property.
4844         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4845         get the ScopeTypeBuilder rather than manually defining it here. 
4846         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4847         iterators here.
4848
4849         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4850         before RootContext.DefineTypes().
4851
4852         * codegen.cs (EmitContext.RemapToProxy): Removed.
4853         (EmitContext.CurrentAnonymousMethod): Changed type from
4854         AnonymousMethod -> AnonymousContainer.
4855         (EmitContext.ResolveTopBlock): Protect from being called twice.
4856         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4857         (EmitContext.EmitThis): Removed the iterators hacks; use the
4858         anonymous methods framework for that.
4859
4860         * statement.cs
4861         (ToplevelBlock.Container): Make this a property, not a field.
4862         (ToplevelBlock.ReParent): New public method; move the
4863         ToplevelBlock into a new container.
4864         (Foreach.TemporaryVariable): Simplify.
4865
4866 2005-06-05  Martin Baulig  <martin@ximian.com>
4867
4868         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4869         (Block.AddTemporaryVariable): New public method; creates a new
4870         `LocalInfo' for a temporary variable.
4871         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4872         variables here.
4873         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4874         non-iterator variables.
4875
4876 2005-06-05  Martin Baulig  <martin@ximian.com>
4877
4878         * statement.cs (Foreach.TemporaryVariable): Create the
4879         LocalBuilder in the Emit phase and not in Resolve since in some
4880         situations, we don't have an ILGenerator during Resolve; see
4881         2test-19.cs for an example.
4882
4883 2005-06-04  Martin Baulig  <martin@ximian.com>
4884
4885         The big Foreach rewrite - Part II.
4886
4887         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4888         with `PropertyInfo ienumerator_getcurrent'.
4889
4890         * codegen.cs (VariableStorage): Removed.
4891
4892         * statement.cs
4893         (Foreach): Derive from Statement, not ExceptionStatement.
4894         (Foreach.CollectionForeach): New nested class.  Moved all the code
4895         dealing with collection foreach here.
4896         (Foreach.ForeachHelperMethods): Removed.
4897         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4898
4899 2005-05-23  Martin Baulig  <martin@ximian.com>
4900
4901         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4902         don't need to.  Fix #75014.
4903
4904 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4905
4906         Improve user-defined conversion handling.
4907         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4908         applicable operators.
4909         (AddConversionOperators): New.  Helper for GetConversionOperators.
4910         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4911         there is only one most encompassed/encompassing type.
4912         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4913         "applicable operator" handling.
4914         (UserConversion): Move cache here from GetConversionOperators.
4915         Directly cache the chosen operator, rather than the whole
4916         MethodGroup.
4917         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4918         case.  Allow conversion of decimal to sbyte and byte too.
4919         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4920         New static methods.  Used to avoid allocating EmptyExpressions in
4921         convert.cs.
4922
4923 2005-05-24  Duncan Mak  <duncan@novell.com>
4924
4925         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4926         another class, used in Convert.ExplicitNumericConversion.
4927         (CastToDecimal): New class, similar to above, but casts to
4928         System.Decimal, used in Convert.ImplicitNumericConversion and also
4929         in explicit convesion from double/float to decimal.
4930
4931         * convert.cs (ImplicitNumericConversion): Handle implicit
4932         conversions to System.Decimal.
4933         (ExplicitNumericConversion): handle explicit conversions to
4934         System.Decimal.
4935
4936         This fixes #68711.
4937         
4938 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4939
4940         * typemanager.cs: Do not throw an exception in the TypeBuilder
4941         case, we take care of it on the TypeCode.
4942
4943 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4944         
4945         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4946         is back.
4947         
4948         * cs-parser.jay: Catch more lexical errors.
4949         
4950         * report.cs: Add one more Error method.
4951         
4952         * rootcontext.cs,
4953         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4954
4955 2005-05-20  Martin Baulig  <martin@ximian.com>
4956
4957         * class.cs (TypeContainer.CircularDepException): Removed.
4958         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4959         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4960         (CS0146) and interface (CS0529) dependencies here.
4961
4962 2005-05-20  Martin Baulig  <martin@ximian.com>
4963
4964         * expression.cs (New.DoResolve): Move the CS0712 check above the
4965         CS0144 check; otherwise it can never be reached.
4966
4967 2005-05-20  Martin Baulig  <martin@ximian.com>
4968
4969         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4970
4971 2005-05-20  Martin Baulig  <martin@ximian.com>
4972
4973         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4974
4975         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4976
4977 2005-05-19  Martin Baulig  <martin@ximian.com>
4978
4979         * delegate.cs
4980         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4981         to disable error reporting.
4982
4983         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4984         here since we don't want to report an error; see the new test-336.cs.
4985
4986 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4987
4988         * statement.cs (ToplevelBlock.GetParameterReference)
4989         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4990         Move here from class Block.
4991         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4992         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4993
4994 2005-05-18  Martin Baulig  <martin@ximian.com>
4995
4996         Fix #74978.
4997
4998         * flowanalysis.cs
4999         (FlowBranching.Reachability): Add non-static public And() and Or()
5000         methods.
5001         (FlowBranchingSwitch): New class; do the `break_origins' thing
5002         like in FlowBranchingLoop.
5003         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5004         reachability, not just locals and parameters.
5005         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5006         switch; MergeBreakOrigins() now takes care of that.
5007
5008 2005-05-18  Martin Baulig  <martin@ximian.com>
5009
5010         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5011         a loop and may leave it, reset the barrier; fixes #74974.
5012
5013 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5014
5015         Fix test-382.cs.  Emit values of decimal constants.
5016         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5017         Carved out of ...
5018         (TypeContainer.AddField): ... this.
5019         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5020         with initializers to include 'Const's.
5021         (ClassPart.RegisterFieldForInitialization): Forward to
5022         PartialContainer.
5023         * const.cs (Const.Const): Pass initializer to base class.
5024         (Const.Define): In case of decimal constants, register them for
5025         initialization in a static constructor.
5026
5027 2005-05-14  Martin Baulig  <martin@ximian.com>
5028
5029         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5030         do not call ResolveUnreachable() on unreachable statements in
5031         here, see the comment in the source code.
5032
5033 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5034
5035         Fix #74934.
5036         * expression.cs (BinaryResolveOperator): If one of the operands of
5037         an equality comparison is 'null' and the other is a pointer type,
5038         convert the null to a NullPointer.
5039         * convert.cs (ImplicitReferenceConversion): If the expression is a
5040         NullLiteral and the target type is a pointer type, return a
5041         NullPointer instead.
5042         (ImplicitConversionStandard): Likewise.
5043
5044 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5045         
5046         * cs-parser.jay: Set readonly context based on special constructs.
5047         
5048         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5049         readonly variable error handling.
5050         
5051         * rootcontext.cs (EmitCode): Don't verify members when error
5052         occurred.
5053         
5054         * statement.cs (LocalInfo): Add reaodnly context information.
5055         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5056
5057 2005-05-17  Martin Baulig  <martin@ximian.com>
5058
5059         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5060         #70970. 
5061
5062 2005-05-13  Martin Baulig  <martin@ximian.com>
5063
5064         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5065         handle unreachable blocks.
5066
5067 2005-05-13  Martin Baulig  <martin@ximian.com>
5068
5069         * class.cs
5070         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5071         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5072         #74905. 
5073
5074 2005-05-13  Martin Baulig  <martin@ximian.com>
5075
5076         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5077         instance variable, not a local.  Fix #74873.
5078         (Block.ResolveUnreachable): Set it to true here.
5079
5080 2005-05-12  Martin Baulig  <martin@ximian.com>
5081
5082         * cs-parser.jay (property_declaration): Pass the `current_class',
5083         not the `current_container' to Property's .ctor.  Fixes #74912.
5084
5085 2005-05-11  Martin Baulig  <martin@ximian.com>
5086
5087         * typemanager.cs (Closure): Copy this from MCS and merge all the
5088         GMCS-specific changes into it.
5089
5090 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5091
5092         Fix #74920.
5093         * typemanager.cs (unmanaged_enclosing_types): New.
5094         (IsUnmanagedType): Avoid infloops by using
5095         'unmanaged_enclosing_types' to talk with recursive invocations.
5096
5097 2005-05-11  Duncan Mak  <duncan@novell.com>
5098
5099         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5100         continuing to process for 'arg'.
5101         (handle_preprocessing_directive): Check the argument of the #endif
5102         directive and report error CS1025 if there are any trailing
5103         characters.
5104
5105         According to the C# spec, having even whitespace after the #endif
5106         directive is illegal; however, because we call arg.TrimEnd ()
5107         beforehand, we have the same behavior as csc, allowing whitespace
5108         after the directive.
5109
5110         Fixes #74892.
5111
5112 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5113
5114         Fix #74863.
5115         
5116         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5117         (Constructor.GetObsoleteAttribute): Implemented correctly.
5118
5119 2005-05-10  Martin Baulig  <martin@ximian.com>
5120
5121         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5122         resolve the type; fixes #74864.
5123         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5124         in DoResolve(); fixes #74862.
5125
5126 2005-05-10  Martin Baulig  <martin@ximian.com>
5127
5128         * support.cs (ReflectionParameters.ParameterModifier): Use
5129         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5130         and `ParameterAttributes.In'.  Fixes #74884.
5131
5132 2005-05-10  Martin Baulig  <martin@ximian.com>
5133
5134         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5135         the cache if we're just looking for `MemberTypes.NestedType' in a
5136         generic instance.
5137
5138         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5139         constraints if we're still resolving the type tree.
5140         (Expression.MemberLookup): If we're resolving the type tree, only
5141         look for `MemberTypes.NestedType' since we're only interested in
5142         getting types.
5143
5144         * class.cs (TypeContainer.DefineType): Don't resolve the type
5145         parameters here; do this later in ResolveType() after the type
5146         tree has been resolved.
5147         (TypeContainer.ResolveType): New public method; this is called
5148         after the type tree is resolved and before the types are being
5149         populated.  We resolve the generic constraints here.
5150         (TypeContainer.DoDefineMember): Check the constraints on our base
5151         class and interfaces.
5152
5153         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5154         set the `ResolvingTypeTree' flag on the EmitContext.
5155
5156         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5157
5158 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5159
5160         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5161         
5162         * expression.cs (Argument.GetParameterModifier): Turned to property.
5163         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5164         
5165         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5166         its C# equivalent.
5167         
5168 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5169
5170         Fix #74852.
5171         * decl.cs (MemberCache.AddMethods): Register override methods,
5172         rather than non-override methods.
5173         * typemanager.cs (RegisterOverride): New.
5174         (IsOverride): Update.
5175
5176 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5177
5178         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5179
5180 2005-05-06  Martin Baulig  <martin@ximian.com>
5181
5182         * attribute.cs
5183         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5184         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5185
5186 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5187
5188         Fix #73105.
5189         
5190         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5191         recursive declaration.
5192         
5193         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5194         
5195 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5196
5197         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5198         
5199         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5200
5201 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5202
5203         Fix #74797.
5204         * decl.cs (DeclSpace.FamilyAccessible): 
5205         Use TypeManager.IsNestedFamilyAccessible.
5206
5207         Fix reopened #64812.
5208         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5209         internal'.
5210
5211 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5212             Abin Thomas  <projectmonokochi@rediffmail.com>
5213             Anoob V E  <projectmonokochi@rediffmail.com>
5214             Harilal P R  <projectmonokochi@rediffmail.com>
5215
5216         Fix #64812.
5217         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5218         allow access to all static members.
5219
5220 2005-05-04  Martin Baulig  <martin@ximian.com>
5221
5222         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5223
5224 2005-05-04  Martin Baulig  <martin@ximian.com>
5225
5226         Fix #74655.
5227
5228         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5229         section at the end; make things work if `default' is not the last
5230         section.        
5231
5232 2005-05-04  Martin Baulig  <martin@ximian.com>
5233
5234         Fix #70400.
5235
5236         * statement.cs (Switch): Replaced the `got_default' field with a
5237         `default_section' one.
5238         (Switch.CheckSwitch): Set `default_section' here.
5239         (Switch.Resolve): If we're a constant switch and the constant is
5240         not found, use the default section.
5241
5242 2005-05-03  Martin Baulig  <martin@ximian.com>
5243
5244         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5245
5246         * statement.cs (Foreach.ArrayForeach): New nested class.
5247         (Foreach.TemporaryVariable): New nested class.
5248         (Foreach.EmitArrayForeach): Removed; this is now in the new
5249         ArrayForeach class.
5250
5251 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5252
5253         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5254         more conservative.
5255         (VerifyPendingMethods): Revert change below.
5256
5257         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5258         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5259         that used to trigger warning -28.  Remove warning -28.
5260         * expression.cs (Invocation.OverloadResolve): Use
5261         TypeManager.IsOverride to distinguish override methods.
5262
5263         Fix #74773.
5264         * pending.cs (VerifyPendingMethods): If a base type implements the
5265         requested interface, don't bother checking individual methods of
5266         the base type.  As a side-effect, this prevents the creation of
5267         unnecessary proxies.
5268
5269 2005-05-02  Martin Baulig  <martin@ximian.com>
5270
5271         Fix #70182.
5272
5273         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5274         Also `And' the locals if the old vector is null.
5275         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5276         null; in this case we basically reset all the variables.        
5277
5278 2005-05-02  Martin Baulig  <martin@ximian.com>
5279
5280         Fix #74529.
5281
5282         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5283         Added `FlowBranching branching' argument; always `and' the
5284         variables instead of `or'ing them unless we're an infinite loop.
5285
5286         * statement.cs (While.Resolve): Create a new sibling unless we're
5287         infinite.       
5288
5289 2005-05-02  Martin Baulig  <martin@ximian.com>
5290
5291         Fix #70140.
5292
5293         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5294         arguments; use it instead of creating a new TopLevelBlock.
5295         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5296         our ConstructorInitializer.
5297
5298         * statement.cs
5299         (TopLevelBlock.TopLevelBranching): New public property.
5300         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5301         and create our `TopLevelBranching'.
5302
5303         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5304         anonymous method host, use `block.TopLevelBranching' rather than
5305         creating a new branching.
5306
5307 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5308
5309         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5310         a ScopeInfo, if any of the current children is a child of the new
5311         entry, move those children there.
5312
5313 2005-04-30  Martin Baulig  <martin@ximian.com>
5314
5315         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5316         at the beginning of a SwitchSection.  Fix #73335.
5317
5318 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5319
5320         Fix #74378
5321         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5322         
5323         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5324         (FieldExpr.DoResolve): Obsolete members are ignored for field
5325         initializers.
5326         
5327 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5328
5329         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5330         of arrays detection.
5331
5332         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5333         verification.
5334         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5335
5336         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5337         arrays report.
5338
5339 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5340
5341         * cs-parser.jay: Use the prefered version of -unsafe in error
5342         message.
5343
5344 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5345
5346         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5347         circumstances.
5348
5349 2005-04-20  John Luke  <john.luke@gmail.com>
5350
5351         * driver.cs: fix typo in error message, --outout to --output
5352
5353 2005-04-30  Martin Baulig  <martin@ximian.com>
5354
5355         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5356         handle the .NET 2.x security attributes.
5357
5358 2005-04-30  Martin Baulig  <martin@ximian.com>
5359
5360         * typemanager.cs
5361         (TypeManager.ExpandInterfaces): Don't add things twice.
5362
5363         * class.cs
5364         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5365
5366 2005-04-29  Martin Baulig  <martin@ximian.com>
5367
5368         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5369
5370         * anonymous.cs: Added support for anonymous generic methods.
5371
5372 2005-04-29  Martin Baulig  <martin@ximian.com>
5373
5374         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5375         generic instances.
5376
5377 2005-04-29  Martin Baulig  <martin@ximian.com>
5378
5379         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5380
5381         * expression.cs (New.DoResolve): Fix the CS0304 check.
5382
5383 2005-04-29  Martin Baulig  <martin@ximian.com>
5384
5385         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5386         naming schema.
5387
5388         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5389         explicit interface implementation, compare the interface types.
5390         (MethodData.Define): Use the new naming scheme from the latest
5391         .NET 2.x beta2.
5392         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5393
5394         * decl.cs (MemberName.GetMemberName): Removed.
5395         (MemberName.MethodName, FullName): New properties.
5396
5397 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5398
5399         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5400
5401 2005-04-22  Martin Baulig  <martin@ximian.com>
5402
5403         * generic.cs (GenericMethod): Create the EmitContext in the
5404         `Define()'; in `Define(MethodBuilder)', create the type parameters
5405         before calling `Define()'.  Fixes #73933.
5406
5407 2005-04-22  Martin Baulig  <martin@ximian.com>
5408
5409         * generic.cs
5410         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5411         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5412
5413         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5414         ConstructedType, check its constraints.
5415
5416 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5417
5418         * codegen.cs (InRefOutArgumentResolving): New field.
5419         
5420         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5421         fields outside contructor.
5422         
5423         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5424         
5425 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5426
5427         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5428         parameter code was not completed ever, so it was not as up-to-date
5429         as local variables.  Must finish it.
5430
5431         The bug fix was to compare the Toplevel of the block, not the
5432         current block.  Thanks for Ben for pointing this out. 
5433
5434 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5435
5436         * decl.cs (AddMethods): Use the declaring type of the problem
5437         method to determine if we want to squash a warning.
5438
5439 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5440
5441         * attribute.cs: Removed debug output.
5442
5443         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5444         
5445         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5446         Report.Stderr.
5447         
5448 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5449
5450         Fix #74481.
5451         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5452         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5453         all null comparisons against reference types.
5454
5455 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5456
5457         Fix# 74565
5458         * class.cs (TypeContainer.CircularDepException) New nested
5459         exception class.
5460         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5461         (TypeContainer.DefineType): Removed error, reset InTransit before
5462         exit.
5463         (Class.DefineType): Throw exception when is in Transit.
5464         Catch exception and report error.
5465         (Struct.DefineType): Throw exception when is in Transit.
5466         Catch exception and report error.
5467         (Interface.DefineType): Throw exception when is in Transit.
5468         Catch exception and report error.
5469
5470         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5471         handle nested exception handlers.
5472
5473         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5474         a catch.
5475
5476         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5477         InFinally and InCatch storage.
5478
5479         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5480         (Catch.Resolve): Set and Restore ec.InCatch.
5481         (Try.Resolve): Set and Restore ec.InFinally.
5482         (Try.HasCatch): True when try has catch.
5483
5484 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5485
5486         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5487           for the same event member, so exclude such cases from warning 419.
5488           Fixed bug #74633.
5489
5490 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5491
5492         * expression.cs (Binary.ResolveOperator): Apply patch from John
5493         Luke to fix bug 59864: operators &, | and ^ on enumerations
5494         require that the same enum type on both sides.
5495
5496         * driver.cs: Add warnings to old flag usage, this is to assist
5497         people who produce Makefiles and hope that the Makefiles will be
5498         used on Windows.
5499
5500         * class.cs (TypeContainer.EmitType): Moved the definition of the
5501         special $PRIVATE$ field from the resolve phase to the Emit phase.
5502         During resolve we do not know if we are a struct with
5503         HasExplicitLayout, we know this only after the attributes for the
5504         type are emitted.
5505
5506         Set the FieldOffset to zero on the dummy field that we create for
5507         the class.   Fixes 74590.
5508
5509 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5510
5511         Fix #73834.
5512         * ecore.cs (PropertyExpr.resolved): New.
5513         (DoResolve): Use it to handle a case of double resolution here.
5514         Handle a case of identical-name-and-type-name.
5515         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5516         resolution by storing the results of expression resolution back
5517         into the "probes" array.
5518
5519 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5520
5521         Fix cs0208-7.cs and cs0208-8.cs.
5522         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5523         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5524         error reporting to point out the reason a struct is not unmanaged.
5525
5526 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5527
5528         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5529           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5530
5531 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5532
5533         Fix #74528.
5534         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5535         IdenticalNameAndTypeName here.
5536         (EventExpr.InstanceResolve): Likewise.
5537
5538 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5539
5540         C# 2.0 DefaultCharSetAttribute implementation
5541         
5542         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5543         which allows us to set GlobalNamespace for every resolve.
5544         (Attribute.ResolveArguments): Cut from Resolve.
5545         (Attribute.GetCharSetValue): Returns CharSet named argument.
5546         (Attribute.DefinePInvokeMethod): Gets default charset from
5547         module settings.
5548         (GlobalAttribute.ResolveAsTypeStep): Override.
5549         (GlobalAttribute.ResolveArguments): Override.
5550         
5551         * class.cs (TypeAttr): Is protected.
5552         
5553         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5554         (ModuleClass.DefaultCharSetType): New memeber.
5555         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5556         
5557         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5558         charset from module.
5559         
5560         * delegate.cs (TypeAttr): Override.
5561         (Delegate.DefineType): Use this TypeAttr.
5562         
5563         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5564         at very early stage (before types are defined) to resolve model
5565         module attributes. It will probably not work with corlib but it
5566         should be ok.
5567         
5568         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5569         charset from module.
5570         
5571         * typemanager.cs (default_charset_type): New type.
5572
5573 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5574
5575         * decl.cs (MemberCache.AddMethods): Don't warn if
5576         System.Object.Finalize has buggy MethodAttributes.
5577
5578         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5579         removed below.
5580
5581 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5582
5583         * doc.cs : detect ambiguous reference to overloaded members.
5584           Fixed bug #71603. MS 1.1 csc does not detect it.
5585
5586 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5587
5588         * doc.cs : delegates must not be referenced with parameters.
5589           Fixed bug #71605.
5590
5591 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5592
5593         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5594
5595 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5596
5597         * driver.cs (MainDriver): Stop processing if the CLS stage found
5598         errors. 
5599
5600         (CompilerCallableEntryPoint.InvokeCompiler): Always
5601         reset after execution;   Take a TextWriter argument for the
5602         output.
5603
5604         * report.cs: Use the error stream instead of hardcoding stderr. 
5605
5606 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5607
5608         * class.cs: Reduce code paths to test, too small of an
5609         optimization to make it worth the extra testing.  Always perform
5610         it. 
5611
5612 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5613
5614         Fix #74510.
5615         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5616         operators that had errors reported on them.
5617
5618 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5619
5620         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5621         argument types.
5622         (Attribute.Resolve): Add named argument type checking.
5623         
5624         * class.cs (FixedField.Define): Use IsPrimitiveType
5625         
5626         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5627         
5628         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5629         unsafe parameter types.
5630         
5631         * statement.cs (Using.ResolveExpression): Add better error description.
5632         
5633         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5634         
5635 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5636
5637         Fix #74484.
5638         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5639         AttributeUsageAttribute in the emitcontext of the attribute class,
5640         not in the emitcontext of the attributable entity it was attached to.
5641         * cs-parser.jay: Use 'current_class', not 'current_container',
5642         when creating a GlobalAttribute.
5643
5644 2005-04-08  Alp Toker  <alp@atoker.com>
5645
5646         * pending.cs: The fix to #58413 failed to compile methods implementing
5647         interfaces with/without params modifiers and vice versa, even though
5648         params modifiers aren't part of the signature. Make the modifier check
5649         less strict as in csc.
5650
5651 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5652             Anoob V E  <projectmonokochi@rediffmail.com>
5653             Harilal P R  <projectmonokochi@rediffmail.com>
5654
5655         Fix #58413.
5656         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5657         modifiers of pending methods.
5658         (PendingImplementation.PendingImplementation): Initialize it.
5659         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5660         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5661         with ParameterData.  Add check for modifiers.
5662         * class.cs (MethodData.Define): Update to changes.
5663
5664 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5665
5666         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5667
5668 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5669
5670         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5671         property.
5672         
5673         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5674         
5675         * rootcontext.cs,
5676         * typemanager.cs: Registered RequiredAttributeAttribute.
5677         
5678 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5679
5680         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5681         Warning CS0169 is back at level 3.
5682         (IMethodData.SetMemberIsUsed): New method.
5683         
5684         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5685         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5686         
5687         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5688
5689         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5690         contants.
5691         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5692         is used.
5693         
5694         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5695         is used.
5696         
5697         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5698         to avoid the problems with nested types.
5699
5700 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5701             Anoob V.E  <projectmonokochi@rediffmail.com>
5702             Harilal P.R  <projectmonokochi@rediffmail.com>
5703             Raja R Harinath  <rharinath@novell.com>
5704
5705         Fix #73820.
5706         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5707         attribute.
5708         * typemanager (GetConstructor): Make public.
5709
5710 2005-04-05  John Luke  <john.luke@gmail.com>
5711             Raja R Harinath  <rharinath@novell.com>
5712
5713         Fix #62232.
5714         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5715         struct too.  Return false quicker in a few cases.
5716         (VerifyUnManaged): Use it.
5717
5718 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5719
5720         Fix #74041.
5721         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5722         not 'unreachable_seen'.
5723
5724 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5725
5726         * attribute.cs (Attribute.GetValue): Removed unused.
5727         
5728         * codegen.cs (CodeGen.TrimExt): Removed unused.
5729         
5730         * cs-parser.jay (output): Removed unused.
5731         
5732         * cs-tokenizer.cs (hex_digits): Removed unused.
5733         
5734         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5735         
5736         * expression.cs (Indirection.LoadExprValue): Removed unused.
5737         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5738         
5739         * iterators.cs (Iterator.param_types): Removed unused.
5740         
5741         * statement.cs (Goto.block): Removed unused.
5742         (ToplevelBlock.did): Removed unused.
5743         (Switch.ResolveConstantSwitch): Removed unused.
5744
5745 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5746
5747         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5748         resetting thingy.
5749
5750 2005-04-19  Martin Baulig  <martin@ximian.com>
5751
5752         Merged r42462 from MCS and made it work for GMCS.
5753
5754         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5755
5756         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5757
5758 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5759
5760         Fix #74232 and cs0208-3.cs.
5761         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5762         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5763         unmanaged type.  Don't use FieldBuilders when 't' is a
5764         TypeBuilder.  Use ModFlags and MemberType fields.
5765         * class.cs (MemberBase.member_type): Rename from MemberType.
5766         (MemberBase.MemberType): New property.  Determines member_type on
5767         demand.
5768         (MemberBase.DoDefine): Don't initialize MemberType here.
5769         (FieldMember.Define): Likewise.
5770
5771 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5772
5773         Fix #74241
5774         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5775         Attributes are emitted there.
5776         
5777 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5778
5779         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5780         keyword in 'partial enum' too.
5781         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5782         is not allowed).
5783         Report from Kamil Skalski <nazgul@omega.pl>.
5784
5785         Fix #74309.
5786         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5787         have partial containers too.
5788
5789         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5790         in block' checks to Block.CheckInvariantMeaningInBlock.
5791         * statement.cs (Block.GetKnownVariableInfo): Make private.
5792         (Block.IsVariableUsedInChildBlock): Remove.
5793         (Block.IsVariableUsedInBlock): Likewise.
5794         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5795         conflicting declaration.
5796         (Block.AddVariable): Make error messages less long-winded and more
5797         specific.  Show location of conflicting declaration.
5798         * parameter.cs (Parameters.Location): New readonly property.
5799
5800 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5801
5802         Clean up semantics of invoking ResolveMemberAccess.
5803         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5804         can have an instance, ensure that we pass in a non-TypeExpression
5805         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5806         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5807         argument.  Update to changes and simplify.
5808         (FieldExpr.Emitinstance): Remove CS0120 check.
5809         (PropertyExpr.EmitInstance): Likewise.
5810         * expression.cs (Argument.Resolve): Likewise.
5811         (Invocation.DoResolve): Update to changes in semantics of
5812         InstanceExpression.
5813
5814 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5815
5816         Fix #74241
5817         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5818         customization.
5819         
5820         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5821
5822 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5823
5824         Fix difference in behaviour with commandline invocation.
5825         * driver.cs (Driver.Reset): New.
5826         (CompilerCallableEntryPoint): Call it.
5827
5828         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5829         variable" warnings if the boolean expression failed to resolve.
5830
5831 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5832
5833         * attribute.cs: Fix the union of several permissions when some of them
5834         are unrestricted (so the result isn't an unrestricted permission set).
5835         Fix #74036.
5836
5837 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5838
5839         * ecore.cs (MemberExpr): New class.  Convert from interface
5840         IMemberExpr.
5841         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5842         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5843         error checks.
5844         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5845         (MethodGroupExpr.IsExplicitImpl): Remove.
5846         (Expression.GetFieldFromEvent): Remove.
5847         (SimpleName.MemberStaticCheck): Remove.
5848         (SimpleName.DoSimpleNameResolve): Update to changes.
5849         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5850         (MemberAccess.IdenticalNameAndTypeName): Remove.
5851         (MemberAccess.error176): Move to MemberExpr.
5852         (MemberAccess.DoResolve): Update to changes.
5853         (BaseAccess.DoResolve): Likewise.
5854
5855 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5856
5857         C# 2.0 Conditional attribute class implementation
5858         
5859         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5860         Analyzes class whether it has attribute which has ConditionalAttribute
5861         and its condition is not defined.
5862         
5863         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5864         (Class.IsExcluded): New method. Search for at least one defined
5865         condition in ConditionalAttribute of attribute class.
5866
5867 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5868
5869         * ecore.cs (PropertyExpr): Derive from Expression, not
5870         ExpressionStatement.
5871         (PropertyExpr.EmitStatement): Remove.
5872
5873 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5874
5875         Fix #74060.
5876         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5877         internal field "value__" of an enum be private.  The examples for
5878         "value__" that I found on MSDN all used FieldAttributes.Private.
5879
5880         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5881         Don't mention IL method attribute names.
5882
5883         Fix #47991.  Remove a TODO.
5884         * statement.cs (Block.Toplevel): Make into a field.
5885         (Block.Parameters): Move into ToplevelBlock.
5886         (Block.known_variables): Rename from child_variable_names.
5887         (Block.Block): Remove variants that take Parameters.  Initialize
5888         'Toplevel' with the immediately surrounding toplevel block.
5889         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5890         LocalInfo parameter.
5891         (Block.GetKnownVariableInfo): New.
5892         (Block.IsVariableNameUsedInChildBlock): Update.
5893         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5894         the block, even though it may not be in scope.
5895         (Block.AddVariable): Remove Parameters parameter.  Use
5896         Toplevel.Parameters instead.
5897         (Block.AddConstant): Remove Parameters parameter.
5898         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5899         (Block.IsParamaterReference): Likewise.
5900         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5901         (ToplevelBlock.Parameters): New.  Moved from Block.
5902         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5903         initialize Parameters to a non-null value.
5904         * cs-parser.jay: Update to changes.
5905         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5906         simple names that mean different things in the same block.  Use
5907         Block.IsVariableNameUsedInBlock.
5908
5909 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5910
5911         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5912
5913 2005-03-26  Raja R Harinath  <harinath@acm.org>
5914
5915         Fix #73038.
5916         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5917         fails to resolve, ensure that the LHS is still resolved as an
5918         lvalue.
5919
5920 2005-03-25  Raja R Harinath  <harinath@acm.org>
5921
5922         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5923         ec.ContainerType.
5924         (Enum.current_ec): Remove.
5925         (Enum.LookupEnumValue): Remove EmitContext argument.
5926         Just uses the one created during DefineType.
5927         (Enum.FindMembers): Update.
5928         * expression.cs (MemberAccess.DoResolve): Update.
5929
5930 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5931
5932         * assign.cs (Assign.DoResolve): Check for CS1717 when
5933         source and target are same (uses Equals).
5934
5935         * expression.cs (LocalVariableReference, ParameterReference,
5936         This): Implemented Equals, GetHashCode.
5937
5938         * statement.cs (Block.GetParameterReference): Removed useless
5939         local variable.
5940
5941 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5942
5943         Fix cs0128.cs
5944         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5945         blocks before deciding whether the error is cs0136 or cs0128.
5946
5947         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5948         (using_alias_directive, using_namespace_directive): Pass
5949         MemberName, not an expression to Namespace.UsingAlias and
5950         Namespace.Using.
5951         (MakeName): Use the MemberName of the namespace.
5952         * namespace.cs (Namespace.MemberName): New.
5953         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5954         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5955         Likewise.
5956         * decl.cs (MemberName.Name): Make readonly.
5957         (MemberName.FromDotted): New "constructor".
5958         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5959         (MemberCore.Name): Compute from MemberName on demand.
5960         (MemberCore.SetMemberName): Provide a way to change the
5961         MemberName.
5962         (MemberCore.AddToContainer): Don't take a fullname parameter.
5963         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5964         fully qualified name of the container to the member name.
5965         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5966         only if the type is a member of the root container.
5967         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5968         MemberName.Left rather than searching for an embedded ".".
5969         (PartialContainer.CreatePart): Update to changes in RootContext.
5970         (MemberBase.ShortName): Turn into a property.  Use
5971         MemberCore.SetMemberName.
5972         (MemberBase.ExplicitInterfaceName): Remove.
5973         (MemberBase.UpdateMemberName): Remove.
5974         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5975         (PropertyBase.SetMemberName): New override.
5976         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5977         (Tree.GetDecl): New.
5978         (Tree.AllDecls): Rename from Decls.
5979         * attribute.cs, enum.cs, report.cs: Update to changes.
5980         * driver.cs (MainDriver): Use MemberName.FromDotted on
5981         RootContext.MainClass.
5982
5983 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5984
5985         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5986         checks.
5987
5988         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5989
5990 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5991
5992         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5993         property accessor modifiers.
5994
5995         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5996         fixed buffer attribute (CS1716).
5997         (PropertyMethod.HasCustomAccessModifier): When property accessor
5998         has custom modifier.
5999
6000         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6001         modifiers.
6002         (PropertyExpr.DoResolveLValue): Add CS0272.
6003
6004 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6005
6006         * convert.cs: When converting to a pointer, use the proper Conv.U
6007         or Conv.I depending on the source data type.
6008
6009         * cs-tokenizer.cs: Make the size for large decimal constants,
6010         fixes #72957.
6011
6012 2005-03-17  Martin Baulig  <martin@ximian.com>
6013
6014         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6015         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6016
6017 2005-03-17  Martin Baulig  <martin@ximian.com>
6018
6019         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6020         to bool so we can return an error condition.
6021         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6022         returned an error.
6023
6024 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6025
6026         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6027         attributes.
6028
6029 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6030
6031         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6032         Refactor to avoid traversing the list of assemblies, and to avoid
6033         string concatenation.
6034         * typemanager.cs (guid_attr_type): Remove.
6035         (negative_hits, pointers, references): Remove hashes.
6036         (type_hash): New.
6037         (GetConstructedType): New.  Uses type_hash to handle constructed
6038         types (arrays, references, pointers).
6039         (GetReferenceType, GetPointerType): Use it.
6040         (GetNestedType): New.  Uses type_hash to handle nested types of
6041         reflected types.
6042         (LookupType, LookupTypeDirect): Remove.
6043         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6044         'types' hash and LookupTypeReflection directly.
6045         (params_string, params_object): Use GetConstructedType.
6046         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6047         top-level types.
6048         (Namespace.Lookup): Use cached_types.
6049         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6050         provided by old TypeManager.LookupType.
6051         * rootcontext.cs (MakeFQN): Remove.
6052         * decl.cs (DeclSpace.MakeFQN): Likewise.
6053         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6054         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6055         TypeManager.GetConstructedType.
6056         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6057
6058 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6059
6060         * cs-parser.jay: Fix build.
6061
6062 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6063
6064         * class.cs (TypeContainer.CircularDepException) New nested
6065         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6066
6067         * cs-parser.jay: Reports CS1527 for any namespace element.
6068
6069         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6070         Added CS0407.
6071
6072         * expression.cs (ParameterReference.IsAssigned): Changed error to
6073         CS0269.
6074         (Error_WrongNumArguments): Moved CS0245 detection here.
6075
6076         * statement.cs (Return.Resolve): Add CS1622 report.
6077
6078 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6079
6080         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6081
6082 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6083
6084         * attribute.cs expression.cs: Get rid of some allocations.
6085
6086 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6087
6088         * doc.cs : just eliminate the latest change.
6089
6090 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6091
6092         * doc.cs : commented out the latest change. It breaks xml-030.cs
6093
6094 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6095
6096         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6097           fail. So invoke CreateType() in FindDocumentedType().
6098
6099 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6100
6101         * cs-tokenizer.cs : added IsKeyword().
6102         * doc.cs : Detect keyword incorrectly used as identifier.
6103           Allow identifiers prefixed by @.
6104
6105 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6106
6107         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6108         It caused exception in namespace resolving (again!).
6109         
6110         * class.cs (Class.ctor): Removed exit.
6111         (PropertyMethod.ctor): ditto.
6112         
6113         * codegen.cs (Codegen.Reset): Reset static data.
6114         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6115         
6116         * cs-tokenizer.cs (Cleanup): Removed.
6117         
6118         * driver.cs (GetSystemDir): Rewrote to one line command.
6119         It caused problem with unloaded dynamic modules.
6120         (UnixParseOption): Removed Exit.
6121         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6122         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6123         Now can be mcs used as library.
6124         
6125         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6126         empty location.
6127         
6128         * location.cs (Reset): Reset static data.
6129         
6130         * namespace.cs (Reset): Reset static data.
6131         
6132         * report.cs (Report.Reset): Reset static data.
6133         
6134         * rootcontext.cs (RootContext.Reset): Reset static data.
6135         
6136         * tree.cs (RootTypes.ctor): Use Location.Null
6137         
6138         * typemanager.cs (TypeManager.Reset): Reset static data.
6139         (CoreLookupType): Removed Exit.
6140         (TypeHandle.Reset): Reset static data.
6141         
6142 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6143
6144         Fix #73516.
6145         * typemanager.cs (ComputeNamespaces): Import namespaces from
6146         referenced modules too.
6147
6148 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6149
6150         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6151         than '.'.
6152
6153 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6154
6155         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6156         enclosing DeclSpace.  This ensures that a name-lookup populates
6157         more caches and there are fewer 'TypeExpression's.  Carve out
6158         nested type lookup into ...
6159         (LookupNestedTypeInHierarchy): ... this.
6160
6161 2005-04-15  Martin Baulig  <martin@ximian.com>
6162
6163         Merged r41590 from MCS and make it work in the generics land.
6164
6165         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6166         `check' argument.
6167
6168         * class.cs (PartialContainer.UpdateConstraints): Removed.
6169         (PartialContainer.CheckConstraints): Removed.
6170         (PartialContainer.SetParameterInfo): Store the constraints here.
6171         (PartialContainer.DefineTypeParameters): New public method;
6172         resolve the type parameter's constraints here.  Note that the
6173         PartialContainer doesn't have an EmitContext anymore, so we must
6174         do this in the ClassPart.
6175
6176 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6177
6178         Clean up a few partial-class semantics.  
6179         Fixes test-357.cs and cs1618-2.cs.
6180         * cs-parser.jay (struct_declaration): Use 'current_class' as
6181         parent of newly-created struct.  Remove call to Register ().
6182         Use 'pop_current_class' to complete handing the current struct.
6183         (interface_declaration): Likewise.
6184         (class_declaration): Likewise.
6185         (enum_declaration): Use 'current_class' as parent of newly created
6186         enum.
6187         (delegate_declaration): Likewise.
6188         (pop_current_class): New function.  This is used to handle closing
6189         up the 'current_class' and 'current_container', and pointing them
6190         to the enclosing class/container.
6191         (CSharpParser): Initialize 'current_class' too.
6192         * decl.cs (MemberCore): Add check for invariant: a partial
6193         container is not a parsed entity, and thus does not enclose any
6194         parsed members.
6195         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6196         (DeclSpace.BaseTypeExpr): Use it.
6197         (DeclSpace.LookupType): Add check for invariant.
6198         * class.cs (TypeContainer): Add check for invariant: a nested
6199         class should have the same NamespaceEntry as its enclosing class.
6200         (TypeContainer.EmitFieldInitializers): Make virtual.
6201         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6202         MemberCore.
6203         (TypeContainer.Register): Remove.
6204         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6205         null.  Use TypeResolveEmitContext for resolving base types and
6206         interfaces.  Move initialization of Parts.TypeBuilder here from
6207         ...
6208         (TypeContainer.DefineNestedTypes): ... here.
6209         (PartialContainer): Take a Namespace not a NamespaceEntry.
6210         (PartialContainer.Create): Don't use Register.  Call the
6211         appropriate Add... function directly.
6212         (ClassPart): Take both the PartialContainer and the enclosing
6213         class as constructor arguments.
6214         (ClassPart.EmitFieldInitializers): Override.
6215         (ClassPart.PartFindNestedTypes): Remove.
6216         (FieldBase.GetInitializerExpression): Resolve the initializer
6217         expression in the emit context of the enclosing class.
6218         * tree.cs (RootTypes): Remove Register ().
6219         
6220 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6221
6222         * cs-parser.jay: Removed CS0134.
6223         
6224         * driver.cs: Removed CS1901.
6225         
6226         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6227         for predefined types.
6228
6229 2005-03-07  Duncan Mak  <duncan@novell.com>
6230
6231         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6232         well. Fixes bug #73454.
6233
6234 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6235
6236         * cs-tokenizer.cs (xtoken): Add CS1035.
6237         
6238         * class.cs (MethodData.Define): Add CS0683.
6239         (FieldMember.ctor): Add CS0681.
6240
6241 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6242
6243         * ecore.cs (SimpleName.DoResolve): Rename from
6244         SimpleName.DoResolveAllowStatic.
6245         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6246         Pass 'intermediate' flag to MemberStaticCheck.
6247         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6248         of "intermediate" lookups via MemberAccess.
6249         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6250         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6251
6252 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6253
6254         Fix #73394.
6255         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6256         slipped in because of variable names that are identical to a
6257         builtin type's BCL equivalent ('string String;', 'int Int32;').
6258         (PropertyExpr.EmitInstance): Likewise.
6259
6260 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6261
6262         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6263         
6264         * report.cs (warning_ignore_table): Made public.
6265
6266 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6267
6268         Fix #73282.
6269         * class.cs (MethodData.Emit): Pass 'container' to
6270         container.GetObsoleteAttribute instead of 'container.Parent'.
6271
6272 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6273
6274         * cs-parser.jay: Add 1534 error test.
6275
6276         * iterators.cs (Yield.CheckContext): Add error 1629.
6277         (Iterator.ctor): Save unsafe modifier.
6278         (MoveNextMethod.DoEmit): Restore unsafe context.
6279
6280         * namespace.cs (UsingAlias): Better error message.
6281
6282 2005-03-03  Dan Winship  <danw@novell.com>
6283
6284         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6285         the warning message [#73219]
6286
6287 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6288
6289         Fix compile with MCS 1.0.0.0.
6290         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6291         w_restore to not depend on string constant folding.
6292
6293 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6294
6295         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6296         CS0246 check to users who passed 'silent = false'.
6297         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6298         check.
6299         (SimpleName.SimpleNameResolve): Update.
6300         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6301         (MemberAccess.IdenticalNameAndTypeName): Update.
6302         * doc.cs (FindDocumentedTypeNonArray): Update.
6303
6304 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6305
6306         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6307         * parameters.cs (ComputeAndDefineParameters): Remove.
6308         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6309         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6310         Use GetParameterInfo.
6311
6312 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6313
6314         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6315
6316 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6317
6318         Unify DeclSpace.LookupType and DeclSpace.FindType.
6319         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6320         is in charge of defining nested types on demand.
6321         (DeclSpace.LookupType): Use it when the current_type is a
6322         TypeBuilder.  Use LookupTypeDirect for reflected types.
6323         (DeclSpace.FindType): Remove.
6324         (DeclSpace.LookupInterfaceOrClass): Likewise.
6325         (DeclSpace.DefineTypeAndParents): Likewise.
6326         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6327         DeclSpace.LookupType.
6328         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6329         * typemanager.cs (LookupType): Simplify.
6330         (AddUserType): Remove type from negative_hits.
6331         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6332         * class.cs (TypeContainer.FindMembers): Move handling of nested
6333         types ...
6334         (TypeContainer.FindMembers_NestedTypes): ... here.
6335         (TypeContainer.FindNestedType): Implement override.
6336         (ClassPart.FindNestedType): Delegate to PartialContainer.
6337         (ClassPart.PartFindNestedType): Looks up the nested types of the
6338         part alone.
6339
6340 2005-04-14  Martin Baulig  <martin@ximian.com>
6341
6342         * generic.cs (ConstructedType): Moved all the type lookup and
6343         nested class logic into SimpleName.
6344         (ConstructedType.ResolveConstructedType): Our underlying type is
6345         already fully resolved; all the type lookup stuff is in
6346         SimpleName.
6347
6348         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6349         constructed types here instead of in ConstructedType.
6350
6351         * decl.cs (MemberName.GetTypeExpression): Always create a
6352         SimpleName, not a ConstructedType.
6353         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6354
6355 2005-03-02  Martin Baulig  <martin@ximian.com>
6356
6357         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6358         static constructor in static classes.
6359
6360 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6361
6362         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6363         sizeParamIndex is not specified.
6364
6365 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6366
6367         Fix #73117
6368         * report.cs (WarningMessage.IsEnabled): Missing null check.
6369
6370 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6371
6372         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6373         in the fields and not in the properties.
6374
6375 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6376
6377         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6378         fields as well.
6379
6380 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6381
6382         * attribute.cs: Small refactoring (improved robustness).
6383         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6384         (ValidateGuid): Removed.
6385         (Resolve): Removed referenced to above mentioned.
6386         (GetAttributeUsage): Made private and changed to work without
6387         class assistance.
6388         (GetIndexerAttributeValue): Don't crash.
6389         (GetConditionalAttributeValue): Ditto.
6390         (GetClsCompliantAttributeValue): Ditto.
6391         (ExtractSecurityPermissionSet): All attributes exceptions are
6392         error 648.
6393         (GetPropertyValue): New helper.
6394         (GetMethodImplOptions): New method.
6395         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6396         some missing properties.
6397         
6398         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6399         (Method.ApplyAttributeBuilder): Updated.
6400         
6401         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6402         exception.
6403
6404 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6405
6406         Fix #73052.
6407         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6408         non-simple types (array, pointer, reference).
6409
6410 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6411
6412         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6413
6414         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6415         for operators.
6416         (Method.CheckBase): Catch wrong destructor here.
6417         (MethodData.Define): Add errors 550, 668.
6418
6419         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6420
6421         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6422
6423         * pending.cs (VerifyPendingMethods): Add error 551.
6424
6425         * typemanager.cs (CSharpName): Next error report helper.
6426
6427 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6428
6429         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6430         attributes. Removed useless attribute double check.
6431         It saves almost 2MBs for corlib.
6432
6433 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6434
6435         Fix #72924.
6436         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6437         called twice in case of error.
6438
6439 2005-02-23  Chris Toshok  <toshok@ximian.com>
6440
6441         Fix compiler portions of #72827.
6442         * statement.cs (Block.Emit): call Begin/EndScope on the
6443         EmitContext instead of the ILGenerator.
6444
6445         * codegen.cs (EmitContext.BeginScope): new method, call
6446         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6447         we have one.)
6448         (EmitContext.BeginScope): same, but EndScope and CloseScope
6449
6450         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6451         offset and call the superclass's OpenScope(int) with it.
6452         (SymbolWriter.CloseScope): get the current il
6453         offset and call superclass's CloseScope(int) with it.
6454
6455 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6456
6457         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6458         CS1677 for out and ref as well.
6459
6460         * class.cs (Method.Define): Add error CS1599 detection.
6461         
6462         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6463         
6464         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6465         
6466         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6467         
6468         * support.cs.cs (ModifierDesc): New helper method.
6469
6470 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6471             Abin Thomas  <projectmonokochi@rediffmail.com>
6472             Anoob V E  <projectmonokochi@rediffmail.com>
6473             Harilal P R  <projectmonokochi@rediffmail.com>
6474
6475         Fix #57851, #72718.
6476         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6477         MemberLookup (used for error reporting) actually returns a result.
6478         Fix error report number (122, not 112).
6479
6480 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6481             Anoob V E  <projectmonokochi@rediffmail.com>
6482             Harilal P R  <projectmonokochi@rediffmail.com>
6483
6484         Fix #71134.
6485         * pending.cs (PendingImplementation.GetAbstractMethods):
6486         Find NonPublic members too.
6487
6488 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6491         Fixed error 217.
6492         
6493         * class.cs (MethodCore.CheckMethodAgainstBase):
6494         Add error 239 report.
6495
6496 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6497
6498         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6499         
6500         * class.cs (Operator.Define): Add error 217 report.
6501         
6502 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6503
6504         Fix #68955.
6505         * expression.cs (Invocation.IsApplicable): Make public.
6506         (Invocation.IsParamsMethodApplicable): Likewise.
6507         * delegate.cs (Delegate.VerifyApplicability): Don't use
6508         Invocation.VerifyArgumentCompat for parameter applicability
6509         testing.  Use Invocation.IsApplicable and
6510         Invocation.IsParamsMethodApplicable.
6511
6512 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6513
6514         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6515         
6516         * class.cs (Operator.Define): Add error 217 report.
6517         
6518 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6519
6520         * namespace.cs (UsingEntry.Resolve): Undo change below.
6521
6522 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6523
6524         Fix #72756.
6525         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6526         disable the error message when the extended MemberLookup also
6527         fails.
6528         (Expression.MemberLookupFinal): Update.
6529         (SimpleName.DoSimpleNameResolve): Update.
6530         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6531         Don't use MemberLookupFinal.
6532         (New.DoResolve): Update.
6533         (BaseAccess.CommonResolve): Update.
6534
6535 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6536
6537         Fix #72732.
6538         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6539         occured previously, don't resolve again.
6540
6541 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6542
6543         Fix #69949
6544         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6545         argument. Call ResolveAttributeUsage for unresolved.
6546         when types doesn't match ctor arguments.
6547         
6548         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6549         for nested attribute classes.
6550         (Class.attribute_usage): Removed.
6551         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6552         for attribute class.
6553         
6554         * ecore.cs (IsAttribute): Removed.
6555         
6556         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6557         
6558         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6559         now normal types.
6560         (attribute_types): Removed.
6561         (EmitCode): Global attributes are emited as the latest.
6562
6563 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6564
6565         * class.cs (EmitFieldInitializers): Don't emit field initializer
6566         for default values when optimilization is on.
6567         
6568         * constant.cs (Constant.IsDefaultValue): New property.
6569         
6570         * driver.cs: Add /optimize handling.
6571         
6572         * constant.cs,
6573         * ecore.cs,
6574         * literal.cs: Implement new IsDefaultValue property.
6575         
6576         * rootcontext.cs (Optimize): New field, holds /optimize option.
6577
6578 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6579
6580         Fix crasher in re-opened #72347.
6581         * namespace.cs (Namespace.Lookup): Return null if
6582         DeclSpace.DefineType returns null.
6583
6584         Fix #72678.
6585         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6586
6587 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6588
6589         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6590         now returns null if it cannot resolve to an lvalue.
6591         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6592         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6593         returned null.  Remove check for SimpleName.
6594         (EventExpr.DoResolveLValue): New.
6595         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6596         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6597         error from ...
6598         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6599         avoid CS0131 error.
6600         (Unary.ResolveOperator): Move CS0211 check ...
6601         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6602         CS0131 error.
6603         (Unary.DoResolveLValue): Simplify.
6604         (AddressOf.DoResolveLValue): New.
6605         (ArrayAccess.DoResolveLValue): New.
6606
6607 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6608
6609         * attribute.cs (Attribute.Resolve): Add arguments casting for
6610         when types doesn't match ctor arguments.
6611
6612 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6613
6614         Fix parts of #63202.
6615         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6616         lookup of operator in base type.  Ensure that all checks happen
6617         when the operator resolves to an "op_..." method.
6618
6619 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6620
6621         Fix #71992.
6622         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6623         'ignore_cs0104' parameter.  Pass it to ...
6624         (NamespaceEntry.Lookup): ... this.
6625         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6626         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6627         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6628         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6629         Update.  Request that cs0104 errors be ignored.
6630         (ComposedCast.ResolveAsTypeStep): Update.
6631
6632 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6633
6634         Fix #59209.
6635         * expression.cs (Invocation.BetterFunction): Remove support for
6636         comparing virtual functions and their overrides.
6637         (Invocation.IsOverride): New.
6638         (Invocation.OverloadResolve): Don't consider 'override' functions
6639         during candidate selection.  Store them in a lookaside list.
6640         If the selected method is a 'virtual' function, use the list to
6641         find any overrides that are closer to the LHS type.
6642
6643 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * expression.cs (New.DoResolve): Add complex core type reduction.
6646         (New.Constantify): Converts complex core type syntax like 'new int ()'
6647         to simple constant.
6648         
6649 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6650
6651         * decl.cs (EntryType.EntryType): New constructor to create an
6652         updated copy of a cache entry.
6653         (MemberCache.AddMethods): Use it.
6654         (MemberCache.ClearDeclaredOnly): Remove.
6655         (MemberCache.MemberCache): Update.
6656
6657 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6658
6659         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6660         variable.  This one is represents the actual low-level declaration
6661         of the method, as opposed to the semantic level `IsStatic'.   
6662
6663         An anonymous method which is hosted into a static method might be
6664         actually an instance method.  IsStatic would reflect the
6665         container, while MethodIsStatic represents the actual code
6666         generated.
6667
6668         * expression.cs (ParameterReference): Use the new MethodIsStatic
6669         instead of IsStatic.
6670
6671         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6672         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6673         set on the current EmitContext. 
6674
6675         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6676         resolve our casted expression as an LValue.  This triggers the
6677         proper LValue processing that is later required by Assign.
6678
6679         This fixes 72347.
6680
6681         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6682
6683 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6684
6685         C# 2.0 Fixed buffer implementation
6686
6687         * anonymous.cs: Update after RegisterHelperClass renaming.
6688
6689         * attribute.cs (AttributeTester.fixed_buffer_cache):
6690         Cache of external fixed buffers.
6691         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6692         implementation if field is fixed buffer else null.
6693
6694         * class.cs
6695         (TypeContainer.AddField): Accept FieldMember instead of Field.
6696         (FieldBase.IsFieldClsCompliant): Extracted code from
6697         VerifyClsCompliance descendant customization.
6698         (FixedField): New class handles fixed buffer fields.
6699         (FixedFieldExternal): Keeps information about imported fixed
6700         buffer.
6701         (IFixedField): Make access to internal or external fixed buffer
6702         same.
6703
6704         * cs-parser.jay: Add fixed buffer parsing.
6705
6706         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6707         buffer.
6708
6709         * expression.cs (Indirection): Extended implementation to accept
6710         fixed buffer field.
6711         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6712         (ElementAccess.MakePointerAccess): Get type as parameter.
6713         (DoResolve): Add fixed buffer field expression conversion.
6714         (DoResolveLValue): Ditto.
6715         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6716         (ArrayPtr): Derives from FixedBufferPtr.
6717         (ArrayPtr.Emit): Add extra emit for array elements.
6718
6719         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6720
6721         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6722         for compiler generated types.
6723         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6724
6725         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6726         and consume less memory.
6727         (Fixed.Resolve): Add fixed buffer case.
6728
6729         * typemanager.cs (compiler_generated_attr_ctor,
6730         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6731         (HasElementType): Add our own implementation to work on every
6732         runtime.
6733
6734 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6735
6736         * anonymous.cs (CaptureContext): Track whether `this' has been
6737         referenced.   
6738
6739         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6740         only captured `this' if it was implicitly done (instance
6741         methods/variables were used). 
6742
6743         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6744         `this' must be captured.
6745
6746 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6747  
6748         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6749         is null it means that there has been no need to capture anything,
6750         so we just create a sibling.
6751
6752         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6753
6754         Just a partial fix.  The other half is fairly elusive.
6755         
6756 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6757
6758         Fix #52586, cs0121-4.cs.
6759         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6760         and return a hashtable.
6761         (MemberCache.ClearDeclaredOnly): New.
6762         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6763         the method_hash of a base type too.
6764         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6765         type methods.  Overwrite entries with the same MethodHandle so
6766         that the ReflectedType is correct.  The process leaves in base
6767         virtual functions and their overrides as distinct entries.
6768         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6769         matters since it was boxed in a ArrayList before.
6770         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6771         modifier.
6772         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6773         case of a virtual function and its override (choose the overload
6774         as better).
6775         (Invocation.OverloadResolve): Avoid 'override' members during
6776         'applicable_type' calculation.
6777
6778 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6779
6780         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6781         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6782         GetTypeHandle.  It is possible for a reflected type to derive from
6783         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6784         System.Array during mscorlib compilation).
6785         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6786         contain a method_hash, don't create one either.  Don't create a
6787         deep copy of the base cache's method_hash.
6788         (MemberCache.SetupCache): Rename back from DeepCopy.
6789         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6790         already initialized.  If we see an override function, add its
6791         underlying base virtual function to the member_hash too.
6792
6793 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6794
6795         Combine two near-redundant caches.
6796         * typemanager.cs (method_params): Rename from method_internal_params.
6797         (TypeManager.GetParameterData): New.  Replace
6798         Invocation.GetParameterData.
6799         (TypeManager.LookupParametersByBuilder): Remove.
6800         * expression.cs (Invocation.method_parameter_cache): Remove.
6801         (Invocation.GetParameterData): Remove.
6802         Update to changes.
6803         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6804         Update to changes.
6805
6806 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6807
6808         Fix #72015.
6809         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6810         TypeManager.multicast_delegate_type is null, resolve it by looking
6811         up "System.MulticastDelegate".
6812         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6813
6814 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6815             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6816             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6817
6818         Fix cs0164.cs.
6819         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6820         (LabeledStatement.AddReference): New.  Set 'referenced'.
6821         (Goto.Resolve): Use it.
6822
6823 2005-02-05  John Luke  <john.luke@gmail.com>
6824
6825         * driver.cs: remove duplicate -doc line in Usage ()
6826
6827 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6828
6829         * location.cs (Location.AddFile): Fix CS2002 error report.
6830
6831 2005-02-02  Martin Baulig  <martin@ximian.com>
6832
6833         * delegate.cs (Delegate.DefineType): Report an internal error if
6834         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6835         details.        
6836
6837 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6838
6839         Fix a crasher in a variant of #31984.
6840         * const.cs (Constant.CheckBase): New override that defers the
6841         new-or-override check in case the base type hasn't been populated
6842         yet.
6843         (Constant.Define): Ensure the new-or-override check is performed.
6844
6845 2005-02-01  Duncan Mak  <duncan@ximian.com>
6846
6847         * const.cs (LookupConstantValue): Check that `ce' is not null
6848         before calling GetValue ().
6849
6850 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6851
6852         Fix test-334.cs (#69519).
6853         * cs-parser.jay (using_alias_directive): Pass in an expression to
6854         NamespaceEntry.UsingAlias.
6855         (using_namespace_directive): Pass in an expression to
6856         NamespaceEntry.Using.
6857         (namespace_name): Don't flatten to a string.
6858         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6859         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6860         ResolveAsTypeStep.
6861         (NamespaceEntry.UsingEntry): Likewise.
6862         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6863         changes.
6864         (NamespaceEntry.LookupForUsing): Remove.
6865         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6866         names.
6867         (NamespaceEntry.Lookup): Remove support for dotted names.
6868
6869 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6870
6871         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6872         split into two.
6873         (NamespaceEntry.ImplicitParent): Compute on demand.
6874         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6875         parallels the current.
6876         (NamespaceEntry.LookupForUsing): Use it.
6877         (NamespaceEntry.Lookup): If the current namespace-entry is
6878         implicit, don't search aliases and using tables.
6879
6880 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6881
6882         Fix #31984.
6883         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6884         BaseCache here.
6885         (TypeContainer.BaseCache): Compute on demand.
6886         (TypeContainer.FindMembers): Define constants and types if they're
6887         not already created.
6888         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6889         check.
6890         * const.cs (Constant.Define): Make idempotent.
6891
6892 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6893
6894         * pending.cs: Produce better code (no nops produced by using Ldarg
6895         + value).
6896         
6897         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6898         i - 1' it should be arg + 1.
6899
6900         Fixes bug #71819.
6901
6902 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6903
6904         * attribute.cs (Attribute.CheckAttributeType): Make private
6905         non-virtual.
6906         (Attribute.ResolveType): Make virtual.
6907         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6908         handling of RootContext.Tree.Types.
6909
6910 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6911
6912         Update attribute-handling to use the SimpleName/MemberAccess
6913         mechanisms.
6914         * cs-parser.jay (attribute): Pass in an expression to the
6915         constructors of Attribute and GlobalAttribute.
6916         * attribute.cs (Attribute): Take an expression for the name.
6917         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6918         passed in attribute name expression.
6919         (Attribute.CheckAttributeType): Use it.
6920         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6921         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6922         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6923         argument to prevent error messages if the lookup fails.
6924
6925 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6926
6927         * expression.cs (Indirection): Implemented IVariable interface
6928         to support indirection in AddressOf operator.
6929         (PointerArithmetic.Emit): Add optimalization for case where
6930         result can be precomputed.
6931
6932 2005-01-26  Martin Baulig  <martin@ximian.com>
6933
6934         * class.cs (TypeContainer.AttributeTargets): Return the correct
6935         AttributeTargets depending on our `Kind' instead of throwing an
6936         exception; fixes #71632.
6937
6938 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6939
6940         Fix #71257
6941         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6942         constant members.
6943
6944 2005-03-17  Martin Baulig  <martin@ximian.com>
6945
6946         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6947         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6948
6949 2005-03-17  Martin Baulig  <martin@ximian.com>
6950
6951         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6952         to bool so we can return an error condition.
6953         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6954         returned an error.
6955
6956 2005-03-17  Martin Baulig  <martin@ximian.com>
6957
6958         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6959
6960         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6961         converting from an array-type of T to `IEnumerable<T>'.
6962
6963 2005-03-16  Martin Baulig  <martin@ximian.com>
6964
6965         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6966         (Nullable.LiftedUnaryMutator): New public class.
6967
6968         * expression.cs (UnaryMutator.DoResolve): Added support for
6969         Nullable Types.
6970
6971 2005-03-14  Martin Baulig  <martin@ximian.com>
6972
6973         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6974
6975 2005-03-14  Martin Baulig  <martin@ximian.com>
6976
6977         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6978         the comparision operators `<', `>', `<=' and `>='.
6979
6980 2005-03-13  Martin Baulig  <martin@ximian.com>
6981
6982         * generic.cs
6983         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6984         avoid confusion with the `NullLiteral'.
6985         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6986
6987 2005-03-13  Martin Baulig  <martin@ximian.com>
6988
6989         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6990         comparing arbitrary types with the null literal.
6991
6992 2005-03-13  Martin Baulig  <martin@ximian.com>
6993
6994         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6995         boolean operators '&&', '||', '&' and '|'.
6996         (Nullable.OperatorTrueOrFalse): New public class.
6997
6998         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6999         instead of a `StaticCallExpr'; added support for nullables.
7000
7001 2005-03-10  Martin Baulig  <martin@ximian.com>
7002
7003         * expression.cs
7004         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7005         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7006
7007 2005-03-07  Martin Baulig  <martin@ximian.com>
7008
7009         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7010         it work if `expr' is not an IMemoryLocation.
7011         (Nullable.Lifted): Implement IMemoryLocation.
7012         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7013         target type.
7014
7015 2005-03-05  Martin Baulig  <martin@ximian.com>
7016
7017         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7018         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7019         (Nullable): Added support for lifted unary and binary operators.
7020
7021         * expression.cs (Unary.DoResolve): Added support for nullable types.
7022         (Binary.DoResolve): Likewise.
7023         (Conditional.DoResolve): Likewise.
7024
7025 2005-03-02  Martin Baulig  <martin@ximian.com>
7026
7027         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7028
7029         * class.cs (ClassPart.SetParameterInfo): Override this.
7030         (PartialContainer.SetParameterInfo): Override this.
7031         (TypeContainer.CheckConstraints): New protected method.
7032         (PartialContainer.CheckConstraints): Override this and check
7033         whether the same contraints were specified in all parts of a
7034         partial generic type definition.
7035         (PartialContainer.UpdateConstraints): New public method.
7036
7037         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7038
7039 2005-03-02  Martin Baulig  <martin@ximian.com>
7040
7041         Committing a patch from Carlos Alberto Cortez to fix #72887.
7042
7043         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7044         casts from `T []' to `int []'.
7045
7046 2005-03-02  Martin Baulig  <martin@ximian.com>
7047
7048         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7049
7050         * expression.cs (Binary.ResolveOperator): When resolving a
7051         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7052         `=='.  Fixes #71866.  See gen-127.cs.
7053
7054 2005-03-02  Martin Baulig  <martin@ximian.com>
7055
7056         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7057         static constructor in static classes.
7058
7059 2005-03-02  Martin Baulig  <martin@ximian.com>
7060
7061         * generic.cs
7062         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7063         (Nullable.LiftedConversion): Added support for user-defined
7064         conversions.
7065
7066         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7067
7068         * cs-parser.jay: Use ComposedCast everywhere instead of
7069         NullableType, so we don't need to check for NullableType
7070         everywhere.
7071         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7072         case where we'll be resolved into a `parenthesized_expression_0'
7073         afterwards.
7074
7075         * convert.cs
7076         (Convert.UserDefinedConversion): Added nullable conversions.
7077
7078 2005-02-28  Martin Baulig  <martin@ximian.com>
7079
7080         * generic.cs (TypeManager.IsNullableType): New static method.
7081         (Nullable): New abstract class.
7082         (Nullable.NullLiteral): New public class.
7083         (Nullable.LiftedConversion): New public class.
7084
7085         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7086         `builtin_types opt_nullable'.
7087
7088         * convert.cs
7089         (Convert.ImplicitConversionStandard): Added nullable conversions.
7090         (Convert.ExplicitConversionStandard): Likewise.
7091         (Convert.ExplicitConversion): Likewise.
7092
7093 2005-02-26  Martin Baulig  <martin@ximian.com>
7094
7095         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7096         begin with a "?", for instance "?[]".  Don't do a type lookup if
7097         `dim' is empty.
7098
7099 2005-02-25  Martin Baulig  <martin@ximian.com>
7100
7101         The first part of Nullable Types :-)
7102
7103         * generic.cs (NullableType): New public class.
7104         (NullCoalescingOperator): New public class.
7105         (TypeArguments.Resolve): Add a CS0306 check.
7106
7107         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7108         (opt_nullable): New rule.
7109         (type): Added `opt_nullable' to `namespace_or_type_name',
7110         `builtin_types' and `pointer_type'.
7111         (array_type): Added `opt_nullable'.
7112         (opt_rank_specifier_or_nullable): New rule; this is the
7113         combination of `opt_rank_specifier' and `opt_nullable'.
7114         (opt_error): New rule; catch errors here.
7115         (nullable_type_or_conditional): New rule; we use this to check for
7116         nullable and still detect the conditional operator.
7117         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7118         instead `opt_rank_specifier'.
7119
7120         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7121         for nullables.
7122
7123 2005-02-24  Martin Baulig  <martin@ximian.com>
7124
7125         * README, README.Changes: Removed; they're old and obsolete.
7126
7127 2005-02-22  Martin Baulig  <martin@ximian.com>
7128
7129         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7130         returned an error, set `constraints' to null to avoid a crash
7131         later on.
7132         (TypeParameter.ResolveType): Likewise.
7133
7134 2005-02-22  Martin Baulig  <martin@ximian.com>
7135
7136         * generic.cs
7137         (Constraints.ResolveTypes): Protect against being called twice.
7138         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7139         (TypeParameter.ResolveType): New public method; calls
7140         constraints.ResolveTypes().
7141         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7142         into the new ResolveType().
7143         (GenericMethod.Define): Call ResolveType() on all our
7144         TypeParameter's.        
7145
7146 2005-02-21  Martin Baulig  <martin@ximian.com>
7147
7148         * generic.cs
7149         (TypeManager.generic_nullable_type): New static public field.
7150         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7151
7152         * rootcontext.cs
7153         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7154
7155 2005-02-15  Martin Baulig  <martin@ximian.com>
7156
7157         * generic.cs (ConstructedType.Constraints): Correctly check
7158         constraints if the argument type is a type parameter; fixes
7159         #72326. 
7160
7161 2005-02-02  Martin Baulig  <martin@ximian.com>
7162
7163         * delegate.cs (Delegate.DefineType): Report an internal error if
7164         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7165         details.        
7166
7167 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7168
7169         * pending.cs: Produce better code (no nops produced by using Ldarg
7170         + value).
7171         
7172         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7173         i - 1' it should be arg + 1.
7174
7175         Fixes bug #71819.
7176         
7177 2005-01-26  Martin Baulig  <martin@ximian.com>
7178
7179         * cs-parser.jay (indexer_declarator): Don't report an error if we
7180         have type parameters since we can be an explicit interface
7181         implementation; fixes #71449.
7182
7183 2005-01-26  Martin Baulig  <martin@ximian.com>
7184
7185         * class.cs (TypeContainer.AttributeTargets): Return the correct
7186         AttributeTargets depending on our `Kind' instead of throwing an
7187         exception; fixes #71632.
7188
7189 2005-01-26  Martin Baulig  <martin@ximian.com>
7190
7191         * delegate.cs (Delegate.DefineType): Correctly define our type
7192         parameters.  Fixes #71483.
7193
7194 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7195
7196         Fix #71602.
7197         * expression.cs (MemberAccess.DoResolve): Don't complain with
7198         cs0572 when the LHS of a member access has identical name and type
7199         name.
7200
7201 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7202
7203         Fix #71651, #71675
7204         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7205         CreatePermission.
7206         Create custom PermissionSet only for PermissionSetAttribute.
7207
7208 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7209
7210         Fix #71649
7211         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7212         delegates in static class.
7213
7214 2005-01-24  Martin Baulig  <martin@ximian.com>
7215
7216         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7217         merging an implicit block, just use its reachability.
7218
7219         * statement.cs (Block.Resolve): Make the unreachable code check
7220         work wrt. implicit blocks; see test-337 from #63842.
7221
7222 2005-01-21  Alp Toker  <alp@atoker.com>
7223  
7224         * cs-parser.jay: destructor_declaration's container is PartialContainer
7225         not Class when partial types are used, so use Kind prop instead of
7226         'is'.
7227         
7228 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7229
7230         * cs-parser.jay: Improve error reporting when an interface
7231         declares new types.
7232
7233 2005-01-20  Dick Porter  <dick@ximian.com>
7234
7235         * support.cs: SeekableStreamReader fix from Sandor Dobos
7236         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7237         chars are read.  Fixes bug 70369.
7238
7239 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7240
7241         * cs-parser.jay (catch_clause): Simplify current_block handling
7242         somewhat.
7243
7244 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7245
7246         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7247         code with ImplicitStandardConversion to handle the implicit
7248         conversion of method groups into valid delegate invocations. 
7249
7250         The problem is that in parameter handling we were using this code
7251         path.  Fixes bug #64698
7252
7253 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7254
7255         * cs-parser.jay: Fix several infelicities.
7256         - Avoid assigning to the parser value stack.  Code like 
7257           '$3 = null' is unclean.  Synthesize a value for the code block
7258           instead. 
7259         - Avoid using oob_stack for storing location information.  Use ...
7260         (_mark_): ... this.  New (empty) rule.  Saves the current location
7261         in $$.
7262         (foreach_statement): Avoid using oob_stack for current_block
7263         handling.  Use technique used in for_statement and
7264         using_statement.  Synthesize a value for the code block to store
7265         additional intermediate information.
7266
7267 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7268
7269         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7270         of a different type is only allowed to private fields of a
7271         containing type, not on fields of a base class.
7272
7273         See test-174.cs and error cs0122-9.cs
7274
7275 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7276
7277         Fix test-335.cs (bug #58126).
7278         * cs-parser.jay (argument): Split out non-expression parts of the
7279         rule into 'non_simple_argument'.
7280         (invocation_expression): Support parenthesized invocations with
7281         multiple arguments, and with single non-simple arguments.
7282
7283 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7284
7285         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7286         places.
7287
7288 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7289
7290         Fix cs0038-1.cs, cs1640-6.cs.
7291         * ecore.cs (Expression.Resolve): Remove special-case for
7292         SimpleName in error-handling.
7293         (Expression.almostMatchedMembers): Relax access permission to
7294         protected.
7295         (Expression.MemberLookupFailed): Handle duplicates in
7296         almostMatchedMembers list.
7297         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7298         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7299         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7300         overload if the passed in MemberInfo is a MethodBase.
7301
7302 2005-01-25  Martin Baulig  <martin@ximian.com>
7303
7304         * doc.cs
7305         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7306
7307 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7308
7309         Fix #70749
7310         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7311         for non-CAS & merge permission sets properly.
7312
7313 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7314
7315         Improve standard-compliance of simple name and member access 
7316         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7317         * ecore.cs (FullNamedExpression): New abstract base class 
7318         for Namespaces and TypeExpressions.
7319         (ResolveFlags.SimpleName): Remove.
7320         (SimpleName): Remove support for dotted names.
7321         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7322         DeclSpace.FindType and DeclSpace.LookupType.
7323         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7324         (Expression.ExprClassName): Make member function.
7325         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7326         a namespace.  Remove creation of dotted "SimpleName"s.
7327         (MemberAccess.DoResolve): Likewise.
7328         * decl.cs (DeclSpace.Cache): Make private.
7329         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7330         (DeclSpace.FindType): Update.
7331         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7332         FullNamedExpression.
7333         * namespace.cs (Namespace): Derive from FullNamedExpression
7334         so that it can be part of expression resolution.
7335         (Namespace.Lookup): Return an FullNamedExpression.
7336         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7337         namespace.
7338         * rootcontext.cs (NamespaceLookup): Remove.
7339         (LookupType): Move to DeclSpace.
7340         * attribute.cs (CheckAttributeType): Update.
7341         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7342         (FindDocumentedTypeNonArray): Likewise.
7343
7344 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7345
7346         Fix cs0509.cs, cs1632.cs.
7347         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7348         is the same as IsInterface.
7349         (TypeContainer.GetClassBases): Likewise.
7350         * statement.cs (LabeledStatement.ig): New field.
7351         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7352         label.
7353         (LabeledStatement.DoEmit): Check that the label was created with
7354         the same ILGenerator.
7355
7356 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7357
7358         Fix #71058
7359         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7360         accessors to its properties.
7361
7362         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7363         from accessors to property.
7364         
7365 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7366
7367         Fix #70722
7368         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7369         only for overrides.
7370         
7371 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7372
7373         * attribute.cs: Check for null and empty strings.  
7374
7375         I have lost another battle to Paolo.
7376
7377 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7378
7379         Fix #70942
7380         * class.cs (PropertyMethod): Set Parent field in ctors.
7381         (SetMethod.InternalParameters): Add unsafe switch hack.
7382         Override MarkForDuplicationCheck where it is appropriate.
7383
7384         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7385         It says whether container allows members with the same name.
7386         Base default is no.
7387         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7388         Removed is_method parameter.
7389
7390 2005-01-06  Duncan Mak  <duncan@ximian.com>
7391
7392         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7393         because the previous change led to incorrect reporting of CS1032
7394         ("Cannot define/undefine preprocessor symbols after first token in
7395         file"). Instead of using `tokens_seen' as the only flag that
7396         triggers CS1040, introduce `comments_seen'. This new flag is used
7397         to signify having seen comments on the current line, so it is
7398         unset after a newline.
7399
7400 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7401
7402         * doc.cs : When searching for a type, find nested type too.
7403           This fixes bug #71040.
7404
7405 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7406
7407         * doc.cs :
7408           - Warn missing member comment on those classes which also does not
7409             have doc comments. Fixed bug #71041.
7410           - Don't warn missing doc comment on default constructor.
7411             Fixed bug #71042.
7412
7413 2005-01-06  Duncan Mak  <duncan@ximian.com>
7414
7415         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7416         comments, set `tokens_seen' to true. This allows us to detect
7417         misplaced preprocessor directives (i.e. not at the beginning of
7418         the a line, nor after whitespaces). In that case, report error
7419         CS1040. This fixes bug #56460.
7420
7421         * cs-parser.jay (interface_member_declaration): Add checks for
7422         IsExplicitImpl, and report CS0541 error if an interface member is
7423         defined as an explicit interface declaration.
7424
7425 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7426
7427         Fix #70817
7428         * class.cs (PropertyMethod): Set Parent field in ctors.
7429         (SetMethod.InternalParameters): Add unsafe switch hack.
7430         
7431         * decl.cs (MemberCore.Parent): Cannot be readonly.
7432
7433 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7434
7435         * decl.cs (DeclSpace.ResolveType): Remove.
7436         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7437         Merge in code from ...
7438         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7439         * class.cs, enum.cs: Update to changes.
7440
7441 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7442
7443         * anonymous.cs: Ensure that we init the scope of our parent if it
7444         has not been initialized yet.
7445
7446 2004-12-30  Duncan Mak  <duncan@ximian.com>
7447
7448         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7449         if field.FieldBuilder is null. Fixes #70758.
7450
7451         * convert.cs: Fixed some typos and updated some of the comments.
7452         (ImplicitStandardConversionExists):
7453         (TryImplicitIntConversion): If `target_type' is an interface and
7454         the type of `ic' implements this interface, return true or a new
7455         BoxedCast instead of null. This fixes #70468.
7456
7457 2004-12-29  Duncan Mak  <duncan@ximian.com>
7458
7459         * expression.cs (Argument.Emit): Check that Expr is
7460         IMemoryLocation before casting to it, and report CS1510 otherwise.
7461
7462         This fixes #70402.
7463
7464 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7465
7466         * statement.cs (Block.ThisVariable): remove the recursion here, to
7467         make the --profile more sane.
7468
7469 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7470
7471         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7472         assembly, by JB Evain.
7473
7474 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7475
7476         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7477           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7478         "parent" refers to enclosing type/class.  "base" refers to superclass.
7479
7480 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7481
7482         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7483         Ensure that we only have GlobalAttributes.
7484         * attribute.cs (Attribute.Emit): Make non-virtual.
7485         (GlobalAttribute.Emit): Remove.
7486         (Attribute.Resolve): Make virtual.
7487         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7488         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7489         the argument. Don't create one.
7490         (Attribute.GetObsoleteAttribute): Likewise.
7491         (Attribute.GetClsCompliantAttributeValue): Likewise.
7492         * class.cs, decl.cs: Update to changes.
7493
7494 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7495
7496         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7497         
7498         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7499         
7500         * statement.cs (Foreach.Resolve): Add error 186 report.
7501
7502 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7503
7504         * expression.cs (Conditional.DoResolve): Add warning 429.
7505         
7506         * statement.cs (If.Resolve): Add warning 665.
7507
7508 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7509
7510         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7511         except when in the parser, and in GlobalAttribute.
7512         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7513         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7514         RootContext.Tree.Types.NamespaceEntry once work is done.
7515         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7516         and resets RootContext.Tree.Types.NamespaceEntry.
7517
7518 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7519
7520         * cs-parser.jay: Don't create a block for every variable.
7521
7522 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7523
7524         * location.cs: Provide extra information.
7525
7526         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7527         variables from the captured environment, it is the ldarg_0.
7528
7529 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7530
7531         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7532         find a conclusion.
7533         
7534         * class.cs: Changed warning level for 169 to avoid developer
7535         displeasure from warning flooding. It will be changed back when they
7536         fix most of current BCL warnings.
7537         
7538         * RootContext.cs: Pushed default WarningLevel to 3.
7539         
7540         * statement.cs: Removed unused variable.
7541
7542 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7543
7544         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7545         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7546         Add error 502 report.
7547         (StaticClass.DefineType): Add error 441 report.
7548         (Class.AllowedModifiersProp): New virtual property as temporary
7549         extension to AllowedModifiers.
7550         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7551         to share implementation with StaticClass and don't call virtual
7552         methods from ctor.
7553         
7554         * driver.cs (MainDriver): Add error 1558 test.
7555
7556         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7557         report. Moved error 36 test here.
7558
7559         * statement.cs (Throw.Resolve): Add error 724 report.
7560
7561         * typemanager.cs: Add out_attribute_type core type.
7562         
7563 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7564
7565         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7566         3018 report.
7567         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7568
7569         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7570         3017 report.
7571         
7572         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7573
7574         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7575         Add error 3023 report.
7576         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7577
7578         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7579         implementation.
7580
7581 2004-12-12  John Luke  <john.luke@gmail.com>
7582
7583         * driver.cs (AddArgs): take -- into account when
7584         adding arguments, fixes bug 65710 
7585
7586 2004-12-12  Martin Baulig  <martin@ximian.com>
7587
7588         * expression.cs (Unary.TryReduceNegative): Added support for
7589         SByteConstant and ByteConstant.
7590         (Unary.Reduce): Check error values from TryReduceNegative().
7591
7592 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7595         and report exception as error 182.
7596
7597 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7598
7599         * driver.cs (Main): Fix message when there are warnings.
7600
7601 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7602
7603         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7604
7605 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7606
7607         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7608         Reduced number of warnings.
7609         
7610         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7611
7612 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7613
7614         * driver.cs: Removed message.
7615
7616         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7617
7618 2004-12-08    <vargaz@freemail.hu>
7619
7620         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7621
7622 2004-12-08  Martin Baulig  <martin@ximian.com>
7623
7624         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7625         instead of a CS3002 for properties and indexer.
7626
7627 2004-12-08  Martin Baulig  <martin@ximian.com>
7628
7629         * decl.cs (MemberName.ToString): Make this work again.
7630
7631 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7632
7633         * attribute.cs (Resolve): Add error 591 detection.
7634
7635         * class.cs (FieldMember.Define): Add error 1547 detection.
7636         (Indexer.Define): Add error 620 detection.
7637         (Operator.Define): Add error 590 detection.
7638
7639         * ecore.cs: Missing argument for error 79.
7640
7641         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7642         detection.
7643
7644 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7645
7646         Fix #70106
7647         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7648         only.
7649
7650 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7651
7652         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7653           Some operator comments were suppressed.
7654         * doc.cs : Implicit/explicit operator name in doc comments are like
7655           "op_Explicit(type)~returnType", so added suffix handling.
7656
7657 2005-01-21  Alp Toker  <alp@atoker.com>
7658
7659         * cs-parser.jay: destructor_declaration's container is PartialContainer
7660         not Class when partial types are used, so use Kind prop instead of 'is'.
7661
7662 2004-12-12  Martin Baulig  <martin@ximian.com>
7663
7664         * expression.cs (Unary.TryReduceNegative): Added support for
7665         SByteConstant and ByteConstant.
7666         (Unary.Reduce): Check error values from TryReduceNegative().
7667
7668 2004-12-11  Martin Baulig  <martin@ximian.com>
7669
7670         * support.cs (ReflectionParameters.ParameterName): If we have a
7671         `gpd', call `ParameterName' on it.
7672
7673         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7674
7675         * pending.cs (PendingImplementation.DefineProxy): Call
7676         DefineParameter() for all of the MethodBuilder's arguments.
7677
7678 2004-12-09  Martin Baulig  <martin@ximian.com>
7679
7680         * doc.cs (DocUtil): Make this a static class.
7681
7682 2004-12-09  Martin Baulig  <martin@ximian.com>
7683
7684         * expression.cs (Invocation.InferType): Moved the type inference
7685         implementation into TypeManager.
7686
7687         * generics.cs (TypeManager): Moved the type inference
7688         implementation here.
7689
7690 2004-12-09  Martin Baulig  <martin@ximian.com>
7691
7692         * typemanager.cs (TypeManager): Make this a partial class.
7693
7694         * generics.cs
7695         (TypeManager): Move the generics part of `TypeManager' here.
7696
7697 2004-12-08  Martin Baulig  <martin@ximian.com>
7698
7699         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7700         instead of a CS3002 for properties and indexer.  Added CS3024
7701         check for generic interfaces.
7702
7703         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7704         instances are not CLS-compliant.
7705
7706 2004-12-08  Martin Baulig  <martin@ximian.com>
7707
7708         * cs-parser.jay
7709         (void_pointer_expression): New rule for `void*', `void**' etc.
7710         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7711
7712 2004-12-08  Martin Baulig  <martin@ximian.com>
7713
7714         * expression.cs (Invocation.InferType): Removed the hack for
7715         MethodCore.MayUnify().  
7716
7717         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7718         this actually work.
7719
7720         * class.cs (MethodCore.MayUnify): Use
7721         TypeManager.MayBecomeEqualGenericTypes().       
7722
7723 2004-12-08  Martin Baulig  <martin@ximian.com>
7724
7725         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7726         parameter, box it.  Fixes #69233.
7727
7728 2004-12-08  Martin Baulig  <martin@ximian.com>
7729
7730         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7731         have the ctor constraint.  Fixes #68326.
7732
7733 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7734
7735         * cs-parser.jay : interface comment was not consumed because of
7736           extra opt_semicolon before doc handling.
7737
7738 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7739
7740         Fix test-327.cs, test-328.cs, and put in early infrastructure
7741         for eventually fixing #52697.
7742         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7743         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7744         from other methods.
7745         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7746         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7747         (VerifyUsing, error246): Update.
7748         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7749         'NamespaceEntry.LookupNamespaceOrType'.
7750
7751 2004-12-07  Martin Baulig  <martin@ximian.com>
7752
7753         * driver.cs: Call it "BETA SOFTWARE" :-)
7754
7755 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7756
7757         Fix crash on cs0657-17.cs.
7758         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7759         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7760         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7761         the case where the NamespaceEntry gets overwritten.
7762
7763 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7764
7765         Fixed #69195, #56821
7766         * ecore.cs (ResolveBoolean): Tiny refactoring.
7767
7768         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7769         of right expression resolving when left is false constant and
7770         operator is LogicalAnd OR true constant and operator is LogicalOr.
7771
7772         * statement.cs (ResolveUnreachable): Always reports warning.
7773
7774 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7775
7776         * class.cs: Distinguish between 1721 and 1722 (just a little help
7777         for the programmer).
7778
7779 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7780
7781         * delegate.cs: Only allow this on new versions of the language. 
7782
7783 2004-12-02  Duncan Mak  <duncan@ximian.com>
7784
7785         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7786         Expression class.
7787         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7788         here as a static method. Take an additional bool out parameter
7789         `must_do_cs1540_check' for signaling to InstanceResolve.
7790         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7791         member field from PropertyExpr class and made it an argument of
7792         the method instead.
7793         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7794         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7795         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7796         and `remove_accessor' as well as InstanceResolve: report CS0122
7797         where applicable.
7798
7799         Fixes #70129.
7800
7801 2004-12-07  Martin Baulig  <martin@ximian.com>
7802
7803         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7804         and CS0692 where appropriate.
7805
7806 2004-12-06  Martin Baulig  <martin@ximian.com>
7807
7808         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7809         IsDuplicateImplementation() and improved it.
7810
7811         * expression.cs (Invocation.InferTypeArguments): Added
7812         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7813         and removed the "ref" modifier from `infered_types'.
7814
7815         * decl.cs (MemberName.ToString): Removed the exception.
7816
7817 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7818
7819         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7820           comments are allowed.
7821
7822 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7823
7824         * delegate.cs: Add checks for subtypes in paramaters and return values
7825         in VerifyMethod () to add support for Covariance/Contravariance
7826         in delegates.
7827         
7828 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7829
7830         * report.cs: Remove extra closing parenthesis.
7831
7832         * convert.cs (Error_CannotImplicitConversion): If the name of the
7833         types are the same, provide some extra information.
7834
7835 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7836
7837         Fix bug #70102
7838         * attribute.cs (Resolve): Improved implementation of params
7839         attribute arguments.
7840
7841         * support.cs (ParameterData): Add HasParams to be faster.
7842
7843 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7844
7845         all things are for /doc support:
7846
7847         * doc.cs: new file that supports XML documentation generation.
7848         * mcs.exe.sources: added doc.cs.
7849         * driver.cs:
7850           Handle /doc command line option.
7851           Report error 2006 instead of 5 for missing file name for /doc.
7852           Generate XML documentation when required, after type resolution.
7853         * cs-tokenizer.cs:
7854           Added support for picking up documentation (/// and /** ... */),
7855           including a new XmlCommentState enumeration.
7856         * cs-parser.jay:
7857           Added lines to fill Documentation element for field, constant,
7858           property, indexer, method, constructor, destructor, operator, event
7859           and class, struct, interface, delegate, enum.
7860           Added lines to warn incorrect comment.
7861         * rootcontext.cs :
7862           Added Documentation field (passed only when /doc was specified).
7863         * decl.cs:
7864           Added DocComment, DocCommentHeader, GenerateDocComment() and
7865           OnGenerateDocComment() and some supporting private members for
7866           /doc feature to MemberCore.
7867         * class.cs:
7868           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7869         * delegate.cs:
7870           Added overriden DocCommentHeader.
7871         * enum.cs:
7872           Added overriden DocCommentHeader and GenerateDocComment().
7873
7874 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7875
7876         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7877         unwrapping the enumeration values, chain to
7878         DoConstantNumericPromotions again, so we can promote things to the
7879         fundamental types (takes care of enums that are bytes, sbytes).
7880
7881         Fixes bug #62054.
7882
7883 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7884
7885         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7886         Fix long-standing bug in type-lookup.  Use FindType instead of
7887         LookupType when ec.ResolvingTypeTree.
7888         (Attribute.ResolveType, Attribute.Resolve)
7889         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7890         Update to changes.
7891         (Attributes.Search): Remove internal version.  Update.
7892         (Attributes.SearchMulti): Update.
7893         (Attributes.GetClsCompliantAttribute): Remove.
7894         (Attributes.GetIndexerNameAttribute): Remove.
7895         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7896         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7897         * class.cs (Indexer.Define): Likewise.
7898
7899 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7900
7901         Fix bug #68790
7902         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7903         MarshallByReference members access.
7904
7905         * expression.cs: Use CheckMarshallByRefAccess;
7906         Better error CS0197 message.
7907
7908         * report.cs: Print whole related error message.
7909
7910 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7911
7912         * class (GetClassBases): Better error 60 report.
7913         (EventProperty): Disabled warning 67 detection.
7914
7915 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7916
7917         Fix bug #60324
7918         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7919
7920         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7921         precise values.
7922
7923 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7924
7925         Fix bug #49488
7926         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7927
7928         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7929
7930 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7931
7932         * attribute.cs (Attribute.Resolve): Refine error reporting and
7933         report a cs0117 if the identifier does not exist, to distinguish
7934         from 0617 which is a miss-use of the actual identifier.
7935
7936         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7937         between cs0070 and cs0079.
7938
7939         * class.cs (MemberBase.DoDefine): When reporting a wrong
7940         accessibility level, we use MethodCore to compare instead of
7941         Method (this was a regression in some refactoring effort).
7942
7943         So now we correctly report cs0056 again.
7944
7945         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7946         testing the target_type (which was known to be object_type) and
7947         not the source type (which is anonymous_method).
7948
7949         Fixed reporting of error cs1660.
7950
7951         * expression.cs (UserCast.Source): Expose the underlying cast.
7952
7953         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7954         allowed types to find a match to int32 first (most common).
7955
7956         In addition, it ignores any ImplicitUserConversions that did an
7957         internal implicit conversion (as the switch statement allows only
7958         one integral conversion to exist).
7959
7960         * class.cs (PartialContainer.Create): rename `name' to
7961         `member_name' for clarity.  Then replace the string calls with a
7962         call to MemberName.GetPartialName, as now using
7963         MemberName.ToString is an error (this is due to the side effects
7964         it had, that were fixed in the past).
7965
7966         This will restore the error reporting on a number of partial class
7967         errors that were missusing this (and getting an exception as a
7968         results, which is now just a plain textual warning, because
7969         yyparse debug output would crash otherwise).
7970
7971 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7972
7973         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7974
7975 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7976
7977         * rootcontext.cs (LookupType): Make sure to cache lookups that
7978         don't give us a negative result. This saves about 5% of corlib
7979         compilation time.
7980
7981 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7982
7983         * report.cs (AbstractMessage.Print): messages are sent to stderr
7984
7985         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7986         non-interface in the list of interfaces (at this point, either
7987         parent was properly set, or a base class is being listed in the
7988         interfaces section).
7989
7990         This flags error 1722, and resolves the crash from bug 69259.
7991
7992 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7993
7994         * statement.cs (Using.EmitExpressionFinally): make this work right
7995         for valuetypes. Fixes 69926.
7996
7997 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7998
7999         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8000         converted to an enum" here, before we try to change the underlying
8001         type.  This code exists, but it is a different code path than the
8002         one used while encoding constants.
8003
8004         (ImplicitReferenceConversionExists): In addition, resynchronized
8005         the code here, so it matches the same code in
8006         ImplicitReferenceConversionExists for the `from any class-type S
8007         to any interface-type T'.       
8008
8009 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8010
8011         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8012
8013 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8014
8015         * cs-parser.jay: Use verbosity accordingly. 
8016
8017 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8018
8019         * expression.cs (Unary.ResolveOperator): Do not report warning;
8020         AddressOf reads from variable.
8021         
8022         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8023
8024 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8025
8026         Fix bug #69462
8027
8028         * attribute.cs (Attributable): Removed CheckTargets.
8029         (Attributes.Emit): Explicit attribute targets are tested here.
8030
8031         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8032         not enabled for interfaces.
8033
8034         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8035         (GetAssemblyName): Ouch next bug there.
8036
8037 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8038
8039         * expression.cs: Error 275 added.
8040         
8041 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8042
8043         Fix bug #69177 (Implemented decimal constant support)
8044
8045         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8046         (BinaryFold): Add DecimalConstant.
8047
8048         * const.cs (Define): Decimal constant 
8049         (is not constant.
8050         (ChangeType): Add decimal type handling.
8051         (LookupConstantValue): Don't set value for decimal type but
8052         emit DecimalConstantAttribute. Needed for constant optimization.
8053
8054         * constant.cs (ToDecimal): New method.
8055         (ConvertToDecimal): New method.
8056         (IntConstant): Implemented ConvertToDecimal.
8057         (DecimalConstant.Emit): Emit optimized version for decimals in
8058         int range.
8059
8060         * expression.cs (ResolveOperator): Changed order of constant
8061         reduction to work correctly with native types which have
8062         overloaded operators.
8063         (ResolveMemberAccess): Extract constant value from attribute
8064         for decimal type.
8065
8066         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8067
8068         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8069         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8070         (ChangeType): Decimal is special.
8071         (TypeToCoreType): Add decimal type.
8072
8073 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8074
8075         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8076         decimal types.
8077
8078 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8079
8080         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8081         test cs1667-5.cs.
8082
8083 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8084
8085         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8086
8087         * pending.cs (PendingImplementation): Grab only interfaces.
8088
8089 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * statement.cs (ForeachHelperMethods): Add location member and
8092         error 202 detection.
8093
8094 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8095
8096         * expression.cs (DoResolveBase): Fixed wrong warning for out
8097         variables.
8098
8099 2004-12-04  Martin Baulig  <martin@ximian.com>
8100
8101         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8102         to check whether the conversion is ok.
8103
8104         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8105         `Type.EmptyTypes' if we're not a generic TypeContainer.
8106
8107 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8108
8109         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8110         old bug: when converting from the null literal to a pointer,
8111         return an EmptyCast, not the NullLiteral.
8112
8113         This fixes #69921, the recent null_type changes probably made this
8114         bug more prominent.
8115
8116 2004-12-03  Martin Baulig  <martin@ximian.com>
8117
8118         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8119         method as our child, call AnonymousMethod.Compatible() on it.
8120
8121 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8122
8123         * class.cs (FieldBase): Use an unused bit field from the field to
8124         encode the `has_offset' property from the FieldMember.  This saves
8125         a couple of Ks on bootstrap compilation.
8126
8127         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8128         method as our child, return the AnonymousMethod resolved
8129         expression.
8130
8131         * expression.cs (New.DoResolve): Allow return values from
8132         NewDelegate to also include AnonymousMethods.
8133
8134         Fixes #70150.
8135
8136 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8137
8138         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8139         cs1648 report.
8140         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8141         System.Runtime.InteropServices._Exception, since it's a base
8142         interface of the core type System.Exception in the net_2_0 profile.
8143
8144 2004-11-27  Martin Baulig  <martin@ximian.com>
8145
8146         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8147
8148 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8149
8150         * Makefile: Convert to use executable.make.
8151         * gmcs.exe.sources: New.
8152
8153 2004-11-25  Martin Baulig  <martin@ximian.com>
8154
8155         * expression.cs (Invocation.InferType): Added support for byref types.
8156
8157 2004-11-25  Martin Baulig  <martin@ximian.com>
8158
8159         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8160         in TypeManager.TypeToCoreType().
8161
8162 2004-11-25  Martin Baulig  <martin@ximian.com>
8163
8164         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8165         "Dispose" method from the `current_type'.
8166         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8167         DoDefineMembers() instead of using the MethodBuilder; this is
8168         required for generic iterators.
8169
8170         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8171
8172 2004-11-24  Martin Baulig  <martin@ximian.com>
8173
8174         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8175
8176 2004-11-20  Martin Baulig  <martin@ximian.com>
8177
8178         * expression.cs (Invocation.InferType): Correctly infer generic
8179         instances; see gen-103.cs.
8180         (Invocation.InferTypeArguments): If a generic method doesn't have
8181         any unbound type parameters, we don't need to infer anything.
8182
8183 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8184
8185         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8186
8187 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8188
8189         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8190         (TypeHandle.GetMemberCache): New.
8191         (TypeHandle.TypeHandle): Update.
8192         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8193         (TypeManager.LookupParentInterfacesCache):
8194         Rename from LookupInterfaceCache.  Optimize slightly.
8195         (TypeManager.MemberLookup_FindMembers): Update.
8196         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8197         multi-type variant.
8198         (AddCacheContents): Rename from AddHashtable.
8199         * class.cs (TypeContainer.parent_container): Remove.
8200         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8201         (TypeContainer.DoDefineMembers): Don't initialize it.
8202         Update to name changes.
8203         
8204 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8205
8206         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8207         that factors the code to check access modifiers on override.  
8208
8209         (PropertyBase): Use the code here.
8210
8211         Patch from Lluis S'anchez, fixes bug #69361.
8212
8213 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8214
8215         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8216         routine that is used to report the use of a captured variable
8217         whose address has been taken.
8218
8219         There are two checks: one when variables are being captured and
8220         the other check is when the address of a variable is taken. 
8221         
8222         (because an anonymous methods might be resolved before *or* after
8223         the address has been taken) and 
8224
8225         * expression.cs (Conditional.DoResolve): Remove the special
8226         casing that Martin added to trueExpr and falseExpr being both
8227         NullLiteral.  We get the right behavior now just by introducing
8228         the null_type into the compiler. 
8229
8230         * convert.cs (ExplicitConversion): Change the code to use
8231         null_type instead of testing `expr is NullLiteral'.
8232         (ImplicitConversionStandard): use null_type too.
8233         (ImplicitReferenceConversionExists): use null_type too.
8234         (ImplicitReferenceConversion): use null_type too.
8235
8236         * literal.cs: The type of `NullLiteral' is now null_type instead
8237         of object_type. 
8238         (Resolve): Set the type here.
8239
8240         * typemanager.cs: Introduce null_type.
8241
8242 2004-11-18  Martin Baulig  <martin@ximian.com>
8243
8244         * rootcontext.cs
8245         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8246
8247 2004-11-18  Martin Baulig  <martin@ximian.com>
8248
8249         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8250
8251 2004-11-18  Martin Baulig  <martin@ximian.com>
8252
8253         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8254         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8255         call ResolveConstructedType() on it to resolve it without checking
8256         constraints.
8257         (Constraints.ResolveTypes): Check them here.
8258         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8259         but don't check constraints.
8260         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8261         check constraints here.
8262         (ConstructedType.ResolveConstructedType): New public method.  This
8263         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8264         resolve ourselves without checking constraints.
8265
8266         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8267
8268 2004-11-18  Martin Baulig  <martin@ximian.com>
8269
8270         * decl.cs
8271         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8272
8273         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8274
8275 2004-11-18  Martin Baulig  <martin@ximian.com>
8276
8277         * ecore.cs (TypeExpr.ResolveType): Removed.
8278         (Expression.ResolveAsTypeTerminal): We always return a fully
8279         resolved `TypeExpr', so we can just access its `Type'.
8280
8281         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8282
8283 2004-11-17  Martin Baulig  <martin@ximian.com>
8284
8285         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8286         sure we don't return any unresolved TypeExpr's.
8287         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8288         a `TypeExpr'.
8289         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8290
8291         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8292         unresolved `ConstructedType's.
8293
8294 2004-11-17  Martin Baulig  <martin@ximian.com>
8295
8296         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8297
8298 2004-11-17  Martin Baulig  <martin@ximian.com>
8299
8300         * ecore.cs
8301         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8302
8303         * decl.cs (DeclSpace.ResolveType): Removed.
8304         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8305
8306 2004-11-17  Martin Baulig  <martin@ximian.com>
8307
8308         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8309         direction, like FindMembers() does.  Fixes #69546, testcase is in
8310         test-315.cs.    
8311
8312 2004-11-16  Martin Baulig  <martin@ximian.com>
8313
8314         This is based on a patch from Marek Safar, see bug #69082.
8315         Fixes bugs #63705 and #67130.
8316
8317         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8318         method; create a MemberCache for an interface type and cache the
8319         result.
8320
8321         * decl.cs (IMemberContainer.ParentContainer): Removed.
8322         (IMemberContainer.ParentCache): New property.
8323         (MemberCache.SetupCacheForInterface): Removed.
8324         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8325         to create a cache for an interface's "parent".
8326
8327         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8328         interfaces too.
8329
8330 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8331
8332         * statement.cs: Avoid adding bools to a hashtable.
8333
8334 2004-11-15  Martin Baulig  <martin@ximian.com>
8335
8336         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8337
8338 2004-11-11  Martin Baulig  <martin@ximian.com>
8339
8340         * typemanager.cs (TypeManager.GetMethodName): New method.
8341
8342         * class.cs (MethodData.Define): Include the generic arity in the
8343         name of an explicit interface; also add it to the method name.
8344
8345         * pending.cs (PendingImplementation.InterfaceMethod): The method
8346         name now includes the generic arity.
8347
8348 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8349
8350         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8351         calling an unsafe method from a safe location.
8352
8353 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8354
8355         Fix #69167
8356         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8357
8358 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8359
8360         * namespace.cs (VerifyUsing): use GetPartialName instead of
8361         ToString. 
8362
8363 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8364
8365         * statement.cs (Return.Resolve): Fix regression in typo: if
8366         `in_exc', we have to request a NeedReturnLabel, this was a typo
8367         introduced in the anonymous method check-in.  Fixes #69131.
8368
8369         * Indexers were using the ShortName when defining themselves,
8370         causing a regression in the compiler bootstrap when applying the
8371         patch from 2004-11-02 (first part), now they use their full name
8372         and the bug is gone.
8373
8374 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8375
8376         * driver.cs: Strip the path from the names of embedded resources. Fixes
8377         #68519.
8378
8379 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8380
8381         Fix error message regression: cs0104-2.cs.
8382         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8383         (AliasEntry.Resolve): Update.
8384         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8385         'silent' flag.
8386         (RootContext.LookupType): Update.
8387
8388 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8389
8390         * cs-parser.jay: Add support for handling accessor modifiers
8391         * class: Add support port accessor modifiers and error checking,
8392         define PropertyMethod.Define as virtual (not abstract anymore)
8393         * ecore.cs: Add checking for proeprties access with access modifiers
8394         * iterators.cs: Modify Accessor constructor call based in the modified
8395         constructor
8396 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8397
8398         * expression.cs (StringConcat): Handle being called twice,
8399         as when we have a concat in a field init with more than two
8400         ctors in the class
8401
8402 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8403
8404         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8405         special case explicit implementations, we should always produce
8406         the .property or .event declaration.
8407         
8408         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8409         since it will not return correct data if people use this
8410         unresolved in the presence of using statements (see test-313).
8411
8412         * class.cs (MethodData.Define): If we are an explicit interface
8413         implementation, set the method name to the full name of the
8414         interface plus the name of the method.  
8415
8416         Notice that using the method.MethodName.GetFullName() does not
8417         work, as it will only contain the name as declared on the source
8418         file (it can be a shorthand in the presence of using statements)
8419         and not the fully qualifed type name, for example:
8420
8421         using System;
8422
8423         class D : ICloneable {
8424                 object ICloneable.Clone ()  {
8425                 }
8426         }
8427
8428         Would produce a method called `ICloneable.Clone' instead of
8429         `System.ICloneable.Clone'.
8430
8431         * namespace.cs (Alias.Resolve): Use GetPartialName.
8432         
8433 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8434
8435         * cs-parser.jay: Add error 1055 report.
8436
8437 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8438
8439         * assign.cs (Assign.DoResolve): Only do the transform of
8440         assignment into a New if the types are compatible, if not, fall
8441         through and let the implicit code deal with the errors and with
8442         the necessary conversions. 
8443
8444 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8445
8446         * cs-parser.jay: Add error 1031 report.
8447
8448         * cs-tokenizer.cs: Add location for error 1038.
8449
8450 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8451
8452         * cs-parser.jay: Add error 1016 report.
8453
8454 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8455
8456         * cs-parser.jay: Add errors 1575,1611 report.
8457
8458 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8459
8460         * cs-parser.jay: Add error 1001 report.
8461
8462 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8463
8464         Fix #68850
8465         * attribute.cs (GetMarshal): Add method argument for
8466         caller identification.
8467
8468         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8469         agument for GetMarshal and RuntimeMissingSupport.
8470
8471 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8472
8473         * attribute.cs (ExtractSecurityPermissionSet): Removed
8474         TypeManager.code_access_permission_type.
8475
8476         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8477
8478 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8479
8480         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8481         for obsolete use of a variable here.   Fixes regression on errors
8482         cs0619-25 and cs0619-26.
8483
8484 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8485
8486         Fix #62358, implemented security attribute encoding.
8487
8488         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8489         Tests permitted SecurityAction for assembly or other types.
8490         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8491         data from SecurityPermissionAttribute to PermisionSet class.
8492
8493         * class.cs (ApplyAttributeBuilder): Added special handling
8494         for System.Security.Permissions.SecurityAttribute based types.
8495
8496         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8497         special handling for System.Security.Permissions.SecurityAttribute
8498         based types.
8499
8500         * enum.cs (ApplyAttributeBuilder): Added special handling
8501         for System.Security.Permissions.SecurityAttribute based types.
8502
8503         * parameter.cs (ApplyAttributeBuilder): Added special handling
8504         for System.Security.Permissions.SecurityAttribute based types.
8505
8506         * rootcontext.cs: Next 2 core types.
8507
8508         * typemanager.cs (TypeManager.security_permission_attr_type):
8509         Built in type for the SecurityPermission Attribute.
8510         (code_access_permission_type): Build in type.
8511
8512 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8513
8514         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8515         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8516         all of this information into
8517         EmitContext.EmitCapturedVariableInstance.
8518         
8519         * codegen.cs (EmitCapturedVariableInstance): move here the
8520         funcionality of emitting an ldarg.0 in the presence of a
8521         remapping.   This centralizes the instance emit code.
8522
8523         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8524         then emit a load of this: it means that we have reached the
8525         topmost ScopeInfo: the one that contains the pointer to the
8526         instance of the class hosting the anonymous method.
8527
8528         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8529         captures to the topmost CaptureContext.
8530
8531 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8532
8533         * expression.cs (LocalVariableReference): Move the knowledge about
8534         the iterators into codegen's EmitCapturedVariableInstance.
8535
8536 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8537
8538         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8539         all code paths return a value from an anonymous method (it is the
8540         same as the 161 error, but for anonymous methods).
8541
8542 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8543
8544         The introduction of anonymous methods in the compiler changed
8545         various ways of doing things in the compiler.  The most
8546         significant one is the hard split between the resolution phase
8547         and the emission phases of the compiler.
8548
8549         For instance, routines that referenced local variables no
8550         longer can safely create temporary variables during the
8551         resolution phase: they must do so from the emission phase,
8552         since the variable might have been "captured", hence access to
8553         it can not be done with the local-variable operations from the runtime.
8554         
8555         * statement.cs 
8556
8557         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8558         is a toplevel block.
8559
8560         (ToplevelBlock): A new kind of Block, these are the blocks that
8561         are created by the parser for all toplevel method bodies.  These
8562         include methods, accessors and anonymous methods.
8563
8564         These contain some extra information not found in regular blocks:
8565         A pointer to an optional CaptureContext (for tracking captured
8566         local variables and parameters).  A pointer to the parent
8567         ToplevelBlock.
8568         
8569         (Return.Resolve): Catch missmatches when returning a value from an
8570         anonymous method (error 1662).
8571         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8572         phase.
8573
8574         (Break.Resolve): ditto.
8575
8576         (SwitchLabel): instead of defining the labels during the
8577         resolution phase, we now turned the public ILLabel and ILLabelCode
8578         labels into methods called GetILLabelCode() and GetILLabel() that
8579         only define the label during the Emit phase.
8580
8581         (GotoCase): Track the SwitchLabel instead of the computed label
8582         (its contained therein).  Emit the code by using
8583         SwitchLabel.GetILLabelCode ().
8584
8585         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8586         whether the Local has been captured or not.
8587
8588         (LocalInfo.IsCaptured): New property, used to tell whether the
8589         local has been captured.
8590         
8591         * anonymous.cs: Vastly updated to contain the anonymous method
8592         support.
8593
8594         The main classes here are: CaptureContext which tracks any
8595         captured information for a toplevel block and ScopeInfo used to
8596         track the activation frames for various local variables.   
8597
8598         Each toplevel block has an optional capture context associated
8599         with it.  When a method contains an anonymous method both the
8600         toplevel method and the anonymous method will create a capture
8601         context.   When variables or parameters are captured, they are
8602         recorded on the CaptureContext that owns them, for example:
8603
8604         void Demo () {
8605              int a;
8606              MyDelegate d = delegate {
8607                  a = 1;
8608              }
8609         }
8610
8611         Here `a' will be recorded as captured on the toplevel
8612         CapturedContext, the inner captured context will not have anything
8613         (it will only have data if local variables or parameters from it
8614         are captured in a nested anonymous method.
8615
8616         The ScopeInfo is used to track the activation frames for local
8617         variables, for example:
8618
8619         for (int i = 0; i < 10; i++)
8620                 for (int j = 0; j < 10; j++){
8621                    MyDelegate d = delegate {
8622                         call (i, j);
8623                    }
8624                 }
8625
8626         At runtime this captures a single captured variable `i', but it
8627         captures 10 different versions of the variable `j'.  The variable
8628         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8629         recorded on a child.  
8630
8631         The toplevel ScopeInfo will also track information like the `this'
8632         pointer if instance variables were referenced (this is necessary
8633         as the anonymous method lives inside a nested class in the host
8634         type of the method). 
8635
8636         (AnonymousMethod): Expanded to track the Toplevel, implement
8637         `AnonymousMethod.Compatible' to tell whether an anonymous method
8638         can be converted to a target delegate type. 
8639
8640         The routine now also produces the anonymous method content
8641
8642         (AnonymousDelegate): A helper class that derives from
8643         DelegateCreation, this is used to generate the code necessary to
8644         produce the delegate for the anonymous method that was created. 
8645
8646         * assign.cs: API adjustments for new changes in
8647         Convert.ImplicitStandardConversionExists.
8648
8649         * class.cs: Adjustments to cope with the fact that now toplevel
8650         blocks are of type `ToplevelBlock'. 
8651
8652         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8653         insteda of standard blocks.
8654
8655         Flag errors if params arguments are passed to anonymous methods.
8656
8657         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8658         `CurrentAnonymousMethod' which points to the current Anonymous
8659         Method.  The variable points to the AnonymousMethod class that
8660         holds the code being compiled.  It is set in the new EmitContext
8661         created for the anonymous method.
8662
8663         (EmitContext.Phase): Introduce a variable and an enumeration to
8664         assist in enforcing some rules about when and where we are allowed
8665         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8666         only one that enfonces this right now).
8667
8668         (EmitContext.HaveCaptureInfo): new helper method that returns
8669         whether we have a CapturedContext initialized.
8670
8671         (EmitContext.CaptureVariable): New method used to register that a
8672         LocalInfo must be flagged for capturing. 
8673
8674         (EmitContext.CapturedParameter): New method used to register that a
8675         parameters must be flagged for capturing. 
8676         
8677         (EmitContext.CapturedField): New method used to register that a
8678         field must be flagged for capturing. 
8679
8680         (EmitContext.HaveCapturedVariables,
8681         EmitContext.HaveCapturedFields): Return whether there are captured
8682         variables or fields. 
8683
8684         (EmitContext.EmitMethodHostInstance): This is used to emit the
8685         instance for the anonymous method.  The instance might be null
8686         (static methods), this (for anonymous methods that capture nothing
8687         and happen to live side-by-side with the current method body) or a
8688         more complicated expression if the method has a CaptureContext.
8689
8690         (EmitContext.EmitTopBlock): Routine that drives the emission of
8691         code: it will first resolve the top block, then emit any metadata
8692         and then emit the code.  The split is done so that we can extract
8693         any anonymous methods and flag any captured variables/parameters.
8694         
8695         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8696         during this phase, the ILGenerator should not be used as labels
8697         and local variables declared here might not be accessible to any
8698         code that is part of an anonymous method.  
8699
8700         Exceptions to this include the temporary variables that are
8701         created by some statements internally for holding temporary
8702         variables. 
8703         
8704         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8705         metadata for a cb
8706
8707         (EmitContext.TemporaryReturn): This method is typically called
8708         from the Emit phase, and its the only place where we allow the
8709         ReturnLabel to be defined other than the EmitMeta.  The reason is
8710         that otherwise we would have to duplicate a lot of logic in the
8711         Resolve phases of various methods that today is on the Emit
8712         phase. 
8713
8714         (EmitContext.NeedReturnLabel): This no longer creates the label,
8715         as the ILGenerator is not valid during the resolve phase.
8716
8717         (EmitContext.EmitThis): Extended the knowledge in this class to
8718         work in anonymous methods in addition to iterators. 
8719
8720         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8721         code is necessary on the stack to access the instance to a local
8722         variable (the variable will be accessed as a field).
8723
8724         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8725         EmitContext.EmitAddressOfParameter): Routines to support
8726         parameters (not completed at this point). 
8727         
8728         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8729         will also remove the parameters.
8730
8731         * convert.cs (Convert): Define a `ConstantEC' which points to a
8732         null.  This is just to prefity some code that uses
8733         ImplicitStandardConversion code and do not have an EmitContext
8734         handy.
8735
8736         The idea is to flag explicitly that at that point in time, it is
8737         known that the conversion will not trigger the delegate checking
8738         code in implicit conversions (which requires a valid
8739         EmitContext). 
8740
8741         Everywhere: pass new EmitContext parameter since
8742         ImplicitStandardConversionExists now requires it to check for
8743         anonymous method conversions. 
8744
8745         (Convert.ImplicitStandardConversionExists): If the type of an
8746         expression is the anonymous_method_type, and the type is a
8747         delegate, we invoke the AnonymousMethod.Compatible method to check
8748         whether an implicit conversion is possible. 
8749
8750         (Convert.ImplicitConversionStandard): Only do implicit method
8751         group conversions if the language level is not ISO_1.
8752
8753         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8754         MethodInfo for the Invoke method.  used by Delegate and
8755         AnonymousDelegate.
8756
8757         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8758         method conversions if the target type is a delegate.
8759
8760         Removed extra debugging nops.
8761
8762         (LocalVariableReference): Turn the `local_info' into a public
8763         field. 
8764
8765         Add `prepared' field, the same hack used for FieldExprs to cope
8766         with composed assignments, as Local variables do not necessarily
8767         operate purely on the stack as they used to: they can be captured
8768         fields. 
8769
8770         Add `temp' for a temporary result, like fields.
8771
8772         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8773
8774         It now copes with Local variables that are captured and emits the
8775         proper instance variable to load it from a field in the captured
8776         case. 
8777
8778         (ParameterReference.DoResolveBase): During the resolve phase,
8779         capture parameters if we are in an anonymous method.
8780
8781         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8782         anonymous method, use the EmitContext helper routines to emit the
8783         parameter reference.
8784
8785         * iterators.cs: Set RemapToProxy to true/false during the
8786         EmitDispose class.
8787
8788         * parameters.cs (GetParameterByName): New helper method. 
8789
8790         * typemanager.cs (anonymous_method_type) a new type that
8791         represents an anonyous method.  This is always an internal type,
8792         used as a fencepost to test against the anonymous-methodness of an
8793         expression. 
8794         
8795 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8796
8797         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8798         561 report.
8799         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8800
8801 2004-11-10  Martin Baulig  <martin@ximian.com>
8802
8803         * expression.cs (Invocation.BetterFunction): If two methods have
8804         equal parameter types, but only one of them is generic, the
8805         non-generic one wins.
8806         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8807         instance; just use `Type.IsValueType' to determine whether
8808         something is a struct or not.
8809         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8810         so we can be called multiple times.
8811
8812 2004-11-10  Martin Baulig  <martin@ximian.com>
8813
8814         * generic.cs (TypeParameter.DefineConstraints): New public method.
8815         (TypeParameter.CheckAccessLevel): Override this and return true.
8816         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8817         override ResolveType() anymore.
8818         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8819
8820 2004-11-10  Martin Baulig  <martin@ximian.com>
8821
8822         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8823         call DeclSpace.ResolveNestedType() on it.
8824
8825 2004-11-10  Martin Baulig  <martin@ximian.com>
8826
8827         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8828         non-null, call ParameterModifier() on it.
8829
8830 2004-11-10  Martin Baulig  <martin@ximian.com>
8831
8832         * iterators.cs
8833         (Iterators): Added `current_type' and `this_type' fields.
8834         (Iterators.DefineIterator): Create a new EmitContext and store it
8835         in `ec'; compute `this_type'.
8836
8837 2004-11-10  Martin Baulig  <martin@ximian.com>
8838
8839         * typemanager.cs
8840         (TypeManager.IsPrivateAccessible): New public method.
8841         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8842
8843 2004-11-10  Martin Baulig  <martin@ximian.com>
8844
8845         * class.cs (TypeContainer.DefineType): Call
8846         TypeBuilder.DefineGenericParameters() before resolving the type
8847         parameters.
8848         (MethodData.parent_method): New protected field.
8849         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8850         (MethodData.Define): Compute `parent_method'.
8851
8852         * decl.cs
8853         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8854         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8855         (DeclSpace.ec): New protected field; store the EmitContext here.
8856         (DeclSpace.EmitContext): New public property.
8857         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8858         (DeclSpace.ResolveNestedType): New public method.
8859         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8860         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8861         (DeclSpace.FamilyAccessible): Likewise.
8862         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8863         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8864         EmitContext.
8865
8866         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8867         field.
8868
8869         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8870         (Enum.Emit): Don't create a new EmitContext.
8871
8872 2004-10-18  Martin Baulig  <martin@ximian.com>
8873
8874         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8875         `Type' directly, but call ResolveType() on it.
8876         (Catch.Resolve): Likewise.
8877         (Foreach.Resolve): Likewise.
8878
8879 2004-10-18  Martin Baulig  <martin@ximian.com>
8880
8881         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8882         `Type' directly, but call ResolveType() on it.
8883         (Probe.DoResolve): Likewise.
8884         (ArrayCreation.LookupType): Likewise.
8885         (TypeOf.DoResolve): Likewise.
8886         (SizeOf.DoResolve): Likewise.
8887
8888 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8889
8890         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8891         the ResolveType.
8892
8893 2004-10-17  John Luke  <john.luke@gmail.com>
8894
8895         * class.cs (Operator.GetSignatureForError): use CSharpName
8896
8897         * parameter.cs (Parameter.GetSignatureForError): Returns
8898         correct name even if was not defined.
8899
8900 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8901
8902         Fix #65816.
8903         * class.cs (TypeContainer.EmitContext): New property.
8904         (DefineNestedTypes): Create an emitcontext for each part.
8905         (MethodCore.DoDefineParameters): Use container's emitcontext.
8906         Pass type array to InternalParameters.
8907         (MemberBase.DoDefine): Use container's emitcontext.
8908         (FieldMember.Define): Likewise.
8909         (Event.Define): Likewise.
8910         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8911         Pass type array to InternalParameters.
8912         (SetIndexerMethod.GetParameterInfo): Likewise.
8913         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8914         * delegate.cs (Define): Pass emitcontext to
8915         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8916         array to InternalParameters.
8917         * expression.cs (ParameterReference.DoResolveBase): Pass
8918         emitcontext to GetParameterInfo.
8919         (ComposedCast.DoResolveAsTypeStep): Remove check on
8920         ec.ResolvingTypeTree.
8921         * parameter.cs (Parameter.Resolve): Change argument to
8922         EmitContext.  Use ResolveAsTypeTerminal.
8923         (Parameter.GetSignature): Change argument to EmitContext.
8924         (Parameters.ComputeSignature): Likewise.
8925         (Parameters.ComputeParameterTypes): Likewise.
8926         (Parameters.GetParameterInfo): Likewise.
8927         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8928         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8929         * support.cs (InternalParameters..ctor): Remove variant that takes
8930         a DeclSpace.
8931         * typemanager.cs (system_intptr_expr): New.
8932         (InitExpressionTypes): Initialize it.
8933
8934 2004-10-12  Chris Toshok  <toshok@ximian.com>
8935
8936         * cs-parser.jay: fix location for try_statement and catch_clause.
8937
8938 2004-10-18  Martin Baulig  <martin@ximian.com>
8939
8940         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8941         `Type' directly, but call ResolveType() on it.
8942         (MemberBase.DoDefine): Likewise.
8943
8944         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8945         `Type' directly, but call ResolveType() on it.
8946         (ComposedCast.DoResolveAsTypeStep): Likewise.
8947
8948         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8949         `Type' directly, but call ResolveType() on it.
8950
8951 2004-10-17  John Luke  <john.luke@gmail.com>
8952
8953         * class.cs (Operator.GetSignatureForError): use CSharpName
8954
8955         * parameter.cs (Parameter.GetSignatureForError): Returns
8956         correct name even if was not defined.
8957
8958 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8959
8960         Fix #65816.
8961         * class.cs (TypeContainer.EmitContext): New property.
8962         (DefineNestedTypes): Create an emitcontext for each part.
8963         (MethodCore.DoDefineParameters): Use container's emitcontext.
8964         Pass type array to InternalParameters.
8965         (MemberBase.DoDefine): Use container's emitcontext.
8966         (FieldMember.Define): Likewise.
8967         (Event.Define): Likewise.
8968         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8969         Pass type array to InternalParameters.
8970         (SetIndexerMethod.GetParameterInfo): Likewise.
8971         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8972         * delegate.cs (Define): Pass emitcontext to
8973         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8974         array to InternalParameters.
8975         * expression.cs (ParameterReference.DoResolveBase): Pass
8976         emitcontext to GetParameterInfo.
8977         (ComposedCast.DoResolveAsTypeStep): Remove check on
8978         ec.ResolvingTypeTree.
8979         * parameter.cs (Parameter.Resolve): Change argument to
8980         EmitContext.  Use ResolveAsTypeTerminal.
8981         (Parameter.GetSignature): Change argument to EmitContext.
8982         (Parameters.ComputeSignature): Likewise.
8983         (Parameters.ComputeParameterTypes): Likewise.
8984         (Parameters.GetParameterInfo): Likewise.
8985         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8986         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8987         * support.cs (InternalParameters..ctor): Remove variant that takes
8988         a DeclSpace.
8989         * typemanager.cs (system_intptr_expr): New.
8990         (InitExpressionTypes): Initialize it.
8991
8992 2004-10-12  Chris Toshok  <toshok@ximian.com>
8993
8994         * cs-parser.jay: fix location for try_statement and catch_clause.
8995
8996 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8997
8998         More DeclSpace.ResolveType avoidance.
8999         * decl.cs (MemberCore.InUnsafe): New property.
9000         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9001         with newly created EmitContext.
9002         (FieldMember.Define): Likewise.
9003         * delegate.cs (Delegate.Define): Likewise.
9004         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9005         only if normal name-lookup fails.
9006         (TypeExpr.DoResolve): Enable error-checking.
9007         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9008         (SizeOf.DoResolve): Likewise.
9009         (ComposedCast.DoResolveAsTypeStep): Likewise.
9010         (StackAlloc.DoResolve): Likewise.
9011         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9012         (Block.Unsafe): New property.
9013         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9014         (Unsafe): Set 'unsafe' flag of contained block.
9015         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9016         (Fixed.Resolve): Likewise.
9017         (Catch.Resolve): Likewise.
9018         (Using.ResolveLocalVariableDecls): Likewise.
9019         (Foreach.Resolve): Likewise.
9020
9021 2004-10-05  John Luke <john.luke@gmail.com>
9022
9023         * cs-parser.jay: add location to error CS0175
9024
9025 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * ecore.cs (Expression.Constantity): Add support for turning null
9028         into a constant.
9029
9030         * const.cs (Const.Define): Allow constants to be reference types
9031         as long as the value is Null.
9032
9033 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9034
9035         * namespace.cs (NamespaceEntry.Using): No matter which warning
9036         level is set, check if this namespace name has already been added.
9037
9038 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9039
9040         * expression.cs: reftype [!=]= null should always use br[true,false].
9041         # 67410
9042
9043 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9044
9045         Fix #67108
9046         * attribute.cs: Enum conversion moved to 
9047         GetAttributeArgumentExpression to be applied to the all
9048         expressions.
9049
9050 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9051
9052         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9053         * class.c (TypeContainer.DefineType): Flag error if
9054         base types aren't accessible due to access permissions.
9055         * decl.cs (DeclSpace.ResolveType): Move logic to
9056         Expression.ResolveAsTypeTerminal.
9057         (DeclSpace.ResolveTypeExpr): Thin layer over
9058         Expression.ResolveAsTypeTerminal.
9059         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9060         Refactor code into NestedAccess.  Use it.
9061         (DeclSpace.NestedAccess): New.
9062         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9063         argument to silence errors.  Check access permissions.
9064         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9065         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9066         (Cast.DoResolve): Likewise.
9067         (New.DoResolve): Likewise.
9068         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9069         (TypeOf.DoResolve): Likewise.
9070
9071         * expression.cs (Invocation.BetterConversion): Return the Type of
9072         the better conversion.  Implement section 14.4.2.3 more faithfully.
9073         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9074         section 14.4.2.2 explicit.
9075         (Invocation.OverloadResolve): Update.
9076         (Invocation): Remove is_base field.
9077         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9078         (Invocation.Emit): Likewise.
9079
9080 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9081
9082         * cs-parser.jay: Reverted 642 warning fix.
9083
9084 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9085
9086         Fix bug #66615
9087         * decl.cs (FindMemberWithSameName): Indexer can have more than
9088         1 argument.
9089
9090 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9091
9092         * expression.cs (LocalVariableReference.DoResolveLValue):
9093         Do not report warning 219 for out values.
9094         (EmptyExpression.Null): New member to avoid extra allocations.
9095
9096 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9097
9098         * cs-parser.jay: Fix wrong warning 642 report.
9099
9100         * cs-tokenizer.cs (CheckNextToken): New helper;
9101         Inspect next character if is same as expected.
9102
9103 2004-09-23  Martin Baulig  <martin@ximian.com>
9104
9105         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9106         (Convert.ImplicitReferenceConversionExists): Likewise.
9107
9108 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9109
9110         * Makefile (DISTFILES): Comment out a few missing files.
9111
9112 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9113
9114         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9115         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9116         (gmcs.exe): Invoke bootstrap-libs.
9117         (clean-local): Clean the net_2_0_bootstrap profile too.
9118         (PROGRAM_INSTALL_DIR): New.
9119         (install-local): Use it.
9120
9121 2004-10-13  Martin Baulig  <martin@ximian.com>
9122
9123         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9124         (TypeParameter.DefineType): If we're a method type parameter and
9125         that method is overriding something, "inflate" its constraints.
9126
9127 2004-10-12  Martin Baulig  <martin@ximian.com>
9128
9129         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9130         and have type arguments, create and resolve a ConstructedType.
9131
9132 2004-10-12  Martin Baulig  <martin@ximian.com>
9133
9134         * decl.cs (MemberCache.FindMemberToOverride): Use
9135         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9136         to compare the invocationType.
9137
9138         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9139         When comparing two type parameters, only do the signature-only
9140         comparision for method type parameters.
9141
9142 2004-10-11  Martin Baulig  <martin@ximian.com>
9143
9144         * report.cs: Don't make --fatal abort on warnings, we have
9145         -warnaserror for that.
9146
9147 2004-10-11  Martin Baulig  <martin@ximian.com>
9148
9149         * typemanager.cs
9150         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9151         (TypeManager.IsEqual): Call ourself recursively instead of using
9152         Type.IsEqual(). 
9153
9154 2004-10-11  Martin Baulig  <martin@ximian.com>
9155
9156         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9157         on our own type parameters, not on the ones we inherit from a containing
9158         class.
9159
9160         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9161         the comparision.
9162
9163         * generic.cs (TypeParameter.Define): We may only be called once.
9164
9165         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9166         instead of TypeManager.IsEqual().
9167
9168 2004-09-28  Martin Baulig  <martin@ximian.com>
9169
9170         * generic.cs
9171         (GenericConstraints.EffectiveBaseClass): New public property.
9172         (TypeParameter.GenericConstraints): New public property.
9173         (ConstructedType.CheckConstraints): Improved.
9174
9175         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9176         (Convert.TypeParameterConversion): New private method; use this in
9177         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9178         for all conversions related to type parameters.
9179
9180 2004-09-24  Martin Baulig  <martin@ximian.com>
9181
9182         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9183         type parameter conversions for type parameters which are known to
9184         be reference types.
9185
9186 2004-09-24  Martin Baulig  <martin@ximian.com>
9187
9188         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9189         `IsValueType' properties.
9190
9191         * support.cs (ReflectionConstraints): Use
9192         Type.GetGenericParameterConstraints() instead of the old hack.
9193
9194 2004-09-24  Martin Baulig  <martin@ximian.com>
9195
9196         * generic.cs (GenericConstraints): Moved here and made it an
9197         abstract class.
9198
9199         * support.cs (GenericConstraints): Moved to generic.cs.
9200
9201 2004-09-24  Martin Baulig  <martin@ximian.com>
9202
9203         * support.cs
9204         (ReflectionConstraints): Un-nested this class and made it public.
9205
9206         * typemanager.cs
9207         (TypeManager.GetTypeParameterConstraints): New public method.
9208         (TypeManager.HasConstructorConstraint): Use the attributes.
9209
9210 2004-09-24  Martin Baulig  <martin@ximian.com>
9211
9212         * support.cs (GenericConstraints): Replaced `HasConstructor',
9213         `IsReferenceType' and `IsValueType' with `Attributes'.
9214         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9215         method and made the .ctor public.
9216
9217         * generic.cs (Constraints.Attributes): New public property.
9218         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9219         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9220         `IsValueType' -> `HasValueTypeConstraint'.
9221
9222 2004-09-23  Martin Baulig  <martin@ximian.com>
9223
9224         * generic.cs (Constraints): Reflect latest runtime changes.
9225
9226 2004-09-23  Martin Baulig  <martin@ximian.com>
9227
9228         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9229         (Convert.ImplicitReferenceConversionExists): Likewise.
9230
9231 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9232
9233         * class.cs (Operator.Define): Add error 448 and 559 report.
9234         
9235 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9236
9237         * class.cs (MemberBase.IsTypePermitted): New protected
9238         method for checking error CS0610.
9239
9240 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9241
9242         * class.cs (TypeContainer.HasExplicitLayout): New property
9243         Returns whether container has StructLayout attribute set Explicit.
9244         (FieldMember): New abstract class for consts and fields.
9245         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9246         (Field): Reuse FieldMember.
9247
9248         * const.cs (Const): Reuse FieldMember.
9249
9250         * rootcontext.cs: EmitConstants call moved to class.
9251
9252 2004-09-22  Martin Baulig  <martin@ximian.com>
9253
9254         Marek and me just fixed one of our oldest bugs: #28562 :-)
9255
9256         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9257
9258         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9259         we're an EnumConstant, just return that.
9260         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9261         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9262         to get the value which'll actually be written into the attribute.
9263         However, we have to use GetValue() to access the attribute's value
9264         in the compiler.        
9265
9266 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9267
9268         * constant.cs (Constant.IsNegative): New abstract property
9269         IsNegative.
9270
9271         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9272         (StackAlloc.DoResolve): Reused IsNegative.
9273
9274 2004-09-22  Martin Baulig  <martin@ximian.com>
9275
9276         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9277         public method; like LookupTypeContainer, but also works for
9278         generic instances.
9279
9280         * report.cs (Report.SymbolRelatedToPreviousError): Use
9281         TypeManager.LookupGenericTypeContainer().       
9282
9283 2004-09-22  Martin Baulig  <martin@ximian.com>
9284
9285         Thanks to Peter Sestoft for this bug report.
9286
9287         * expression.cs (Conditional): If both the `trueExpr' and the
9288         `falseExpr' is a NullLiteral, return a NullLiteral.
9289
9290 2004-09-22  Martin Baulig  <martin@ximian.com>
9291
9292         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9293         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9294         for the "get_Current" call.
9295
9296 2004-09-21  Martin Baulig  <martin@ximian.com>
9297
9298         * convert.cs (Convert.ImplicitReferenceConversion): When
9299         converting to an interface type, first check whether we're
9300         converting from a reference type.
9301
9302 2004-09-14  Martin Baulig  <martin@ximian.com>
9303
9304         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9305
9306 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9307
9308         Fixed bug #61902
9309         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9310         called and is obsolete then this member suppress message
9311         when call is inside next [Obsolete] method or type.
9312
9313         * expression.cs: Use TestObsoleteMethodUsage member.
9314
9315 2004-09-14  Martin Baulig  <martin@ximian.com>
9316
9317         * genericparser.cs: Removed.
9318
9319 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9320
9321         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9322
9323 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9324
9325         * attribute.cs (Attribute.Resolve): Add error 653 report.
9326
9327         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9328         report.
9329         (Method.ApplyAttributeBuilder): Add error 685 report.
9330         (Operator.Define): Add error 564 report.
9331
9332         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9333
9334         * expression.cs (Invocation.DoResolve): Add error
9335         245 and 250 report.
9336
9337         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9338         error 674 report.
9339
9340 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9341
9342         * class.cs (ConstructorInitializer.Resolve):
9343         Wrong error number (515->516).
9344
9345 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9346
9347         * class.cs (Indexer.Define): Add error 631 report.
9348
9349 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9352
9353 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9354
9355         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9356
9357 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9358
9359         * cs-parser.jay: Added error CS0241 report.
9360
9361 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9362
9363         * cs-parser.jay (fixed_statement): Introduce a scope for the
9364         declaration in the 'fixed' statement.
9365
9366 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9367
9368         * cs-parser.jay: Added CS0230 error report.
9369
9370 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9371
9372         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9373
9374 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9375
9376         * expression.cs (Argument.Resolve): Added error CS0192 and
9377         CS0199 report.
9378
9379 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9380
9381         C# 2.0 #pragma warning feature
9382
9383         * cs-tokenizer.cs (PreProcessPragma): New method; 
9384         Handles #pragma directive.
9385
9386         * report.cs (WarningRegions): New class; Support
9387         class for #pragma warning directive. It tests whether
9388         warning is enabled for a given line.
9389
9390 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9391
9392         * const.cs: Add more descriptive error report, tahnks to
9393         Sebastien. 
9394
9395 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9396
9397         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9398
9399 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9400
9401         * expression.cs: Apply patch from Ben: Remove dead code from
9402         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9403         as that code just threw an exception anwyays.
9404
9405         * const.cs: Remove the call to the turnintoconstant, for details
9406         see bug: #63144
9407         
9408         * literal.cs: The type of the null-literal is the null type;  So
9409         we use a placeholder type (literal.cs:System.Null, defined here)
9410         for it.
9411
9412         * expression.cs (Conditional.DoResolve): Remove some old code that
9413         is no longer needed, conversions have been fixed.
9414
9415         (ArrayCreationExpression.DoResolve): Return false if we fail to
9416         resolve the inner expression.
9417
9418 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9419
9420         Fix test-290.cs.
9421         * cs-parser.jay (delegate_declaration): Record a delegate
9422         declaration as a type declaration.
9423         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9424
9425 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9426
9427         * parameter.cs: Do not crash if the type can not be resolved. 
9428
9429         * expression.cs: Report errors with unsafe pointers, fixes #64896
9430
9431 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9432
9433         * expression.cs: Pointer arith always needs to do a conv.i
9434         if the operand is a long. fix 65320
9435
9436 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9437
9438         Fixed cs0619-37.cs, cs0619-38.cs
9439
9440         * enum.cs (GetObsoleteAttribute): Removed.
9441
9442         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9443         on Enum member is double staged. The first is tested member
9444         and then enum.
9445
9446 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9447
9448         Fixed #56986, #63631, #65231
9449
9450         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9451         adds member to name container.
9452         (TypeContainer.AddToTypeContainer): New method, adds type to
9453         name container.
9454         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9455         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9456         AddOperator): Simplified by reusing AddToMemberContainer.
9457         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9458         instead of field.
9459         (Method.CheckForDuplications): Fixed implementation to test all
9460         possibilities.
9461         (MemberBase): Detection whether member is explicit interface
9462         implementation is now in constructor.
9463         (MemberBase.UpdateMemberName): Handles IndexerName.
9464         (Accessor): Changed to keep also location information.
9465         (AbstractPropertyEventMethod): Is derived from MemberCore.
9466         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9467         will be emited or not.
9468         (PropertyBase.AreAccessorsDuplicateImplementation):
9469         Tests whether accessors are not in collision with some method.
9470         (Operator): Is derived from MethodCore to simplify common
9471         operations.
9472
9473         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9474         must be performed.
9475         (DeclSpace.AddToContainer): Adds the member to defined_names
9476         table. It tests for duplications and enclosing name conflicts.
9477
9478         * enum.cs (EnumMember): Clean up to reuse the base structures
9479
9480 2004-09-03  Martin Baulig  <martin@ximian.com>
9481
9482         Merged latest changes into gmcs.  Please keep this comment in
9483         here, it makes it easier for me to see what changed in MCS since
9484         the last time I merged.
9485
9486 2004-09-03  Martin Baulig  <martin@ximian.com>
9487
9488         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9489         into TypeContainer, to make partial classes work again.
9490
9491 2004-09-03  Martin Baulig  <martin@ximian.com>
9492
9493         * rootcontext.cs (RootContext.V2): Removed.
9494
9495 2004-03-23  Martin Baulig  <martin@ximian.com>
9496
9497         * expression.cs (Invocation.OverloadResolve): Added `bool
9498         may_fail' argument and use it instead of the Location.IsNull() hack.
9499
9500 2004-09-09  Martin Baulig  <martin@ximian.com>
9501
9502         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9503
9504 2004-09-09  Martin Baulig  <martin@ximian.com>
9505
9506         * generic.cs (TypeParameter.DefineType): Added support for
9507         explicit interface methods.
9508
9509 2004-09-09  Martin Baulig  <martin@ximian.com>
9510
9511         * README.Changes: New document.  Started to list important changes
9512         between MCS and GMCS here.
9513
9514 2004-09-08  Martin Baulig  <martin@ximian.com>
9515
9516         * class.cs
9517         (TypeContainer.CheckRecursiveDefinition): New protected method.
9518         (TypeContainer.DefineType): Move the CS0146 check into
9519         CheckRecursiveDefinition().     
9520
9521 2004-09-06  Martin Baulig  <martin@ximian.com>
9522
9523         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9524         types for the constructor constraint.
9525
9526 2004-09-03  Martin Baulig  <martin@ximian.com>
9527
9528         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9529         into TypeContainer, to make partial classes work again.
9530
9531 2004-09-03  Martin Baulig  <martin@ximian.com>
9532
9533         * rootcontext.cs (RootContext.V2): Removed.
9534
9535 2004-03-23  Martin Baulig  <martin@ximian.com>
9536
9537         * expression.cs (Invocation.OverloadResolve): Added `bool
9538         may_fail' argument and use it instead of the Location.IsNull() hack.
9539
9540 2004-09-03  Martin Baulig  <martin@ximian.com>
9541
9542         Merged latest changes into gmcs.  Please keep this comment in
9543         here, it makes it easier for me to see what changed in MCS since
9544         the last time I merged.
9545
9546 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9547
9548         Fix #61128.
9549         * expression.cs (BetterConversion): Don't allow either conversion 
9550         to be null.  Remove redundant implicit conversion test when 'q ==
9551         null' -- when this function is invoked, we already know that the
9552         implicit conversion exists.
9553         (BetterFunction): Assume that 'best' is non-null.  Remove
9554         redundant reimplementation of IsApplicable when 'best' is null.
9555         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9556         number of arguments.
9557         (IsAncestralType): Extract from OverloadResolve.
9558         (OverloadResolve): Make robust to the MethodGroupExpr being
9559         unsorted.  Implement all the logic of Section 14.5.5.1, and
9560         support overloading of methods from multiple applicable types.
9561         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9562
9563         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9564         (RealError, Warning): Append type of report to related symbol.
9565
9566 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9567
9568         * enum.cs: Fixed CLS-Compliance checks for enum members.
9569         Error tests cs3008-8.cs, cs3014-8.cs
9570
9571 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9572
9573         Fixed bug #62342, #63102
9574         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9575         like ImplementMethod.
9576
9577 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9578
9579         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9580         Fixed bug #65170.
9581
9582 2004-09-02  Martin Baulig  <martin@ximian.com>
9583
9584         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9585         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9586         on the MethodBase.
9587
9588 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9589
9590         C# 2.0 Static classes implemented
9591
9592         * class.cs (TypeContainer): instance_constructors,
9593         initialized_fields, initialized_static_fields,
9594         default_constructor, base_inteface_types are protected to be
9595         accessible from StaticClass.
9596         (TypeContainer.DefineDefaultConstructor): New virtual method
9597         for custom default constructor generating
9598         (StaticClass): New class to handle "Static classes" feature.
9599
9600         * cs-parser.jay: Handle static keyword on class like instance
9601         of StaticClass.
9602
9603         * driver.cs: Added "/langversion" command line switch with two
9604         options (iso-1, default).
9605
9606 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9607
9608         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9609
9610 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9611
9612         * delegate.cs: Style.
9613
9614 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9615
9616         * delegate.cs: Add seperate instance expr field for miguel.
9617
9618 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9619
9620         * PointerArithmetic (Resolve): make sure we are not doing
9621         pointer arith on void*. Also, make sure we are resolved
9622         by not setting eclass until resolve.
9623
9624         All callers: Make sure that PointerArithmetic gets resolved.
9625
9626 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9627
9628         * ArrayCreation (LookupType): If the type does not resolve 
9629         to an array, give an error.
9630
9631 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9632
9633         * statement.cs (Try.Resolve): Fixed bug #64222
9634
9635 2004-08-27  Martin Baulig  <martin@ximian.com>
9636
9637         * class.cs
9638         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9639         crash here.     
9640
9641 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9642
9643         * ecore.cs (Constantify): Get underlying type via
9644         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9645         Windows in special cases.
9646
9647 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9648
9649         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9650         for obtaining also private methods.
9651         (GetRemoveMethod): Used GetRemoveMethod (true)
9652         for obtaining also private methods.
9653
9654 2004-09-02  Martin Baulig  <martin@ximian.com>
9655
9656         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9657         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9658         on the MethodBase.
9659
9660 2004-08-27  Martin Baulig  <martin@ximian.com>
9661
9662         * class.cs
9663         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9664         crash here.     
9665
9666 2004-08-25  Martin Baulig  <martin@ximian.com>
9667
9668         * support.cs (ReflectionParameters..ctor): If this is a generic
9669         method, retrieve and store its type parameters.
9670         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9671         (ReflectionParameters.GenericConstraints): The argument specifies
9672         the type parameter, not the method parameter.
9673         (InternalParameters.GenericConstraints): Likewise.
9674
9675         * generic.cs (TypeParameter.DefineType): Correctly handle
9676         constraints wrt. generic methods in interfaces and their
9677         implementations.        
9678
9679 2004-08-24  Martin Baulig  <martin@ximian.com>
9680
9681         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9682         (Constraints.IsSubclassOf): New internal method.
9683
9684         * typemanager.cs (TypeManager.FindMembers): Added special support
9685         for GenericTypeParameterBuilder's.      
9686         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9687         type parameters.
9688
9689 2004-08-24  Martin Baulig  <martin@ximian.com>
9690
9691         * typemanager.cs
9692         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9693         this for accessibility checks.
9694         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9695         IsNestedFamilyAccessible.
9696         (TypeManager.IsSubclassOf): New method, do what the name actually
9697         says.   
9698
9699 2004-08-24  Martin Baulig  <martin@ximian.com>
9700
9701         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9702         as a SimpleName, include the generic arity.
9703
9704 2004-08-24  Martin Baulig  <martin@ximian.com>
9705
9706         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9707         MethodAttributes.HideBySig for operators.
9708
9709 2004-08-23  Martin Baulig  <martin@ximian.com>
9710
9711         Back to the old error reporting system :-)
9712
9713         * report.cs (Message): Removed.
9714         (Report.MessageData, ErrorData, WarningData): Removed.
9715         (Report.Error, Warning): Back to the old system.
9716
9717 2004-08-23  Martin Baulig  <martin@ximian.com>
9718
9719         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9720
9721         * class.cs (TypeContainer.ParentContainer): New public virtual
9722         method; replaces the explicit interface implementation.
9723         (ClassPart.ParentContainer): Override.
9724
9725 2004-08-23  Martin Baulig  <martin@ximian.com>
9726
9727         * statement.cs (Switch): Added support for constant switches; see
9728         #59428 or test-285.cs.
9729
9730 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9731
9732         Fixed bug #62740.
9733         * statement.cs (GetEnumeratorFilter): Removed useless
9734         logic because C# specs is strict. GetEnumerator must be
9735         public.
9736
9737 2004-08-22  Martin Baulig  <martin@ximian.com>
9738
9739         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9740         a switch and may break, reset the barrier.  Fixes #59867.
9741
9742 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9743
9744         CLS-Compliance speed up (~5% for corlib)
9745
9746         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9747         New method. Tests container for CLS-Compliant names
9748
9749         * class.cs (TypeContainer.VerifyClsName): New method.
9750         Checks whether container name is CLS Compliant.
9751         (Constructor): Implements IMethodData.
9752
9753         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9754         low-case table for CLS Compliance test.
9755         (MemberCache.VerifyClsParameterConflict): New method.
9756         Checks method parameters for CS3006 error.
9757
9758         * enum.cs (EnumMember): Is derived from MemberCore.
9759         (Enum.VerifyClsName): Optimized for better performance.
9760
9761 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9762
9763         * report.cs: Renamed Error_T to Error and changed all
9764         references.
9765
9766 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9767
9768         * class.cs (TypeContainer.IndexerArrayList): New inner class
9769         container for indexers.
9770         (TypeContainer.DefaultIndexerName): New constant for default
9771         indexer name. Replaced all "Item" with this constant.
9772         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9773
9774         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9775         DefaultMemberAttribute constructor.
9776
9777 2004-08-05  Martin Baulig  <martin@ximian.com>
9778
9779         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9780         Fix bug #59429.
9781
9782 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9783
9784         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9785         multi platforms problem.
9786
9787         * compiler.csproj: Included shared files.
9788
9789 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9790
9791         Fix bug 60333, 55971 in the more general way
9792         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9793         Added arg_type argument for constant conversion.
9794         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9795
9796 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9797
9798         Fix bug #59760
9799         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9800         OperatorArrayList, MethodCoreArrayList for typecontainer
9801         containers. Changed class member types to these new types.
9802         (MethodArrayList.DefineMembers): Added test for CS0659.
9803
9804 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9805
9806         * cfold.cs: Synchronize the folding with the code in expression.cs
9807         Binary.DoNumericPromotions for uint operands.
9808
9809         * attribute.cs: Revert patch from Raja, it introduced a regression
9810         while building Blam-1.2.1 (hard to isolate a test case).
9811
9812 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9813
9814         Fix for #55382
9815         * class.cs:
9816         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9817         name collision.
9818         (MethodCore.parent_method): New member. The method we're overriding
9819         if this is an override method.
9820         (MethodCore.CheckBase): Moved from Method class and made common.
9821         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9822         private.
9823         (MethodCore.CheckForDuplications): New abstract method. For custom
9824         member duplication search in a container
9825         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9826         method and its return type.
9827         (Event.conflict_symbol): New member. Symbol with same name in the
9828         parent class.
9829
9830         * decl.cs:
9831         (MemberCache.FindMemberWithSameName): New method. The method
9832         is looking for conflict with inherited symbols.
9833
9834 2004-08-04  Martin Baulig  <martin@ximian.com>
9835
9836         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9837
9838         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9839
9840 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9841
9842         * report.cs (Message): New enum for better error, warning reference in
9843         the code.
9844         (MessageData): New inner abstract class. It generally handles printing of
9845         error and warning messages.
9846         Removed unused Error, Warning, Message methods.
9847
9848 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9849
9850         Fix for cs0592-8.cs test
9851         * attribute.cs
9852         (Attributable.ValidAttributeTargets): Made public.
9853         (Attribute.ExplicitTarget): New member for explicit target value.
9854         (Attribute.CheckTargets): Now we translate explicit attribute
9855         target to Target here.
9856
9857 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9858
9859         * ecore.cs (MethodGroupExpr): new IsBase property.
9860
9861         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9862
9863         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9864         rather than an instance expr.
9865
9866         (DelegateCreation.Emit): Use the method group rather than
9867         the instance expression. Also, if you have base.Foo as the
9868         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9869
9870         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9871
9872         (NewDelegate.DoResolve): Only check for the existance of Invoke
9873         if the method is going to be needed. Use MethodGroupExpr.
9874
9875         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9876
9877         * expression.cs: For pointer arith., make sure to use
9878         the size of the type, not the size of the pointer to
9879         the type.
9880
9881 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9882
9883         Fix for #60722
9884         * class.cs (Class): Added error CS0502 test.
9885
9886 2004-08-03  John Luke  <jluke@cfl.rr.com>
9887             Raja R Harinath  <rharinath@novell.com>
9888
9889         Fix for #60997.
9890         * attribute.cs (Attribute.complained_before): New flag.
9891         (Attribute.ResolveType, Attribute.Resolve),
9892         (Attribute.DefinePInvokeMethod): Set it.
9893         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9894         
9895 2004-08-03  Martin Baulig  <martin@ximian.com>
9896
9897         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9898         use a user-defined operator; we still need to do numeric
9899         promotions in case one argument is a builtin type and the other
9900         one has an implicit conversion to that type.  Fixes #62322.
9901
9902 2004-08-18  Martin Baulig  <martin@ximian.com>
9903
9904         * class.cs (Method.Define): Use the correct method name when
9905         creating the MethodBuilder for a generic method.
9906
9907 2004-08-17  Martin Baulig  <martin@ximian.com>
9908
9909         * generic.cs (Constraints): Support type parameter constraints.
9910
9911 2004-08-16  Martin Baulig  <martin@ximian.com>
9912
9913         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9914         (Token.GENERIC_DIMENSION): New token; this is returned if we
9915         encounter an unbound generic type in a typeof() expression.
9916
9917         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9918         this token is only generated while parsing a typeof() expression.
9919         (typeof_expression): Removed the old unbound_type hack.
9920
9921         * generic.cs (TypeArguments.IsUnbound): New public property.
9922
9923         * decl.cs (MemberName): Added support for unbound types.
9924
9925 2004-08-14  Martin Baulig  <martin@ximian.com>
9926
9927         * typemanager.cs
9928         (TypeManager.IsEqualGenericInstance): New static method.
9929         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9930         just used to check accessibility, so follow the rules of 26.1.6.        
9931
9932         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9933         ConstructedType instead of a TypeExpression if we have type arguments.
9934
9935         * cs-parser.jay (typeof_expression): Support unbound generic types.
9936
9937         * ecore.cs (UnboundTypeExpression): New public class.
9938
9939 2004-08-12  Martin Baulig  <martin@ximian.com>
9940
9941         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9942         TypeManager.IsEqual() rather than `=='.
9943
9944         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9945         generic instances as well.
9946
9947 2004-08-12  Martin Baulig  <martin@ximian.com>
9948
9949         * expression.cs (Invocation.InferType): We can only infer method
9950         type parameters.  Fixes #62647.
9951
9952 2004-08-11  Martin Baulig  <martin@ximian.com>
9953
9954         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9955         before resolving the base classes.
9956
9957 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9958
9959         * Makefile: install .mdb file too.
9960
9961 2004-08-05  Martin Baulig  <martin@ximian.com>
9962
9963         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9964         initializer, the current type is just the TypeBuilder, not the
9965         instantiated generic type.
9966         (FieldExpr.IsFieldInitializer): New public property.
9967
9968 2004-08-04  Martin Baulig  <martin@ximian.com>
9969
9970         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9971
9972         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9973
9974 2004-08-03  Martin Baulig  <martin@ximian.com>
9975
9976         * class.cs (MethodData.Define): If we're an explicit
9977         implementation, remove the generic arity from the type name.
9978
9979 2004-08-03  Martin Baulig  <martin@ximian.com>
9980
9981         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9982         use a user-defined operator; we still need to do numeric
9983         promotions in case one argument is a builtin type and the other
9984         one has an implicit conversion to that type.  Fixes #62322.
9985
9986 2004-08-02  Martin Baulig  <martin@ximian.com>
9987
9988         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9989         `TypeExpr[]' array.
9990         (TypeContainer.GetClassBases): Return the unexpanded list of
9991         interfaces; we expand them later.
9992         (TypeContainer.DefineType): After creating the TypeBuilder, call
9993         TypeManager.ExpandInterfaces() to get an expanded and resolved
9994         list of interfaces.
9995
9996         * ecore.cs (TypeExpr.GetInterfaces): Removed
9997
9998         * generics.cs (Constraints.InterfaceConstraints): Remove.
9999         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10000         register the interface constraints.
10001
10002         * typemanager.cs
10003         (TypeManager.AddUserType): Removed the `ifaces' argument.
10004         (TypeManager.AddTypeParameter): Likewise.
10005         (TypeManager.AddUserInterface): Removed, was unused.
10006         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10007         `TypeExpr[]' array for the interfaces.
10008         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10009         has been defined, returns a list of the resolved interfaces types.
10010         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10011         (TypeManager.GetExplicitInterfaces): Likewise.  
10012
10013 2004-08-02  Martin Baulig  <martin@ximian.com>
10014
10015         * expression.cs (Invocation.EmitCall): If we're invoking a method
10016         on a type parameter, use the new `Constrained' prefix opcode.
10017
10018 2004-08-02  Martin Baulig  <martin@ximian.com>
10019
10020         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10021         (LocalInfo.IsThis): New public property.
10022         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10023
10024 2004-08-01  Martin Baulig  <martin@ximian.com>
10025
10026         * class.cs (TypeContainer.GetClassBases): Don't set the default
10027         here since we may get called from GetPartialBases().
10028         (TypeContainer.DefineType): If GetClassBases() didn't return a
10029         parent, use the default one.
10030
10031 2004-07-30  Martin Baulig  <martin@ximian.com>
10032
10033         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10034
10035         * class.cs (SourceMethod): New public class, derive from the
10036         symbol writer's ISourceMethod.
10037         (Method): Use the new symbol writer API.
10038
10039         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10040         as argument and use the new symbol writer.
10041
10042         * location.cs
10043         (SourceFile): Implement the symbol writer's ISourceFile.
10044         (Location.SymbolDocument): Removed.
10045         (Location.SourceFile): New public property.
10046
10047         * symbolwriter.cs: Use the new symbol writer API.
10048
10049 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10050
10051         * Makefile (install-local): Remove.  Functionality moved to
10052         executable.make.
10053
10054 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10055
10056         * Makefile: Install mcs.exe.config file together with mcs.exe.
10057         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10058         correct runtime version.
10059         
10060 2004-07-25  Martin Baulig  <martin@ximian.com>
10061
10062         * class.cs
10063         (TypeContainer.RegisterOrder): Removed, this was unused.
10064         (TypeContainer, interface_order): Removed.
10065         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10066         TypeContainer as argument since we can also be called with a
10067         `PartialContainer' for a partial class/struct/interface.
10068         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10069         of checking whether we're an `Interface' - we could be a
10070         `PartialContainer'.
10071         (PartialContainer.Register): Override; call
10072         AddClass()/AddStruct()/AddInterface() on our parent.
10073
10074         * cs-parser.jay (interface_member_declaration): Add things to the
10075         `current_container', not the `current_class'.
10076
10077         * rootcontext.cs (RegisterOrder): The overloaded version which
10078         takes an `Interface' was unused, removed.
10079
10080         * typemanager.cs (TypeManager.LookupInterface): Return a
10081         `TypeContainer', not an `Interface'.
10082         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10083         contain a `PartialContainer' for an interface, so check it's
10084         `Kind' to figure out what it is.
10085
10086 2004-07-25  Martin Baulig  <martin@ximian.com>
10087
10088         * class.cs (Class.DefaultTypeAttributes): New public constant.
10089         (Struct.DefaultTypeAttributes): Likewise.
10090         (Interface.DefaultTypeAttributes): Likewise.
10091         (PartialContainer.TypeAttr): Override this and add the
10092         DefaultTypeAttributes.
10093
10094 2004-07-25  Martin Baulig  <martin@ximian.com>
10095
10096         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10097         we can just use the `Parent' field instead.
10098
10099 2004-07-25  Martin Baulig  <martin@ximian.com>
10100
10101         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10102
10103 2004-07-25  Martin Baulig  <martin@ximian.com>
10104
10105         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10106         our parts before defining any methods.
10107         (TypeContainer.VerifyImplements): Make this virtual.
10108         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10109         on our PartialContainer.
10110
10111 2004-07-25  Martin Baulig  <martin@ximian.com>
10112
10113         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10114
10115         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10116         argument, we can just use the `Parent' field instead.
10117
10118         * class.cs
10119         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10120         (MemberBase.DoDefine): Likewise.
10121
10122 2004-07-24  Martin Baulig  <martin@ximian.com>
10123
10124         * decl.cs (MemberCore.Parent): New public field.
10125         (DeclSpace.Parent): Moved to MemberCore.
10126
10127         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10128         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10129         parent's .ctor.
10130         (FieldBase, Field, Operator): Likewise.
10131         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10132         (EventField, Event): Likewise.
10133
10134 2004-07-23  Martin Baulig  <martin@ximian.com>
10135
10136         * class.cs (PartialContainer): New public class.
10137         (ClassPart): New public class.
10138         (TypeContainer): Added support for partial classes.
10139         (TypeContainer.GetClassBases): Splitted some of the functionality
10140         out into GetNormalBases() and GetPartialBases().
10141
10142         * cs-tokenizer.cs (Token.PARTIAL): New token.
10143         (Tokenizer.consume_identifier): Added some hacks to recognize
10144         `partial', but only if it's immediately followed by `class',
10145         `struct' or `interface'.
10146
10147         * cs-parser.jay: Added support for partial clases.
10148
10149 2004-07-23  Martin Baulig  <martin@ximian.com>
10150
10151         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10152         a `DeclSpace' and also made it readonly.
10153         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10154         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10155         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10156
10157         * cs-parser.jay: Pass the `current_class', not the
10158         `current_container' (at the moment, this is still the same thing)
10159         to a new Method, Property, Event, Indexer or Constructor.
10160
10161 2004-07-23  Martin Baulig  <martin@ximian.com>
10162
10163         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10164         and removed the `current_interface' one.
10165         (struct_declaration, class_declaration, interface_declaration):
10166         Set `current_class' to the newly created class/struct/interface;
10167         set their `Bases' and call Register() before parsing their body.
10168
10169 2004-07-23  Martin Baulig  <martin@ximian.com>
10170
10171         * class.cs (Kind): New public enum.
10172         (TypeContainer): Made this class abstract.
10173         (TypeContainer.Kind): New public readonly field.
10174         (TypeContainer.CheckDef): New public method; moved here from
10175         cs-parser.jay.
10176         (TypeContainer.Register): New public abstract method.
10177         (TypeContainer.GetPendingImplementations): New public abstract
10178         method.
10179         (TypeContainer.GetClassBases): Removed the `is_class' and
10180         `is_iface' parameters.
10181         (TypeContainer.DefineNestedTypes): Formerly known as
10182         DoDefineType().
10183         (ClassOrStruct): Made this class abstract.
10184
10185         * tree.cs (RootTypes): New public type. 
10186
10187 2004-07-20  Martin Baulig  <martin@ximian.com>
10188
10189         * tree.cs (Tree.RecordNamespace): Removed.
10190         (Tree.Namespaces): Removed.
10191
10192         * rootcontext.cs (RootContext.IsNamespace): Removed.
10193
10194         * cs-parser.jay (namespace_declaration): Just create a new
10195         NamespaceEntry here.
10196
10197 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10198
10199         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10200         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10201         entry to make sure it runs in the correct runtime version.
10202         
10203 2004-07-18  Martin Baulig  <martin@ximian.com>
10204
10205         * generic.cs (ConstructedType.CheckConstraints): Improved
10206         constraints checking.
10207
10208 2004-07-18  Martin Baulig  <martin@ximian.com>
10209
10210         * expression.cs (Invocation.BetterMethod): Call
10211         TypeManager.TypeToCoreType() on all types and removed my previous
10212         hack; we're already doig the right thing here.
10213
10214 2004-07-17  Martin Baulig  <martin@ximian.com>
10215
10216         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10217
10218 2004-07-16  Martin Baulig  <martin@ximian.com>
10219
10220         * iterators.cs: Added generics support.
10221
10222 2004-07-16  Martin Baulig  <martin@ximian.com>
10223
10224         * iterators.cs: Rewrote this.  We're now using one single Proxy
10225         class for both the IEnumerable and the IEnumerator interface and
10226         `Iterator' derives from Class so we can use the high-level API.
10227
10228         * class.cs (TypeContainer.AddIterator): New method.
10229         (TypeContainer.DoDefineType): New protected virtual method, which
10230         is called from DefineType().
10231         (TypeContainer.DoDefineMembers): Call DefineType() and
10232         DefineMembers() on all our iterators.
10233         (TypeContainer.Emit): Call Emit() on all our iterators.
10234         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10235
10236         * codegen.cs (EmitContext.CurrentIterator): New public field.
10237
10238 2004-07-15  Martin Baulig  <martin@ximian.com>
10239
10240         * typemanager.cs
10241         (TypeManager.not_supported_exception_type): New type.   
10242
10243 2004-07-14  Martin Baulig  <martin@ximian.com>
10244
10245         * typemanager.cs
10246         (TypeManager.generic_ienumerable_type): New type.
10247         (TypeManager.generic_ienumerator_type): New type.
10248
10249         * rootcontext.cs
10250         (RootContext.interfaces_first_stage): Added
10251         "System.Collections.Generic.IEnumerator`1" and
10252         "System.Collections.Generic.IEnumerable`1".     
10253
10254 2004-07-14  Martin Baulig  <martin@ximian.com>
10255
10256         * iterators.cs: Use real error numbers.
10257
10258 2004-07-14  Martin Baulig  <martin@ximian.com>
10259
10260         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10261         requires this to be a System.Collection.IEnumerable and not a
10262         class implementing that interface.
10263         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10264
10265 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10266
10267         * class.cs: Fixed previous fix, it broke some error tests.
10268
10269 2004-07-12  Martin Baulig  <martin@ximian.com>
10270
10271         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10272         Fixes #61293.
10273
10274 2004-07-14  Martin Baulig  <martin@ximian.com>
10275
10276         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10277         an exclamation mark (!) for the generic arity to reflect the
10278         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10279
10280 2004-07-13  Martin Baulig  <martin@ximian.com>
10281
10282         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10283         specifiers being part of a type argument.
10284
10285 2004-07-13  Martin Baulig  <martin@ximian.com>
10286
10287         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10288         name for generic types.
10289
10290 2004-07-13  Martin Baulig  <martin@ximian.com>
10291
10292         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10293         bit to fix #60119.
10294
10295 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10296
10297         * assign.cs (LocalTemporary): Add new argument: is_address,If
10298         `is_address' is true, then the value that we store is the address
10299         to the real value, and not the value itself.
10300         
10301         * ecore.cs (PropertyExpr): use the new local temporary
10302         stuff to allow us to handle X.Y += z (where X is a struct)
10303
10304 2004-07-08  Martin Baulig  <martin@ximian.com>
10305
10306         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10307         not always return, just like we're doing in Using.Resolve().
10308
10309 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * cs-parser.jay (fixed_statement): flag this as Pinned.
10312
10313 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10314
10315         * typemanager.cs (TypeManager): Removed MakePinned method, this
10316         mechanism is replaced with the .NET 2.x compatible mechanism of
10317         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10318
10319         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10320         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10321         `IsFixed' property which has a different meaning.
10322
10323 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10324
10325         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10326         visible from inside a nested class, not just the names of the
10327         immediately enclosing class.
10328         Fix for bug #60730.
10329
10330 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10331
10332         * expression.cs (BetterConversion): Remove buggy special-case
10333         handling of "implicit constant expression conversions".  At this
10334         point, we already know that the conversion is possible -- we're
10335         only checking to see which is better.
10336
10337 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10338
10339         * cs-parser.jay: Added error CS0210 test.
10340
10341 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10342
10343         * cs-parser.jay: Added error CS0134 test.
10344
10345 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10346
10347         Fix bug #52507
10348         * cs-parser.jay: Added error CS0145 test.
10349
10350 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10351
10352         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10353
10354 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10355         
10356         * expression.cs (StackAlloc.Resolve): The argument may not
10357         be a constant; deal with this case.
10358         
10359 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10360
10361         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10362         GetIndexerAttributeValue.
10363         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10364
10365         * class.cs (Indexer.Define): Added error tests for CS0415,
10366         CS0609.
10367
10368 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10369
10370         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10371         property code.
10372
10373 2004-06-23  Martin Baulig  <martin@ximian.com>
10374
10375         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10376         neither return nor throw, reset the barrier as well.  Fixes #60457.
10377
10378 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10379
10380         * class.cs : EventAttributes is now set to None by default.
10381           This fixes bug #60459.
10382
10383 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10384
10385         Fix bug #60219
10386         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10387         Don't throw exception but return null (it's sufficient now).
10388
10389 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10390
10391         * typemanager.cs (GetArgumentTypes): Faster implementation.
10392
10393 2004-06-18  Martin Baulig  <martin@ximian.com>
10394
10395         * attribute.cs (Attribute.Resolve): Check whether we're an
10396         EmptyCast which a Constant child.  Fixes #60333.
10397
10398 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10399
10400         * statement.cs (EmitCollectionForeach): Account for the fact that
10401         not all valuetypes are in areas which we can take the address of.
10402         For these variables, we store to a temporary variable. Also, make
10403         sure that we dont emit a `callvirt' on a valuetype method.
10404
10405 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10406
10407         * expression.cs (StackAlloc.DoReSolve): Added test for
10408         negative parameter (CS0247).
10409
10410 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10411
10412         Fix bug #59792
10413         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10414
10415 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10416
10417         Fix bug #59781
10418         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10419         ulong.
10420
10421 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10422
10423         Fix bug #58254 & cs1555.cs, cs1556.cs
10424         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10425
10426 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10427
10428         * cs-parser.jay: Added error CS1669 test for indexers.
10429
10430 2004-06-18  Martin Baulig  <martin@ximian.com>
10431
10432         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10433         argument.  Fixes #60441.
10434
10435 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10436         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10437         The name needs to have the actual name of the method in order
10438         for other tests (such as the one in OverloadResolve for Invoke
10439         on a delegate) to work. As well, it does not really help
10440         error reporting because the method group had multiple methods.
10441         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10442         Make profiling work.
10443         
10444 2004-06-13  Martin Baulig  <martin@ximian.com>
10445
10446         * cs-parser.jay: Don't allow generic attributes.
10447
10448 2004-06-13  Martin Baulig  <martin@ximian.com>
10449
10450         * class.cs (MemberBase.DoDefineBase): New protected method.
10451         (MemberBase.DoDefine): Compute the `flags' in the new
10452         DoDefineBase() which must be called first.
10453         (Method.Define): Call DoDefineBase() first so we have the flags
10454         when defining the generic method.
10455
10456         * cs-parser.jay (interface_method_declaration): Support generic methods.
10457
10458 2004-06-13  Martin Baulig  <martin@ximian.com>
10459
10460         * decl.cs (TypeName): Removed.
10461         (MemberName): Removed TypeName and MemberNow; now we just have
10462         MemberName.
10463
10464         * cs-parser.jay: Don't distinguish between type arguments and type
10465         parameters in the grammar and simplified the rules a bit.  The
10466         reduce/reduce conflicts are now gone (except the one we inherited
10467         from mcs).
10468
10469 2004-06-11  Martin Baulig  <martin@ximian.com>
10470
10471         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10472         call this twice: for params and varargs methods.
10473
10474 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10475
10476         * class.cs:
10477         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10478
10479 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10480
10481         * attribute.cs (Attribute.GetValidTargets): Made public.
10482
10483         * class.cs: 
10484         (AbstractPropertyEventMethod): New class for better code sharing.
10485         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10486         CS1667 report.
10487         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10488
10489 2004-06-09  Martin Baulig  <martin@ximian.com>
10490
10491         * cs-parser.jay: Removed a reduce/reduce conflict.
10492
10493 2004-06-03  Martin Baulig  <martin@ximian.com>
10494
10495         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10496         GetSimpleName() and return a SimpleName.
10497
10498         * ecore.cs (SimpleName.Arguments): New public field.
10499         (SimpleName): Added overloaded ctor which takes an additional
10500         TypeArguments argument.
10501         (SimpleName.SimpleNameResolve): Added support for generic methods.
10502         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10503         formerly in MemberAccess.DoResolve(), but we also need it in
10504         SimpleNameResolve().
10505
10506         * expression.cs (MemberAccess.DoResolve): Use the new
10507         MethodGroupExpr.ResolveGeneric().       
10508
10509 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10510
10511         * decl.cs: If possible, use lookuptypedirect here. We can only do
10512         this if there is no `.' after the namespace. Avoids using
10513         LookupType, which does lots of slow processing.
10514         (FindNestedType) New method, does what it says :-).
10515         * namespace.cs: use LookupTypeDirect.
10516         * rootcontext.cs: use membercache, if possible.
10517         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10518
10519 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10520
10521         * expression.cs:
10522         According to the spec, 
10523
10524         In a member access of the form E.I, if E is a single identifier,
10525         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10526         field, property, localvariable, or parameter with the same type as
10527         the meaning of E as a type-name (§3.8), then both possible
10528         meanings of E are permitted.
10529
10530         We did not check that E as a simple-name had the same type as E as
10531         a type name.
10532
10533         This trivial check gives us 5-7% on bootstrap time.
10534
10535 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10536
10537         * expression.cs (Invocation.OverloadResolve): Avoid the
10538         use of hashtables and boxing here by allocating on demand.
10539
10540 2004-05-30  Martin Baulig  <martin@ximian.com>
10541
10542         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10543         we're doing a silent lookup.  Don't try to lookup nested types in
10544         TypeManager.object_type (thanks to Ben Maurer).
10545
10546 2004-05-30  Martin Baulig  <martin@ximian.com>
10547
10548         Committing a patch from Ben Maurer.
10549
10550         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10551
10552 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10553
10554         * convert.cs: add a trivial cache for overload operator resolution.
10555
10556 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * attribute.cs
10559         (AttributeTester.GetObsoleteAttribute): Returns instance of
10560         ObsoleteAttribute when type is obsolete.
10561
10562         * class.cs
10563         (TypeContainer.VerifyObsoleteAttribute): Override.
10564         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10565         (MethodCode.VerifyObsoleteAttribute): Override.
10566         (MemberBase.VerifyObsoleteAttribute): Override.
10567
10568         * decl.cs
10569         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10570         and report proper error.
10571
10572         *delegate.cs
10573         (Delegate.VerifyObsoleteAttribute): Override.
10574
10575         * ecore.cs
10576         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10577         and report proper error.
10578         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10579
10580         * enum.cs
10581         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10582         and enum member.
10583
10584         * expression.cs
10585         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10586         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10587         Added test for ObsoleteAttribute.
10588
10589         * statement.cs
10590         (Catch): Derived from Statement.
10591
10592 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10593
10594         * decl.cs: If possible, use lookuptypedirect here. We can only do
10595         this if there is no `.' after the namespace. Avoids using
10596         LookupType, which does lots of slow processing.
10597         (FindNestedType) New method, does what it says :-).
10598         * namespace.cs: use LookupTypeDirect.
10599         * rootcontext.cs: use membercache, if possible.
10600         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10601
10602 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10603
10604         * expression.cs:
10605         According to the spec, 
10606
10607         In a member access of the form E.I, if E is a single identifier,
10608         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10609         field, property, localvariable, or parameter with the same type as
10610         the meaning of E as a type-name (§3.8), then both possible
10611         meanings of E are permitted.
10612
10613         We did not check that E as a simple-name had the same type as E as
10614         a type name.
10615
10616         This trivial check gives us 5-7% on bootstrap time.
10617
10618 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10619
10620         Fixed bug #59071 & cs0160.cs
10621         * statement.cs (Try.Resolve): Check here whether order of catch
10622         clauses matches their dependencies.
10623
10624 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10625
10626         Fixed bug #58624
10627         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10628         unsafe type.
10629
10630 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10631
10632         * expression.cs (Invocation.OverloadResolve): Avoid the
10633         use of hashtables and boxing here by allocating on demand.
10634
10635 2004-05-30  Martin Baulig  <martin@ximian.com>
10636
10637         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10638         we're doing a silent lookup.  Don't try to lookup nested types in
10639         TypeManager.object_type (thanks to Ben Maurer).
10640
10641 2004-05-30  Martin Baulig  <martin@ximian.com>
10642
10643         Committing a patch from Ben Maurer.
10644
10645         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10646
10647 2004-05-29  Martin Baulig  <martin@ximian.com>
10648
10649         * class.cs (IMethodData.ShouldIgnore): New method.
10650
10651         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10652         `Location' argument, we don't need it anywhere.  Use
10653         `IMethodData.ShouldIgnore ()' instead of
10654         `MethodData.GetMethodFlags ()'.
10655         (TypeManager.AddMethod): Removed.
10656         (TypeManager.AddMethod2): Renamed to AddMethod.
10657
10658 2004-05-29  Martin Baulig  <martin@ximian.com>
10659
10660         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10661
10662         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10663         converting from a class type S to an interface type and we already
10664         have an object on the stack, don't box it again.  Fixes #52578.
10665
10666 2004-05-29  Martin Baulig  <martin@ximian.com>
10667
10668         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10669         Added support for `params' parameters.  Fixes #59267.
10670
10671 2004-05-29  Martin Baulig  <martin@ximian.com>
10672
10673         * literal.cs (NullPointer): Provide a private .ctor which sets
10674         `type' to TypeManager.object_type.  Fixes #59048.
10675
10676 2004-05-29  Martin Baulig  <martin@ximian.com>
10677
10678         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10679         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10680
10681         * ecore.cs (EventExpr.instance_expr): Make the field private.
10682
10683 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10684
10685         Fixed bug #50080 & cs0214-2.cs
10686         * expression.cs (Cast.DoResolve): Check unsafe context here.
10687         
10688         * statement.cs (Resolve.DoResolve): Likewise.
10689
10690 2004-05-26  Martin Baulig  <martin@ximian.com>
10691
10692         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10693
10694         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10695         (RootContext.LookupType): Pass down the `silent' flag.
10696
10697 2004-05-25  Martin Baulig  <martin@ximian.com>
10698
10699         * expression.cs
10700         (MethodGroupExpr.IdenticalTypeName): New public property.
10701         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10702         expression actually refers to a type.
10703
10704 2004-05-25  Martin Baulig  <martin@ximian.com>
10705
10706         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10707         for #56176 and made it actually work.
10708
10709 2004-05-25  Martin Baulig  <martin@ximian.com>
10710
10711         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10712         (FieldExpr, PropertyExpr): Override and implement
10713         CacheTemporaries.  Fixes #52279.
10714
10715 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10716
10717         * location.cs: In the new compiler listing a file twice is a
10718         warning, not an error.
10719
10720 2004-05-24  Martin Baulig  <martin@ximian.com>
10721
10722         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10723         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10724
10725 2004-05-24  Martin Baulig  <martin@ximian.com>
10726
10727         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10728         walking the `using' list.  Fixes #53921.
10729
10730 2004-05-24  Martin Baulig  <martin@ximian.com>
10731
10732         * const.cs (Const.LookupConstantValue): Added support for
10733         EmptyCast's; fixes #55251.
10734
10735 2004-05-24  Martin Baulig  <martin@ximian.com>
10736
10737         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10738         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10739         which does the CS0135 check.  The reason is that we first need to
10740         check whether the variable actually exists.
10741
10742 2004-05-24  Martin Baulig  <martin@ximian.com>
10743
10744         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10745         than RootContext.LookupType() to find the explicit interface
10746         type.  Fixes #58584.
10747
10748 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10749
10750         * Makefile: Simplify.  Use executable.make.
10751         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10752
10753 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10754
10755         * decl.cs:
10756         * enum.cs:
10757         Use the invariant culture when doing String.Compare for CLS case
10758         sensitivity.
10759         
10760 2004-05-23  Martin Baulig  <martin@ximian.com>
10761
10762         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10763         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10764
10765         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10766
10767 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10768
10769         * class.cs (MemberBase.Define): Reuse MemberType member for 
10770         resolved type. Other methods can use it too.
10771
10772 2004-05-23  Martin Baulig  <martin@ximian.com>
10773
10774         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10775         the variable also exists in the current block (otherwise, we need
10776         to report a CS0103).  Fixes #58670.
10777
10778 2004-05-23  Martin Baulig  <martin@ximian.com>
10779
10780         * flowanalysis.cs (Reachability.Reachable): Compute this
10781         on-the-fly rather than storing it as a field.
10782
10783 2004-05-23  Martin Baulig  <martin@ximian.com>
10784
10785         * flowanalysis.cs (Reachability.And): Manually compute the
10786         resulting `barrier' from the reachability.      
10787        
10788 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10789
10790         Fix bug #57835
10791         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10792         instance of ObsoleteAttribute when symbol is obsolete.
10793
10794         * class.cs
10795         (IMethodData): Extended interface for ObsoleteAttribute support.
10796
10797 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10798
10799         * attribute.cs: Fix bug #55970
10800
10801 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10802
10803         Fix bug #52705
10804         * attribute.cs
10805         (GetObsoleteAttribute): New method. Creates the instance of
10806         ObsoleteAttribute.
10807         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10808         ObsoleteAttribute when member is obsolete.
10809         (AttributeTester.Report_ObsoleteMessage): Common method for
10810         Obsolete error/warning reporting.
10811
10812         * class.cs
10813         (TypeContainer.base_classs_type): New member for storing parent type.
10814
10815         * decl.cs
10816         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10817         for this MemberCore.
10818
10819 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10820
10821         * attribute.cs, const.cs: Fix bug #58590
10822
10823 2004-05-21  Martin Baulig  <martin@ximian.com>
10824
10825         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10826         out parameters if the end of the method is unreachable.  Fixes
10827         #58098. 
10828
10829 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10830
10831         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10832         Hari was right, why extra method.
10833
10834 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10835
10836         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10837
10838 2004-05-20  Martin Baulig  <martin@ximian.com>
10839
10840         * delegate.cs: Convert this file to Unix mode - like the original
10841         version in mcs is.
10842
10843 2004-05-20  Martin Baulig  <martin@ximian.com>
10844
10845         * attribute.cs: Convert this file to Unix mode - like the original
10846         version in mcs is.
10847
10848 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10849
10850        Fix bug #58688 (MCS does not report error when the same attribute
10851        is assigned twice)
10852
10853        * attribute.cs (Attribute.Emit): Distinction between null and default.
10854
10855 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10856
10857        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10858        of a top-level attribute without an attribute target.
10859        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10860        Make non-static.
10861        (Attribute.Conditional_GetConditionName), 
10862        (Attribute.Obsolete_GetObsoleteMessage): Update.
10863        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10864        part of ScanForIndexerName.
10865        (Attribute.CanIgnoreInvalidAttribute): New function.
10866        (Attribute.ScanForIndexerName): Move to ...
10867        (Attributes.ScanForIndexerName): ... here.
10868        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10869        (Attributes.Search): New internal variant that can choose not to
10870        complain if types aren't resolved.  The original signature now
10871        complains.
10872        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10873        complaints suppressed.
10874        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10875        only if it not useful.
10876        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10877        top-level for attributes that are shared between the assembly
10878        and a top-level class.
10879        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10880        * class.cs: Update to reflect changes.
10881        (DefineIndexers): Fuse loops.
10882        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10883        a couple more variants of attribute names.
10884
10885 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10886
10887         Fix bug #52585 (Implemented explicit attribute declaration)
10888
10889         * attribute.cs:
10890         (Attributable.ValidAttributeTargets): New abstract method. It gets
10891         list of valid attribute targets for explicit target declaration.
10892         (Attribute.Target): It holds target itself.
10893         (AttributeSection): Removed.
10894         (Attribute.CheckTargets): New method. It checks whether attribute
10895         target is valid for the current element.
10896
10897         * class.cs:
10898         (EventProperty): New class. For events that are declared like
10899         property (with add and remove accessors).
10900         (EventField): New class. For events that are declared like field.
10901         class.cs
10902
10903         * cs-parser.jay: Implemented explicit attribute target declaration.
10904
10905         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10906         Override ValidAttributeTargets.
10907
10908         * parameter.cs:
10909         (ReturnParameter): Class for applying custom attributes on 
10910         the return type.
10911         (ParameterAtribute): New class. Class for applying custom
10912         attributes on the parameter type.
10913
10914 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10917         definitions. 
10918
10919         (Method): Allow UNSAFE here.
10920
10921         * modifiers.cs: Support unsafe reporting.
10922
10923 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10924
10925         * decl.cs: Fix bug #58478.
10926
10927 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10928
10929         * statement.cs: When checking for unreachable code on an EmptyStatement,
10930         set the location. Fixes bug #58488.
10931
10932 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10933
10934         * driver.cs: Add -pkg handling.
10935
10936         From Gonzalo: UseShelLExecute=false
10937
10938 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10939
10940         * attribute.cs:
10941         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10942         for attribute.
10943         (Attribute.IsClsCompliaceRequired): Moved to base for better
10944         accesibility.
10945         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10946         when attribute is AttributeUsageAttribute.
10947         (Attribute.GetValidTargets): Simplified.
10948         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10949         attribute for this type.
10950         (Attribute.ApplyAttributes): Method renamed to Emit and make
10951         non-static.
10952         (GlobalAttributeSection): New class for special handling of global
10953         attributes (assembly, module).
10954         (AttributeSection.Emit): New method.
10955
10956         * class.cs: Implemented Attributable abstract methods.
10957         (MethodCore.LabelParameters): Moved to Parameter class.
10958         (Accessor): Is back simple class.
10959         (PropertyMethod): Implemented Attributable abstract class.
10960         (DelegateMethod): Implemented Attributable abstract class.
10961         (Event): New constructor for disctintion between normal Event
10962         and Event with accessors.
10963
10964         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10965
10966         * codegen.cs, const.cs, decl.cs, delegate.cs:
10967         (CommonAssemblyModulClass): Implemented Attributable abstract class
10968         and simplified.
10969
10970         * enum.cs: Implement IAttributeSupport interface.
10971         (EnumMember): New class for emum members. Implemented Attributable
10972         abstract class
10973
10974         * parameter.cs:
10975         (ParameterBase): Is abstract.
10976         (ReturnParameter): New class for easier [return:] attribute handling.
10977
10978         * typemanager.cs: Removed builder_to_attr.
10979
10980 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10981
10982         Fix bug #57151.
10983         * attribute.cs (Attribute.GetPositionalValue): New function.
10984         * class.cs (TypeContainer.VerifyMembers): New function.
10985         (TypeContainer.Emit): Use it.
10986         (ClassOrStruct): New base class for Class and Struct.
10987         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10988         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10989         class.
10990         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10991         then each non-static field should have a FieldOffset attribute.
10992         Otherwise, none of the fields should have a FieldOffset attribute.
10993         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10994         and FieldOffset attributes.
10995         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10996         (TypeManager.field_offset_attribute_type): New core types.
10997         (TypeManager.InitCoreTypes): Initialize them.
10998
10999 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11000
11001         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11002         Return correct type.
11003         From bug #58270.
11004
11005 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11006
11007         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11008         be implicitly converted to ulong.
11009         
11010         * expression.cs: The logic for allowing operator &, | and ^ worked
11011         was wrong, it worked before because we did not report an error in
11012         an else branch.  Fixes 57895.
11013
11014         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11015         allow volatile fields to be reference types.
11016
11017 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11018
11019         * driver.cs: Add support for /debug-
11020
11021 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11022
11023         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11024         Add a 'complain' parameter to silence errors.
11025         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11026         silently overlooked type-resolutions.
11027         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11028         to reflect changes.
11029         (Attributes.Search): New function.
11030         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11031         (Attributes.GetAttributeFullName): Remove hack.
11032         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11033         Update to reflect changes.
11034         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11035         Use Attributes.Search instead of nested loops.
11036
11037 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11038
11039         * decl.cs:
11040         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11041         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11042         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11043
11044         * report.cs: (Report.Warning): Renamed to Warning_T because of
11045         parameter collision.
11046
11047 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11048
11049         * expression.cs (MemberAccess.ResolveMemberAccess):
11050         Exit with non-zero status after Report.Error.
11051         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11052         Likewise.
11053         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11054
11055 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11056
11057         * support.cs: Don't hang when the file is empty.
11058
11059 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11060
11061         * support.cs: In SeekableStreamReader, compute the preamble size of the
11062           underlying stream. Position changes should take into account that initial
11063           count of bytes.
11064
11065 2004-05-03  Todd Berman  <tberman@sevenl.net>
11066
11067         * driver.cs: remove unused GetSysVersion function.
11068
11069 2004-05-03  Todd Berman  <tberman@sevenl.net>
11070
11071         * driver.cs: Remove the hack from saturday, as well as the hack
11072         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11073         link_paths to get that bit proper.
11074
11075 2004-05-01  Todd Berman  <tberman@sevenl.net>
11076
11077         * driver.cs: Try a LoadFrom before a Load, this checks the current
11078         path. This is currently a bug in mono that is be fixed, however, this
11079         provides a workaround for now. This will be removed when the bug
11080         is fixed.
11081
11082 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11083
11084         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11085         incomplete key pairs (#57941).
11086
11087 2004-05-01  Todd Berman  <tberman@sevenl.net>
11088
11089         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11090         from the GAC
11091
11092 2004-04-30  Jackson Harper  <jackson@ximian.com>
11093
11094         * codegen.cs: Open keys readonly.
11095         
11096 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11097
11098         * typemanager.cs: don't report cyclic struct layout when a struct
11099         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11100         which has 2 Pango.Rectangle fields.
11101
11102 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11103
11104         * expression.cs: Handle IntPtr comparisons with IL code
11105         rather than a method call.
11106
11107 2004-04-29  Martin Baulig  <martin@ximian.com>
11108
11109         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11110         the list of PropertyInfo's in class hierarchy and find the
11111         accessor.  Fixes #56013.
11112
11113 2004-04-29  Martin Baulig  <martin@ximian.com>
11114
11115         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11116
11117 2004-04-29  Martin Baulig  <martin@ximian.com>
11118
11119         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11120
11121         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11122
11123 2004-04-29  Martin Baulig  <martin@ximian.com>
11124
11125         * class.cs (ConstructorInitializer.Resolve): Check whether the
11126         parent .ctor is accessible.  Fixes #52146.
11127
11128 2004-04-29  Martin Baulig  <martin@ximian.com>
11129
11130         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11131
11132         * statement.cs (Using.EmitLocalVariableDecls): Use
11133         TypeManager.idisposable_type, not typeof (IDisposable).
11134         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11135
11136 2004-04-29  Martin Baulig  <martin@ximian.com>
11137
11138         * class.cs (Event.Define): Don't emit the field and don't set
11139         RTSpecialName and SpecialName for events on interfaces.  Fixes
11140         #57703. 
11141
11142 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11143
11144         Refactor Attribute.ApplyAttributes.
11145         * attribute.cs (Attributable): New base class for objects that can
11146         have Attributes applied on them.
11147         (Attribute): Make AttributeUsage fields public.
11148         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11149         (Attribute.IsInternalCall): New property.
11150         (Attribute.UsageAttr): Convert to a public read-only property.
11151         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11152         (Attribute.ResolveType, Attribute.Resolve)
11153         (Attribute.ScanForIndexerName): Update to reflect changes.
11154         (Attribute.CheckAttributeTarget): Re-format.
11155         (Attribute.ApplyAttributes): Refactor, to various
11156         Attributable.ApplyAttributeBuilder methods.
11157         * decl.cs (MemberCore): Make Attributable.
11158         * class.cs (Accessor): Make Attributable.
11159         (MethodData.ApplyAttributes): Use proper attribute types, not
11160         attribute names.
11161         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11162         (TypeContainer.ApplyAttributeBuilder)
11163         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11164         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11165         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11166         (Operator.ApplyAttributeBuilder): New factored-out methods.
11167         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11168         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11169         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11170         * parameter.cs (ParameterBase): New Attributable base class
11171         that can also represent Return types.
11172         (Parameter): Update to the changes.
11173
11174 2004-04-29  Jackson Harper  <jackson@ximian.com>
11175
11176         * driver.cs: Prefer the corlib system version when looking for
11177         assemblies in the GAC. This is still a hack, but its a better hack
11178         now.
11179         
11180 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11181
11182         * decl.cs, enum.cs: Improved error 3005 reporting.
11183   
11184         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11185         (related_symbols): New private member for list of symbols
11186         related to reported error/warning.
11187         
11188         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11189
11190 2004-04-29  Martin Baulig  <martin@ximian.com>
11191
11192         * ecore.cs (Expression.Constantify): If we're an enum and
11193         TypeManager.TypeToCoreType() doesn't give us another type, use
11194         t.UnderlyingSystemType.  Fixes #56178.  
11195
11196 2004-04-29  Martin Baulig  <martin@ximian.com>
11197
11198         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11199         interfaces and for each interface, only add members directly
11200         declared in that interface.  Fixes #53255.
11201
11202 2004-04-28  Martin Baulig  <martin@ximian.com>
11203
11204         * expression.cs (ConditionalLogicalOperator): Use a temporary
11205         variable for `left' to avoid that we evaluate it more than once;
11206         bug #52588.
11207
11208 2004-04-28  Martin Baulig  <martin@ximian.com>
11209
11210         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11211         `void[]' (CS1547).
11212
11213 2004-04-28  Martin Baulig  <martin@ximian.com>
11214
11215         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11216         void (CS1547).
11217
11218         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11219         whether the type is not void (CS1547).
11220
11221 2004-04-28  Martin Baulig  <martin@ximian.com>
11222
11223         * expression.cs (Unary.DoResolveLValue): Override this and report
11224         CS0131 for anything but Operator.Indirection.
11225
11226 2004-04-28  Martin Baulig  <martin@ximian.com>
11227
11228         Committing a patch from Ben Maurer; see bug #50820.
11229
11230         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11231         check for classes.
11232
11233         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11234         classes.        
11235
11236 2004-04-28  Martin Baulig  <martin@ximian.com>
11237
11238         Committing a patch from Ben Maurer; see bug #50820.
11239
11240         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11241         check for classes.
11242
11243         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11244         classes.        
11245
11246 2004-04-28  Martin Baulig  <martin@ximian.com>
11247
11248         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11249         (Block.AddLabel): Call DoLookupLabel() to only search in the
11250         current block.
11251
11252 2004-04-28  Martin Baulig  <martin@ximian.com>
11253
11254         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11255         comparing StringConstants and NullLiterals in Equality and Inequality.
11256
11257 2004-04-28  Jackson Harper  <jackson@ximian.com>
11258
11259         * driver.cs: Attempt to load referenced assemblies from the
11260         GAC. This is the quick and dirty version of this method that
11261         doesnt take into account versions and just takes the first
11262         canidate found. Will be good enough for now as we will not have more
11263         then one version installed into the GAC until I update this method.
11264
11265 2004-04-28  Martin Baulig  <martin@ximian.com>
11266
11267         * typemanager.cs (TypeManager.CheckStructCycles): New public
11268         static method to check for cycles in the struct layout.
11269
11270         * rootcontext.cs (RootContext.PopulateTypes): Call
11271         TypeManager.CheckStructCycles() for each TypeContainer.
11272         [Note: We only need to visit each type once.]
11273
11274 2004-04-28  Martin Baulig  <martin@ximian.com>
11275
11276         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11277
11278         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11279         success and added `out object value'.  Use a `bool resolved' field
11280         to check whether we've already been called rather than
11281         `ConstantValue != null' since this breaks for NullLiterals.
11282
11283 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11284
11285         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11286         setting of this flag, since the 'set' method may be non-public.
11287
11288 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11289
11290         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11291         check on current_vector.Block.
11292
11293 2004-04-27  Martin Baulig  <martin@ximian.com>
11294
11295         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11296         a field initializer.  Fixes #56459.
11297
11298 2004-04-27  Martin Baulig  <martin@ximian.com>
11299
11300         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11301         we're not attempting to use an indexer.  Fixes #52154.
11302
11303 2004-04-27  Martin Baulig  <martin@ximian.com>
11304
11305         * statement.cs (Return): Don't create a return label if we don't
11306         need it; reverts my change from January 20th.  Thanks to Ben
11307         Maurer for this.
11308
11309 2004-04-27  Martin Baulig  <martin@ximian.com>
11310
11311         According to the spec, `goto' can only leave a nested scope, but
11312         never enter it.
11313
11314         * statement.cs (Block.LookupLabel): Only lookup in the current
11315         block, don't recurse into parent or child blocks.
11316         (Block.AddLabel): Check in parent and child blocks, report
11317         CS0140/CS0158 if we find a duplicate.
11318         (Block): Removed this indexer for label lookups.
11319         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11320         this already does the error reporting for us.
11321
11322         * flowanalysis.cs
11323         (FlowBranching.UsageVector.Block): New public variable; may be null.
11324         (FlowBranching.CreateSibling): Added `Block' argument.
11325         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11326         label for the target of a `goto' and check whether we're not
11327         leaving a `finally'.
11328
11329 2004-04-27  Martin Baulig  <martin@ximian.com>
11330
11331         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11332         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11333         just for returns).
11334
11335 2004-04-27  Martin Baulig  <martin@ximian.com>
11336
11337         * statement.cs (Block.AddLabel): Also check for implicit blocks
11338         and added a CS0158 check.
11339
11340 2004-04-27  Martin Baulig  <martin@ximian.com>
11341
11342         * flowanalysis.cs (FlowBranchingLoop): New class.
11343         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11344         UsageVector's instead of an ArrayList.
11345         (FlowBranching.Label): Likewise.
11346         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11347         (FlowBranching.AddBreakVector): New method.
11348
11349 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11350
11351         * attribute.cs: Small regression fix: only convert the type if we
11352         the type is different, fixes System.Drawing build.
11353
11354 2004-04-27  Martin Baulig  <martin@ximian.com>
11355
11356         * attribute.cs (Attribute.Resolve): If we have a constant value
11357         for a named field or property, implicity convert it to the correct
11358         type.
11359
11360 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11361
11362         * statement.cs (Block.Block): Implicit blocks share
11363         'child_variable_names' fields with parent blocks.
11364         (Block.AddChildVariableNames): Remove.
11365         (Block.AddVariable): Mark variable as "used by a child block" in
11366         every surrounding block.
11367         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11368         been used in a child block, complain about violation of "Invariant
11369         meaning in blocks" rule.
11370         * cs-parser.jay (declare_local_variables): Don't use
11371         AddChildVariableNames.
11372         (foreach_statement): Don't create an implicit block: 'foreach'
11373         introduces a scope.
11374
11375 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11376
11377         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11378         converting from 0L to ulong.  Fixes 57522.
11379
11380 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11381
11382         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11383         derived class hides via 'new' keyword field from base class (test-242.cs).
11384         TODO: Handle this in the more general way.
11385         
11386         * class.cs (CheckBase): Ditto.
11387
11388 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11389
11390         * decl.cs (caching_flags): New member for storing cached values
11391         as bit flags.
11392         (MemberCore.Flags): New enum where bit flags for caching_flags
11393         are defined.
11394         (MemberCore.cls_compliance): Moved to caching_flags.
11395         (DeclSpace.Created): Moved to caching_flags.
11396
11397         * class.cs: Use caching_flags instead of DeclSpace.Created
11398         
11399 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11400
11401         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11402         if we are only a derived class, not a nested class.
11403
11404         * typemanager.cs: Same as above, but do this at the MemberLookup
11405         level (used by field and methods, properties are handled in
11406         PropertyExpr).   Allow for the qualified access if we are a nested
11407         method. 
11408
11409 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11410
11411         * class.cs: Refactoring.
11412         (IMethodData): New inteface; Holds links to parent members
11413         to avoid member duplication (reduced memory allocation).
11414         (Method): Implemented IMethodData interface.
11415         (PropertyBase): New inner classes for get/set methods.
11416         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11417         (Event): New inner classes for add/remove methods.
11418         (Event.DelegateMethod): Implemented IMethodData interface.
11419
11420         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11421         EmitContext (related to class.cs refactoring).
11422
11423 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11424
11425         * delegate.cs (Delegate.VerifyApplicability): If the number of
11426         arguments are the same as the number of parameters, first try to
11427         verify applicability ignoring  any 'params' modifier on the last
11428         parameter.
11429         Fixes #56442.
11430
11431 2004-04-08  Martin Baulig  <martin@ximian.com>
11432
11433         Merged latest changes into gmcs.  Please keep this comment in
11434         here, it makes it easier for me to see what changed in MCS since
11435         the last time I merged.
11436
11437 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11438
11439         * class.cs (TypeContainer.AddIndexer): Use
11440         'ExplicitInterfaceName' to determine if interface name was
11441         explicitly specified.  'InterfaceType' is not initialized at this time.
11442         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11443         Indexers array is already in the required order.  Initialize
11444         'IndexerName' only if there are normal indexers.
11445         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11446         (TypeContainer.Emit): Emit DefaultMember attribute only if
11447         IndexerName is initialized.
11448         Fixes #56300.
11449
11450 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11451
11452         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11453         Fixes #57007
11454
11455 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11456
11457         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11458         attributes.
11459         Fix for #56456.
11460
11461         * attribute.cs (Attribute.Resolve): Check for duplicate named
11462         attributes.
11463         Fix for #56463.
11464
11465 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11466
11467         * iterators.cs (MarkYield): track whether we are in an exception,
11468         and generate code accordingly.  Use a temporary value to store the
11469         result for our state.
11470
11471         I had ignored a bit the interaction of try/catch with iterators
11472         since their behavior was not entirely obvious, but now it is
11473         possible to verify that our behavior is the same as MS .NET 2.0
11474
11475         Fixes 54814
11476
11477 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11478
11479         * iterators.cs: Avoid creating temporaries if there is no work to
11480         do. 
11481
11482         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11483         Enumerations, use TypeManager.EnumToUnderlying and call
11484         recursively. 
11485
11486         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11487         bug #57013
11488
11489         (This.Emit): Use EmitContext.EmitThis to emit our
11490         instance variable.
11491
11492         (This.EmitAssign): Ditto.
11493
11494         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11495         codepaths, we will move all the functionality into
11496         Mono.CSharp.This 
11497
11498         (FieldExpr.EmitAssign): Ditto.
11499
11500         This fixes several hidden bugs that I uncovered while doing a code
11501         review of this today.
11502
11503         * codegen.cs (EmitThis): reworked so the semantics are more clear
11504         and also support value types "this" instances.
11505
11506         * iterators.cs: Changed so that for iterators in value types, we
11507         do not pass the value type as a parameter.  
11508
11509         Initialization of the enumerator helpers is now done in the caller
11510         instead of passing the parameters to the constructors and having
11511         the constructor set the fields.
11512
11513         The fields have now `assembly' visibility instead of private.
11514
11515 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11516
11517         * expression.cs (Argument.Resolve): Check if fields passed as ref
11518         or out are contained in a MarshalByRefObject.
11519
11520         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11521         another compiler type.
11522
11523 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11524
11525         * class.cs (Indexer.Define): use the new name checking method.
11526         Also, return false on an error.
11527         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11528         (is_identifier_[start/part]_character): make static.
11529
11530 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11531
11532         * expression.cs (Binary.ResolveOperator): Do no append strings
11533         twice: since we can be invoked more than once (array evaluation)
11534         on the same concatenation, take care of this here.  Based on a fix
11535         from Ben (bug #56454)
11536
11537 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11538
11539         * codegen.cs: Fix another case where CS1548 must be reported (when 
11540         delay-sign isn't specified and no private is available #56564). Fix
11541         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11542         error when MCS is used on the MS runtime and we need to delay-sign 
11543         (which seems unsupported by AssemblyBuilder - see #56621).
11544
11545 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11546
11547         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11548         (TypeManager.ComputeNamespaces): Faster implementation for
11549         Microsoft runtime.
11550
11551         * compiler.csproj: Updated AssemblyName to mcs.
11552
11553 2004-05-11  Jackson Harper  <jackson@ximian.com>
11554
11555         * Makefile: Preserve MONO_PATH
11556         
11557 2004-05-11  Jackson Harper  <jackson@ximian.com>
11558
11559         * Makefile: Use mono and mcs to build gmcs
11560         
11561 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * codegen.cs: Add patch from Robert Shade
11564         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11565         sync with mcs.
11566
11567 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11568
11569         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11570         incomplete key pairs (#57941).
11571
11572 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11573
11574         * codegen.cs: Fix another case where CS1548 must be reported (when 
11575         delay-sign isn't specified and no private is available #56564). Fix
11576         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11577         error when MCS is used on the MS runtime and we need to delay-sign 
11578         (which seems unsupported by AssemblyBuilder - see #56621).
11579
11580 2004-04-29  Jackson Harper  <jackson@ximian.com>
11581
11582         * Makefile: Set MONO_PATH to use the bootstrap corlib
11583         * driver.cs: Check the GAC for referenced assemblies.
11584                 
11585 2004-04-29  Martin Baulig  <martin@ximian.com>
11586
11587         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11588
11589 2004-04-07  Martin Baulig  <martin@ximian.com>
11590
11591         * expression.cs (Binary.ResolveOperator): Added special case for
11592         Equality/Inequality between a type parameter and a null literal.
11593
11594 2004-04-07  Martin Baulig  <martin@ximian.com>
11595
11596         * convert.cs: Check null literal -> type parameter conversions.
11597
11598 2004-04-07  Martin Baulig  <martin@ximian.com>
11599
11600         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11601         `class' and `struct' constraints.
11602
11603 2004-04-07  Martin Baulig  <martin@ximian.com>
11604
11605         * generic.cs (SpecialConstraint): New public enum.
11606         (Constraints.Resolve): Added support for the `class' and `struct'
11607         constraints.
11608
11609         * cs-parser.jay (type_parameter_constraint): Added support for the
11610         `class' and `struct' constraints.
11611
11612 2004-04-07  Martin Baulig  <martin@ximian.com>
11613
11614         * support.cs (GenericConstraints): Replaced `Types' by
11615         `ClassConstraint' and `InterfaceConstraints'; added
11616         `HasClassConstraint'.   
11617
11618 2004-04-07  Martin Baulig  <martin@ximian.com>
11619
11620         * generic.cs
11621         (Constraints.InterfaceConstraints): New public property.
11622         (Constraints.Types): Make this property public
11623         (TypeParameter): Implement IMemberContainer.
11624         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11625         instead of a TypeBuilder/MethodBuilder; pass the interface
11626         constraints to TypeManager.AddTypeParameter().
11627         (TypeParameter.DefineType): Just take an EmitContext and no
11628         TypeBuilder/MethodBuilder.  Use the new public API.
11629
11630         * typemanager.cs (TypeManager.AddTypeParameter): Added
11631         `TypeExpr[]' argument; add the interfaces to the
11632         `builder_to_ifaces' hash.
11633         (TypeManager.LookupMemberContainer): For
11634         GenericTypeParameterBuilders, get the TypeParameter from the
11635         `builder_to_type_param'.
11636         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11637         the TypeParameter and call FindMembers on it.
11638
11639 2004-04-07  Martin Baulig  <martin@ximian.com>
11640
11641         * class.cs
11642         (MethodCore.GenericMethod): Moved this field here from Method.
11643         (MethodCore.IsDuplicateImplementation): Take the number of type
11644         parameters into account if we're a generic method.
11645
11646         * expression.cs (Invocation.InferTypeArguments): Don't return true
11647         if `arguments' is null; we still need to check whether we actually
11648         don't need to infer anything in this case.
11649         (MemberAccess): Merged the functionality from GenericMemberAccess
11650         into this class.
11651
11652         * generic.cs (GenericMemberAccess): Removed.
11653
11654 2004-04-05  Martin Baulig  <martin@ximian.com>
11655
11656         * decl.cs (MemberCore): For generic classes, interfaces and
11657         structs, `Name' now includes the number of type parameters
11658         ("Stack!1.Node!1").
11659         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11660         encode the number of type arguments in the type name.
11661
11662         * expression.cs (Expression.MemberLookup): Removed the
11663         `num_type_args' argument; we now encode the number of type
11664         arguments in the type name.
11665
11666         * ecore.cs (SimpleName): Encode the number of type arguments in
11667         the type name itself.
11668
11669         * generic.cs (ConstructedType): Likewise.
11670
11671         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11672         `MemberName'; we now include the number of type parameters in the
11673         type name.
11674
11675         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11676         (TypeManager.MemberLookup): Removed the
11677         `num_type_args' argument; we now encode the number of type
11678         arguments in the type name.     
11679
11680 2004-04-03  Martin Baulig  <martin@ximian.com>
11681
11682         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11683         (MemberCore.MemberName): Moved here from MemberBase.
11684         (DeclSpace.SetParameterInfo): Just take the constraints as an
11685         ArrayList; we already have the type parameters in our
11686         `MemberName'; also do the CS0080 reporting here.
11687
11688         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11689         `IDENTIFIER opt_type_parameter_list'; when constructing our
11690         `MemberName', it'll already include our type parameters.
11691         (class_declaration, interface_declaration): Likewise.
11692         (delegate_declaration): Likewise.
11693         (MakeName): Take a MemberName and return a MemberName.
11694         The following two changes are required to avoid shift/reduce conflicts:
11695         (member_name): Don't include a TypeName anymore; ie. this is now
11696         just 'IDENTIFIER opt_type_parameter_list'.
11697         (property_declaration, event_declaration): Use a
11698         `namespace_or_type_name' instead of a `member_name'.            
11699
11700 2004-04-03  Martin Baulig  <martin@ximian.com>
11701
11702         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11703         `MemberName' class.
11704         (TypeName): Formerly known as MemberName.
11705
11706         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11707         instead of a `MemberName'.
11708
11709         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11710         (member_name): New rule; create a MemberName.
11711
11712 2004-04-02  Martin Baulig  <martin@ximian.com>
11713
11714         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11715         (CS0305 and CS0308).
11716
11717 2004-04-02  Martin Baulig  <martin@ximian.com>
11718
11719         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11720         support for nested types.
11721
11722 2004-04-02  Martin Baulig  <martin@ximian.com>
11723
11724         * ecore.cs (IAlias): New public interface.
11725         (TypeExpr, TypeExpression): Implement IAlias.
11726         (TypeAliasExpression): New public class.
11727
11728         * namespace.cs (Namespace): Implement IAlias.
11729         (Namespace.Lookup): Return an IAlias instead on an object.
11730         (Namespace.DefineName): Take an IAlias instead of an object.
11731         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11732         an object.
11733         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11734         Expression.
11735         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11736         object.
11737         (NamespaceEntry.Lookup): Likewise.
11738
11739         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11740         instead of a Type.      
11741
11742         * decl.cs (DeclSpace): Implement IAlias.
11743         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11744
11745         * generic.cs (ConstructedType): Improved error checking.
11746
11747 2004-04-02  Martin Baulig  <martin@ximian.com>
11748
11749         * convert.cs: Added type parameter conversions.
11750
11751         * ecore.cs
11752         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11753         (ClassCast.Emit): If the source type is a type parameter, box it.
11754         If the target type is a type parameter, emit an `unbox.any'
11755         instead of a `classcast'.1      
11756
11757 2004-04-01  Martin Baulig  <martin@ximian.com>
11758
11759         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11760
11761 2004-04-01  Martin Baulig  <martin@ximian.com>
11762
11763         * generic.cs (ConstructedType.CheckConstraints): Use
11764         Convert.ImplicitStandardConversionExists(); user-defined implicit
11765         conversions are not allowed according to the spec.
11766
11767 2004-03-30  Martin Baulig  <martin@ximian.com>
11768
11769         * expression.cs (New): Added support for type parameters.
11770
11771         * typemanager.cs
11772         (TypeManager.activator_type): New public static field.
11773         (TypeManager.activator_create_instance): Likewise.
11774
11775 2004-03-30  Martin Baulig  <martin@ximian.com>
11776
11777         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11778         public method.
11779
11780 2004-03-30  Martin Baulig  <martin@ximian.com>
11781
11782         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11783         the spec here: the argument type must be convertible to the
11784         constraints.
11785
11786 2004-03-30  Martin Baulig  <martin@ximian.com>
11787
11788         * generic.cs
11789         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11790         TypeManager.AddTypeParameter().
11791         (ConstructedType.CheckConstraints): Re-enable this and actually
11792         check whether we have a constructor constraint.
11793
11794         * typemanager.cs
11795         (TypeManager.builder_to_type_param): New static field.
11796         (TypeManager.AddTypeParameter): New static method.
11797         (TypeManager.LookupTypeParameter): New public method.
11798
11799 2004-03-30  Martin Baulig  <martin@ximian.com>
11800
11801         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11802         the new API to actually define the constructor constraint.
11803
11804         * typemanager.cs
11805         (TypeManager.new_constraint_attr_type): New static field.
11806         (TypeManager.InitCoreTypes): Initialize it.
11807
11808 2004-03-30  Martin Baulig  <martin@ximian.com>
11809
11810         * generic.cs (Constraints): Completed error checking, use correct
11811         error numbers.
11812
11813 2004-03-29  Martin Baulig  <martin@ximian.com>
11814
11815         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11816
11817         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11818         public version which takes a `ParameterData pd' instead of an
11819         `ArrayList args'.
11820
11821 2004-03-29  Martin Baulig  <martin@ximian.com>
11822
11823         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11824         not a MethodInfo.       
11825
11826 2004-03-29  Martin Baulig  <martin@ximian.com>
11827
11828         * expression.cs (Argument.ResolveMethodGroup): If we're a
11829         ConstructedType, call GetMemberAccess() on it.  
11830
11831 2004-03-29  Martin Baulig  <martin@ximian.com>
11832
11833         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11834         (MethodCore.CheckGenericOverride): When overriding a generic
11835         method, check whether the constraints match.
11836
11837         * support.cs (GenericConstraints): New public interface.
11838         (ParameterData.GenericConstraints): New public method.
11839
11840         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11841         method parameter and compute our constraints if appropriate.
11842         (Parameter.GenericConstraints): New public property.
11843
11844         * generic.cs (Constraints): Implement GenericConstraints.
11845
11846 2004-03-29  Martin Baulig  <martin@ximian.com>
11847
11848         * decl.cs (MemberCache.FindMemberToOverride): Use
11849         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11850
11851 2004-03-29  Martin Baulig  <martin@ximian.com>
11852
11853         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11854
11855 2004-03-29  Martin Baulig  <martin@ximian.com>
11856
11857         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11858         not allowed on non-generic declarations").
11859
11860 2004-03-29  Martin Baulig  <martin@ximian.com>
11861
11862         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11863         public version of this method.
11864
11865         * class.cs (MethodCore.IsDuplicateImplementation): Use
11866         Invocation.InferTypeArguments() to check this.
11867
11868 2004-03-29  Martin Baulig  <martin@ximian.com>
11869
11870         * convert.cs: Use TypeManager.IsDelegateType() instead of
11871         comparing types correctly.
11872
11873 2004-03-29  Martin Baulig  <martin@ximian.com>
11874
11875         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11876         types directly to make it work for generic instances.
11877
11878         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11879
11880 2004-03-29  Martin Baulig  <martin@ximian.com>
11881
11882         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11883         support for arrays.     
11884
11885 2004-03-24  Martin Baulig  <martin@ximian.com>
11886
11887         * decl.cs (DeclSpace.FindType): Also use
11888         TypeManager.CheckGeneric() for types from the using clauses.
11889
11890 2004-03-23  Martin Baulig  <martin@ximian.com>
11891
11892         * expression.cs (Invocation.OverloadResolve): Added `bool
11893         may_fail' argument and use it instead of the Location.IsNull() hack.
11894
11895 2004-03-23  Martin Baulig  <martin@ximian.com>
11896
11897         * expression.cs (Invocation.InferType): Use correct type inference
11898         rules here.     
11899
11900 2004-03-23  Martin Baulig  <martin@ximian.com>
11901
11902         * ecore.cs (MethodGroupExpr.Name): Use
11903         TypeManager.CSharpSignature() instead of just the name.
11904
11905         * expression.cs (Invocation.OverloadResolve): Provide better error
11906         reporting.
11907         (Invocation.DoResolve): OverloadResolve() never returns null
11908         without reporting an error, so removed the error -6 reporting here.
11909
11910 2004-03-23  Martin Baulig  <martin@ximian.com>
11911
11912         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11913         generic methods.
11914
11915         * cs-parser.jay (delegate_declaration): Support generic delegates.
11916
11917         * delegate.cs: Support generic delegates.
11918
11919 2004-03-22  Martin Baulig  <martin@ximian.com>
11920
11921         * expression.cs (Invocation.InferParamsTypeArguments): New static
11922         method; does type inference for params arguments.
11923
11924 2004-03-21  Martin Baulig  <martin@ximian.com>
11925
11926         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11927         method; checks whether a method is a generic method.    
11928
11929         * expression.cs (Invocation.InferTypeArguments): New static method;
11930         infer type arguments for generic method invocation.
11931
11932         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11933         property; we set this to true if we're resolving a generic method
11934         invocation and the user specified type arguments, ie. we're not
11935         doing type inference.
11936
11937 2004-03-20  Martin Baulig  <martin@ximian.com>
11938
11939         * class.cs (MethodData.DeclaringType): New public property.
11940         (MethodData.Define): Set DeclaringType here.
11941         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11942         instead of OperatorMethodBuilder.DeclaringType.
11943
11944 2004-03-20  Martin Baulig  <martin@ximian.com>
11945
11946         * cs-tokenizer.cs (xtoken): Return a special
11947         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11948
11949         * cs-parser.jay (default_value_expression): Switch to the new
11950         syntax (14.5.13).
11951
11952 2004-03-19  Martin Baulig  <martin@ximian.com>
11953
11954         * decl.cs (MemberName): New class.  We use this to "construct"
11955         namespace_or_type_name's.
11956
11957         * generics.cs (TypeArguments.GetDeclarations): New public method;
11958         returns the type arguments as a string[] and reports a CS0081 if
11959         one of them is not an identifier.
11960
11961         * class.cs (MemberBase): The .ctor now takes the name as a
11962         MemberName instead of a string.
11963         (MemberBase.ExplicitInterfaceName): Changed type from string to
11964         Expression.
11965         (MemberBase.DoDefine): If we're an explicit implementation, the
11966         InterfaceType may be a generic instance.
11967
11968         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11969         (namespace_name): Call MemberName.GetName () to transform the
11970         MemberName into a string and ensure we don't have any type
11971         arguments.
11972         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11973         MemberName into an expression.
11974         (method_header): Use namespace_or_type_name instead of member_name.     
11975
11976 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11977
11978         * rootcontext.cs: Add new types to the boot resolution.
11979
11980         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11981         MulticastDelegate is not allowed.
11982
11983         * typemanager.cs: Add new types to lookup: System.TypedReference
11984         and ArgIterator.
11985
11986         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11987         check for TypedReference or ArgIterator, they are not allowed. 
11988
11989         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11990         makes us properly catch 1510 in some conditions (see bug 56016 for
11991         details). 
11992
11993 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11994
11995         * CryptoConvert.cs: update from corlib version
11996         with endian fixes.
11997
11998 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * class.cs (Indexer.Define): Check indexername declaration
12001
12002 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12003
12004         * attribute.cs (IsClsCompliant): Fixed problem with handling
12005         all three states (compliant, not-compliant, undetected).
12006
12007 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12008
12009         * attribute.cs (Attribute): Location is now public.
12010         (Resolve): Store resolved arguments (pos_values) in attribute class.
12011         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12012         (GetClsCompliantAttributeValue): New method that gets
12013         CLSCompliantAttribute value.
12014         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12015         if exists else null.
12016         (AttributeTester): New class for CLS-Compliant verification routines.
12017
12018         * class.cs (Emit): Add CLS-Compliant verification.
12019         (Method.GetSignatureForError): Implemented.
12020         (Constructor.GetSignatureForError): Implemented
12021         (Constructor.HasCompliantArgs): Returns if constructor has
12022         CLS-Compliant arguments.
12023         (Constructor.Emit): Override.
12024         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12025         is needed to test only parameters.
12026         (FieldBase.GetSignatureForError): Implemented.
12027         (TypeContainer): New member for storing base interfaces.
12028         (TypeContainer.FindMembers): Search in base interfaces too.
12029
12030         * codegen.cs (GetClsComplianceAttribute): New method that gets
12031         assembly or module CLSCompliantAttribute value.
12032         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12033         for assembly.
12034         (ModuleClass.Emit): Add error 3012 test.
12035
12036         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12037
12038         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12039         state for all decl types.
12040         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12041         if CLS-Compliant tests are required.
12042         (IsClsCompliaceRequired): New method. Analyze whether code
12043         must be CLS-Compliant.
12044         (IsExposedFromAssembly): New method. Returns true when MemberCore
12045         is exposed from assembly.
12046         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12047         value or gets cached value.
12048         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12049         is explicitly marked with CLSCompliantAttribute.
12050         (IsIdentifierClsCompliant): New abstract method. This method is
12051         used to testing error 3005.
12052         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12053         for identifier and parameters CLS-Compliant testing.
12054         (VerifyClsCompliance): New method. The main virtual method for
12055         CLS-Compliant verifications.
12056         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12057         null. I don't know why is null (too many public members !).
12058         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12059         and get value of first CLSCompliantAttribute that found.
12060
12061         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12062         (VerifyClsCompliance): Override and add extra tests.
12063
12064         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12065         clscheck- disable CLS-Compliant verification event if assembly is has
12066         CLSCompliantAttribute(true).
12067
12068         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12069         ApllyAttribute is now called in emit section as in the other cases.
12070         Possible future Emit integration.
12071         (IsIdentifierClsCompliant): New override.
12072         (VerifyClsCompliance): New override.
12073         (GetEnumeratorName): Returns full enum name.
12074
12075         * parameter.cs (GetSignatureForError): Implemented.
12076
12077         * report.cs (WarningData): New struct for Warning message information.
12078         (LocationOfPreviousError): New method.
12079         (Warning): New method. Reports warning based on the warning table.
12080         (Error_T): New method. Reports error based on the error table.
12081
12082         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12083         verifications are done here.
12084
12085         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12086
12087         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12088         CLSCompliantAttribute.
12089         (all_imported_types): New member holds all imported types from other
12090         assemblies.
12091         (LoadAllImportedTypes): New method fills static table with exported types
12092         from all referenced assemblies.
12093         (Modules): New property returns all assembly modules.
12094
12095 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12096
12097         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12098         throwing a parser error.
12099
12100         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12101         which removes the hardcoded get_/set_ prefixes for properties, as
12102         IL allows for the properties to be named something else.  
12103
12104         Bug #56013
12105
12106         * expression.cs: Do not override operand before we know if it is
12107         non-null.  Fix 56207
12108
12109 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12110
12111         * typemanager.cs: support for pinned variables.
12112
12113 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12114
12115         * decl.cs, typemanager.cs: Avoid using an arraylist
12116         as a buffer if there is only one result set.
12117
12118 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12119
12120         * expression.cs: Make sure you cant call a static method
12121         with an instance expression, bug #56174.
12122
12123 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12124
12125         * class.cs (IsDuplicateImplementation): Improve error reporting to
12126         flag 663 (method only differs in parameter modifier).
12127
12128         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12129         in preprocessor directives.
12130
12131         * location.cs (LookupFile): Allow for the empty path.
12132
12133         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12134         better approach for some of that patch, but its failing with the
12135         CharSet enumeration.  For now try/catch will do.
12136
12137         * typemanager.cs: Do not crash if a struct does not have fields.
12138         Fixes 56150.
12139
12140 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12141
12142         * expression.cs: cs0213, cant fix a fixed expression.
12143         fixes 50231.
12144
12145 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12146
12147         * cs-parser.jay: detect invalid embeded statements gracefully.
12148         bug #51113.
12149
12150 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12151
12152         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12153         As a regex:
12154         s/
12155         the invocation type may not be a subclass of the tye of the item/
12156         The type of the item must be a subclass of the invocation item.
12157         /g
12158
12159         Fixes bug #50820.
12160
12161 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12162
12163         * attribute.cs: Added methods to get a string and a bool from an
12164         attribute. Required to information from AssemblyKeyFileAttribute,
12165         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12166         * codegen.cs: Modified AssemblyName creation to include support for
12167         strongnames. Catch additional exceptions to report them as CS1548.
12168         * compiler.csproj: Updated include CryptoConvert.cs.
12169         * compiler.csproj.user: Removed file - user specific configuration.
12170         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12171         Mono.Security assembly. The original class is maintained and tested in
12172         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12173         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12174         like CSC 8.0 (C# v2) supports.
12175         * Makefile: Added CryptoConvert.cs to mcs sources.
12176         * rootcontext.cs: Added new options for strongnames.
12177
12178 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12179
12180         * driver.cs: For --expect-error, report error code `2'
12181         if the program compiled with no errors, error code `1' if
12182         it compiled with an error other than the one expected.
12183
12184 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12185
12186         * compiler.csproj: Updated for Visual Studio .NET 2003.
12187         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12188         * compiler.sln: Updated for Visual Studio .NET 2003.
12189
12190 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12191
12192         * expression.cs: Fix bug #47234. We basically need to apply the
12193         rule that we prefer the conversion of null to a reference type
12194         when faced with a conversion to 'object' (csc behaviour).
12195
12196 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12197
12198         * statement.cs: Shorter form for foreach, eliminates
12199         a local variable. r=Martin.
12200
12201 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12202
12203         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12204         checks if we can use brtrue/brfalse to test for 0.
12205         * expression.cs: use the above in the test for using brtrue/brfalse.
12206         cleanup code a bit.
12207
12208 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12209
12210         * expression.cs: Rewrite string concat stuff. Benefits:
12211
12212         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12213         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12214         rather than a concat chain.
12215
12216         * typemanager.cs: Add lookups for more concat overloads.
12217
12218 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12219
12220         * expression.cs: Emit shorter il code for array init.
12221
12222         newarr
12223         dup
12224         // set 1
12225
12226         // set 2
12227
12228         newarr
12229         stloc.x
12230
12231         ldloc.x
12232         // set 1
12233
12234         ldloc.x
12235         // set 2
12236
12237 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12238
12239         * statement.cs: Before, two switch blocks would be merged if the
12240         total size of the blocks (end_item - begin_item + 1) was less than
12241         two times the combined sizes of the blocks.
12242
12243         Now, it will only merge if after the merge at least half of the
12244         slots are filled.
12245
12246         fixes 55885.
12247
12248 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12249
12250         * class.cs : csc build fix for GetMethods(). See bug #52503.
12251
12252 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12253
12254         * expression.cs: Make sure fp comparisons work with NaN.
12255         This fixes bug #54303. Mig approved this patch a long
12256         time ago, but we were not able to test b/c the runtime
12257         had a related bug.
12258
12259 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12262
12263 2004-03-19  Martin Baulig  <martin@ximian.com>
12264
12265         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12266         two overloads may unify for some type parameter substitutions and
12267         report a CS0408 if appropriate.
12268
12269 2004-03-19  Martin Baulig  <martin@ximian.com>
12270
12271         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12272         error here and not in our caller.
12273
12274 2004-03-19  Martin Baulig  <martin@ximian.com>
12275
12276         * interface.cs: Completely killed this file.
12277         (Interface): We're now a TypeContainer and live in class.cs.
12278
12279         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12280         argument; we're now also called for interfaces.
12281         (TypeContainer.DefineMembers): Allow this method being called
12282         multiple times.
12283         (TypeContainer.GetMethods): New public method; formerly known as
12284         Interface.GetMethod().  This is used by PendingImplementation.
12285         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12286         it's now private and non-static.
12287         (Interface): Moved this here; it's now implemented similar to
12288         Class and Struct.
12289         (Method, Property, Event, Indexer): Added `bool is_interface'
12290         argument to their .ctor's.
12291         (MemberBase.IsInterface): New public field.
12292
12293         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12294         instances instead of InterfaceMethod, InterfaceProperty, etc.
12295         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12296         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12297
12298 2004-03-19  Martin Baulig  <martin@ximian.com>
12299
12300         * class.cs (MethodCore.IsDuplicateImplementation): New private
12301         method which does the CS0111 checking.
12302         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12303         Use IsDuplicateImplementation().
12304
12305 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12306
12307         * decl.cs (FindMemberToOverride): New method to find the correct
12308         method or property to override in the base class.
12309         * class.cs
12310             - Make Method/Property use the above method to find the
12311               version in the base class.
12312             - Remove the InheritableMemberSignatureCompare as it is now
12313               dead code.
12314
12315         This patch makes large code bases much faster to compile, as it is
12316         O(n) rather than O(n^2) to do this validation.
12317
12318         Also, it fixes bug 52458 which is that nested classes are not
12319         taken into account when finding the base class member.
12320
12321         Reviewed/Approved by Martin.
12322
12323 2004-03-17  Martin Baulig  <martin@ximian.com>
12324
12325         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12326         of type arguments into account; use the `real_num_type_args'
12327         approach like in DoResolveAsTypeStep().
12328
12329         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12330         nested types.
12331
12332 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12333
12334         * interface.cs: In all interface classes removed redundant
12335         member initialization.
12336
12337 2004-03-16  Martin Baulig  <martin@ximian.com>
12338
12339         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12340
12341 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12342
12343         * decl.cs (DefineTypeAndParents): New helper method to define a
12344         type's containers before the type itself is defined;  This is a
12345         bug exposed by the recent changes to Windows.Forms when an
12346         implemented interface was defined inside a class that had not been
12347         built yet.   
12348
12349         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12350
12351         (Check): Loop correctly to report errors modifiers
12352         (UNSAFE was not in the loop, since it was the same as TOP).
12353
12354         * interface.cs: Every interface member now takes a ModFlags,
12355         instead of a "is_new" bool, which we set on the base MemberCore. 
12356
12357         Every place where we called "UnsafeOk" in the interface, now we
12358         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12359         the unsafe settings from the member declaration instead of the
12360         container interface. 
12361
12362         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12363
12364         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12365         `set_indexer_name' to the pending bits (one per type).
12366
12367         We fixed a bug today that was picking the wrong method to
12368         override, since for properties the existing InterfaceMethod code
12369         basically ignored the method name.  Now we make sure that the
12370         method name is one of the valid indexer names.
12371
12372 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12373  
12374         * support.cs (SeekableStreamReader): Keep track of stream byte
12375         positions and don't mix them with character offsets to the buffer.
12376
12377         Patch from Gustavo Giráldez
12378
12379 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12380
12381         * interface.cs (InterfaceSetGetBase): Removed double member
12382         initialization, base class does it as well.
12383
12384 2004-03-13  Martin Baulig  <martin@ximian.com>
12385
12386         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12387         when compiling corlib.
12388
12389 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12390
12391         * convert.cs (ExplicitConversion): We were reporting an error on
12392         certain conversions (object_type source to a value type, when the
12393         expression was `null') before we had a chance to pass it through
12394         the user defined conversions.
12395
12396         * driver.cs: Replace / and \ in resource specifications to dots.
12397         Fixes 50752
12398
12399         * class.cs: Add check for duplicate operators.  Fixes 52477
12400
12401 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12402
12403         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12404         that are in the middle of the statements, not only at the end.
12405         Fixes #54987
12406
12407         * class.cs (TypeContainer.AddField): No longer set the
12408         `HaveStaticConstructor' flag, now we call it
12409         `UserDefineStaticConstructor' to diferentiate the slightly
12410         semantic difference.
12411
12412         The situation is that we were not adding BeforeFieldInit (from
12413         Modifiers.TypeAttr) to classes that could have it.
12414         BeforeFieldInit should be set to classes that have no static
12415         constructor. 
12416
12417         See:
12418
12419         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12420
12421         And most importantly Zoltan's comment:
12422
12423         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12424
12425         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12426          before its static fields are used', i.e. initialization does not need
12427          to be triggered by the first access to the type. Setting this flag
12428          helps the JIT to compile better code, since it can run the static
12429          constructor at JIT time, and does not need to generate code to call it
12430          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12431          this flag for lots of classes like String. 
12432          
12433          csc sets this flag if the type does not have an explicit static 
12434          constructor. The reasoning seems to be that if there are only static
12435          initalizers for a type, and no static constructor, then the programmer
12436          does not care when this initialization happens, so beforefieldinit
12437          can be used.
12438          
12439          This bug prevents the AOT compiler from being usable, since it 
12440          generates so many calls to mono_runtime_class_init that the AOT code
12441          is much slower than the JITted code. The JITted code is faster, 
12442          because it does not generate these calls if the vtable is type is
12443          already initialized, which is true in the majority of cases. But the
12444          AOT compiler can't do this."
12445
12446 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * class.cs (MethodData.Emit): Refactor the code so symbolic
12449         information is generated for destructors;  For some reasons we
12450         were taking a code path that did not generate symbolic information
12451         before. 
12452
12453 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12454
12455         * class.cs: Create a Constructor.CheckBase method that
12456         takes care of all validation type code. The method
12457         contains some code that was moved from Define.
12458
12459         It also includes new code that checks for duplicate ctors.
12460         This fixes bug #55148.
12461
12462 2004-03-09  Joshua Tauberer <tauberer@for.net>
12463
12464         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12465         a { ... }-style array creation invokes EmitStaticInitializers
12466         which is not good for reference-type arrays.  String, decimal
12467         and now null constants (NullCast) are not counted toward
12468         static initializers.
12469
12470 2004-03-05  Martin Baulig  <martin@ximian.com>
12471
12472         * location.cs (SourceFile.HasLineDirective): New public field;
12473         specifies whether the file contains or is referenced by a "#line"
12474         directive.
12475         (Location.DefineSymbolDocuments): Ignore source files which
12476         either contain or are referenced by a "#line" directive.        
12477
12478 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12479
12480         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12481         direct access to our parent, so check the method inline there.
12482
12483 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12484
12485         * expression.cs (Invocation.EmitCall): Miguel's last commit
12486         caused a regression. If you had:
12487
12488             T t = null;
12489             t.Foo ();
12490
12491         In Foo the implict this would be null.
12492
12493 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12494
12495         * expression.cs (Invocation.EmitCall): If the method is not
12496         virtual, do not emit a CallVirt to it, use Call.
12497
12498         * typemanager.cs (GetFullNameSignature): Improve the method to
12499         cope with ".ctor" and replace it with the type name.
12500
12501         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12502         as an argument the ConstructorBuilder where it is being defined,
12503         to catch the recursive constructor invocations.
12504
12505 2004-03-16  Martin Baulig  <martin@ximian.com>
12506
12507         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12508         ConstructedType, call ResolveType() on it to get the type rather
12509         than just using `expr.Type'.
12510
12511 2004-03-16  Martin Baulig  <martin@ximian.com>
12512
12513         * generics.cs (ConstructedType.GetMemberAccess): Take the
12514         EmitContext instead on the TypeExpr and use
12515         ec.TypeContainer.CurrentType/ec.ContainerType.
12516
12517 2004-03-16  Martin Baulig  <martin@ximian.com>
12518
12519         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12520         parameters before aliases.
12521
12522 2004-03-16  Martin Baulig  <martin@ximian.com>
12523
12524         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12525         New oublic function; checks whether two generic instances may become
12526         equal under some instantiations (26.3.1).
12527
12528         * class.cs (TypeContainer.Define): Call
12529         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12530         error.
12531
12532 2004-03-16  Martin Baulig  <martin@ximian.com>
12533
12534         * class.cs (TypeContainer.GetClassBases): Moved
12535         Error_TypeParameterAsBase() here and also check whether the base
12536         class is not an attribute.
12537
12538 2004-03-16  Martin Baulig  <martin@ximian.com>
12539
12540         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12541
12542 2004-03-16  Martin Baulig  <martin@ximian.com>
12543
12544         * class.cs (Error_TypeParameterAsBase): Use correct error number
12545         here (CS0689).  
12546
12547 2004-03-16  Martin Baulig  <martin@ximian.com>
12548
12549         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12550         for generics.
12551
12552         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12553         error reporting.
12554
12555 2004-03-15  Martin Baulig  <martin@ximian.com>
12556
12557         * typemanager.cs (TypeManager.GetFullName): New public method.
12558         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12559         argument; only return members with the correct number of type
12560         arguments.
12561         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12562         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12563         whether the number of type arguments matches.
12564
12565         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12566         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12567
12568         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12569         field; it's set by the protected .ctor when we're actually a
12570         GenericMemberAccess.
12571         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12572         arguments and pass it to MemberLookupFinal ().
12573
12574         * ecore.cs (Expression.MemberLookup): Added `int
12575         num_type_arguments' argument; only return members with the correct
12576         number of type arguments.
12577         (Expression.MemberLookupFailed): Check whether the MemberLookup
12578         failed because we did not have the correct number of type
12579         arguments; report CS0305 in this case.
12580
12581         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12582         `e.ResolveAsTypeTerminal()' already did so.
12583
12584 2004-03-15  Martin Baulig  <martin@ximian.com>
12585
12586         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12587         we're a ConstructedType; in this case, the caller must report an
12588         error (for instance CS0131).
12589
12590         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12591         (TypeArguments.Resolve): Actually report errors here.
12592
12593 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12594
12595         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12596         `set_indexer_name' to the pending bits (one per type).
12597
12598         We fixed a bug today that was picking the wrong method to
12599         override, since for properties the existing InterfaceMethod code
12600         basically ignored the method name.  Now we make sure that the
12601         method name is one of the valid indexer names.
12602
12603 2004-03-15  Martin Baulig  <martin@ximian.com>
12604
12605         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12606         for generic instances.
12607
12608 2004-03-13  Martin Baulig  <martin@ximian.com>
12609
12610         * class.cs (TypeContainer.DefineType): Call
12611         TypeManager.AddUserType() immediately after creating the
12612         TypeBuilder; pass all type parameters when creating the
12613         CurrentType.
12614
12615         * decl.cs (DeclSpace.FindNestedType): New public method.
12616         (DeclSpace.FindType): Added `int num_type_args' argument; only
12617         return types with the correct number of type parameters.
12618         (DeclSpace.CountTypeParams): New public property.
12619
12620         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12621         the number of type parameters; defaults to zero.
12622
12623         * generic.cs (TypeArguments.Count): New public property.
12624         (ConstructedType.DoResolveAsTypeStep): First call
12625         ds.FindNestedType() to find out whether we're nested in the
12626         current generic type; in this case, we inherit all type parameters
12627         from the current class.
12628
12629         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12630         num_type_args' argument.
12631         (RootContext.LookupType): Added overloaded version which takes the
12632         number of type arguments; only return types with the correct
12633         number of type arguments.
12634
12635         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12636         checks whether `Type t' has `int num_type_args'.
12637
12638 2004-03-13  Martin Baulig  <martin@ximian.com>
12639
12640         * generic.cs (GenericMethod.DefineType): New method; calls
12641         DefineType() on all the type parameters.
12642
12643         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12644         (MethodData.Define): If we're a generic method, call
12645         GenericMethod.DefineType() to define the type parameters.       
12646
12647 2004-03-10  Martin Baulig  <martin@ximian.com>
12648
12649         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12650         instead of IsAssignableFrom.    
12651
12652 2004-03-10  Martin Baulig  <martin@ximian.com>
12653
12654         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12655
12656         * support.cs (ParameterData.HasArrayParameter): New property.
12657         (ReflectionParameters.ctor): Take a MethodBase instead of a
12658         ParameterInfo[].  If we have any type parameters, get the generic
12659         method definition and ask it whether we have variable arguments.
12660
12661 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12662
12663         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12664         routines to check if a type is an enumerable/enumerator allow
12665         classes that implement the IEnumerable or IEnumerator interfaces.
12666
12667         * class.cs (Property, Operator): Implement IIteratorContainer, and
12668         implement SetYields.
12669
12670         (Property.Define): Do the block swapping for get_methods in the
12671         context of iterators.   We need to check if Properties also
12672         include indexers or not.
12673
12674         (Operator): Assign the Block before invoking the
12675         OperatorMethod.Define, so we can trigger the Iterator code
12676         replacement. 
12677
12678         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12679         Property and Operator classes are not created when we parse the
12680         declarator but until we have the block completed, so we use a
12681         singleton SimpleIteratorContainer.Simple to flag whether the
12682         SetYields has been invoked.
12683
12684         We propagate this setting then to the Property or the Operator to
12685         allow the `yield' to function.
12686
12687 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12688
12689         * codegen.cs: Implemented attribute support for modules.
12690         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12691         Assembly/Module functionality.
12692
12693         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12694         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12695         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12696
12697 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12698
12699         * interface.cs (FindMembers): The operation is performed on all base
12700         interfaces and not only on the first. It is required for future CLS Compliance patch.
12701
12702 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12703
12704         * statement.cs, codegen.cs:
12705         This patch deals with patterns such as:
12706
12707         public class List : IEnumerable {
12708
12709                 public MyEnumerator GetEnumerator () {
12710                         return new MyEnumerator(this);
12711                 }
12712
12713                 IEnumerator IEnumerable.GetEnumerator () {
12714                         ...
12715                 }
12716                 
12717                 public struct MyEnumerator : IEnumerator {
12718                         ...
12719                 }
12720         }
12721
12722         Before, there were a few things we did wrong:
12723         1) we would emit callvirt on a struct, which is illegal
12724         2) we emited ldarg when we needed to emit ldarga
12725         3) we would mistakenly call the interface methods on an enumerator
12726         type that derived from IEnumerator and was in another assembly. For example:
12727
12728         public class MyEnumerator : IEnumerator
12729
12730         Would have the interface methods called, even if there were public impls of the
12731         method. In a struct, this lead to invalid IL code.
12732
12733 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12734
12735         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12736           renamed to Emit.
12737
12738         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12739
12740 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12741
12742         * cs-parser.jay: Fix small regression: we were not testing V2
12743         compiler features correctly.
12744
12745         * interface.cs: If the emit context is null, then create one
12746
12747 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12748
12749         * decl.cs (GetSignatureForError): New virtual method to get full name
12750           for error messages.
12751
12752         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12753           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12754
12755         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12756           Duplicated members and code in these classes has been removed.
12757           Better encapsulation in these classes.
12758
12759 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12760
12761         * assign.cs (Assign.DoResolve): When dealing with compound
12762         assignments, there is a new rule in ECMA C# 2.4 (might have been
12763         there before, but it is documented here) that states that in:
12764
12765         a op= b;
12766
12767         If b is of type int, and the `op' is a shift-operator, then the
12768         above is evaluated as:
12769
12770         a = (int) a op b 
12771
12772         * expression.cs (Binary.ResolveOperator): Instead of testing for
12773         int/uint/long/ulong, try to implicitly convert to any of those
12774         types and use that in pointer arithmetic.
12775
12776         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12777         method to print information for from the type, not from the
12778         null-method we were given.
12779
12780 2004-02-01  Duncan Mak  <duncan@ximian.com>
12781
12782         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12783         parsing for cmd, fixes bug #53694.
12784
12785 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12786
12787         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12788         in the member name duplication tests. Property and operator name duplication
12789         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12790
12791 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12792
12793         * interface.cs (PopulateMethod): Fixed crash when interface method
12794         returns not existing type (error test cs0246-3.cs).
12795
12796 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12797
12798         * cs-parser.jay (interface_accessors): Re-write actions to also
12799         store attributes attached to get and set methods. Fix spelling
12800         while at it.
12801
12802         (inteface_property_declaration): Modify accordingly.
12803
12804         (InterfaceAccessorInfo): New helper class to store information to pass
12805         around between rules that use interface_accessors.
12806
12807         * interface.cs (Emit): Apply attributes on the get and set
12808         accessors of properties and indexers too.
12809
12810         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12811         right MethodBuilder when applying attributes to the get and set accessors.
12812
12813 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12814
12815         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12816
12817 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12818
12819         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12820
12821 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12822
12823         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12824         changes that treat `yield' specially when present before `break'
12825         or `return' tokens.
12826
12827         * cs-tokenizer.cs: yield is no longer a keyword.
12828
12829 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12830
12831         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12832         setting for default constructors.
12833         For default constructors are almost every time set wrong Modifier. The
12834         generated IL code has been alright. But inside mcs this values was
12835         wrong and this was reason why several of my CLS Compliance tests
12836         failed.
12837
12838 2004-02-27  Martin Baulig  <martin@ximian.com>
12839
12840         * generics.cs (ConstructedType.ResolveType): Make the nested type
12841         stuff actually work.
12842
12843 2004-02-25  Martin Baulig  <martin@ximian.com>
12844
12845         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12846         property; returns the type parameters just from the current type,
12847         ie. with the ones from outer classes.
12848         (DeclSpace.LookupGeneric): First search in the current class, then
12849         in outer classes.
12850         (DeclSpace.initialize_type_params): When hiding a type parameter
12851         from an outer class, put it into the `type_param_list' anyways.
12852
12853         * expression.cs (MemberAccess.expr): Made this field protected.
12854
12855         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12856         the type parameters from the current class.
12857
12858         * generic.cs (ConstructedType.ResolveType): Support nested generic
12859         types by taking the type parameters which we inherit from outer
12860         classes into account.
12861         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12862         support for nested generic types.
12863
12864 2004-02-23  Martin Baulig  <martin@ximian.com>
12865
12866         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12867         field and check whether we're nested inside a generic type.
12868         (DeclSpace.ResolveType): If we're resolving to a generic type
12869         definition, create a ConstructedType and return its resolved type.
12870         (DeclSpace.initialize_type_params): New private method;
12871         initializes the `type_param_list' field from the type parameters
12872         from this and all enclosing classes.
12873         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12874         we're already initialized.
12875
12876 2004-02-23  Martin Baulig  <martin@ximian.com>
12877
12878         * class.cs (Method.Define): Create the generic method before
12879         calling DoDefine().
12880         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12881         the TypeContainer one); we use this for generic methods.
12882
12883         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12884         parent's TypeBuilder.
12885
12886 2004-02-18  Martin Baulig  <martin@ximian.com>
12887
12888         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12889         to check for equality.
12890
12891 2004-02-05  Martin Baulig  <martin@ximian.com>
12892
12893         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12894         `ec.TypeContainer.CurrentType', use it instead of
12895         `ec.ContainerType' to check whether we're in the type's ctor.
12896
12897 2004-01-29  Martin Baulig  <martin@ximian.com>
12898
12899         * expression.cs (Invocation.DoResolve): If we're a
12900         `ConstructedType', then we're actually a generic method, so
12901         rewrite the expr as a GenericMemberAccess.
12902
12903         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12904         here; manually parse it into a string.
12905
12906 2004-01-28  Martin Baulig  <martin@ximian.com>
12907
12908         * typemanager.cs (TypeManager.IsEqual): New static method.
12909         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12910         check for equality instead of using `=='.
12911
12912 2004-01-26  Martin Baulig  <martin@ximian.com>
12913
12914         * decl.cs (DeclSpace.CurrentType): New public field.
12915
12916         * expression.cs (This.ResolveBase): If we have an
12917         `ec.TypeContainer.CurrentType', use it instead of
12918         `ec.ContainerType'.
12919
12920         * class.cs (TypeContainer.DefineType): If we're a generic type,
12921         create the `CurrentType' (unresolved).
12922         (TypeContainer.GenericType): New private field.
12923         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12924         it and store it in `GenericType' before creating the MemberCache.
12925         (TypeContainer.GetMembers): If we have a `GenericType', call
12926         TypeManager.FindMembers() on it.
12927
12928         * interface.cs (Interface.GenericType): New private field.
12929         (Interface.DefineType): If we're a generic type, create the
12930         `CurrentType' (unresolved).
12931         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12932         and store it in `GenericType' before creating the MemberCache.
12933         (Interface.GetMembers): If we have a `GenericType', call
12934         TypeManager.FindMembers() on it.
12935
12936 2004-01-22  Martin Baulig  <martin@ximian.com>
12937
12938         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12939         not a QualifiedIdentifier.  This is what `type_name_expression'
12940         was previously doing.
12941         (type_name_expression): Removed; the code is now in
12942         `namespace_or_type_name'.
12943         (qualified_identifier): Removed, use `namespace_or_type_name'
12944         instead.
12945         (QualifiedIdentifier): Removed this class.      
12946
12947 2004-01-22  Martin Baulig  <martin@ximian.com>
12948
12949         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12950         not a string as alias name.
12951
12952 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12953
12954         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12955         #52730 bug, and instead compute correctly the need to use a
12956         temporary variable when requesting an address based on the
12957         static/instace modified of the field and the constructor.
12958  
12959 2004-01-21  Martin Baulig  <martin@ximian.com>
12960
12961         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12962         class and namespace before looking up aliases.  Fixes #52517.
12963
12964 2004-01-21  Martin Baulig  <martin@ximian.com>
12965
12966         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12967         assinged in a 'try'; fixes exception4.cs.
12968
12969 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12970         * class.cs : Implemented parameter-less constructor for TypeContainer
12971
12972         * decl.cs: Attributes are now stored here. New property OptAttributes
12973
12974         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12975
12976         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12977
12978 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12979
12980         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12981           (CSharpSignature): New method for indexer and property signature.
12982
12983 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12984
12985         * pending.cs (IsVirtualFilter): Faster implementation.
12986
12987 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12988
12989         * typemanager.cs: Avoid inclusion of same assembly more than once.
12990
12991 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12992
12993         * cs-parser.jay: Fixed problem where the last assembly attribute
12994           has been applied also to following declaration (class, struct, etc.)
12995           
12996 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12997
12998         * class.cs: Added error CS0538, CS0539 reporting.
12999         Fixed crash on Microsoft runtime when field type is void.
13000
13001         * cs-parser.jay: Added error CS0537 reporting.
13002
13003         * pending.cs: Added error CS0535 reporting.
13004         Improved error report for errors CS0536, CS0534.
13005
13006 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13007
13008         Merge a few bits from the Anonymous Method MCS tree.
13009
13010         * statement.cs (ToplevelBlock): New class for toplevel methods,
13011         will hold anonymous methods, lifted variables.
13012
13013         * cs-parser.jay: Create toplevel blocks for delegates and for
13014         regular blocks of code. 
13015
13016 2004-01-20  Martin Baulig  <martin@ximian.com>
13017
13018         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13019         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13020         and `NeedExplicitReturn'; added `IsLastStatement'.
13021         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13022         have a `ReturnLabel' or we're not unreachable.
13023
13024         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13025         child's reachability; don't just override ours with it.  Fixes
13026         #58058 (lluis's example).
13027         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13028         InFinally(), InLoop(), InSwitch() and
13029         BreakCrossesTryCatchBoundary() methods.
13030
13031         * statement.cs (Return): Do all error checking in Resolve().
13032         Unless we are the last statement in a top-level block, always
13033         create a return label and jump to it.
13034         (Break, Continue): Do all error checking in Resolve(); also make
13035         sure we aren't leaving a `finally'.
13036         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13037         statement in a top-level block.
13038         (Block.Flags): Added `IsDestructor'.
13039         (Block.IsDestructor): New public property.
13040
13041 2004-01-20  Martin Baulig  <martin@ximian.com>
13042
13043         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13044
13045 2004-01-20  Martin Baulig  <martin@ximian.com>
13046
13047         * statement.cs (Statement.ResolveUnreachable): New public method.
13048         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13049         (Block.Resolve): Resolve unreachable statements.
13050
13051 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13052
13053         * expression.cs: We need to fix the case where we do
13054         not have a temp variable here.
13055
13056         * assign.cs: Only expression compound assignments need
13057         temporary variables.
13058
13059 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13060
13061         * flowanalysis.cs: Reduce memory allocation in a few ways:
13062           - A block with no variables should not allocate a bit
13063             vector for itself.
13064           - A method with no out parameters does not need any tracking
13065             for assignment of the parameters, so we need not allocate
13066             any data for it.
13067           - The arrays:
13068                 public readonly Type[] VariableTypes;
13069                 public readonly string[] VariableNames;
13070             Are redundant. The data is already stored in the variable
13071             map, so we need not allocate another array for it.
13072           - We need to add alot of checks for if (params | locals) == null
13073             due to the first two changes.
13074
13075 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13076
13077         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13078         implement IMemoryLocation, we store a copy on a local variable and
13079         take the address of it.  Patch from Benjamin Jemlich
13080
13081         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13082         to use a special "type_name_expression" rule which reduces the
13083         number of "QualifiedIdentifier" classes created, and instead
13084         directly creates MemberAccess expressions.
13085
13086 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13087
13088         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13089         that fixes #52853.  Null literal assignment to ValueType
13090
13091         * class.cs (MethodData.Emit): Instead of checking the name of the
13092         method to determine if its a destructor, create a new derived
13093         class from Method called Destructor, and test for that.  
13094
13095         * cs-parser.jay: Create a Destructor object instead of a Method.  
13096
13097         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13098
13099         Fixes: 52933
13100
13101 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13102
13103         * expression.cs (Binary.ResolveOperator): Perform an implicit
13104         conversion from MethodGroups to their delegate types on the
13105         Addition operation.
13106
13107         * delegate.cs: Introduce a new class DelegateCreation that is the
13108         base class for `NewDelegate' and `ImplicitDelegateCreation',
13109         factor some code in here.
13110
13111         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13112         conversion from MethodGroups to compatible delegate types. 
13113
13114         * ecore.cs (Expression.Resolve): Do not flag error 654
13115         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13116         we allow conversions from MethodGroups to delegate types now.
13117
13118         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13119         assignments in v2 either.
13120
13121 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13122
13123         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13124         static read-only fields in ctors.
13125
13126         Applied patch from Benjamin Jemlich 
13127
13128         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13129
13130 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13131
13132         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13133         here to return true, as they can be used like this:
13134
13135                 (XXX) int.MEMBER ()
13136
13137         Fixed 49836 and all the other dups
13138
13139 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13140
13141         * driver.cs: Implement /win32res and /win32icon.
13142
13143 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * cs-parser.jay: Add a rule to improve error handling for the
13146         common mistake of placing modifiers after the type.
13147
13148 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * cs-parser.jay (interface_event_declaration): Catch
13151         initialization of events on interfaces, and report cs0068
13152
13153         * cs-parser.jay (interface_event_declaration): Catch
13154         initialization of events. 
13155
13156         * ecore.cs: Better report missing constructors.
13157
13158         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13159         the error reporting done in the wrong place.  Fix.
13160
13161         * expression.cs (Binary.ResolveOperator): Catch the 
13162         operator + (E x, E y) error earlier, and later allow for implicit
13163         conversions in operator +/- (E e, U x) from U to the underlying
13164         type of E.
13165
13166         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13167         52596, if the container class is abstract, the default constructor
13168         is protected otherwise its public (before, we were always public).
13169
13170         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13171         fixed statement.
13172
13173         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13174         Jemlich that fixes bug #52597, MCS was generating invalid code for
13175         idisposable structs.   Thanks to Ben for following up with this
13176         bug as well.
13177
13178 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13179
13180         * driver.cs: Allow assemblies without code to be generated, fixes
13181         52230.
13182
13183 2004-01-07  Nick Drochak <ndrochak@gol.com>
13184
13185         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13186
13187 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13188
13189         * cs-parser.jay: Add rules to improve error reporting if fields or
13190         methods are declared at the namespace level (error 116)
13191
13192         * Add rules to catch event add/remove
13193
13194 2004-01-04  David Sheldon <dave-mono@earth.li>
13195
13196   * expression.cs: Added matching ")" to error message for 
13197   CS0077
13198
13199 2004-01-03 Todd Berman <tberman@gentoo.org>
13200
13201         * ecore.cs, attribute.cs:
13202         Applying fix from #52429.
13203
13204 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13205
13206         * ecore.cs, expression.cs, statement.cs:
13207         Total rewrite of how we handle branching. We
13208         now handle complex boolean expressions with fewer
13209         jumps. As well if (x == 0) no longer emits a ceq.
13210
13211         if (x is Foo) is much faster now, because we generate
13212         better code.
13213
13214         Overall, we get a pretty big improvement on our benchmark
13215         tests. The code we generate is smaller and more readable.
13216
13217         I did a full two-stage bootstrap. The patch was reviewed
13218         by Martin and Miguel.
13219
13220 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13221
13222         * cs-parser.jay: Make primary_expression not take a QI.
13223         we dont need this because the member_access rule covers
13224         us here. So we replace the rule with just IDENTIFIER.
13225
13226         This has two good effects. First, we remove a s/r conflict.
13227         Second, we allocate many fewer QualifiedIdentifier objects.
13228
13229 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13230
13231         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13232         set the correct information via SRE. This prevents
13233         hanging on the MS runtime. Fixes #29374.
13234
13235 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13236
13237         * convert.cs: correctly handle conversions to value types
13238         from Enum and ValueType as unboxing conversions.
13239
13240         Fixes bug #52569. Patch by Benjamin Jemlich.
13241
13242 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13243
13244         * expression.cs (BetterConversion): Prefer int -> uint
13245         over int -> ulong (csc's behaviour). This fixed bug #52046.
13246
13247 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13248
13249         * decl.cs (MemberCache.FindMembers): now returns a
13250         MemberInfo [].
13251
13252         * typemanager.cs: In general, go with with ^^.
13253         (CopyNewMethods): take an IList.
13254         (RealMemberLookup): Only allocate an arraylist
13255         if we copy from two sets of methods.
13256
13257         This change basically does two things:
13258         1) Fewer array lists allocated due to CopyNewMethods.
13259         2) the explicit cast in MemberList costed ALOT.
13260
13261 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13262
13263         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13264         a hashtable to avoid needless string allocations when an identifier is
13265         used more than once (the common case).
13266
13267 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13268
13269         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13270         is broken, it will not return anything. So, we
13271         have to use the information we have in mcs to
13272         do the task.
13273
13274         * typemanager.cs: Add a cache for GetInterfaces,
13275         since this will now be used more often (due to ^^)
13276
13277         (GetExplicitInterfaces) New method that gets the
13278         declared, not effective, interfaces on a type
13279         builder (eg, if you have interface IFoo, interface
13280         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13281         { IBar }.
13282
13283         This patch makes MCS able to bootstrap itself on
13284         Windows again.
13285
13286 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13287
13288         * expression.cs: Remove the Nop's that Miguel put
13289         in by mistake.
13290
13291 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13292
13293         * report.cs, codegen.cs: Give the real stack trace to
13294         the error when an exception is thrown.
13295
13296 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13297
13298         * decl.cs: only allocate hashtables for ifaces if 
13299         it is an iface!
13300
13301 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13302
13303         * expression.cs: fix the error from cs0121-2.cs
13304         (a parent interface has two child interfaces that
13305         have a function with the same name and 0 params
13306         and the function is called through the parent).
13307
13308 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13309
13310         * class.cs, rootcontext.cs, typmanager.cs: do not
13311         leak pointers.
13312
13313 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13314
13315         * codegen.cs: remove stack for the ec flow branching.
13316         It is already a linked list, so no need.
13317
13318 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13319
13320         * Makefile: Allow custom profiler here.
13321
13322 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13323
13324         * typemanager.cs (LookupType):
13325           - Use a static char [], because split takes
13326             a param array for args, so it was allocating
13327             every time.
13328           - Do not store true in a hashtable, it boxes.
13329
13330 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13331
13332         * flowanalysis.cs: bytify common enums.
13333
13334 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13335
13336         * modifiers.cs: Add a new set of flags for the
13337         flags allowed on explicit interface impls.
13338         * cs-parser.jay: catch the use of modifiers in
13339         interfaces correctly.
13340         * class.cs: catch private void IFoo.Blah ().
13341
13342         All related to bug #50572.
13343
13344 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13345
13346         * decl.cs: Rewrite the consistant accessability checking.
13347         Accessability is not linear, it must be implemented in
13348         a tableish way. Fixes #49704.
13349
13350 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13351
13352         * expression.cs: Handle negation in a checked context.
13353         We must use subtraction from zero. Fixes #38674.
13354
13355 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13356
13357         * class.cs: Ignore static void main in DLLs.
13358         * rootcontext.cs: Handle the target type here,
13359         since we are have to access it from class.cs
13360         * driver.cs: account for the above.
13361
13362 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13363
13364         * report.cs: Give line numbers and files if available.
13365
13366 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13367
13368         * driver.cs: Implement /addmodule.
13369
13370         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13371         ModuleBuilders.
13372
13373 2003-12-20  Martin Baulig  <martin@ximian.com>
13374
13375         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13376         (FieldBase.IsAssigned): Removed this field.
13377         (FieldBase.SetAssigned): New public method.
13378         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13379
13380 2003-12-20  Martin Baulig  <martin@ximian.com>
13381
13382         * expression.cs (LocalVariableReference.DoResolve): Don't set
13383         `vi.Used' if we're called from DoResolveLValue().
13384
13385         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13386         returns the usage vector it just merged into the current one -
13387         pass this one to UsageWarning().
13388         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13389         of the `EmitContext', don't call this recursively on our children.
13390
13391 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13392
13393         * driver.cs: Implement /target:module.
13394
13395 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13396
13397         * support.cs (CharArrayHashtable): New helper class.
13398
13399         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13400         char arrays, not strings, so we can avoid creating a string in
13401         consume_identifier if the identifier is a keyword.
13402
13403 2003-12-16  Martin Baulig  <martin@ximian.com>
13404
13405         * statement.cs (LocalInfo.Assigned): Removed this property.
13406         (LocalInfo.Flags): Removed `Assigned'.
13407         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13408         and uses flow analysis.
13409         (Block.UsageWarning): Made this method private.
13410         (Block.Resolve): Call UsageWarning() if appropriate.
13411
13412         * expression.cs (LocalVariableReference.DoResolve): Always set
13413         LocalInfo.Used here.
13414
13415 2003-12-13  Martin Baulig  <martin@ximian.com>
13416
13417         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13418         any value here; we're now using flow analysis to figure out
13419         whether a statement/block returns a value.
13420
13421 2003-12-13  Martin Baulig  <martin@ximian.com>
13422
13423         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13424         working again.
13425         (FlowBranching.MergeFinally): Don't call
13426         `branching.CheckOutParameters()' here, this is called in
13427         MergeTopBlock().
13428         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13429         when adding the `finally' vector.       
13430
13431 2003-12-13  Martin Baulig  <martin@ximian.com>
13432
13433         * flowanalysis.cs
13434         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13435         actually work and also fix #48962.
13436
13437 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13438
13439         * decl.cs: Do not check System.Object for nested types,
13440         since we know it does not have any. Big bang for buck:
13441
13442         BEFORE:
13443            Run 1:   8.35 seconds
13444            Run 2:   8.32 seconds
13445            corlib:  17.99 seconds
13446         AFTER:
13447            Run 1:   8.17 seconds
13448            Run 2:   8.17 seconds
13449            corlib:  17.39 seconds
13450
13451 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13452
13453         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13454         time we are returning 0 members, so we save alot here.
13455
13456 2003-12-11  Martin Baulig  <martin@ximian.com>
13457
13458         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13459         `MergeChild()', also just take the `FlowBranching' as argument;
13460         call Merge() on it and return the result.
13461         (FlowBranching.Merge): We don't need to do anything if we just
13462         have one sibling.
13463
13464 2003-12-11  Martin Baulig  <martin@ximian.com>
13465
13466         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13467         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13468         Maurer for this idea.
13469
13470 2003-12-11  Martin Baulig  <martin@ximian.com>
13471
13472         * flowanalysis.cs (MergeResult): This class is now gone; we now
13473         use the `UsageVector' for this.  The reason for this is that if a
13474         branching just has one sibling, we don't need to "merge" them at
13475         all - that's the next step to do.
13476         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13477         `MergeResult'.
13478
13479 2003-12-11  Martin Baulig  <martin@ximian.com>
13480
13481         Reworked flow analyis and made it more precise and bug-free.  The
13482         most important change is that we're now using a special `Reachability'
13483         class instead of having "magic" meanings of `FlowReturns'.  I'll
13484         do some more cleanups and optimizations and also add some more
13485         documentation this week.
13486
13487         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13488         largely reworked this class.
13489         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13490         the new `Reachability' class instead of having "magic" values here.
13491         (FlowBranching): We're now using an instance of `Reachability'
13492         instead of having separate `Returns', `Breaks' etc. fields.
13493
13494         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13495         based on flow analysis; ignore the return value of block.Emit ().
13496
13497 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13498
13499         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13500         if they are private.
13501
13502 2003-12-09  Martin Baulig  <martin@ximian.com>
13503
13504         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13505         call them directly on the UsageVector.
13506
13507 2003-12-09  Martin Baulig  <martin@ximian.com>
13508
13509         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13510         Changed return type from `FlowReturns' to `Reachability'.
13511
13512 2003-12-09  Martin Baulig  <martin@ximian.com>
13513
13514         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13515         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13516         `Reachable' fields with a single `Reachability' one.
13517
13518 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13519
13520         * class.cs (FindMembers): Remove foreach's.
13521
13522         Bootstrap times:
13523
13524         BEFORE
13525                 Run 1:   8.74 seconds
13526                 Run 2:   8.71 seconds
13527
13528         AFTER
13529                 Run 1:   8.64 seconds
13530                 Run 2:   8.58 seconds
13531
13532
13533 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13534
13535         * cs-parser.jay:
13536         * gen-treedump.cs:
13537         * statement.cs:
13538         This patch does a few things:
13539                 1. EmptyStatement is now a singleton, so it is never reallocated.
13540                 2. All blah is EmptyStatement constructs have been changed to
13541                    blah == EmptyStatement.Value, which is much faster and valid
13542                    now that EmptyStatement is a singleton.
13543                 3. When resolving a block, rather than allocating a new array for
13544                    the non-empty statements, empty statements are replaced with
13545                    EmptyStatement.Value
13546                 4. Some recursive functions have been made non-recursive.
13547         Mainly the performance impact is from (3), however (1) and (2) are needed for
13548         this to work. (4) does not make a big difference in normal situations, however
13549         it makes the profile look saner.
13550
13551         Bootstrap times:
13552
13553         BEFORE
13554         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13555         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13556         Total memory allocated: 56397 KB
13557
13558         AFTER
13559         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13560         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13561         Total memory allocated: 55666 KB
13562
13563 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13564
13565         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13566         than the hashtable in a hashtable version
13567
13568         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13569         we always end up concating a string. This results in a huge perf
13570         loss, because many strings have to be tracked by the GC. In this
13571         patch, we first use a hashtable that works with two keys, so that
13572         the strings do not need to be concat'ed.
13573
13574         Bootstrap times:
13575         BEFORE
13576                 Run 1:   8.74 seconds
13577                 Run 2:   8.71 seconds
13578
13579         AFTER
13580                 Run 1:   8.65 seconds
13581                 Run 2:   8.56 seconds
13582
13583 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13584
13585         * Makefile: Add a new target `do-time' that does a quick and simple
13586         profile, leaving easy to parse output.
13587
13588 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13589
13590         * codegen.cs (Init): Create the dynamic assembly with 
13591         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13592
13593 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13594
13595         * support.cs: Make the PtrHashtable use only one
13596         instance of its comparer.
13597
13598 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13599
13600         * typemanager.cs: Fix lookup of GetNamespaces.
13601
13602 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13603
13604         * expression.cs: Removed redundant line.
13605
13606         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13607         ArrayLists, use for loops with bounds.  
13608
13609         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13610         arraylist.
13611
13612         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13613         arraylists, use for loop with bounds.
13614
13615         The above three changes give us a 0.071 second performance
13616         improvement out of 3.294 seconds down to 3.223.  On my machine
13617         the above changes reduced the memory usage by 1,387 KB during
13618         compiler bootstrap.
13619
13620         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13621         QualifiedIdentifiers.  Before we created a new string through
13622         concatenation, and mostly later on, the result would be
13623         manipulated by DecomposeQI through string manipulation.
13624
13625         This reduced the compiler memory usage for bootstrapping from
13626         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13627         compile times in 0.05 seconds.
13628
13629 2003-11-28  Dick Porter  <dick@ximian.com>
13630
13631         * support.cs: Do string compares with the Invariant culture.
13632
13633         * rootcontext.cs: 
13634         * gen-treedump.cs: 
13635         * expression.cs: 
13636         * driver.cs: 
13637         * decl.cs: 
13638         * codegen.cs: 
13639         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13640         the comparison is done with the Invariant culture.
13641
13642 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13643
13644         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13645         GetEnumerator method.
13646
13647         (ProbeCollectionType): Iterate starting at the most specific type
13648         upwards looking for a GetEnumerator
13649
13650         * expression.cs: Shift count can be up to 31 for int/uint and 63
13651         for long/ulong.
13652
13653 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * statement.cs (Block.LookupLabel): Also look for the label on the
13656         children blocks.  Use a hash table to keep track of visited
13657         nodes. 
13658
13659         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13660         we actually did transform the other operand, otherwise fall back
13661         to the common codepath that casts to long.
13662
13663         * cs-tokenizer.cs: Use the same code pattern as the int case.
13664         Maybe I should do the parsing myself, and avoid depending on the
13665         Parse routines to get this done.
13666
13667 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13670         which fixes bug 51347.  This time test it.
13671
13672         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13673         attributes for example can not tell the difference between these.
13674         The difference was only a syntax feature of the language. 
13675
13676         * attribute.cs: Apply attributes to delegates.
13677
13678         * delegate.cs: Call the apply attributes method.
13679
13680 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13683         comparing 0 vs Byte.MinValue, not the value
13684
13685         (ImplicitConversionRequired): When reporting a conversion error,
13686         use error 31 to print out the constant error instead of the
13687         simpler 29.
13688
13689         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13690         which fixes bug 51347.
13691
13692 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13695         which fixes the -warnaserror command line option.
13696
13697 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13698
13699         * cfold.cs (DoNumericPromotions): During constant folding of
13700         additions on UIntConstant, special case intconstants with
13701         IntConstants like we do on the expression binary operator. 
13702
13703 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13704
13705         * convert.cs (ImplicitReferenceConversion): We were missing a case
13706         (System.Enum are not value types or class types, so we need to
13707         classify them separatedly).
13708
13709         * driver.cs: We do not support error 2007.
13710
13711 2003-11-12 Jackson Harper <jackson@ximian.com>
13712
13713         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13714         system directory. Also use the full file name so users can
13715         libraries names mscorlib-o-tron.dll in a non system dir.
13716         
13717 2004-01-04  David Sheldon <dave-mono@earth.li>
13718
13719         * expression.cs: Added matching ")" to error message for CS0077.
13720
13721 2003-12-19  Martin Baulig  <martin@ximian.com>
13722
13723         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13724         static method; see documentation in the method.
13725         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13726
13727         * convert.cs (Convert.ImplicitReferenceConversion,
13728         Convert.ImplicitReferenceConversionExists): Add support for
13729         generic type declarations; see gen-36.cs.
13730
13731 2003-12-19  Martin Baulig  <martin@ximian.com>
13732
13733         * pending.cs (Pending.InterfaceMethod): Use
13734         `Type.IsAssignableFrom()' instead of `=='.
13735
13736 2003-12-18  Martin Baulig  <martin@ximian.com>
13737
13738         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13739         byref types first.
13740
13741         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13742         `expr_type.Equals (target_type)' instead of `=='.
13743
13744 2003-12-08  Martin Baulig  <martin@ximian.com>
13745
13746         * generics.cs (Constraints.Types): Removed.
13747         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13748         to Type's.
13749         (Constraints.ResolveTypes): New public method; resolves the
13750         TypeExpr's to Type's.
13751         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13752         longer takes the constraints.
13753         (TypeParameter.DefineMethod): Likewise.
13754         (TypeParameter.DefineType): New public method.  Calls
13755         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13756         the constraints.
13757
13758 2003-12-08  Martin Baulig  <martin@ximian.com>
13759
13760         * convert.cs (Convert.ImplicitConversionStandard): Use
13761         `expr_type.Equals (target_type)' instead of `=='.
13762
13763 2003-12-08  Martin Baulig  <martin@ximian.com>
13764
13765         * typemanager.cs (TypeManager.GetReferenceType): Call
13766         `Type.MakeByRefType ()'.
13767
13768 2003-12-08  Martin Baulig  <martin@ximian.com>
13769
13770         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13771         just has some special meaning in some situations.  For instance,
13772         it is allowed to use `where' as the name of a variable etc.
13773
13774 2003-12-04  Martin Baulig  <martin@ximian.com>
13775
13776         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13777         `Type.MakeArrayType()' for array types.
13778
13779 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13782         debugging message.
13783
13784         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13785         corlib to compile.
13786
13787 2003-11-16  Martin Baulig  <martin@ximian.com>
13788
13789         * codegen.cs (EmitContext.IsGeneric): Removed.
13790
13791         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13792         ResolveGeneric() on the DeclSpace.
13793
13794 2003-11-16  Martin Baulig  <martin@ximian.com>
13795
13796         * generic.cs (TypeArguments.Resolve):
13797         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13798         `ResolveType()' on it to get the Type.
13799
13800 2003-11-15  Martin Baulig  <martin@ximian.com>
13801
13802         * generic.cs (ConstructedType.GetInterfaces): Override this.
13803
13804 2003-11-14  Martin Baulig  <martin@ximian.com>
13805
13806         * interface.cs (Interface.DefineType): Define all type parameters
13807         before adding the interfaces we inherit.
13808
13809 2003-11-11  Martin Baulig  <martin@ximian.com>
13810
13811         * generic.cs (ConstructedType.ResolveType): Always call
13812         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13813
13814 2003-11-10  Martin Baulig  <martin@ximian.com>
13815
13816         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13817         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13818         calling `ResolveType()' on them, directly assign their `Type'.
13819
13820 2003-11-08  Martin Baulig  <martin@ximian.com>
13821
13822         * generic.cs (ConstructedType): Override `IsClass' etc.
13823
13824 2003-11-08  Martin Baulig  <martin@ximian.com>
13825
13826         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13827         return value and the `out parent' parameter.
13828         (TypeContainer.DefineType): Moved the CS0644 check into
13829         GetClassBases().  Don't pass the interface types to the
13830         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13831         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13832
13833         * ecore.cs (TypeExpr.IsAttribute): New property.
13834         (TypeExpr.GetInterfaces): New method.
13835
13836         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13837         TypeExpr instead of a Type.
13838         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13839         (Interface.DefineType): Don't pass the interface types to the
13840         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13841         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13842
13843         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13844         instead of a `Type[]'.
13845         (TypeManager.RegisterBuilder): Likewise.
13846         (TypeManager.AddUserInterface): Likewise.
13847         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13848         `Type[]' and also return a `TypeExpr[]'.
13849         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13850
13851 2003-11-08  Martin Baulig  <martin@ximian.com>
13852
13853         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13854         Expression.     
13855
13856 2003-11-08  Martin Baulig  <martin@ximian.com>
13857
13858         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13859         TypeManager.ResolveExpressionTypes().
13860
13861         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13862         instead of an Expression.
13863         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13864         (TypeExpression): New public class; formerly known as `TypeExpr'.
13865
13866         * expression.cs (ComposedCast): Derive from TypeExpr.
13867
13868         * typemanager.cs (TypeManager.system_*_expr): These are now
13869         TypExpr's instead of Expression's.
13870         (TypeManager.ResolveExpressionTypes): New public static function;
13871         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13872         of them.        
13873
13874 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13875
13876         * expression.cs (New.DoResolve): Do not dereference value that
13877         might be a null return.
13878
13879         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13880         sure that the constant value has the right type.  Fixes an
13881         unreported bug, similar to 50425.
13882
13883         * const.cs (Const.LookupConstantValue): Call
13884         ImplicitStandardConversionExists before doing a conversion to
13885         avoid havng the TypeManager.ChangeType do conversions.
13886
13887         Reduced the number of casts used
13888
13889         (Const.ChangeType): New routine to enable reuse of the constant
13890         type changing code from statement.
13891
13892         * typemanager.cs (ChangeType): Move common initialization to
13893         static global variables.
13894
13895         Fixes #50425.
13896
13897         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13898         every value type to go through, even if it was void.  Fix that. 
13899
13900         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13901         character of the define, and the is_identifier_part_character for
13902         the rest of the string.
13903
13904 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * expression.cs (UnaryMutator.EmitCode): When I updated
13907         LocalVariableReference.DoResolve, I overdid it, and dropped an
13908         optimization done on local variable references.
13909
13910 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13911
13912         * ecore.cs: Convert the return from Ldlen into an int.
13913
13914 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13915
13916         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13917         the accessibility, this is a special case for toplevel non-public
13918         classes (internal for instance).
13919
13920 2003-10-20  Nick Drochak <ndrochak@gol.com>
13921
13922         * ecore.cs: Fix typo and build.  Needed another right paren.
13923
13924 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13927         `internal' case regular and protected, but not allowing protected
13928         to be evaluated later.  Bug 49840
13929
13930 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13933         to kb.Nlast, and not the kb.nFirst to isolate the switch
13934         statement.
13935
13936         Extract the underlying type, so enumerations of long/ulong are
13937         treated like long/ulong.
13938
13939 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13940
13941         * expression.cs (New): Overload the meaning of RequestedType to
13942         track the possible creation of the NewDelegate type, since
13943         DoResolve is invoked more than once for new constructors on field
13944         initialization.
13945
13946         See bugs: #48800 and #37014
13947
13948         * cs-parser.jay (declare_local_constants): Take an arraylist
13949         instead of a single constant.
13950
13951         (local_constant_declaration): It should take a
13952         constant_declarators, not a constant_declarator.  Fixes 49487
13953
13954         * convert.cs: Fix error report.
13955
13956 2003-10-13 Jackson Harper <jackson@ximian.com>
13957
13958         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13959         bug #49611
13960         
13961 2003-11-03  Martin Baulig  <martin@ximian.com>
13962
13963         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13964         `out bool has_type_arg'; if set, we need to pass the type to
13965         ig.Emit().
13966         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13967         Stelem_Any/Ldelem_Any for generic parameters.   
13968
13969 2003-11-02  Martin Baulig  <martin@ximian.com>
13970
13971         * expression.cs (Invocation.EmitCall): Use
13972         `TypeManager.IsValueType()' to check whether it's a value type.
13973         Don't set `struct_call' when calling a method on a type parameter.
13974
13975 2003-11-02  Martin Baulig  <martin@ximian.com>
13976
13977         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13978         and removed the TypeBuilder argument.
13979
13980         * typemanager.cs (TypeManager.IsValueType): Return
13981         `t.IsGenericParameter || t.IsValueType'.
13982
13983 2003-10-25  Martin Baulig  <martin@ximian.com>
13984
13985         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13986         call ConstructedType.Resolve() on it.
13987
13988         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13989
13990 2003-10-25  Martin Baulig  <martin@ximian.com>
13991
13992         * class.cs (TypeContainer.GetClassBases): Changed
13993         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13994         CS8214 reporting here.
13995         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13996         instead of a `Type' for our parent.  In case of a recursive
13997         declaration (see tests/gen-23.cs for an example), our parent is a
13998         ConstructedType and it doesn't have its type set.  So, first
13999         create our own TypeBuilder, then call constructed.Resolve() to get
14000         the parent's type and finally TypeBuilder.SetParent() it.
14001
14002         * ecore.cs (TypeExpr.Name): New public virtual property.
14003
14004         * generic.cs
14005         (ConstructedType): We're now a TypeExpr and not just an Expression.
14006         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14007         arguments here; this is done later.
14008         (ConstructedType.Resolve): New public method to resolve the type
14009         arguments and bind them.
14010
14011 2003-10-21  Martin Baulig  <martin@ximian.com>
14012
14013         * convert.cs: Use `TypeManager.IsValueType' instead of
14014         'type.IsValueType' everywhere.
14015
14016         * typemanager.cs (TypeManager.IsValueType): Return true for type
14017         parameters.  The reason for this is that we need to box a type
14018         parameter when converting it to a reference type.
14019
14020         * cs-parser.jay: Added support for default value expressions.
14021
14022         * generics.cs (DefaultValueExpression): New public class.       
14023
14024 2003-10-17  Martin Baulig  <martin@ximian.com>
14025
14026         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14027         TypeContainer so we can also use this for Interfaces.
14028         (TypeParameter.Resolve): Likewise.
14029
14030         * interface.cs (Interface.DefineType): Added support for generic
14031         interfaces.
14032
14033         * cs-parser.jay: Added support for generic structs and interfaces.
14034
14035 2003-10-17  Martin Baulig  <martin@ximian.com>
14036
14037         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14038         call generic methods :-)
14039
14040 2003-10-16  Martin Baulig  <martin@ximian.com>
14041
14042         * cs-parser.jay (namespace_or_type_name): Only create a
14043         GenericMemberAccess if we actually have type arguments.
14044
14045 2003-10-13  Martin Baulig  <martin@ximian.com>
14046
14047         * class.cs (Method.Define): If we're a generic method, call
14048         TypeBuilder.DefineGenericMethod () before resolving
14049         the parameters.
14050         (MethodData): Added .ctor which takes an additional MethodBuilder
14051         argument; this is used for generic methods.
14052         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14053         we already have a MethodBuilder.
14054
14055 2003-10-10  Martin Baulig  <martin@ximian.com>
14056
14057         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14058         instead of a `DeclSpace'.  This is used for generic methods.
14059
14060         * cs-parser.jay (method_header): Added support for generic
14061         methods; create a `GenericMethod' instance and pass it to the
14062         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14063         parameters and locals.
14064
14065         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14066         since we already have the location.  Check whether we're a generic
14067         type declaration or a generic method and create the correct type
14068         parameter.
14069
14070         * generic.cs (TypeParameter.DefineMethod): New public method.
14071         (GenericMethod): New public class; derives from DeclSpace and is
14072         used for generic methods.       
14073
14074 2003-10-09  Martin Baulig  <martin@ximian.com>
14075
14076         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14077         to the .ctor.
14078         (MethodCore.DoDefineParameters): Removed the TypeContainer
14079         argument; use the DeclSpace which was passed to the .ctor instead.
14080         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14081         TypeContainer; we only need a DeclSpace here.
14082
14083 2003-10-09  Martin Baulig  <martin@ximian.com>
14084
14085         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14086         to the .ctor.
14087         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14088         EmitContext's .ctor.    
14089
14090 2003-10-09  Martin Baulig  <martin@ximian.com>
14091
14092         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14093         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14094         AsAccessible(), moved them as well.
14095
14096         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14097
14098 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14101         generation for >=, as spotted by Paolo, bug 48679.  
14102         Patch from David Waite.
14103
14104         * cs-tokenizer.cs: Add handling for #pragma.
14105
14106         * cs-parser.jay: Allow for both yield and yield return in the
14107         syntax.  The anti-cobolization of C# fight will go on!
14108
14109         * class.cs (TypeBuilder.DefineType): Catch error condition here
14110         (Parent.DefineType erroring out and returning null).
14111
14112         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14113         coping with enumerations variables, we were mistakenly processing
14114         them as a regular value type instead of built-in types.  Fixes the
14115         bug #48063
14116
14117         * typemanager.cs (IsBuiltinOrEnum): New method.
14118
14119 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * cs-parser.jay: Upgrade: yield now needs the return clause.
14122
14123 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14124
14125         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14126
14127 2003-09-29  Martin Baulig  <martin@ximian.com>
14128
14129         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14130         inflated generic methods.
14131
14132         * generics.cs (ConstructedType): Distinguish between open and
14133         closed constructed types; correctly resolve the arguments.
14134
14135 2003-09-22  Martin Baulig  <martin@ximian.com>
14136
14137         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14138         all type arguments meet their constraints.
14139
14140 2003-09-19  Martin Baulig  <martin@ximian.com>
14141
14142         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14143         `MemberCache parent' argument.  Normally, an interface doesn't
14144         have a parent type except System.Object, but we use this in gmcs
14145         for generic type parameters.
14146
14147 2003-09-18  Martin Baulig  <martin@ximian.com>
14148
14149         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14150         on `type.IsInterface'; don't check whether the type has a parent
14151         to determine whether it's an interface.
14152
14153 2003-09-17  Martin Baulig  <martin@ximian.com>
14154
14155         * generic.cs (ConstructedType.ToString): Always use `name' as the
14156         type name.
14157
14158 2003-09-15  Martin Baulig  <martin@ximian.com>
14159
14160         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14161
14162         * generic.cs (Constraints.Resolve): New public method; this is
14163         called to resolve the constraint types and to check whether all
14164         the constraints are correct.
14165         (Constraints.Types): New public property.
14166         (TypeParameter.Resolve): New public method; resolves all the
14167         type's constraints.
14168
14169         * class.cs (TypeContainer.DefineType): Call
14170         TypeParameter.Resolve() before actually defining the type.
14171
14172 2003-09-15  Martin Baulig  <martin@ximian.com>
14173
14174         * class.cs (TypeContainer.DefineType): Added an error flag to
14175         avoid reporting duplicate CS0146's ("class definition is
14176         circular.").
14177
14178         * driver.cs (Driver.MainDriver): Abort if
14179         RootContext.ResolveTree() reported any errors.
14180
14181 2003-09-07  Martin Baulig  <martin@ximian.com>
14182
14183         * report.cs (Error, Warning): Added overloaded versions which take
14184         a `params object[] args' and call String.Format().
14185
14186 2003-09-07  Martin Baulig  <martin@ximian.com>
14187
14188         * decl.cs (DeclSpace..ctor): Don't call
14189         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14190         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14191         (DeclSpace.RecordDecl): New method.
14192
14193         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14194
14195 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14196
14197         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14198         value attributes to be applied to ParameterBuilders.
14199
14200         * class.cs (MethodCore.LabelParameters): Make static and more
14201         generic so that it can be used from other places - like interface
14202         methods, for instance.
14203
14204         * interface.cs (Interface.Emit): Call LabelParameters before
14205         emitting attributes on the InterfaceMethod.
14206
14207 2003-09-07  Martin Baulig  <martin@ximian.com>
14208
14209         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14210         if the number of type parameters doesn't match.
14211
14212 2003-09-04  Martin Baulig  <martin@ximian.com>
14213
14214         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14215         for arrays of generic type params (ie. `!0[]').
14216
14217 2003-09-04  Martin Baulig  <martin@ximian.com>
14218
14219         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14220         for the moment.
14221
14222 2003-09-04  Martin Baulig  <martin@ximian.com>
14223
14224         * decl.cs (DeclSpace.LookupGeneric): New method.
14225         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14226         moment.
14227
14228         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14229         argument, not just a string.
14230         (TypeParameter.Define): New public method; this is called to
14231         actually define the generic parameter; after this, you can use the
14232         new `Type' property to get the type.
14233
14234 2003-09-04  Martin Baulig  <martin@ximian.com>
14235
14236         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14237         is now an ArrayList; initialize the result of the `TypeParameters'
14238         property here.
14239         (DeclSpace.GetGenericData): Removed.
14240         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14241         implement this in a different way.
14242         (DeclSpace.GetTypeParameters): Removed; there's now a
14243         `TypeParameters' property.
14244         (DeclSpace.TypeParameters): New public property.
14245
14246         * generic.cs (Constraints): Make this class public.
14247         (TypeParameter): New public class.
14248
14249 2003-09-04  Martin Baulig  <martin@ximian.com>
14250
14251         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14252         generic parameters.
14253
14254         * class.cs (TypeContainer.DefineType): Call
14255         TypeBuilder.DefineGenericParameter () on all generic parameters if
14256         this is a generic type.
14257
14258 2003-08-28  Martin Baulig  <martin@ximian.com>
14259
14260         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14261         sample-stack.il".
14262
14263         * sample-hello.cs: Compile this with gmcs: "gmcs
14264         /r:sample-stack.dll sample-hello.cs".
14265
14266 2003-08-28  Martin Baulig  <martin@ximian.com>
14267
14268         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14269         the parameters to the generic type.
14270
14271 2003-08-28  Martin Baulig  <martin@ximian.com>
14272
14273         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14274
14275 2003-08-28  Martin Baulig  <martin@ximian.com>
14276
14277         * cs-parser.jay (opt_type_argument_list): Use
14278         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14279         (primary_expression): Replace `qualified_identifier' with `type_name'.
14280         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14281
14282         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14283         parser to check whether it is syntactically a type parameter list;
14284         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14285         this case.
14286
14287 2003-08-26  Martin Baulig  <martin@ximian.com>
14288
14289         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14290         resolving aliases; fixes #47927.
14291
14292 2003-08-26  Martin Baulig  <martin@ximian.com>
14293
14294         * statement.cs (Using.DoResolve): This is internally emitting a
14295         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14296         do not always return.  Fixes #47681.
14297
14298 2003-08-26  Martin Baulig  <martin@ximian.com>
14299
14300         * decl.cs (MemberCore): Moved WarningNotHiding(),
14301         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14302         into MemberBase.
14303         (AdditionResult): Make this nested in DeclSpace.
14304         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14305         argument; call NamespaceEntry.Define() unless we're nested in a
14306         class or struct.
14307
14308         * namespace.cs (Namespace.DefineName): New public function.  This
14309         is called from DeclSpace's .ctor to add 
14310         (Namespace.Lookup): Include DeclSpaces in the lookup.
14311
14312         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14313
14314         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14315
14316 2003-08-25  Martin Baulig  <martin@ximian.com>
14317
14318         * convert.cs (Convert.ExplicitReferenceConversion): When
14319         converting from an interface type to a class, unbox if the target
14320         type is a struct type.  Fixes #47822.
14321
14322 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14323
14324         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14325         #47854.
14326
14327 2003-08-22  Martin Baulig  <martin@ximian.com>
14328
14329         * class.cs (TypeManager.DefineType): When defining a nested type,
14330         call DefineType() on our parent; fixes #47801.
14331
14332 2003-08-22  Martin Baulig  <martin@ximian.com>
14333
14334         * class.cs (MethodData.Define): While checking if a method is an
14335         interface implementation, improve the test a bit more to fix #47654.
14336
14337 2003-08-22  Martin Baulig  <martin@ximian.com>
14338
14339         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14340         correctly; fixes #47722.
14341
14342 2003-08-22  Martin Baulig  <martin@ximian.com>
14343
14344         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14345         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14346
14347         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14348
14349 2003-08-22  Martin Baulig  <martin@ximian.com>
14350
14351         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14352         can only be assigned in static constructors.  Fixes #47161.
14353
14354 2003-08-22  Martin Baulig  <martin@ximian.com>
14355
14356         Rewrote and improved the flow analysis code.
14357
14358         * flowbranching.cs (FlowBranching): Make this class abstract.
14359         (FlowBranching.CreateBranching): New static function to create a
14360         new flow branching.
14361         (FlowBranchingBlock, FlowBranchingException): New classes.
14362         (FlowBranching.UsageVector.Type): New public readonly field.
14363         (FlowBranching.UsageVector.Breaks): Removed the setter.
14364         (FlowBranching.UsageVector.Returns): Removed the setter.
14365         (FlowBranching.UsageVector): Added Break(), Return(),
14366         NeverReachable() and Throw() methods to modify the reachability.
14367         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14368         done by FlowBranching.Merge().
14369         (FlowBranching.UsageVector.MergeChild): New method; merges the
14370         merge result into the current vector.
14371         (FlowBranching.Merge): New abstract method to merge a branching.
14372
14373 2003-08-12  Martin Baulig  <martin@ximian.com>
14374
14375         * expression.cs (Indirection.CacheTemporaries): Create the
14376         LocalTemporary with the pointer type, not its element type.
14377
14378 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14379
14380         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14381         token was a keyword or not.
14382
14383         Add `error' options where an IDENTIFIER was expected;  Provide
14384         CheckToken and CheckIdentifierToken convenience error reporting
14385         functions. 
14386
14387         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14388
14389         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14390         NameSpaceEntry NameSpaceEntry.
14391
14392         (LookupInterfaceOrClass): Avoid creating a full qualified name
14393         from namespace and name: avoid doing lookups when we know the
14394         namespace is non-existant.   Use new Tree.LookupByNamespace which
14395         looks up DeclSpaces based on their namespace, name pair.
14396
14397         * driver.cs: Provide a new `parser verbose' to display the
14398         exception thrown during parsing.  This is turned off by default
14399         now, so the output of a failure from mcs is more graceful.
14400
14401         * namespace.cs: Track all the namespaces defined in a hashtable
14402         for quick lookup.
14403
14404         (IsNamespace): New method
14405
14406 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14409         we know that we need to concatenate (full typename can never be
14410         null). 
14411
14412         * class.cs: ditto.
14413
14414         * statement.cs: Use a bitfield;  Do not initialize to null things
14415         which are done by the constructor by default.
14416
14417         * cs-parser.jay: bug fix, parameter was 4, not 3.
14418
14419         * expression.cs: Just use the property;
14420
14421         * statement.cs: No need for GetVariableInfo method.
14422
14423 2003-08-08  Martin Baulig  <martin@ximian.com>
14424
14425         * flowanalysis.cs (FlowReturns): This is now nested in the
14426         `FlowBranching' class.
14427         (MyBitVector): Moved this here from statement.cs.
14428         (FlowBranching.SiblingType): New enum type.
14429         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14430
14431 2003-08-07  Martin Baulig  <martin@ximian.com>
14432
14433         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14434         `FlowBranching' class and called `BranchingType'.
14435
14436 2003-08-07  Martin Baulig  <martin@ximian.com>
14437
14438         * flowanalysis.cs: Moved all the control flow analysis code into
14439         its own file.
14440
14441 2003-08-07  Martin Baulig  <martin@ximian.com>
14442
14443         * assign.cs (Assign.DoResolve): `target' must either be an
14444         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14445         #37319.
14446
14447 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14448
14449         * expression.cs (BinaryMethod): This kind of expression is created by the
14450         Binary class if it determines that the operator has to be handled
14451         by a method.
14452
14453         (BinaryDelegate): This kind of expression is created if we are
14454         dealing with a + or - operator on delegates.
14455
14456         (Binary): remove method, argumetns, and DelegateOperator: when
14457         dealing with methods, 
14458
14459         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14460
14461         * statement.cs (Block): use bitfields for the three extra booleans
14462         we had in use.   Remove unused topblock parameter.
14463
14464         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14465
14466         * assign.cs: Drop extra unneeded tests.
14467
14468 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14471
14472         * statement.cs (Foreach): Use VariableStorage instead of
14473         LocalBuilders.   
14474
14475         * codegen.cs (VariableStorage): New class used by clients that
14476         require a variable stored: locals or fields for variables that
14477         need to live across yield.
14478
14479         Maybe provide a convenience api for EmitThis+EmitLoad?
14480
14481         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14482         these bad boys.
14483
14484 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14485
14486         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14487         RemapParameterLValue): New methods that are used to turn a
14488         precomputed FieldInfo into an expression like this:
14489
14490                 instance.FieldInfo
14491
14492         The idea is to use this instead of making LocalVariableReference
14493         have more than one meaning.
14494
14495         * cs-parser.jay: Add error production to BASE.
14496
14497         * ecore.cs: Deal with TypeManager.GetField returning null, which
14498         is now a valid return value.
14499
14500         (FieldExprNoAddress): New expression for Fields whose address can
14501         not be taken.
14502
14503         * expression.cs (LocalVariableReference): During the resolve
14504         phases, create new expressions if we are in a remapping context.
14505         Remove code that dealt with remapping here.
14506
14507         (ParameterReference): same.
14508
14509         (ProxyInstance): New expression, like the `This' expression, but
14510         it is born fully resolved.  We know what we are doing, so remove
14511         the errors that are targeted to user-provided uses of `this'.
14512
14513         * statement.cs (Foreach): our variable is now stored as an
14514         Expression;  During resolution, follow the protocol, dont just
14515         assume it will return this.
14516
14517 2003-08-06  Martin Baulig  <martin@ximian.com>
14518
14519         * support.cs (SeekableStreamReader.cs): New public class.
14520
14521         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14522         SeekableStreamReader instead of the normal StreamReader.
14523
14524 2003-08-04  Martin Baulig  <martin@ximian.com>
14525
14526         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14527         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14528         deambiguate casts and delegate invocations.
14529         (parenthesized_expression): Use the new tokens to ensure this is
14530         not a cast of method invocation.
14531
14532         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14533         when reading a `)' and Deambiguate_CloseParens () was previously
14534         called.
14535
14536         * expression.cs (ParenthesizedExpression): New class.  This is
14537         just used for the CS0075 test.
14538         (Binary.DoResolve): Check for CS0075.   
14539
14540 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14541
14542         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14543         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14544         reference comparison.
14545
14546         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14547         examine the ReturnType for equality - this is necessary in the
14548         cases of implicit and explicit operators whose signature also
14549         includes the return type.
14550
14551 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14552
14553         * namespace.cs: Cache the result of the namespace computation,
14554         instead of computing it every time.
14555
14556 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * decl.cs: Use a global arraylist that we reuse over invocations
14559         to avoid excesive memory consumption.  Reduces memory usage on an
14560         mcs compile by one meg (45 average).
14561
14562         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14563         private, work around that.
14564
14565 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14566
14567         * literal.cs (IntLiteral): Define Zero and One static literals. 
14568
14569         * cs-parser.jay (integer_literal): use static literals to reduce
14570         memory usage for the most used literals (0, 1 and -1).  211kb
14571         reduced in memory usage.
14572
14573         Replace all calls to `new ArrayList' with `new
14574         ArrayList(4)' which is a good average number for most allocations,
14575         and also requires only 16 bytes of memory for its buffer by
14576         default. 
14577
14578         This reduced MCS memory usage in seven megabytes for the RSS after
14579         bootstrapping.
14580
14581 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14582
14583         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14584         handle params methods the correct way by forming only one
14585         applicable set with params and normal methods in them. Earlier we
14586         were looking at params methods only if we found no normal methods
14587         which was not the correct thing to do.
14588
14589         (Invocation.BetterFunction): Take separate arguments indicating
14590         when candidate and the best method are params methods in their
14591         expanded form.
14592
14593         This fixes bugs #43367 and #46199.
14594
14595         * attribute.cs: Documentation updates.
14596
14597         (CheckAttribute): Rename to CheckAttributeTarget.
14598         (GetValidPlaces): Rename to GetValidTargets.
14599
14600         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14601         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14602
14603         Fixes bug #44468.
14604
14605 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14606
14607         * codegen.cs: Compute IsGeneric correctly.
14608
14609         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14610         resolution. 
14611
14612         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14613         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14614         regressions, and I was chasing more bugs than I required.
14615
14616         * interface.cs: Use expressions for base type names (like classes
14617         and structs have been doing for a while now), and resolve that.
14618         This patch should probably go into head as well.
14619
14620         This makes it one less user of FindType.
14621
14622 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14623
14624         This compiler can not self host currently.  Need to fix that.
14625         
14626         * Makefile: compile to `gmcs.exe'
14627
14628         * driver.cs: Turn on v2 by default on gmcs.
14629
14630         * generic.cs (ConstructedType): Does no longer take a container
14631         type argument;  That will be taken care of later.
14632
14633         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14634         Use SimpleName to resolve for now, so we can continue the work on
14635         the parser, until we get Type.GetType that understands generics.
14636
14637         (ConstructedType.ToString): Implement
14638
14639         (TypeArguments.Resolve): Resolve the child expressions as types. 
14640         
14641         * cs-parser.jay: Rename interface_constraints to
14642         type_parameter_constraints
14643
14644         (namespace_or_type_name): Only use constructed types for the basic
14645         construction, we will deal with identifier<...> later.
14646
14647         (type/type_name): No longer call DecomposeQI, as
14648         namespace_or_type_name is always decoded now.
14649         
14650 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14651
14652         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14653         closely: we eliminate methods in base types when we have an
14654         applicable method in a top-level type.
14655
14656         Please see section 14.5.5.1 for an exact description of what goes
14657         on. 
14658
14659         This fixes bug #45127 and a host of other related to corlib compilation.
14660
14661         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14662         array is the method corresponding to the top-level type (this is
14663         because of the changes made to icall.c) so we change this
14664         accordingly.
14665
14666         (MethodGroupExpr.Name): This too.
14667
14668         * typemanager.cs (GetElementType): New method which does the right
14669         thing when compiling corlib. 
14670
14671         * everywhere: Make use of the above in the relevant places.
14672
14673 2003-07-22  Martin Baulig  <martin@ximian.com>
14674
14675         * cs-parser.jay (invocation_expression): Moved
14676         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14677         `cast_expression', but create a InvocationOrCast which later
14678         resolves to either an Invocation or a Cast.
14679
14680         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14681         method; call this before EmitStatement() to make sure that this
14682         expression can be used as a statement.
14683
14684         * expression.cs (InvocationOrCast): New class; resolves to either
14685         an Invocation or a Cast.
14686
14687         * statement.cs (StatementExpression): Call ResolveStatement() on
14688         the ExpressionStatement before emitting it.
14689
14690 2003-07-21  Martin Baulig  <martin@ximian.com>
14691
14692         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14693         `ref' and `out' attributes match; fixes #46220.
14694         (MemberAccess.ResolveMemberAccess): You can't reference a type
14695         through an expression; fixes #33180.
14696         (Indexers.GetIndexersForType): Don't return the indexers from
14697         interfaces the class implements; fixes #46502.
14698
14699 2003-07-21  Martin Baulig  <martin@ximian.com>
14700
14701         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14702         CS0661 checks; fixes bug #30442.
14703
14704 2003-07-21  Martin Baulig  <martin@ximian.com>
14705
14706         * decl.cs (AdditionResult): Added `Error'.
14707
14708         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14709
14710         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14711         cs0031.cs actually work.
14712
14713  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14714  
14715         * cs-parser.jay (namespace_name): do not use
14716         namespace_or_type_name, use qualified_identifier, because
14717         namespace_or_type_name will soon return a composed expression
14718         instead of a string.
14719  
14720         (namespace_or_type_name): Instead of returning a string, now this
14721         production returns an expression.
14722  
14723         * codegen.cs (EmitContext): Setup IsGeneric property based on
14724         whether our DeclSpace is generic, our the method is generic.
14725  
14726         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14727         the method is generic.
14728  
14729         * cs-parser.jay (type_arguments, opt_type_argument_list,
14730         type_parameters, type_parameter_list, opt_type_parameter_list,
14731         type_parameter,, opt_type_parameter_constraints_clauses,
14732         type_parameter_constraints_clauses,
14733         type_parameter_constraint_clause, type_parameter_constraint,
14734         interface_constraints): Add new production
14735  
14736         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14737         DeclSpace is generic or not.
14738  
14739         (DeclSpace.SetParameterInfo): New routine, used to set the
14740         parameter info for a type.
14741  
14742         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14743         returns a GenericTypeExpr
14744  
14745         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14746         generic, lookup the generic argument.
14747  
14748         * attribute.cs: Do not allow TypeParameterExpressions in
14749         Attributes.
14750  
14751         * class.cs: Do not allow the Main method to be defined in a
14752         Generic container.
14753  
14754         * expression.cs (SizeOf): Do not allow generic types to be used as
14755         arguments to sizeof.
14756  
14757         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14758         it: whether a type is generic or not.  Only works for types we are
14759         currently building for now.
14760         
14761 2003-07-20  Martin Baulig  <martin@ximian.com>
14762
14763         * namespace.cs: Fixed that bug which caused a crash when compiling
14764         the debugger's GUI.
14765
14766 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * typemanager.cs (LookupTypeReflection): Never expose types which
14769         are NotPublic, NestedPrivate, NestedAssembly, or
14770         NestedFamANDAssem.  We used to return these, and later do a check
14771         that would report a meaningful error, but the problem is that we
14772         would not get the real match, if there was a name override.
14773
14774 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14775
14776         * namespace.cs (Namespace, Name): Do not compute the namespace
14777         name dynamically, compute it in the constructor.  This reduced
14778         memory usage by 1697 KB.
14779
14780         * driver.cs: Use --pause to pause at the end.
14781
14782 2003-07-17  Peter Williams  <peter@newton.cx>
14783
14784         * Makefile: Change the name of the test target so that it doesn't
14785         conflict with the recursive test target.
14786
14787 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14790         AddressOf): Do not use EmitThis, that was wrong, use the actual
14791         this pointer.
14792
14793 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14794
14795         * class.cs (MethodData.Define): While checking if a method is an
14796         interface implementation, improve the test: If we are not public
14797         (use new test here: use the computed MethodAttributes directly,
14798         instead of the parsed modifier flags) check if the `implementing'
14799         method comes from an interface or not.
14800
14801         * pending.cs (VerifyPendingMethods): Slightly better error
14802         message.
14803
14804         * makefile: add test target that does the mcs bootstrap.
14805
14806 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14807
14808         * interface.cs (Define): Do nothing here since there are no
14809         members to populate etc. Move the attribute emission out of here
14810         since this was just totally the wrong place to put it. Attribute
14811         application happens during the 'Emit' phase, not in the 'Define'
14812         phase.
14813
14814         (Emit): Add this method and move the attribute emission here
14815
14816         * rootcontext.cs (EmitCode): Call the Emit method on interface
14817         types too.
14818
14819 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14820
14821         * expression.cs (OverloadResolve): Report error only if Location
14822         is not 'Null' which means that there was a probe going on.
14823
14824 2003-07-14  Martin Baulig  <martin@ximian.com>
14825
14826         * expression.cs (ConditionalLogicalOperator): New public class to
14827         implement user defined conditional logical operators.
14828         This is section 14.11.2 in the spec and bug #40505.
14829
14830 2003-07-14  Martin Baulig  <martin@ximian.com>
14831
14832         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14833
14834 2003-07-14  Martin Baulig  <martin@ximian.com>
14835
14836         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14837
14838         * ecore.cs (IVariable.VerifyFixed): New interface method.
14839
14840         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14841         operator, check whether the variable is actually fixed.  Fixes bug
14842         #36055.  Set a variable definitely assigned when taking its
14843         address as required by the spec.
14844
14845         * statement.cs (LocalInfo.IsFixed): New field.
14846         (LocalInfo.MakePinned): Set `IsFixed' to true.
14847
14848 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14849
14850         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14851         for .ctors, ensure that we only ask for members declared in the
14852         attribute type (BindingFlags.DeclaredOnly).
14853
14854         Fixes bug #43632.
14855
14856         * expression.cs (Error_WrongNumArguments): Report error 1501
14857         correctly the way CSC does.
14858
14859 2003-07-13  Martin Baulig  <martin@ximian.com>
14860
14861         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14862         lookup on the fully qualified name, to make things like "X.X" work
14863         where "X.X" is a fully qualified type name, but we also have a
14864         namespace "X" in the using list.  Fixes #41975.
14865
14866 2003-07-13  Martin Baulig  <martin@ximian.com>
14867
14868         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14869         function. If we're a CompoundAssign, we need to create an embedded
14870         CompoundAssign, not an embedded Assign.
14871         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14872         Fixes #45854.
14873
14874 2003-07-13  Martin Baulig  <martin@ximian.com>
14875
14876         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14877         work to fix bug #46088.
14878
14879 2003-07-13  Ravi Pratap <ravi@ximian.com>
14880
14881         * class.cs (Operator.Emit): Do not emit attributes here - it is
14882         taken care of by the Method class that we delegate too. This takes
14883         care of bug #45876.
14884
14885 2003-07-10  Martin Baulig  <martin@ximian.com>
14886
14887         * expression.cs (TypeOfVoid): New class.
14888         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14889
14890 2003-07-10  Martin Baulig  <martin@ximian.com>
14891
14892         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14893         bug #35957.
14894
14895 2003-07-10  Martin Baulig  <martin@ximian.com>
14896
14897         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14898         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14899
14900         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14901
14902         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14903
14904 2003-07-10  Martin Baulig  <martin@ximian.com>
14905
14906         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14907         of decimal.  Fixes #42850.
14908
14909         NOTE: I also fixed the created byte blob, but this doesn't work on
14910         the MS runtime and csc never produces any byte blobs for decimal
14911         arrays.
14912
14913 2003-07-10  Martin Baulig  <martin@ximian.com>
14914
14915         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14916         structs; fixes #32068.
14917         (Block.AddChildVariableNames): Fixed #44302.
14918
14919 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14920
14921         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14922
14923 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * attribute.cs: And this test is onger needed.
14926
14927 2003-07-08  Martin Baulig  <martin@ximian.com>
14928
14929         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14930         inaccessible types.  Fixes #36313.
14931
14932         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14933
14934         * namespace.cs (NamespaceEntry): Create implicit entries for all
14935         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14936         implicit entries for N1.N2 and N1.
14937
14938 2003-07-08  Martin Baulig  <martin@ximian.com>
14939
14940         Rewrote the handling of namespaces to fix a lot of the issues
14941         wrt. `using' aliases etc.
14942
14943         * namespace.cs (Namespace): Splitted this class into a
14944         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14945
14946         * typemanager.cs (TypeManager.IsNamespace): Removed.
14947         (TypeManager.ComputeNamespaces): Only compute namespaces from
14948         loaded assemblies here, not the namespaces from the assembly we're
14949         currently compiling.
14950
14951 2003-07-08  Martin Baulig  <martin@ximian.com>
14952
14953         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14954
14955 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14958         already fixed it.  
14959
14960         I thought about the memory savings here, but LookupTypeReflection
14961         is used under already very constrained scenarios.  Compiling
14962         corlib or mcs only exposes one hit, so it would not really reduce
14963         any memory consumption.
14964
14965 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14966
14967         * typemanager.cs: fixes bug #45889 by only adding public types from
14968         other assemblies to the list of known types.
14969
14970 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14973         on the type we resolved.
14974
14975 2003-07-05  Martin Baulig  <martin@ximian.com>
14976
14977         * pending.cs (PendingImplementation.ParentImplements): Don't
14978         create the proxy if the parent is abstract.
14979
14980         * class.cs (TypeContainer.DefineIndexers): Process explicit
14981         interface implementations first.  Fixes #37714.
14982
14983 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14986         defined recursively;  but since we modify the input parameters
14987         (left is set to `this' temporarily), we reset this value if the
14988         left_is_explicit is false, which gives the original semantics to
14989         the code.  
14990
14991         * literal.cs (NullPointer): new class used to represent a null
14992         literal in a pointer context.
14993
14994         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14995         type is a pointer, use a NullPointer object instead of a
14996         NullLiteral.   Closes 43687
14997
14998         (ExplicitConversion): Convert pointer values using
14999         the conv opcode to the proper type.
15000
15001         * ecore.cs (New): change ValueTypeVariable property into a method,
15002         that returns whether the valuetype is suitable for being used.
15003
15004         * expression.cs (Binary.DoNumericPromotions): Only return if we
15005         the int constant was a valid uint, and we can return both left and
15006         right as uints.  If not, we continue processing, to trigger the
15007         type conversion.  This fixes 39018.
15008
15009         * statement.cs (Block.EmitMeta): During constant resolution, set
15010         the CurrentBlock property on the emitcontext, so that we resolve
15011         constants propertly.
15012
15013 2003-07-02  Martin Baulig  <martin@ximian.com>
15014
15015         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15016         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15017
15018         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15019         than emitting it here.
15020
15021         * statement.cs: Fixed some more flow analysis bugs.
15022
15023 2003-07-02  Martin Baulig  <martin@ximian.com>
15024
15025         * class.cs (MethodData.Define): When implementing interface
15026         methods, set Final unless we're Virtual.
15027
15028         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15029         check work for interface methods.
15030
15031 2003-07-01  Martin Baulig  <martin@ximian.com>
15032
15033         * ecore.cs (EmitContext.This): Replaced this property with a
15034         GetThis() method which takes a Location argument.  This ensures
15035         that we get the correct error location for a CS0188.
15036
15037 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15038
15039         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15040         ImplicitStandardConversion.
15041
15042         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15043
15044 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15045
15046         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15047         optimization.
15048
15049 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15050
15051         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15052         constructors.
15053
15054         (MethodData.Define): Turn off initlocals for unsafe methods.
15055
15056 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15057
15058         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15059         complete;  Fixes #37521.
15060
15061         * delegate.cs: Use Modifiers.TypeAttr to compute the
15062         TypeAttributes, instead of rolling our own.  This makes the flags
15063         correct for the delegates.
15064
15065 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * class.cs (Constructor.Define): Set the private flag for static
15068         constructors as well.
15069
15070         * cs-parser.jay (statement_expression): Set the return value to
15071         null, to avoid a crash when we catch an error.
15072
15073 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15074
15075         * cs-parser.jay: Applied patch from Jackson that adds support for
15076         extern and unsafe modifiers to destructor declarations.
15077
15078         * expression.cs: Report error 21 if the user is trying to index a
15079         System.Array.
15080
15081         * driver.cs: Add an error message, suggested by the bug report.
15082
15083         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15084         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15085
15086 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15087
15088         * namespace.cs: Add some information to reduce FAQs.
15089
15090 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15093         underlying enumeration types.  Fixes #43915.
15094
15095         * expression.cs: Treat ushort/short as legal values to be used in
15096         bitwise operations.
15097
15098 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15099
15100         * delegate.cs: transfer custom attributes for paramenters from
15101         the delegate declaration to Invoke and BeginInvoke.
15102
15103 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15104
15105         * attribute.cs: handle custom marshalers and emit marshal info
15106         for fields, too.
15107
15108 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15109
15110         * makefile.gnu: Added anonymous.cs to the compiler sources.
15111
15112 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * iterators.cs: Change the name of the proxy class to include two
15115         underscores.
15116
15117         * cs-parser.jay: Update grammar to include anonymous methods.
15118
15119         * anonymous.cs: new file.
15120
15121 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * class.cs (Field.Define): Add missing test for pointers and
15124         safety. 
15125
15126 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15127
15128         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15129         we use the stobj opcode.
15130
15131         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15132         since it wasn't the correct fix. 
15133
15134         It still is puzzling that we are required to use stobj for IntPtr
15135         which seems to be a ValueType.
15136
15137 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15140         during regular simple name resolution.   Now, the trick is that
15141         instead of returning for processing the simplename, we do a
15142         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15143         contextual lookup type).   If a match is found, return that, if
15144         not, return for further composition.
15145
15146         This fixes long-standing 30485.
15147
15148         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15149         using the address to initialize an object, do an Stobj instead of
15150         using the regular Stelem.
15151
15152         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15153         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15154         Because if we are a BaseIndexerAccess that value will be true.
15155         Fixes 43643.
15156
15157         * statement.cs (GotoCase.Resolve): Return after reporting an
15158         error, do not attempt to continue. 
15159
15160         * expression.cs (PointerArithmetic.Emit): If our operand is a
15161         long, convert our constants to match the operand before
15162         multiplying.  Convert to I type before adding.   Fixes 43670.
15163
15164 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15165
15166         * enum.cs (ImplicitConversionExists) : Rename to
15167         ImplicitEnumConversionExists to remove ambiguity. 
15168
15169         * ecore.cs (NullCast): New type of cast expression class which
15170         basically is very similar to EmptyCast with the difference being
15171         it still is a constant since it is used only to cast a null to
15172         something else
15173         (eg. (string) null)
15174
15175         * convert.cs (ImplicitReferenceConversion): When casting a null
15176         literal, we return a NullCast.
15177
15178         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15179         should be around anymore.
15180
15181         The renaming (reported was slightly wrong). Corrections:
15182
15183         ConvertImplicitStandard -> ImplicitConversionStandard
15184         ConvertExplicitStandard -> ExplicitConversionStandard
15185
15186         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15187         before passing them in !
15188
15189         * convert.cs (ImplicitConversionStandard): When comparing for
15190         equal expr and target types, ensure that expr is not a
15191         NullLiteral.
15192
15193         In general, we must not be checking (expr_type ==
15194         target_type) in the top level conversion methods
15195         (ImplicitConversion, ExplicitConversion etc). This checking is
15196         done in the methods that they delegate to.
15197
15198 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15199
15200         * convert.cs: Move Error_CannotConvertType,
15201         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15202         ImplicitNumericConversion, ImplicitConversionExists,
15203         ImplicitUserConversionExists, StandardConversionExists,
15204         FindMostEncompassedType, FindMostSpecificSource,
15205         FindMostSpecificTarget, ImplicitUserConversion,
15206         ExplicitUserConversion, GetConversionOperators,
15207         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15208         TryImplicitIntConversion, Error_CannotConvertImplicit,
15209         ConvertImplicitRequired, ConvertNumericExplicit,
15210         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15211         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15212         its own file.
15213
15214         Perform the following renames:
15215
15216         StandardConversionExists -> ImplicitStandardConversionExists
15217         ConvertImplicit -> ImplicitConversion
15218         ConvertImplicitStandard -> ImplicitStandardConversion
15219         TryImplicitIntConversion -> ImplicitIntConversion
15220         ConvertImplicitRequired -> ImplicitConversionRequired
15221         ConvertNumericExplicit -> ExplicitNumericConversion
15222         ConvertReferenceExplicit -> ExplicitReferenceConversion
15223         ConvertExplicit -> ExplicitConversion
15224         ConvertExplicitStandard -> ExplicitStandardConversion
15225
15226 2003-05-19  Martin Baulig  <martin@ximian.com>
15227
15228         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15229         (TypeInfo): Added support for structs having structs as fields.
15230
15231         * ecore.cs (FieldExpr): Implement IVariable.
15232         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15233         VariableInfo for the field.
15234
15235 2003-05-18  Martin Baulig  <martin@ximian.com>
15236
15237         * expression.cs (This.DoResolve): Report a CS0027 if we're
15238         emitting a field initializer.
15239
15240 2003-05-18  Martin Baulig  <martin@ximian.com>
15241
15242         * expression.cs (This.ResolveBase): New public function.
15243         (This.DoResolve): Check for CS0188.
15244
15245         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15246         This.Resolve().
15247
15248         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15249         `instance_expression' to null if we don't have any non-static
15250         methods.
15251
15252 2003-05-18  Martin Baulig  <martin@ximian.com>
15253
15254         Reworked the way how local variables and parameters are handled by
15255         the flow analysis code.
15256
15257         * statement.cs (TypeInfo, VariableMap): New public classes.
15258         (VariableInfo): New public class.  This is now responsible for
15259         checking whether a variable has been assigned.  It is used for
15260         parameters and local variables.
15261         (Block.EmitMeta): Take the InternalParameters as argument; compute
15262         the layout of the flow vectors here.
15263         (Block.LocalMap, Block.ParameterMap): New public properties.
15264         (FlowBranching): The .ctor doesn't get the InternalParameters
15265         anymore since Block.EmitMeta() now computes the layout of the flow
15266         vector.
15267         (MyStructInfo): This class is now known as `StructInfo' and nested
15268         in `TypeInfo'; we don't access this directly anymore.
15269
15270         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15271         property and removed IsAssigned(), IsFieldAssigned(),
15272         SetAssigned() and SetFieldAssigned(); we now call them on the
15273         VariableInfo so we don't need to duplicate this code everywhere.
15274
15275         * expression.cs (ParameterReference): Added `Block block' argument
15276         to the .ctor.
15277         (LocalVariableReference, ParameterReference, This): The new
15278         VariableInfo class is now responsible for all the definite
15279         assignment stuff.
15280
15281         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15282         IsParameterAssigned, SetParameterAssigned): Removed.
15283
15284 2003-05-18  Martin Baulig  <martin@ximian.com>
15285
15286         * typemanager.cs (InitCoreTypes): Try calling
15287         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15288         the 3-args-version.  Corlib now also needs our `void_type'.
15289         (GetMethod): Added overloaded version which takes an optional
15290         `bool report_errors' to allow lookups of optional methods.
15291
15292 2003-05-12  Martin Baulig  <martin@ximian.com>
15293
15294         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15295         only used for locals and not for parameters.
15296
15297 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * support.cs (InternalParameters.ParameterType): Return the
15300         ExternalType of the parameter.
15301
15302         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15303         they were unused.
15304
15305 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * class.cs (MethodData.Define): Do not set the `newslot' on
15308         interface members, if they are also flagged as "override".
15309
15310         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15311         better code for ++i and i++.  This only works for static fields
15312         and local variables.
15313
15314         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15315         want to pull the DeclSpace out of the builder_to_declspace instead
15316         of the TypeBuilder (like in TypeContainer.FindMembers).
15317
15318         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15319         instead of LookupTypeContainer.  Fixes the crash on .NET for
15320         looking up interface members.
15321
15322         * const.cs: Create our own emit context during the Definition
15323         stage, so that constants are evaluated in the proper context, when
15324         a recursive definition happens.
15325
15326 2003-05-11  Martin Baulig  <martin@ximian.com>
15327
15328         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15329         new block for a switch section.
15330         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15331         the adding/lookup in the switch block.  Fixes #39828.
15332
15333 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15334
15335         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15336         functionality: I needed to convert the data after I had performed
15337         the add/sub operation into the operands type size.
15338
15339         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15340         pass the type for the box operation, otherwise the resulting
15341         object would have been of type object.
15342
15343         (BoxedCast): Add constructor to specify the type to box as.
15344
15345 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * iterators.cs: I was reusing the `count' variable inadvertently,
15348         take steps to not allow this to happen.
15349
15350 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15351
15352         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15353         by creating an array at the point where the params starts and
15354         putting all those arguments there, then adjusting the size of the
15355         array.
15356
15357 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * expression.cs (New.AddressOf): Implement interface
15360         IMemoryLocation.  This is used when the `new' operator is used in
15361         the context of an invocation to a method on a value type.
15362
15363         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15364         example. 
15365
15366         * namespace.cs: Also check the using aliases here.
15367
15368         * driver.cs: Move the test for using validity after the types have
15369         been entered, so we do a single pass that also includes the using
15370         aliases. 
15371
15372         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15373         in the regular case.   CreateSiblingForFinally is doing extra
15374         error checking.
15375
15376         * attribute.cs (GetAttributeArgumentExpression): Store the result
15377         on an out value, and use the return value to indicate failure
15378         instead of using null (which is a valid return for Constant.GetValue).
15379
15380         * statement.cs: Perform the analysis flow for the increment
15381         portion after the statement, because this will be the real flow of
15382         execution.  Fixes #42385
15383
15384         * codegen.cs (EmitContext.EmitArgument,
15385         EmitContext.EmitStoreArgument): New helper functions when the
15386         RemapToProxy flag is set.
15387
15388         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15389         function.
15390
15391         Add support for remapping parameters. 
15392
15393         * iterators.cs: Propagate parameter values;  Store parameter
15394         values in the proxy classes.
15395
15396 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15399         need a proxy reference;  I do not know what I was thinking
15400
15401         * cs-parser.jay (constructor_initializer): catch another error,
15402         and display nice message.
15403
15404         (field_declaration): catch void field declaration
15405         to flag a better error. 
15406
15407         * class.cs (MemberBase.CheckBase): Report an error instead of a
15408         warning if a new protected member is declared in a struct. 
15409         (Field.Define): catch the error of readonly/volatile.
15410
15411         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15412
15413         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15414         volatile variable is taken
15415
15416 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15417
15418         * statement.cs (Fixed.Resolve): Report an error if we are not in
15419         an unsafe context.
15420
15421 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15422
15423         * typemanager.cs: reuse the code that handles type clashes for
15424         delegates and enumerations.
15425
15426         * class.cs (Report28): Always report.
15427
15428         * expression.cs (EncodeAsAttribute): Allow nulls here.
15429
15430 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15431
15432         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15433         the functionality for testing whether an expression is valid for
15434         an attribute here.  Also handle the case of arrays of elements
15435         being stored. 
15436
15437         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15438         encoding a linear array into an array of objects that are suitable
15439         to be passed to an CustomAttributeBuilder.
15440
15441         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15442
15443         * ecore.cs: (FieldExpr): Handle field remapping here.
15444
15445         * iteratators.cs: Pass the instance variable (if the method is an
15446         instance method) to the constructors, so we can access the field
15447         variables on the class.
15448
15449         TODO: Test this with structs.  I think the THIS variable on
15450         structs might have to be a pointer, and not a refenrece
15451
15452 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15453
15454         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15455         local variables to fields in a proxy class.
15456
15457         * iterators.cs (PopulateProxy): Rename our internal fields to
15458         <XXX>.  
15459         Create a <THIS> field if we are an instance method, so we can
15460         reference our parent container variables.
15461         (MapVariable): Called back from the EmitContext code to enter a
15462         new variable to field mapping into the proxy class (we just create
15463         a FieldBuilder).
15464
15465         * expression.cs
15466         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15467         for using the remapped locals to fields.
15468
15469         I placed the code here, because that gives the same semantics to
15470         local variables, and only changes the Emit code.
15471
15472         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15473         statements inside iterators.
15474         (VariableInfo): Add a FieldBuilder for the cases when we are
15475         remapping local variables to fields in a proxy class
15476
15477         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15478         current_block != null.
15479
15480         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15481         not cope with strings, as it has been moved to the
15482         TableSwitchEmit.  Fixed bug in switch generation.
15483
15484         * expression.cs (New.DoResolve): Provide more context for the user
15485         when reporting an error.
15486
15487         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15488         pointers. 
15489
15490         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15491         check the permissions for it.  Note than in a type-resolution
15492         context the check was already present in DeclSpace.ResolveType,
15493         but was missing from the MemberAccess.
15494
15495         (ArrayCreation.CheckIndices): warn if the user has
15496         more nested levels of expressions, but there are no more
15497         dimensions specified.  Avoids crash on bug 41906.
15498
15499 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * statement.cs (Block): replace Implicit bool, for a generic
15502         flags.   
15503         New flag: `Unchecked'.  This is used during the EmitMeta phase
15504         (which is out-of-line with the regular Resolve/Emit process for a
15505         statement, as this is done ahead of time, but still gets a chance
15506         to call constant resolve).
15507
15508         (Block.Flags): new enum for adding a new flag.
15509
15510         (Block.EmitMeta): track the state of unchecked.
15511
15512         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15513         to enable constant resolution to work there as well.
15514
15515 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * typemanager.cs (ienumerable_type): Also look up
15518         System.Collections.IEnumerable. 
15519
15520 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15521
15522         TODO: Test more than one conditional per method.
15523
15524         * class.cs (Indexer.Define): Report the location where the user is
15525         referencing the unsupported feature.
15526
15527         (MethodData): Overload the use of `conditionals' to
15528         minimize the creation of needless ArrayLists.   This saves roughly
15529         212kb on my machine.
15530
15531         (Method): Implement the new IIteratorContainer interface.
15532         (Method.SetYields): Implement the method by setting the ModFlags
15533         to contain METHOD_YIELDS.
15534
15535         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15536         which just got set to null.
15537
15538         * iterators.cs: New file.
15539
15540         (Yield, YieldBreak): New statements.
15541
15542         * statement.cs (Return.Resolve): Flag an error if we are used in
15543         an iterator method.
15544
15545         * codegen.cs (InIterator): New flag set if the code is being
15546         compiled in an iterator method.
15547
15548         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15549         internal modifier, and we just use it to avoid adding extra
15550         fields, as this is seldom used.  
15551
15552         * cs-parser.jay: Add yield_statement (yield and yield break).
15553
15554         * driver.cs: New flag -v2 to turn on version 2 features. 
15555
15556         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15557         hashtable when v2 is enabled.
15558
15559 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15560
15561         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15562         there is already a namespace defined with this name.
15563
15564         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15565         people upgraded their corlibs.
15566
15567         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15568         always use fully qualified types, no need to use the compiler
15569         front end.
15570
15571         (TypeManager.IsNamespace): Use binarysearch.
15572
15573         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15574         AddDelegate): I did not quite use the new IsValid API properly: I
15575         have to pass the short-name and the fullname.  I was passing only
15576         the basename instead of the fullname sometimes. 
15577
15578         (TypeContainer.DefineType): call NamespaceClash.
15579
15580         * interface.cs (Interface.DefineType): use NamespaceClash before
15581         defining the type.
15582
15583         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15584         defining the type.
15585
15586         * enum.cs: (Enum.DefineType): use NamespaceClash before
15587         defining the type.
15588
15589         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15590         speed increase.  First, use the negative_hits cache when we get a
15591         negative.  Second, add the type with its full original name
15592         instead of the new . and + encoded name (reflection uses + to
15593         separate type from a nested type).  Use LookupTypeReflection
15594         directly which bypasses the type->name hashtable (that we already
15595         know does not contain the type.
15596
15597         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15598         location/container type. 
15599
15600         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15601
15602 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15603
15604         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15605
15606         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15607         method is being referenced in the method group from a static
15608         context, and report error 120 if so.
15609
15610         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15611         Error118. 
15612
15613         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15614         is created, we create the A namespace).
15615
15616         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15617         Fixes #41591
15618
15619 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15620
15621         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15622         invocation to ModuleBuilder.GetType with the same values will
15623         return a new type instance, so we need to cache its return
15624         values. 
15625
15626         * expression.cs (Binary.ResolveOperator): Only allow the compare
15627         operators on enums if they are of the same type.
15628
15629         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15630         types of ValueType on their own case.  Before we were giving them
15631         the same treatment as objects.
15632
15633         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15634         fullname.  Short name is used to compare against container name.
15635         Fullname is used to check against defined namespace names.
15636
15637         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15638         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15639
15640         (Method.CheckBase): Call parent.
15641         (MemberBase.CheckBase): Check for protected members on sealed
15642         classes.
15643         (PropertyBase.CheckBase): Call parent.
15644         (Field.Define): Call parent.
15645
15646         * report.cs: Negative error codes are now mapped to 8000 - code,
15647         so that the display is render more nicely.
15648
15649         * typemanager.cs: Do not use try/catch, instead report a regular
15650         error. 
15651
15652         (GetPointerType, GetReferenceType): These methods provide
15653         mechanisms to obtain the T* and T& from a T.  We had the code
15654         previously scattered around the code base, and it also used
15655         TypeManager.LookupType that would go through plenty of caches.
15656         This one goes directly to the type source.
15657
15658         In some places we did the Type.GetType followed by
15659         ModuleBuilder.GetType, but not in others, so this unifies the
15660         processing as well.
15661
15662         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15663         statements now that we have namespace information.
15664
15665         * typemanager.cs (IsNamespace): New method, returns whether the
15666         string presented is a namespace or not.
15667
15668         (ComputeNamespaces): New public entry point, computes the list of
15669         available namespaces, using the GetNamespaces API call in Mono, or
15670         the slower version in MS.NET.   
15671
15672         Now before we start the semantic analysis phase, we have a
15673         complete list of namespaces including everything that the user has
15674         provided.
15675
15676         Deleted old code to cache namespaces in .nsc files.
15677
15678 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15681         class/struct location definition Location for the implicit
15682         constructor location.
15683
15684         (Operator.Define): Use the location of the operator for the
15685         implicit Method definition.
15686
15687         (Constructor.Emit): use the constructor location for the implicit
15688         base initializer constructor.
15689
15690         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15691         and the Expression class now contains two new methods:
15692
15693         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15694         isolate type lookup from the rest of the resolution process.
15695
15696         Since we use Expressions to hold type definitions due to the way
15697         we parse the input we have historically overloaded Resolve to
15698         perform the Type lookups if a special flag is passed.  Now this is
15699         eliminated and two methods take their place. 
15700
15701         The differences in the two methods between xStep and xTerminal is
15702         that xStep is involved in our current lookup system that uses
15703         SimpleNames to compose a name, while xTerminal is used just to
15704         catch the case where the simplename lookup failed.
15705
15706 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * expression.cs (ResolveMemberAccess): Remove redundant code.
15709         TypeExpr expressions are always born fully resolved.
15710
15711         * interface.cs (PopulateMethod): Do not lookup the types twice.
15712         We were doing it once during SemanticAnalysis and once during
15713         PopulateMethod.
15714
15715         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15716         in local variable type definitions, were being returned as a
15717         SimpleName (we decomposed everything into a string), that is
15718         because primary_expression was being used instead of a type in the
15719         grammar (reduce/reduce conflicts).
15720
15721         The part that was wrong is that we converted the expression into a
15722         string (an oversimplification in one hand, compounded with primary
15723         expressions doing string concatenation).
15724
15725         So things like:
15726
15727         A.B.C [] x;
15728
15729         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15730         using clauses from working on this particular context.  And a type
15731         was being matched directly against "A.B.C[]".
15732
15733         We now use the correct approach, and allow for ComposedCast to be
15734         part of the unary expression.  So the "A.B.C []" become a composed
15735         cast of "A.B.C" (as a nested group of MemberAccess with a
15736         SimpleName at the end) plus the rank composition "[]". 
15737
15738         Also fixes 35567
15739
15740 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15743         for the access level checking.
15744
15745         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15746         `TypeContainer container', because I kept getting confused when I
15747         was debugging this code.
15748
15749         * expression.cs (Indexers): Instead of tracking getters/setters,
15750         we now track them in parallel.  We create one arraylist less, but
15751         most importantly it is possible now for the LValue code to find a
15752         matching get for a set.
15753
15754         (IndexerAccess.DoResolveLValue): Update the code.
15755         GetIndexersForType has been modified already to extract all the
15756         indexers from a type.  The code assumed it did not.
15757
15758         Also make the code set the correct return type for the indexer.
15759         This was fixed a long time ago for properties, but was missing for
15760         indexers.  It used to be void_type.
15761
15762         (Binary.Emit): Test first for doubles instead of
15763         floats, as they are more common.
15764
15765         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15766         when dealing with floats and the <=, >= operators.  This fixes bug
15767         #39314 
15768
15769         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15770         to load the array value by emitting a load on the foreach variable
15771         type.  This was incorrect.  
15772
15773         We now emit the code to load an element using the the array
15774         variable type, and then we emit the conversion operator.
15775
15776         Fixed #40176
15777
15778 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15779
15780         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15781
15782 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15785         test for protection before we test for signatures. 
15786
15787         (MethodSignature.ToString): implement.
15788
15789         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15790         to the case where we reduced into a LongConstant.
15791
15792         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15793         depend on whether the information is acurrate, because the
15794         Microsoft runtime will always claim that the array type is public,
15795         regardless of the real state.
15796
15797         If the type is a pointer, another problem happens: the type is
15798         reported as non-public in Microsoft.  
15799
15800         In both cases we have to call CheckAccessLevel recursively with
15801         the underlying type as the argument to be tested.
15802
15803 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * assign.cs (Assign.Emit): If we are dealing with a compound
15806         assignment expression, we should use the code path that stores the
15807         intermediate result in a temporary value.  This fixes #40903.
15808
15809         *expression.cs (Indirection.ToString): Provide ToString method for
15810         debugging. 
15811
15812 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15813
15814         * class.cs: Null out fields holding references to Block objects so
15815         they can be garbage collected.
15816
15817         * expression.cs (OverloadResolve): Remove unused local.
15818
15819 2003-04-07  Martin Baulig  <martin@ximian.com>
15820
15821         * codegen.cs (EmitContext.CurrentFile): New public field.
15822         (EmitContext.Mark): Use the CurrentFile to check whether the
15823         location is in the correct file.
15824         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15825
15826 2003-04-07  Martin Baulig  <martin@ximian.com>
15827
15828         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15829
15830         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15831         location.  [FIXME: The location argument which gets passed to this
15832         method is sometimes wrong!]
15833
15834 2003-04-07  Nick Drochak <ndrochak@gol.com>
15835
15836         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15837
15838 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * expression.cs (Indirection.EmitAssign): We were using the
15841         temporary, but returning immediately instead of continuing the
15842         EmitAssing flow.
15843
15844 2003-04-06  Martin Baulig  <martin@ximian.com>
15845
15846         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15847         if it's a nested child, but also deriving from the outer class.
15848         See test 190.cs.
15849
15850         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15851         nested child, but also deriving from the outer class.  See
15852         test-190.cs.
15853         (FilterWithClosure): We may access private members of the outer
15854         class if we're a nested child and deriving from the outer class.
15855         (RealMemberLookup): Only set `closure_private_ok' if the
15856         `original_bf' contained BindingFlags.NonPublic.
15857
15858 2003-04-05  Martin Baulig  <martin@ximian.com>
15859
15860         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15861         probe if its a type parameter, and if so, flag an error.
15862
15863         * decl.cs: Move here the SetParameterInfo code from class.cs.
15864         Handle IsGeneric here.
15865
15866         Handle a variety of errors in the parameter info definition.
15867
15868         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15869         type parameters here.
15870
15871         * cs-parser.jay (class_declaration): report errors for parameters
15872         here as well.
15873
15874 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15875
15876         * generic.cs: New file, contains support code for generics.
15877
15878         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15879         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15880
15881         Update parser for the above removals.
15882
15883         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15884         now taken care of in the parser.
15885
15886 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * class.cs (Event.Define): Do not allow abstract events to have
15889         initializers. 
15890
15891 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15892
15893         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15894         block in event declarations.
15895
15896         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15897         value type, get its address.
15898
15899         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15900         leaving a class on the stack instead of a boolean value (int
15901         0/1).  Change the code so we compare against null, and then the
15902         result against zero.
15903
15904         * class.cs (TypeContainer.GetClassBases): We were checking for the
15905         parent class being sealed too late.
15906
15907         * expression.cs (Binary.Emit): For <= and >= when dealing with
15908         floating point values, use cgt.un and clt.un instead of cgt and
15909         clt alone.
15910
15911 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15912
15913         * statement.cs: Apply the same optimization as MS: skip the 
15914         GetEnumerator returning an IEnumerator, and use the one returning a 
15915         CharEnumerator instead. This allows us to avoid the try-finally block 
15916         and the boxing.
15917
15918 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15919
15920         * cs-parser.jay: Attributes cannot be applied to
15921                          namespaces. Fixes #40473
15922
15923 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15924
15925         * class.cs:
15926         (Add*): check if the name is valid using the full name for constants,
15927         fields, properties and events.
15928
15929 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15930
15931         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15932         char constants to be part of the enumeration.
15933
15934         * expression.cs (Conditional.DoResolve): Add support for operator
15935         true. Implements the missing functionality from 14.12
15936
15937         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15938         operator true/false as required by the spec.
15939
15940         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15941         implicit conversion to boolean.
15942
15943         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15944         also one where the type implements `operator true'. 
15945
15946         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15947         get an expression that will invoke operator true based on an
15948         expression.  
15949
15950         (GetConversionOperators): Removed the hack that called op_True
15951         here.  
15952
15953         (Expression.ResolveBoolean): Move this from Statement.
15954
15955 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15956
15957         * ecore.cs (FieldExpr): do not allow initialization of initonly
15958         fields on derived classes
15959
15960 2003-03-13  Martin Baulig  <martin@ximian.com>
15961
15962         * statement.cs (Block.Emit): Call ig.BeginScope() and
15963         ig.EndScope() when compiling with debugging info; call
15964         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15965
15966 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (Indexers): Do not construct immediately, allow
15969         for new members to be appended as we go.  Fixes 38143
15970
15971 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15972
15973         * expression.cs: save/restore context when resolving an unchecked
15974         expression.
15975
15976 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15977
15978         * cfold.cs: Catch division by zero in modulus operator during
15979         constant folding.
15980
15981 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * interface.cs (Interface.DefineMembers): Avoid defining members
15984         twice. 
15985
15986 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * driver.cs: handle the +/- options for -noconfig
15989
15990         * statement.cs (Unckeched.Resolve): Also track the state of
15991         unchecked in the Resolve phase.
15992
15993 2003-02-27  Martin Baulig  <martin@ximian.com>
15994
15995         * ecore.cs (Expression.MemberLookup): Don't create a
15996         MethodGroupExpr for something which is not a method.  Fixes #38291.
15997
15998 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * class.cs (MemberBase.CheckParameters): Also check that the type
16001         is unmanaged if it is a pointer.
16002
16003         * expression.cs (SizeOf.Resolve): Add location information.
16004
16005         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16006         a managed type is declared.
16007
16008         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16009         parameter modifiers as well.  Fixes bug 38606
16010
16011         * class.cs: Very sad.  Am backing out the speed up changes
16012         introduced by the ArrayList -> Array in the TypeContainer, as they
16013         were not actually that much faster, and introduced a bug (no error
16014         reports on duplicated methods).
16015
16016         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16017         source first, this will guarantee that we have a valid expression
16018         before calling in lower levels functions that will require a
16019         resolved object.  Then use this original_source in the
16020         target.ResolveLValue instead of the original source that was
16021         passed to us.
16022
16023         Another change.  Use target.Resolve instead of LValueResolve.
16024         Although we are resolving for LValues, we will let the Assign code
16025         take care of that (it will be called again from Resolve).  This
16026         basically allows code like this:
16027
16028         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16029         class Y { void A (X x) { x [0] += o; }
16030
16031         The problem was that the indexer was trying to resolve for
16032         set_Item (idx, object o) and never finding one.  The real set_Item
16033         was set_Item (idx, X).  By delaying the process we get the right
16034         semantics. 
16035
16036         Fixes bug 36505
16037
16038 2003-02-23  Martin Baulig  <martin@ximian.com>
16039
16040         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16041         while calling DoEmit ().
16042
16043         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16044         source files; if you use the #line directive inside a method, the
16045         compiler stops emitting line numbers for the debugger until it
16046         reaches the end of the method or another #line directive which
16047         restores the original file.
16048
16049 2003-02-23  Martin Baulig  <martin@ximian.com>
16050
16051         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16052
16053 2003-02-23  Martin Baulig  <martin@ximian.com>
16054
16055         * statement.cs (Block.AddChildVariableNames): We need to call this
16056         recursively, not just for our immediate children.
16057
16058 2003-02-23  Martin Baulig  <martin@ximian.com>
16059
16060         * class.cs (Event.Define): Always make the field private, like csc does.
16061
16062         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16063         actually work, fixes bug #37521.
16064
16065 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * delegate.cs: When creating the various temporary "Parameters"
16068         classes, make sure that we call the ComputeAndDefineParameterTypes
16069         on those new parameters (just like we do with the formal ones), to
16070         allow them to be resolved in the context of the DeclSpace.
16071
16072         This fixes the bug that Dick observed in Bugzilla #38530.
16073
16074 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * expression.cs (ResolveMemberAccess): When resolving a constant,
16077         do not attempt to pull a constant if the value was not able to
16078         generate a valid constant.
16079
16080         * const.cs (LookupConstantValue): Do not report more errors than required.
16081
16082 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16083
16084         * expression.cs: fixes bug #38328.
16085
16086 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16087
16088         * class.cs: Changed all the various members that can be part of a
16089         class from being an ArrayList to be an Array of the right type.
16090         During the DefineType type_list, interface_list, delegate_list and
16091         enum_list are turned into types, interfaces, delegates and enums
16092         arrays.  
16093
16094         And during the member population, indexer_list, event_list,
16095         constant_list, field_list, instance_constructor_list, method_list,
16096         operator_list and property_list are turned into their real arrays.
16097
16098         Although we could probably perform this operation earlier, for
16099         good error reporting we need to keep the lists and remove the
16100         lists for longer than required.
16101
16102         This optimization was triggered by Paolo profiling the compiler
16103         speed on the output of `gen-sample-program.pl' perl script. 
16104
16105         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16106         not crash in methods like MemberLookupFailed that use this field.  
16107
16108         This problem arises when the compiler fails to resolve a type
16109         during interface type definition for example.
16110
16111 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16112
16113         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16114         inherit from System.Object, so we have to stop at null, not only
16115         when reaching System.Object.
16116
16117 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16118
16119         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16120         DeclaredOnly because the parent indexer might have had a different
16121         name, but did not loop until the top of the hierarchy was reached.
16122
16123         The problem this one fixes is 35492: when a class implemented an
16124         indexer from an interface, we were getting the interface method
16125         (which was abstract) and we were flagging an error (can not invoke
16126         abstract method).
16127
16128         This also keeps bug 33089 functioning, and test-148 functioning.
16129
16130         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16131         out if a method is special is to see if it is declared in a
16132         property or event, or whether it is one of the predefined operator
16133         names.   This should fix correctly #36804.
16134
16135 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16136
16137         The goal here is to remove the dependency on EmptyCast.Peel ().
16138         Killing it completely.
16139
16140         The problem is that currently in a number of places where
16141         constants are expected, we have to "probe" for an EmptyCast, and
16142         Peel, which is not the correct thing to do, as this will be
16143         repetitive and will likely lead to errors. 
16144
16145         The idea is to remove any EmptyCasts that are used in casts that
16146         can be reduced to constants, so we only have to cope with
16147         constants. 
16148
16149         This bug hunt was triggered by Bug 37363 and the desire to remove
16150         the duplicate pattern where we were "peeling" emptycasts to check
16151         whether they were constants.  Now constants will always be
16152         constants.
16153
16154         * ecore.cs: Use an enumconstant here instead of wrapping with
16155         EmptyCast.  
16156
16157         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16158         throwing me off.  By handling this we can get rid of a few hacks.
16159
16160         * statement.cs (Switch): Removed Peel() code.
16161
16162 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * class.cs: Location information for error 508
16165
16166         * expression.cs (New.DoResolve): Add a guard against double
16167         resolution of an expression.  
16168
16169         The New DoResolve might be called twice when initializing field
16170         expressions (see EmitFieldInitializers, the call to
16171         GetInitializerExpression will perform a resolve on the expression,
16172         and later the assign will trigger another resolution
16173
16174         This leads to bugs (#37014)
16175
16176         * delegate.cs: The signature for EndInvoke should contain any ref
16177         or out parameters as well.  We were not doing this in the past. 
16178
16179         * class.cs (Field.Define): Do not overwrite the type definition
16180         inside the `volatile' group.  Turns out that volatile enumerations
16181         were changing the type here to perform a validity test, which
16182         broke conversions. 
16183
16184 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16185
16186         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16187         and structs, we do not want to load the instance variable
16188
16189         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16190         enum_type has to be handled like an object reference (implicit
16191         conversions exists from this to object), but the regular IsClass
16192         and IsValueType tests will never return true for this one.
16193
16194         Also we use TypeManager.IsValueType instead of type.IsValueType,
16195         just for consistency with the rest of the code (this is only
16196         needed if we ever use the construct exposed by test-180.cs inside
16197         corlib, which we dont today).
16198
16199 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16200
16201         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16202         just InternalCall.
16203
16204 2003-02-09  Martin Baulig  <martin@ximian.com>
16205
16206         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16207         (Namespace.DefineNamespaces): New static public method; this is
16208         called when we're compiling with debugging to add all namespaces
16209         to the symbol file.
16210
16211         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16212         pass it to the Namespace's .ctor.
16213
16214         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16215         and MethodBase arguments; pass the namespace ID to the symwriter;
16216         pass the MethodBase instead of the token to the symwriter.
16217         (SymbolWriter.DefineNamespace): New method to add a namespace to
16218         the symbol file.
16219
16220 2003-02-09  Martin Baulig  <martin@ximian.com>
16221
16222         * symbolwriter.cs: New file.  This is a wrapper around
16223         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16224         methods here in near future.
16225
16226 2003-02-09  Martin Baulig  <martin@ximian.com>
16227
16228         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16229         ILGenerator.MarkSequencePoint() which are actually used by the
16230         symbol writer.
16231
16232 2003-02-09  Martin Baulig  <martin@ximian.com>
16233
16234         * location.cs (SourceFile): New public sealed class.  This
16235         contains the name and an index which is used in the location's token.
16236         (Location): Reserve an appropriate number of bits in the token for
16237         the source file instead of walking over that list, this gives us a
16238         really huge performance improvement when compiling with debugging.
16239
16240         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16241         `SourceFile' argument instead of a string.
16242         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16243         but don't parse/tokenize here, we need to generate the list of all
16244         source files before we do that.
16245         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16246         the files.
16247
16248         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16249         instead of a string.
16250
16251         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16252         of a string.
16253
16254 2003-02-09  Martin Baulig  <martin@ximian.com>
16255
16256         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16257         filename on `#line default'.
16258
16259 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16260
16261         * statement.cs: don't clear the pinned var when the fixed statement
16262         returns from the method (fixes bug#37752).
16263
16264 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16265
16266         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16267         to IsValueType.
16268
16269 2003-02-07  Martin Baulig  <martin@ximian.com>
16270
16271         * driver.cs: Removed the `--debug-args' command line argument.
16272
16273         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16274         automatically by the AsssemblyBuilder.
16275         (CodeGen.InitializeSymbolWriter): We don't need to call any
16276         initialization function on the symbol writer anymore.  This method
16277         doesn't take any arguments.
16278
16279 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16282         from referenced assemblies as well.
16283
16284 2003-02-02  Martin Baulig  <martin@ximian.com>
16285
16286         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16287
16288 2003-02-02  Martin Baulig  <martin@ximian.com>
16289
16290         * class.cs (Constructor.Emit): Open the symbol writer before
16291         emitting the constructor initializer.
16292         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16293         single-stepping through constructor initializers.
16294
16295 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * class.cs: Handle error 549: do not allow virtual methods in
16298         sealed classes. 
16299
16300 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16301
16302         * decl.cs: Check access levels when resolving types
16303
16304 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16305
16306         * statement.cs: Add parameters and locals set in catch blocks that might 
16307         return to set vector
16308
16309 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16310
16311         * class.cs (Operator): Set the SpecialName flags for operators.
16312
16313         * expression.cs (Invocation.DoResolve): Only block calls to
16314         accessors and operators on SpecialName methods.
16315
16316         (Cast.TryReduce): Handle conversions from char constants.
16317
16318
16319 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16320
16321         * statement.cs: small memory and time optimization in FlowBranching.
16322
16323 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16324
16325         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16326         problem that the last fix but in the other sid (Set).
16327
16328         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16329         access when there is no indexer in the hierarchy.
16330
16331 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16332
16333         * class.cs: Combine some if statements.
16334
16335 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16336
16337         * driver.cs: fixed bug #37187.
16338
16339 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16340
16341         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16342         any indexer, it's needed to build a list with all the indexers in the
16343         hierarchy (AllGetters), else we have problems. Fixes #35653.
16344
16345 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16346
16347         * class.cs (MethodData.Define): It is wrong for an interface
16348         implementation to be static in both cases: explicit and implicit.
16349         We were only handling this in one case.
16350
16351         Improve the if situation there to not have negations.
16352
16353         * class.cs (Field.Define): Turns out that we do not need to check
16354         the unsafe bit on field definition, only on usage.  Remove the test.
16355
16356 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16357
16358         * driver.cs: use assembly.Location instead of Codebase (the latest
16359         patch made mcs fail when using MS assemblies).
16360
16361 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16362
16363         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16364         get the path to *corlib.dll.
16365
16366 2003-01-21  Nick Drochak <ndrochak@gol.com>
16367
16368         * cs-tokenizer.cs:
16369         * pending.cs:
16370         * typemanager.cs: Remove compiler warnings
16371
16372 2003-01-20  Duncan Mak  <duncan@ximian.com>
16373
16374         * AssemblyInfo.cs: Bump the version number to 0.19.
16375
16376 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16377
16378         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16379
16380 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16381
16382         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16383
16384 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16385
16386         * cs-parser.jay: Small fix: we were not comparing the constructor
16387         name correctly.   Thanks to Zoltan for the initial pointer.
16388
16389 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16390
16391         * cs-tokenizer.cs: Set file name when specified with #line
16392
16393 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * cs-parser.jay: Only perform the constructor checks here if we
16396         are named like the class;  This will help provider a better
16397         error.  The constructor path is taken when a type definition is
16398         not found, but most likely the user forgot to add the type, so
16399         report that rather than the constructor error.
16400
16401 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16402
16403         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16404         allocations.
16405
16406 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16407
16408         * cs-parser.jay: Add cleanup call.
16409
16410 2003-01-13  Duncan Mak  <duncan@ximian.com>
16411
16412         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16413         consistent with other methods.
16414
16415 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16416
16417         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16418
16419 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16420
16421         * attribute.cs: only set GuidAttr to true when we have a
16422         GuidAttribute.
16423
16424 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16425
16426         * ecore.cs:
16427         * expression.cs:
16428         * typemanager.cs: fixes to allow mcs compile corlib with the new
16429         Type.IsSubclassOf fix.
16430
16431 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16432
16433         * expression.cs (LocalVariableReference.DoResolve): Classify a
16434         constant as a value, not as a variable.   Also, set the type for
16435         the variable.
16436
16437         * cs-parser.jay (fixed_statement): take a type instead of a
16438         pointer_type, so we can produce a better error message later.
16439
16440         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16441         as an error.  
16442
16443         (For.DoEmit): Make inifinite loops have a
16444         non-conditional branch back.
16445
16446         (Fixed.DoEmit): First populate the pinned variables, then emit the
16447         statement, then clear the variables.  Before I was emitting the
16448         code once for each fixed piece.
16449
16450
16451 2003-01-08  Martin Baulig  <martin@ximian.com>
16452
16453         * statement.cs (FlowBranching.MergeChild): A break in a
16454         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16455
16456 2003-01-08  Martin Baulig  <martin@ximian.com>
16457
16458         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16459         lives in the same number space than `param_map'.  Fixes #36154.
16460
16461 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16462
16463         * cs-parser.jay (constructor_declaration): Set the
16464         Constructor.ModFlags before probing for it.  This makes the
16465         compiler report 514, 515 and 132 (the code was there, but got
16466         broken). 
16467
16468         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16469         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16470         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16471
16472 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16473
16474         * enum.cs: create the enum static fields using the enum type.
16475
16476 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16477
16478         * class.cs: don't try to create the ParamBuilder for the return
16479         type if it's not needed (and handle it breaking for the ms runtime
16480         anyway).
16481
16482 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16483
16484         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16485
16486 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16489         the command.   This showed up while compiling the JANET source
16490         code, which used \r as its only newline separator.
16491
16492 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16493
16494         * class.cs (Method.Define): If we are an operator (because it
16495         reuses our code), then set the SpecialName and HideBySig.  #36128
16496
16497 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16500         exception, report error 120 `object reference required'.
16501
16502         * driver.cs: Add --pause option, used during to measure the size
16503         of the process as it goes with --timestamp.
16504
16505         * expression.cs (Invocation.DoResolve): Do not allow methods with
16506         SpecialName to be invoked.
16507
16508 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16509
16510         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16511         number before adding it.
16512
16513 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16514
16515         * ecore.cs (StandardImplicitConversion): When in an unsafe
16516         context, we allow conversion between void * to any other pointer
16517         type. This fixes bug #35973.
16518
16519 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16520
16521         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16522         is not thrown when extensionless outputs are used 
16523
16524 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16525
16526         * rootcontext.cs: fixed compilation of corlib.
16527
16528 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16529
16530         * attribute.cs (Attributes.Contains): Add new method.
16531
16532         * class.cs (MethodCore.LabelParameters): if the parameter is an
16533         `out' parameter, check that no attribute `[In]' has been passed.
16534
16535         * enum.cs: Handle the `value__' name in an enumeration.
16536
16537 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16538
16539         * decl.cs: Added special case to allow overrides on "protected
16540         internal" methods
16541
16542 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16543
16544         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16545         since it makes much more sense.
16546
16547         (Attributes.ctor): Don't require a Location parameter.
16548
16549         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16550
16551         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16552         since we already have that information per attribute.
16553
16554         * everywhere : make appropriate changes.
16555
16556         * class.cs (LabelParameters): Write the code which actually
16557         applies attributes to the return type. We can't do this on the MS
16558         .NET runtime so we flag a warning in the case an exception is
16559         thrown.
16560
16561 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * const.cs: Handle implicit null conversions here too.
16564
16565 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16566
16567         * class.cs (MethodCore.LabelParameters): Remove the extra
16568         Type [] parameter since it is completely unnecessary. Instead
16569         pass in the method's attributes so that we can extract
16570         the "return" attribute.
16571
16572 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16573
16574         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16575         of ignoring it and letting the compile continue.
16576
16577         * typemanager.cs (ChangeType): use an extra argument to return an
16578         error condition instead of throwing an exception.
16579
16580 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16581
16582         * expression.cs (Unary.TryReduce): mimic the code for the regular
16583         code path.  Perform an implicit cast in the cases where we can
16584         implicitly convert to one of the integral types, and then reduce
16585         based on that constant.   This fixes bug #35483.
16586
16587 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16588
16589         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16590
16591 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16592
16593         * namespace.cs: fixed bug #35489.
16594
16595 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16596
16597         * class.cs: Remove some dead code.
16598
16599         * cs-parser.jay: Estimate the number of methods needed
16600         (RootContext.MethodCount);
16601
16602         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16603         numbers instead of StringBuilders.
16604
16605         * support.cs (PtrHashtable): Add constructor with initial size;
16606         We can now reduce reallocations of the method table.
16607
16608 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16609
16610         * attribute.cs (ApplyAttributes): Keep track of the emitted
16611         attributes on a per-target basis. This fixes bug #35413.
16612
16613 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16614
16615         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16616         default to the Windows 1252 encoding.
16617
16618         (UnixParseOption): Support version, thanks to Alp for the missing
16619         pointer. 
16620
16621         * AssemblyInfo.cs: Add nice assembly information.
16622
16623         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16624         (bug 35169).
16625
16626         * cs-parser.jay: Allow a trailing comma before the close bracked
16627         in the attribute_section production.
16628
16629         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16630         address of the instance was being taken, I will take this out,
16631         because we take the address of the object immediately here.
16632
16633 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16634
16635         * typemanager.cs (AreMultipleAllowed): Take care of the most
16636         obvious case where attribute type is not in the current assembly -
16637         stupid me ;-)
16638
16639 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16642         definitions, instead of doing that afterwards.  
16643
16644         Also we use a nice little hack, depending on the constructor, we
16645         know if we are a "composed" name or a simple name.  Hence, we
16646         avoid the IndexOf test, and we avoid 
16647
16648         * codegen.cs: Add code to assist in a bug reporter to track down
16649         the source of a compiler crash. 
16650
16651 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16652
16653         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16654         types have been emitted for a given element and flag an error
16655         if something which does not have AllowMultiple set is used more
16656         than once.
16657
16658         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16659         attribute types and their corresponding AllowMultiple properties
16660
16661         (AreMultipleAllowed): Check the property for a given type.
16662
16663         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16664         property in the case we have a TypeContainer.
16665
16666         (Attributes.AddAttribute): Detect duplicates and just skip on
16667         adding them. This trivial fix catches a pretty gross error in our
16668         attribute emission - global attributes were being emitted twice!
16669
16670         Bugzilla bug #33187 is now fixed.
16671
16672 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16673
16674         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16675         instead of pp_and).
16676
16677         * expression.cs (Binary.ResolveOperator): I can only use the
16678         Concat (string, string, string) and Concat (string, string,
16679         string, string) if the child is actually a concatenation of
16680         strings. 
16681
16682 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16683
16684         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16685         context where we need a 2-character lookahead.
16686
16687         * pending.cs (PendingImplementation): Rework so we can keep track
16688         of interface types all the time, and flag those which were
16689         implemented by parents as optional.
16690
16691 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16692
16693         * expression.cs (Binary.ResolveOperator): Use
16694         String.Concat(string,string,string) or
16695         String.Concat(string,string,string,string) when possible. 
16696
16697         * typemanager: More helper methods.
16698
16699
16700 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16701
16702         * pending.cs: remove the bogus return from GetMissingInterfaces()
16703         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16704
16705 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16706
16707         * namespace.cs: avoid duplicated 'using xxx' being added to
16708         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16709         when we get more than one 'using' statement for the same namespace.
16710         Report a CS0105 warning for it.
16711
16712 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16715         of calling getChar/putback, uses internal knowledge of it.    
16716
16717         (xtoken): Reorder tokenizer so most common patterns are checked
16718         first.  This reduces the compilation time in another 5% (from 8.11s
16719         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16720
16721         The parsing time is 22% of the compilation in mcs, and from that
16722         64% is spent on the tokenization process.  
16723
16724         I tried using a binary search for keywords, but this is slower
16725         than the hashtable.  Another option would be to do a couple of
16726         things:
16727
16728                 * Not use a StringBuilder, instead use an array of chars,
16729                   with a set value.  Notice that this way we could catch
16730                   the 645 error without having to do it *afterwards*.
16731
16732                 * We could write a hand-parser to avoid the hashtable
16733                   compares altogether.
16734
16735         The identifier consumption process takes 37% of the tokenization
16736         time.  Another 15% is spent on is_number.  56% of the time spent
16737         on is_number is spent on Int64.Parse:
16738
16739                 * We could probably choose based on the string length to
16740                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16741                   computations. 
16742
16743         Another 3% is spend on wrapping `xtoken' in the `token' function.
16744
16745         Handle 0xa0 as whitespace (#34752)
16746
16747 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16748
16749         * typemanager.cs (IsCLRType): New routine to tell whether a type
16750         is one of the builtin types.  
16751
16752         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16753         typecode in more places instead of doing pointer comparissions.
16754         We could leverage some knowledge about the way the typecodes are
16755         laid out.
16756
16757         New code to cache namespaces in assemblies, it is currently not
16758         invoked, to be used soon.
16759
16760         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16761
16762         * expression.cs (Binary.ResolveOperator): specially handle
16763         strings, and do not perform user-defined operator overloading for
16764         built-in types.
16765
16766 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16767
16768         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16769         internalcall as it is a pretty simple operation;  Avoid whenever
16770         possible to call Char.IsLetter.
16771
16772         (consume_identifier): Cut by half the number of
16773         hashtable calls by merging the is_keyword and GetKeyword behavior.
16774
16775         Do not short-circuit, because if we do, we
16776         report errors (ie, #if false && true would produce an invalid
16777         directive error);
16778
16779
16780 2002-11-24  Martin Baulig  <martin@ximian.com>
16781
16782         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16783         check constant ranges and report a CS0221.  Fixes #33186.
16784
16785 2002-11-24  Martin Baulig  <martin@ximian.com>
16786
16787         * cs-parser.jay: Make this work for uninitialized variable
16788         declarations in the `for' initializer.  Fixes #32416.
16789
16790 2002-11-24  Martin Baulig  <martin@ximian.com>
16791
16792         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16793         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16794
16795 2002-11-24  Martin Baulig  <martin@ximian.com>
16796
16797         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16798         argument; if true, we also check for user-defined conversions.
16799         This is only needed if both arguments are of a user-defined type.
16800         Fixes #30443, added test-175.cs.
16801         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16802
16803         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16804
16805 2002-11-24  Martin Baulig  <martin@ximian.com>
16806
16807         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16808         function to get the store opcode.
16809         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16810         only emit the Ldelema if the store opcode is Stobj.  You must run
16811         both test-34 and test-167 to test this.  Fixes #34529.
16812
16813 2002-11-23  Martin Baulig  <martin@ximian.com>
16814
16815         * ecore.cs (Expression.MemberLookup): Added additional
16816         `qualifier_type' argument which is used when we're being called
16817         from MemberAccess.DoResolve() and null if we're called from a
16818         SimpleName lookup.
16819         (Expression.MemberLookupFailed): New method to report errors; this
16820         does the CS1540 check and reports the correct error message.
16821
16822         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16823         argument for the CS1540 check and redone the way how we're dealing
16824         with private members.  See the comment in the source code for details.
16825         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16826         `closure_start_type' to `closure_qualifier_type' and check whether
16827         it's not null.  It was not this filter being broken, it was just
16828         being called with the wrong arguments.
16829
16830         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16831         and pass it the correct `qualifier_type'; this also does the error
16832         handling for us.
16833
16834 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16835
16836         * expression.cs (Invocation.EmitParams): If the we are dealing
16837         with a non-built-in value type, load its address as well.
16838
16839         (ArrayCreation): Use a a pretty constant instead
16840         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16841         static initializers.  
16842
16843         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16844         because they are not really value types, just glorified integers. 
16845
16846         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16847
16848         * ecore.cs: Remove redundant code for enumerations, make them use
16849         the same code path as everything else, fixes the casting issue
16850         with enumerations in Windows.Forms.
16851
16852         * attribute.cs: Do only cast to string if it is a string, the
16853         validation happens later.
16854
16855         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16856         people upgrade their corlibs.
16857
16858         * ecore.cs: Oops, enumerations were not following the entire code path
16859
16860 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * typemanager.cs (FilterWithClosure): Commented out the test for
16863         1540 in typemanager.cs, as it has problems when accessing
16864         protected methods from a parent class (see test-174.cs). 
16865
16866         * attribute.cs (Attribute.ValidateGuid): new method.
16867         (Attribute.Resolve): Use above.
16868
16869 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16870
16871         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16872
16873         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16874         handling for enumerations, as we only needed the TypeContainer
16875         functionality to begin with (this is required for the fix below to
16876         work for enums that reference constants in a container class for
16877         example). 
16878
16879         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16880
16881         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16882         a valid TypeBuilder to perform lookups on.o
16883
16884         * class.cs (InheritableMemberSignatureCompare): Use true in the
16885         call to GetGetMethod and GetSetMethod, because we are comparing
16886         the signature, and we need to get the methods *even* if they are
16887         private. 
16888
16889         (PropertyBase.CheckBase): ditto.
16890
16891         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16892         GotoCase.Resolve): Use Peel on EmpytCasts.
16893
16894         * ecore.cs (EmptyCast): drop child, add Peel method.
16895
16896 2002-11-17  Martin Baulig  <martin@ximian.com>
16897
16898         * ecore.cs (EmptyCast.Child): New public property.
16899
16900         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16901         label resolved to an EmptyCast.  Fixes #34162.
16902         (GotoCase.Resolve): Likewise.
16903         (Block.EmitMeta): Likewise.
16904
16905 2002-11-17  Martin Baulig  <martin@ximian.com>
16906
16907         * expression.cs (Invocation.BetterConversion): Prefer int over
16908         uint; short over ushort; long over ulong for integer literals.
16909         Use ImplicitConversionExists instead of StandardConversionExists
16910         since we also need to check for user-defined implicit conversions.
16911         Fixes #34165.  Added test-173.cs.
16912
16913 2002-11-16  Martin Baulig  <martin@ximian.com>
16914
16915         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16916         with the `true' and `false' literals.  Fixes #33151.
16917
16918 2002-11-16  Martin Baulig  <martin@ximian.com>
16919
16920         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16921         October 22nd; don't do the cs1540 check for static members.
16922
16923         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16924         now using our own filter here and doing the cs1540 check again.
16925
16926 2002-11-16  Martin Baulig  <martin@ximian.com>
16927
16928         * support.cs (InternalParameters): Don't crash if we don't have
16929         any fixed parameters.  Fixes #33532.
16930
16931 2002-11-16  Martin Baulig  <martin@ximian.com>
16932
16933         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16934         when looking up static methods to make this work on Windows.
16935         Fixes #33773.
16936
16937 2002-11-16  Martin Baulig  <martin@ximian.com>
16938
16939         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16940         a setter rather than using PropertyInfo.CanWrite.
16941
16942 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16943
16944         * class.cs: Allow acces to block member by subclasses. Fixes build
16945         breaker.
16946
16947 2002-11-14  Martin Baulig  <martin@ximian.com>
16948
16949         * class.cs (Constructor.Emit): Added the extern/block check.
16950         Fixes bug #33678.
16951
16952 2002-11-14  Martin Baulig  <martin@ximian.com>
16953
16954         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16955         iteration while looking for indexers, this is needed because the
16956         indexer may have a different name in our base classes.  Fixed the
16957         error reporting (no indexers at all, not get accessor, no
16958         overloaded match).  Fixes bug #33089.
16959         (IndexerAccess.DoResolveLValue): Likewise.
16960
16961 2002-11-14  Martin Baulig  <martin@ximian.com>
16962
16963         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16964         indexers.  Fixes the first part of bug #33089.
16965         (MethodSignature.InheritableMemberSignatureCompare): Added support
16966         for properties.
16967
16968 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16969
16970         * attribute.cs (Attribute.Resolve): Catch the
16971         NullReferenceException and report it since it isn't supposed to
16972         happen. 
16973
16974 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16977         LogicalOr and LogicalAnd that can benefit from recursively
16978         handling EmitBranchable.  The code now should be nice for Paolo.
16979
16980 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16981
16982         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16983         the Type lookups, as we perform quite a number of lookups on
16984         non-Types.  This can be removed once we can deterministically tell
16985         whether we have a type or a namespace in advance.
16986
16987         But this might require special hacks from our corlib.
16988
16989         * TODO: updated.
16990
16991         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16992         and double which avoids a conversion from an integer to a double.
16993
16994         * expression.cs: tiny optimization, avoid calling IsConstant,
16995         because it effectively performs the lookup twice.
16996
16997 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16998
16999         But a bogus return here to keep the semantics of the old code
17000         until the Mono runtime is fixed.
17001
17002         * pending.cs (GetMissingInterfaces): New method used to remove all
17003         the interfaces that are already implemented by our parent
17004         classes from the list of pending methods. 
17005
17006         * interface.cs: Add checks for calls after ResolveTypeExpr.
17007
17008 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * class.cs (Class.Emit): Report warning 67: event not used if the
17011         warning level is beyond 3.
17012
17013         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17014         being a NullLiteral.
17015
17016         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17017         specifiers. 
17018
17019         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17020         path that might fail if a type can not be resolved.
17021
17022         * expression.cs (Binary.Emit): Emit unsigned versions of the
17023         operators. 
17024
17025         * driver.cs: use error 5.
17026
17027 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17028
17029         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17030
17031 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17032
17033         * cs-parser.jay (switch_section): A beautiful patch from Martin
17034         Baulig that fixed 33094.
17035
17036 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17037
17038         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17039         Check whether the base is abstract and report an error if so.
17040
17041         * expression.cs (IndexerAccess.DoResolveLValue,
17042         IndexerAccess.DoResolve): ditto. 
17043
17044         (Invocation.DoResolve): ditto.
17045
17046         (Invocation.FullMethodDesc): Improve the report string.
17047
17048         * statement.cs (Block): Eliminate IsVariableDefined as it is
17049         basically just a wrapper for GetVariableInfo.
17050
17051         * ecore.cs (SimpleName): Use new 
17052
17053         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17054         type, as we return the actual parameter ref/unref state on a
17055         different call.
17056
17057 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17058
17059         * support.cs: Return proper flags REF/OUT fixing the previous
17060         commit.  
17061
17062         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17063         not used to mean `ref' but `ref or out' in ParameterReference
17064
17065         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17066         full type signature instead of calling TypeManger.CSharpName
17067         ourselves. 
17068
17069         * support.cs (InternalParameters.ParameterDesc): Do not compare
17070         directly to the modflags, because REF/OUT will actually be bitsets
17071         if set. 
17072
17073         * delegate.cs (VerifyMethod): Check also the modifiers.
17074
17075         * cs-tokenizer.cs: Fix bug where floating point values with an
17076         exponent where a sign was missing was ignored.
17077
17078         * driver.cs: Allow multiple assemblies to be specified in a single
17079         /r: argument
17080
17081 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17084         because identifiers after a parenthesis would end up in this kind
17085         of production, and we needed to desamiguate it for having casts
17086         like:
17087
17088                 (UserDefinedType *) xxx
17089
17090 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17093         we should set on the Bindingflags.NonPublic, but not turn on
17094         private_ok.  private_ok controls whether a Private member is
17095         returned (this is chekced on the filter routine), while the
17096         BindingFlags.NonPublic just controls whether private/protected
17097         will be allowed.   This fixes the problem part of the problem of
17098         private properties being allowed to be used in derived classes.
17099
17100         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17101         so we can call the children DoResolveLValue method (this will
17102         properly signal errors on lvalue assignments to base properties)
17103
17104         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17105         getter are null, and we have a property info, we know that this
17106         happened because the lookup failed, so we report an error 122 for
17107         protection level violation.
17108
17109         We also silently return if setter and getter are null in the
17110         resolve functions, this condition only happens if we have flagged
17111         the error before.  This is the other half of the problem. 
17112
17113         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17114         not have accessibility information, that is why we were returning
17115         true in the filter function in typemanager.cs.
17116
17117         To properly report 122 (property is inaccessible because of its
17118         protection level) correctly, we report this error in ResolveAccess
17119         by failing if both the setter and the getter are lacking (ie, the
17120         lookup failed). 
17121
17122         DoResolve and DoLResolve have been modified to check for both
17123         setter/getter being null and returning silently, the reason being
17124         that I did not want to put the knowledge about this error in upper
17125         layers, like:
17126
17127         int old = Report.Errors;
17128         x = new PropertyExpr (...);
17129         if (old != Report.Errors)
17130                 return null;
17131         else
17132                 return x;
17133
17134         So the property expr is returned, but it is invalid, so the error
17135         will be flagged during the resolve process. 
17136
17137         * class.cs: Remove InheritablePropertySignatureCompare from the
17138         class, as we no longer depend on the property signature to compute
17139         whether it is possible to implement a method or not.
17140
17141         The reason is that calling PropertyInfo.GetGetMethod will return
17142         null (in .NET, in Mono it works, and we should change this), in
17143         cases where the Get Method does not exist in that particular
17144         class.
17145
17146         So this code:
17147
17148         class X { public virtual int A { get { return 1; } } }
17149         class Y : X { }
17150         class Z : Y { public override int A { get { return 2; } } }
17151
17152         Would fail in Z because the parent (Y) would not have the property
17153         defined.  So we avoid this completely now (because the alternative
17154         fix was ugly and slow), and we now depend exclusively on the
17155         method names.
17156
17157         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17158         reference method, instead of using the property.
17159
17160         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17161         routines are gone now.
17162
17163         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17164         names, they were incorrectly named.
17165
17166         * cs-tokenizer.cs: Return are more gentle token on failure. 
17167
17168         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17169         had an out-of-sync index variable, which caused it to remove from
17170         the list of pending methods the wrong method sometimes.
17171
17172 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17173
17174         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17175         CanWrite, because those refer to this particular instance of the
17176         property, and do not take into account the fact that we can
17177         override single members of a property.
17178
17179         Constructor requires an EmitContext.  The resolution process does
17180         not happen here, but we need to compute the accessors before,
17181         because the resolution does not always happen for properties.
17182
17183         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17184         subclass, before we did not update this flag, but we did update
17185         bindingflags. 
17186
17187         (GetAccessors): Drop this routine, as it did not work in the
17188         presence of partially overwritten set/get methods. 
17189
17190         Notice that this broke the cs1540 detection, but that will require
17191         more thinking. 
17192
17193 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17194
17195         * class.cs:
17196         * codegen.cs:
17197         * driver.cs: issue a warning instead of an error if we don't support
17198         debugging for the platform. Also ignore a couple of errors that may
17199         arise when trying to write the symbols. Undo my previous patch.
17200
17201 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17202
17203         * driver.cs: ignore /debug switch except for Unix platforms.
17204
17205 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17206
17207         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17208
17209 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17210
17211         * driver.cs: Do not make mcs-debug conditional, so we do not break
17212         builds that use it.
17213
17214         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17215         review this patch.  But basically after all the children variables
17216         have been merged, the value of "Breaks" was not being set to
17217         new_breaks for Switch blocks.  I think that it should be set after
17218         it has executed.  Currently I set this to the value of new_breaks,
17219         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17220         conservative, but I do not understand this code very well.
17221
17222         I did not break anything in the build, so that is good ;-)
17223
17224         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17225
17226 2002-10-20  Mark Crichton  <crichton@gimp.org>
17227
17228         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17229
17230 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17231
17232         * cfold.cs: Fixed compile blocker.
17233
17234 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17235
17236         * driver.cs: I was chekcing the key, not the file.
17237
17238 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17239
17240         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17241         message that we were generating - we just need to silently return
17242         a null.
17243
17244 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17245
17246         * class.cs (Event.Define): Change my previous commit, as this
17247         breaks the debugger.  This is a temporary hack, as it seems like
17248         the compiler is generating events incorrectly to begin with.
17249
17250         * expression.cs (Binary.ResolveOperator): Added support for 
17251         "U operator - (E x, E y)"
17252
17253         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17254         y)".
17255
17256         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17257         init-only variables, but this path did not take into account that
17258         there might be also instance readonly variables.  Correct this
17259         problem. 
17260
17261         This fixes bug 32253
17262
17263         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17264         delegates as well.
17265
17266         * driver.cs: Change the extension for modules to `netmodule'
17267
17268         * cs-parser.jay: Improved slightly the location tracking for
17269         the debugger symbols.
17270
17271         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17272         modifiers that were specified instead of the hardcoded value
17273         (FamAndAssem).  This was basically ignoring the static modifier,
17274         and others.  Fixes 32429.
17275
17276         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17277         fixed a bug in the process (32476)
17278
17279         * expression.cs (ArrayAccess.EmitAssign): Patch from
17280         hwang_rob@yahoo.ca that fixes bug 31834.3
17281
17282 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * driver.cs: Make the module extension .netmodule.
17285
17286 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17287
17288         * driver.cs: Report an error if the resource file is not found
17289         instead of crashing.
17290
17291         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17292         false, like Emit does.
17293
17294 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17295
17296         * typemanager.cs: Remove unused private member.  Also reported mcs
17297         bug to report this as a warning like csc.
17298
17299 2002-10-15  Martin Baulig  <martin@gnome.org>
17300
17301         * statement.cs (Statement.Emit): Made this a virtual method; emits
17302         the line number info and calls DoEmit().
17303         (Statement.DoEmit): New protected abstract method, formerly knows
17304         as Statement.Emit().
17305
17306         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17307
17308 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17311         have fixed a remaining problem: not every AddXXXX was adding a
17312         fully qualified name.  
17313
17314         Now everyone registers a fully qualified name in the DeclSpace as
17315         being defined instead of the partial name.  
17316
17317         Downsides: we are slower than we need to be due to the excess
17318         copies and the names being registered this way.  
17319
17320         The reason for this is that we currently depend (on the corlib
17321         bootstrap for instance) that types are fully qualified, because
17322         we dump all the types in the namespace, and we should really have
17323         types inserted into the proper namespace, so we can only store the
17324         basenames in the defined_names array.
17325
17326 2002-10-10  Martin Baulig  <martin@gnome.org>
17327
17328         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17329         from bug #31834, see the bug report for a testcase which is
17330         miscompiled.
17331
17332 2002-10-10  Martin Baulig  <martin@gnome.org>
17333
17334         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17335         flow analysis code for this.
17336
17337         * statement.cs (Do, While, For): Tell the flow analysis code about
17338         infinite loops.
17339         (FlowBranching.UsageVector): Added support for infinite loops.
17340         (Block.Resolve): Moved the dead code elimination here and use flow
17341         analysis to do it.
17342
17343 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * class.cs (Field.Define): Catch cycles on struct type
17346         definitions. 
17347
17348         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17349         fields if the fields are static.  We only need to check instance
17350         fields. 
17351
17352         * expression.cs (As.DoResolve): Test for reference type.
17353
17354         * statement.cs (Using.ResolveExpression): Use
17355         ConvertImplicitRequired, not ConvertImplicit which reports an
17356         error on failture
17357         (Using.ResolveLocalVariableDecls): ditto.
17358
17359         * expression.cs (Binary.ResolveOperator): Report errors in a few
17360         places where we had to.
17361
17362         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17363
17364 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17365
17366         * expression.cs: Use StoreFromPtr instead of extracting the type
17367         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17368
17369         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17370         an enumeration value to a System.Enum, but System.Enum is not a
17371         value type, but an class type, so we need to box.
17372
17373         (Expression.ConvertExplicit): One codepath could return
17374         errors but not flag them.  Fix this.  Fixes #31853
17375
17376         * parameter.cs (Resolve): Do not allow void as a parameter type.
17377
17378 2002-10-06  Martin Baulig  <martin@gnome.org>
17379
17380         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17381         if it's a class type and not a struct.  Fixes #31815.
17382
17383 2002-10-06  Martin Baulig  <martin@gnome.org>
17384
17385         * statement.cs: Reworked the flow analysis code a bit to make it
17386         usable for dead code elimination.
17387
17388 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17389
17390         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17391
17392 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17393
17394         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17395         to fix the test 165, will investigate deeper.
17396
17397 2002-10-04  Martin Baulig  <martin@gnome.org>
17398
17399         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17400         finally blocks actually work.
17401         (Try.Resolve): We don't need to create a sibling for `finally' if
17402         there is no finally block.
17403
17404 2002-10-04  Martin Baulig  <martin@gnome.org>
17405
17406         * class.cs (Constructor.Define): The default accessibility for a
17407         non-default constructor is private, not public.
17408
17409 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * class.cs (Constructor): Make AllowedModifiers public, add
17412         EXTERN.
17413
17414         * cs-parser.jay: Perform the modifiers test here, as the
17415         constructor for the Constructor class usually receives a zero
17416         because of the way we create it (first we create, later we
17417         customize, and we were never checking the modifiers).
17418
17419         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17420         is a version of LookupTypeReflection that includes the type-name
17421         cache.  This can be used as a fast path for functions that know
17422         the fully qualified name and are only calling into *.GetType() to
17423         obtain a composed type.
17424
17425         This is also used by TypeManager.LookupType during its type
17426         composition.
17427
17428         (LookupType): We now also track the real type name, as sometimes
17429         we can get a quey for the real type name from things like
17430         ComposedCast.  This fixes bug 31422.
17431
17432         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17433         complete type fullname, it does not have to go through the type
17434         resolution system to obtain the composed version of the type (for
17435         obtaining arrays or pointers).
17436
17437         (Conditional.Emit): Use the EmitBoolExpression to
17438         generate nicer code, as requested by Paolo.
17439
17440         (ArrayCreation.CheckIndices): Use the patch from
17441         hwang_rob@yahoo.ca to validate the array initializers. 
17442
17443 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17444
17445         * class.cs (ConstructorInitializer.Emit): simplify code by using
17446         Invocation.EmitCall, and at the same time, fix the bugs in calling
17447         parent constructors that took variable arguments. 
17448
17449         * ecore.cs (Expression.ConvertNumericExplicit,
17450         Expression.ImplicitNumericConversion): Remove the code that
17451         manually wrapped decimal (InternalTypeConstructor call is now gone
17452         as well).
17453
17454         * expression.cs (Cast.TryReduce): Also handle decimal types when
17455         trying to perform a constant fold on the type.
17456
17457         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17458
17459         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17460         that only turned off an error report, and did nothing else. 
17461
17462 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17463
17464         * driver.cs: Handle and ignore /fullpaths
17465
17466 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17467
17468         * expression.cs (Binary.ResolveOperator): Catch the case where
17469         DoNumericPromotions returns true, 
17470
17471         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17472
17473 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17476         report error 70.
17477
17478 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17481         conversion exists, but it is also required that the conversion be
17482         performed.  This manifested in "(Type64Enum) 2".  
17483
17484         * class.cs (TypeManager.AddMethod): The fix is not to change
17485         AddEnum, because that one was using a fully qualified name (every
17486         DeclSpace derivative does), but to change the AddMethod routine
17487         that was using an un-namespaced name.  This now correctly reports
17488         the duplicated name.
17489
17490         Revert patch until I can properly fix it.  The issue
17491         is that we have a shared Type space across all namespaces
17492         currently, which is wrong.
17493
17494         Options include making the Namespace a DeclSpace, and merge
17495         current_namespace/current_container in the parser.
17496
17497 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17498
17499         * cs-parser.jay: Improve error reporting when we get a different
17500         kind of expression in local_variable_type and
17501         local_variable_pointer_type. 
17502
17503         Propagate this to avoid missleading errors being reported.
17504
17505         * ecore.cs (ImplicitReferenceConversion): treat
17506         TypeManager.value_type as a target just like object_type.   As
17507         code like this:
17508
17509         ValueType v = 1;
17510
17511         Is valid, and needs to result in the int 1 being boxed before it
17512         is assigned to the value type v.
17513
17514         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17515         to validate the enumeration name.
17516
17517         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17518         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17519         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17520
17521         * ecore.cs (TryImplicitIntConversion): When doing an
17522         implicit-enumeration-conversion, check if the type is 64-bits and
17523         perform a conversion before passing to EnumConstant.
17524
17525 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17526
17527         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17528         report ambiguous type references.  Unlike the MS version, we
17529         report what the ambiguity is.   Innovation at work ;-)
17530
17531         (DeclSpace.FindType): Require a location argument to
17532         display when we display an ambiguous error.
17533
17534         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17535
17536         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17537
17538         * expression.cs (EmitDynamicInitializers): Apply patch from
17539         hwang_rob@yahoo.ca that fixes the order in which we emit our
17540         initializers. 
17541
17542 2002-09-21  Martin Baulig  <martin@gnome.org>
17543
17544         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17545         delegate takes no arguments.
17546
17547 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17548
17549         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17550         from integers.
17551
17552         * expression.cs: Extract the underlying type.
17553
17554         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17555
17556         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17557
17558 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * class.cs (TypeContainer.DefineType): We can not use the nice
17561         PackingSize with the size set to 1 DefineType method, because it
17562         will not allow us to define the interfaces that the struct
17563         implements.
17564
17565         This completes the fixing of bug 27287
17566
17567         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17568         means also structs.  This fixes part of the problem. 
17569         (Expresion.ImplicitReferenceConversionExists): ditto.
17570
17571         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17572         error if there were no errors reported during the type lookup
17573         process, to avoid duplicates or redundant errors.  Without this
17574         you would get an ambiguous errors plus a type not found.  We have
17575         beaten the user enough with the first error.  
17576
17577         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17578         reference. 
17579
17580         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17581         during the resolution process, stop the lookup, this avoids
17582         repeated error reports (same error twice).
17583
17584         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17585
17586         * typemanager.cs (LookupType): Redo the type lookup code to match
17587         the needs of System.Reflection.  
17588
17589         The issue is that System.Reflection requires references to nested
17590         types to begin with a "+" sign instead of a dot.  So toplevel
17591         types look like: "NameSpace.TopLevelClass", and nested ones look
17592         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17593         levels. 
17594
17595 2002-09-19  Martin Baulig  <martin@gnome.org>
17596
17597         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17598         says that a method always returns or always throws an exception,
17599         don't report the CS0161.
17600
17601         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17602         set `Returns = new_returns'.
17603
17604 2002-09-19  Martin Baulig  <martin@gnome.org>
17605
17606         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17607         to an enum constant, check for a CS0176.
17608
17609 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17612         for operators that must be in pairs and report errors.
17613
17614         * ecore.cs (SimpleName.DoResolveType): During the initial type
17615         resolution process, when we define types recursively, we must
17616         check first for types in our current scope before we perform
17617         lookups in the enclosing scopes.
17618
17619         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17620
17621         (Invocation.VerifyArgumentsCompat): Call
17622         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17623         I thought we were supposed to always call this, but there are a
17624         few places in the code where we dont do it.
17625
17626 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * driver.cs: Add support in -linkres and -resource to specify the
17629         name of the identifier.
17630
17631 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * ecore.cs (StandardConversionExists): Sync with the conversion
17634         code: allow anything-* to void* conversions.
17635
17636         (FindMostSpecificSource): Use an Expression argument
17637         instead of a Type, because we might be handed over a Literal which
17638         gets a few more implicit conversions that plain types do not.  So
17639         this information was being lost.
17640
17641         Also, we drop the temporary type-holder expression when not
17642         required.
17643
17644 2002-09-17  Martin Baulig  <martin@gnome.org>
17645
17646         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17647         this is an explicit interface implementation.
17648
17649 2002-09-17  Martin Baulig  <martin@gnome.org>
17650
17651         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17652         different `IndexerName' attributes.
17653
17654         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17655         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17656         virtual CommonResolve().
17657
17658 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17659
17660         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17661         and convert that to the UnderlyingType.
17662
17663         * statement.cs (Foreach.Resolve): Indexers are just like variables
17664         or PropertyAccesses.
17665
17666         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17667         inside quoted strings, we were not doing this before.
17668
17669 2002-09-16  Martin Baulig  <martin@gnome.org>
17670
17671         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17672         resolve it.  This is needed for the definite assignment check of the
17673         instance expression, fixes bug #29846.
17674         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17675
17676 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17677
17678         * parameter.cs: Fix compile error.  Cannot reference static member
17679         from an instance object.  Is this an mcs bug?
17680
17681 2002-09-14  Martin Baulig  <martin@gnome.org>
17682
17683         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17684         multiple times.  Fixes bug #30295, added test-166.cs.
17685
17686 2002-09-14  Martin Baulig  <martin@gnome.org>
17687
17688         * statement.cs (Block.Emit): Don't emit unreachable code.
17689         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17690         `break' statements.
17691         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17692
17693 2002-09-14  Martin Baulig  <martin@gnome.org>
17694
17695         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17696         is set.
17697
17698 2002-09-14  Martin Baulig  <martin@gnome.org>
17699
17700         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17701         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17702         be false on the ms runtime.
17703
17704 2002-09-13  Martin Baulig  <martin@gnome.org>
17705
17706         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17707         the CS0038 error message.
17708
17709 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17710
17711         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17712         constant inside, return it.
17713
17714 2002-09-12  Martin Baulig  <martin@gnome.org>
17715
17716         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17717         implicit conversion can be done between enum types.
17718
17719         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17720         check whether an implicit conversion to the current enum's UnderlyingType
17721         exists and report an error if not.
17722
17723         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17724         without debugging support.
17725
17726         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17727         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17728
17729 2002-09-12  Martin Baulig  <martin@gnome.org>
17730
17731         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17732
17733         * ecore.cs (IMemberExpr.DeclaringType): New property.
17734         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17735         nonstatic member of an outer type (CS0038).
17736
17737 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * driver.cs: Activate the using-error detector at warning level
17740         4 (at least for MS-compatible APIs).
17741
17742         * namespace.cs (VerifyUsing): Small buglett fix.
17743
17744         * pending.cs (PendingImplementation): pass the container pointer. 
17745
17746         * interface.cs (GetMethods): Allow for recursive definition.  Long
17747         term, I would like to move every type to support recursive
17748         definitions, not the current ordering mechanism that we have right
17749         now.
17750
17751         The situation is this: Attributes are handled before interfaces,
17752         so we can apply attributes to interfaces.  But some attributes
17753         implement interfaces, we will now handle the simple cases
17754         (recursive definitions will just get an error).  
17755
17756         * parameter.cs: Only invalidate types at the end if we fail to
17757         lookup all types.  
17758
17759 2002-09-09  Martin Baulig  <martin@gnome.org>
17760
17761         * ecore.cs (PropertyExpr.Emit): Also check for
17762         TypeManager.system_int_array_get_length so this'll also work when
17763         compiling corlib.  Fixes #30003.
17764
17765 2002-09-09  Martin Baulig  <martin@gnome.org>
17766
17767         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17768         and throw an exception if we can't get the type's size.  Fixed #30040,
17769         added test-165.cs.
17770
17771 2002-09-09  Martin Baulig  <martin@gnome.org>
17772
17773         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17774
17775         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17776         context.  Fixes bug #30027.
17777
17778         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17779         virtual functions.  Fixes bug #30043, added test-164.cs.
17780
17781 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17782
17783         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17784
17785 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17786
17787         * driver.cs: Use an object to get the windows codepage since it's not a
17788         static property.
17789
17790 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17791
17792         * statement.cs (For.Emit): for infinite loops (test == null)
17793         return whether there is a break inside, not always "true".
17794
17795         * namespace.cs (UsingEntry): New struct to hold the name of the
17796         using definition, the location where it is defined, and whether it
17797         has been used in a successful type lookup.
17798
17799         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17800         strings.
17801
17802         * decl.cs: ditto.
17803
17804 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17805
17806         * attribute.cs : Fix incorrect code which relied on catching
17807         a NullReferenceException to detect a null being passed in
17808         where an object was expected.
17809
17810 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17811
17812         * statement.cs (Try): flag the catch variable as assigned
17813
17814         * expression.cs (Cast): Simplified by using ResolveType instead of
17815         manually resolving.
17816
17817         * statement.cs (Catch): Fix bug by using ResolveType.
17818
17819 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17820
17821         * expression.cs (BetterConversion): Special case for when we have
17822         a NullLiteral as the argument and we have to choose between string
17823         and object types - we choose string the way csc does.
17824
17825         * attribute.cs (Attribute.Resolve): Catch the
17826         NullReferenceException and report error #182 since the Mono
17827         runtime no more has the bug and having this exception raised means
17828         we tried to select a constructor which takes an object and is
17829         passed a null.
17830
17831 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17832
17833         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17834         message (1502, 1503) when we can't locate a method after overload
17835         resolution. This is much more informative and closes the bug
17836         Miguel reported.
17837
17838         * interface.cs (PopulateMethod): Return if there are no argument
17839         types. Fixes a NullReferenceException bug.
17840
17841         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17842         expressions too. Previously we were checking only in one place for
17843         positional arguments leaving out named arguments.
17844
17845         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17846         type to the enum type is not allowed. Remove code corresponding to
17847         that.
17848
17849         (ConvertNumericExplicit): Allow explicit conversions from
17850         the underlying type to enum type. This precisely follows the spec
17851         and closes a bug filed by Gonzalo.
17852
17853 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17854
17855         * compiler.csproj:
17856         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17857
17858 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17859
17860         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17861         it was important that we stored the right value after the
17862         reduction in `converted'.
17863
17864 2002-09-04  Martin Baulig  <martin@gnome.org>
17865
17866         * location.cs (Location.SymbolDocument): Use full pathnames for the
17867         source files.
17868
17869 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17870
17871         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17872         of the expression resolve mechanism, because that will catch the
17873         SimpleName error failures.
17874
17875         (Conditional): If we can not resolve the
17876         expression, return, do not crash.
17877
17878 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17879
17880         * cs-tokenizer.cs:
17881         (location): display token name instead of its number.
17882
17883 2002-08-28  Martin Baulig  <martin@gnome.org>
17884
17885         * expression.cs (Binary.ResolveOperator): Don't silently return
17886         but return an error if an operator cannot be applied between two
17887         enum types.
17888
17889 2002-08-28  Martin Baulig  <martin@gnome.org>
17890
17891         * class.cs (Constructor.Define): Set the permission attributes
17892         correctly instead of making all constructors public.
17893
17894 2002-08-28  Martin Baulig  <martin@gnome.org>
17895
17896         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17897         for private members before reporting a CS0103; if we find anything,
17898         it's a CS0122.
17899
17900 2002-08-28  Martin Baulig  <martin@gnome.org>
17901
17902         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17903         to check whether `closure_start_type == closure_invocation_type',
17904         we also need to check whether `m.DeclaringType == closure_invocation_type'
17905         before bypassing the permission checks.  We might be accessing
17906         protected/private members from the base class.
17907         (TypeManager.RealMemberLookup): Only set private_ok if private
17908         members were requested via BindingFlags.NonPublic.
17909
17910         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17911
17912         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17913         MethodGroupExpr.IsExplicitImpl if appropriate.
17914         (Invocation.DoResolve): Don't report the CS0120 for explicit
17915         interface implementations.
17916
17917 2002-08-27  Martin Baulig  <martin@gnome.org>
17918
17919         * expression.cs (Invocation.DoResolve): If this is a static
17920         method and we don't have an InstanceExpression, we must report
17921         a CS0120.
17922
17923 2002-08-25  Martin Baulig  <martin@gnome.org>
17924
17925         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17926         `==' between a valuetype and an object.
17927
17928 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * ecore.cs (TypeExpr): Provide a ToString method.
17931
17932 2002-08-24  Martin Baulig  <martin@gnome.org>
17933
17934         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17935         now called proggie.dbg and it's a binary file.
17936
17937 2002-08-23  Martin Baulig  <martin@gnome.org>
17938
17939         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17940
17941 2002-08-23  Martin Baulig  <martin@gnome.org>
17942
17943         * struct.cs (MyStructInfo.ctor): Make this work with empty
17944         structs; it's not allowed to use foreach() on null.
17945
17946 2002-08-23  Martin Baulig  <martin@gnome.org>
17947
17948         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17949         writer the full pathname of the generated assembly.
17950
17951 2002-08-23  Martin Baulig  <martin@gnome.org>
17952
17953         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17954         A `finally' block never returns or breaks; improved handling of
17955         unreachable code.
17956
17957 2002-08-23  Martin Baulig  <martin@gnome.org>
17958
17959         * statement.cs (Throw.Resolve): Allow `throw null'.
17960
17961 2002-08-23  Martin Baulig  <martin@gnome.org>
17962
17963         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17964         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17965         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17966         MemberLookup would return a wrong event if this is an explicit
17967         interface implementation and the class has an event with the same
17968         name.
17969
17970 2002-08-23  Martin Baulig  <martin@gnome.org>
17971
17972         * statement.cs (Block.AddChildVariableNames): New public method.
17973         (Block.AddChildVariableName): Likewise.
17974         (Block.IsVariableNameUsedInChildBlock): Likewise.
17975         (Block.AddVariable): Check whether a variable name has already
17976         been used in a child block.
17977
17978         * cs-parser.jay (declare_local_variables): Mark all variable names
17979         from the current block as being used in a child block in the
17980         implicit block.
17981
17982 2002-08-23  Martin Baulig  <martin@gnome.org>
17983
17984         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17985         find the symbol writer.
17986
17987         * driver.cs: csc also allows the arguments to /define being
17988         separated by commas, not only by semicolons.
17989
17990 2002-08-23  Martin Baulig  <martin@gnome.org>
17991
17992         * interface.cs (Interface.GetMembers): Added static check for events.
17993
17994 2002-08-15  Martin Baulig  <martin@gnome.org>
17995
17996         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17997         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17998
17999         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18000         why the MethodData.EmitDestructor() change was necessary.
18001
18002 2002-08-20  Martin Baulig  <martin@gnome.org>
18003
18004         * class.cs (TypeContainer.FindMembers): Added static check for events.
18005
18006         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18007
18008         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18009         use Type.GetEvents(), not Type.FindMembers().
18010
18011 2002-08-20  Martin Baulig  <martin@gnome.org>
18012
18013         * decl.cs (MemberCache): Added a special method cache which will
18014         be used for method-only searched.  This ensures that a method
18015         search will return a MethodInfo with the correct ReflectedType for
18016         inherited methods.      
18017
18018 2002-08-20  Martin Baulig  <martin@gnome.org>
18019
18020         * decl.cs (DeclSpace.FindMembers): Made this public.
18021
18022 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18023
18024         * delegate.cs: fixed build on windows.
18025         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18026
18027 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18028
18029         * ecore.cs (StandardConversionExists): Return a false
18030         if we are trying to convert the void type to anything else
18031         since that is not allowed.
18032
18033         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18034         we flag error 70 in the event an event is trying to be accessed
18035         directly from outside the declaring type.
18036
18037 2002-08-20  Martin Baulig  <martin@gnome.org>
18038
18039         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18040         MemberCache from typemanager.cs to decl.cs.
18041
18042 2002-08-19  Martin Baulig  <martin@gnome.org>
18043
18044         * class.cs (TypeContainer): Implement IMemberContainer.
18045         (TypeContainer.DefineMembers): Create the MemberCache.
18046         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18047         return public members if BindingFlags.Public was given, check
18048         whether members are static.
18049
18050 2002-08-16  Martin Baulig  <martin@gnome.org>
18051
18052         * decl.cs (DeclSpace.Define): Splitted this in Define and
18053         DefineMembers.  DefineMembers is called first and initializes the
18054         MemberCache.
18055
18056         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18057         DefineMembers() on all our DeclSpaces.
18058
18059         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18060         but call DefineMembers() on all nested interfaces.  We call their
18061         Define() in our new Define() function.
18062
18063         * interface.cs (Interface): Implement IMemberContainer.
18064         (Interface.Define): Moved all code except the attribute stuf to
18065         DefineMembers().
18066         (Interface.DefineMembers): Initialize the member cache.
18067
18068         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18069         need this anymore since we can use MemberCache.FindMembers directly.
18070
18071 2002-08-19  Martin Baulig  <martin@gnome.org>
18072
18073         * typemanager.cs (MemberCache): When creating the cache for an
18074         interface type, add all inherited members.
18075         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18076         to `out bool used_cache' and documented it.
18077         (TypeManager.MemberLookup): If we already used the cache in the first
18078         iteration, we don't need to do the interfaces check.
18079
18080 2002-08-19  Martin Baulig  <martin@gnome.org>
18081
18082         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18083         here from IMemberFinder and don't implement this interface anymore.
18084         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18085
18086         * typemanager.cs (IMemberFinder): This interface is now only used by
18087         classes which actually support the member cache.
18088         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18089         since we only put DeclSpaces into this Hashtable.
18090         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18091         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18092
18093 2002-08-16  Martin Baulig  <martin@gnome.org>
18094
18095         * typemanager.cs (ICachingMemberFinder): Removed.
18096         (IMemberFinder.MemberCache): New property.
18097         (TypeManager.FindMembers): Merged this with RealFindMembers().
18098         This function will never be called from TypeManager.MemberLookup()
18099         so we can't use the cache here, just the IMemberFinder.
18100         (TypeManager.MemberLookup_FindMembers): Check whether the
18101         IMemberFinder has a MemberCache and call the cache's FindMembers
18102         function.
18103         (MemberCache): Rewrote larger parts of this yet another time and
18104         cleaned it up a bit.
18105
18106 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * driver.cs (LoadArgs): Support quoting.
18109
18110         (Usage): Show the CSC-like command line arguments.
18111
18112         Improved a few error messages.
18113
18114 2002-08-15  Martin Baulig  <martin@gnome.org>
18115
18116         * typemanager.cs (IMemberContainer.Type): New property.
18117         (IMemberContainer.IsInterface): New property.
18118
18119         The following changes are conditional to BROKEN_RUNTIME, which is
18120         defined at the top of the file.
18121
18122         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18123         class'es members, but add all members from TypeHandle.ObjectType
18124         if we're an interface.
18125         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18126         is the current type.
18127         (MemberCache.CacheEntry.Container): Removed this field.
18128         (TypeHandle.GetMembers): Include inherited members.
18129
18130 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18131
18132         * typemanager.cs: fixed compilation and added a comment on a field that
18133         is never used.
18134
18135 2002-08-15  Martin Baulig  <martin@gnome.org>
18136
18137         * class.cs (ConstructorInitializer.Resolve): In the
18138         Expression.MemberLookup call, use the queried_type as
18139         invocation_type.
18140
18141         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18142         declared' attribute, it's always true.
18143         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18144         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18145         temporary wrapper for FindMembers which tells MemberLookup whether
18146         members from the base classes are included in the return value.
18147         This will go away soon.
18148         (TypeManager.MemberLookup): Use this temporary hack here; once the
18149         new MemberCache is completed, we don't need to do the DeclaredOnly
18150         looping here anymore since the MemberCache will take care of this.
18151         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18152         (MemberCache): When creating the MemberCache for a class, get
18153         members from the current class and all its base classes.
18154         (MemberCache.CacheEntry.Container): New field.  This is a
18155         temporary hack until the Mono runtime is fixed to distinguish
18156         between ReflectedType and DeclaringType.  It allows us to use MCS
18157         with both the MS runtime and the unfixed Mono runtime without
18158         problems and without accecting performance.
18159         (MemberCache.SearchMembers): The DeclaredOnly looping from
18160         TypeManager.MemberLookup is now done here.      
18161
18162 2002-08-14  Martin Baulig  <martin@gnome.org>
18163
18164         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18165         Type.GetFields on dynamic types but get the fields from the
18166         corresponding TypeContainer.
18167         (MyStructInfo.GetStructInfo): Added check for enum types.
18168
18169         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18170         (MemberList.SyncRoot): Implemented.
18171         (TypeManager.FilterWithClosure): No need to check permissions if
18172         closure_start_type == closure_invocation_type, don't crash if
18173         closure_invocation_type is null.
18174
18175 2002-08-13  Martin Baulig  <martin@gnome.org>
18176
18177         Rewrote TypeContainer.FindMembers to use a member cache.  This
18178         gives us a speed increase of about 35% for the self-hosting MCS
18179         build and of about 15-20% for the class libs (both on GNU/Linux).
18180
18181         * report.cs (Timer): New class to get enhanced profiling.  This
18182         whole class is "TIMER" conditional since it remarkably slows down
18183         compilation speed.
18184
18185         * class.cs (MemberList): New class.  This is an IList wrapper
18186         which we're now using instead of passing MemberInfo[]'s around to
18187         avoid copying this array unnecessarily.
18188         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18189         (ICachingMemberFinder, IMemberContainer): New interface.
18190         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18191         has already been checked, otherwise use it for the name comparision.
18192         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18193         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18194         if possible.  Returns a MemberList, not a MemberInfo [].
18195         (TypeHandle): New class, implements IMemberContainer.  We create
18196         one instance of this class per type, it contains a MemberCache
18197         which is used to do the member lookups.
18198         (MemberCache): New class.  Each instance of this class contains
18199         all members of a type and a name-based hash table.
18200         (MemberCache.FindMembers): This is our new member lookup
18201         function.  First, it looks up all members of the requested name in
18202         the hash table.  Then, it walks this list and sorts out all
18203         applicable members and returns them.
18204
18205 2002-08-13  Martin Baulig  <martin@gnome.org>
18206
18207         In addition to a nice code cleanup, this gives us a performance
18208         increase of about 1.4% on GNU/Linux - not much, but it's already
18209         half a second for the self-hosting MCS compilation.
18210
18211         * typemanager.cs (IMemberFinder): New interface.  It is used by
18212         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18213         Enum, Delegate or Interface.
18214         (TypeManager.finder_to_member_finder): New PtrHashtable.
18215         (TypeManager.finder_to_container): Removed.
18216         (TypeManager.finder_to_delegate): Removed.
18217         (TypeManager.finder_to_interface): Removed.
18218         (TypeManager.finder_to_enum): Removed.
18219
18220         * interface.cs (Interface): Implement IMemberFinder.
18221
18222         * delegate.cs (Delegate): Implement IMemberFinder.
18223
18224         * enum.cs (Enum): Implement IMemberFinder.
18225
18226         * class.cs (TypeContainer): Implement IMemberFinder.
18227
18228 2002-08-12  Martin Baulig  <martin@gnome.org>
18229
18230         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18231
18232 2002-08-12  Martin Baulig  <martin@gnome.org>
18233
18234         * ecore.cs (ITypeExpression): New interface for expressions which
18235         resolve to a type.
18236         (TypeExpression): Renamed to TypeLookupExpression.
18237         (Expression.DoResolve): If we're doing a types-only lookup, the
18238         expression must implement the ITypeExpression interface and we
18239         call DoResolveType() on it.
18240         (SimpleName): Implement the new ITypeExpression interface.
18241         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18242         hack, the situation that we're only looking up types can't happen
18243         anymore when this method is called.  Moved the type lookup code to
18244         DoResolveType() and call it.
18245         (SimpleName.DoResolveType): This ITypeExpression interface method
18246         is now doing the types-only lookup.
18247         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18248         (ResolveFlags): Added MaskExprClass.
18249
18250         * expression.cs (MemberAccess): Implement the ITypeExpression
18251         interface.
18252         (MemberAccess.DoResolve): Added support for a types-only lookup
18253         when we're called via ITypeExpression.DoResolveType().
18254         (ComposedCast): Implement the ITypeExpression interface.
18255
18256         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18257         Expression.Resolve() with ResolveFlags.Type instead.
18258
18259 2002-08-12  Martin Baulig  <martin@gnome.org>
18260
18261         * interface.cs (Interface.Define): Apply attributes.
18262
18263         * attribute.cs (Attribute.ApplyAttributes): Added support for
18264         interface attributes.
18265
18266 2002-08-11  Martin Baulig  <martin@gnome.org>
18267
18268         * statement.cs (Block.Emit): Only check the "this" variable if we
18269         do not always throw an exception.
18270
18271         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18272         whether the property has a set accessor.
18273
18274 2002-08-11  Martin Baulig  <martin@gnome.org>
18275
18276         Added control flow analysis support for structs.
18277
18278         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18279         with control flow analysis turned off.
18280         (IVariable): New interface.
18281         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18282         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18283         (FieldExpr.DoResolve): Resolve the instance expression with flow
18284         analysis turned off and do the definite assignment check after the
18285         resolving when we know what the expression will resolve to.
18286
18287         * expression.cs (LocalVariableReference, ParameterReference):
18288         Implement the new IVariable interface, only call the flow analysis
18289         code if ec.DoFlowAnalysis is true.
18290         (This): Added constructor which takes a Block argument.  Implement
18291         the new IVariable interface.
18292         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18293         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18294         This does the definite assignment checks for struct members.
18295
18296         * class.cs (Constructor.Emit): If this is a non-static `struct'
18297         constructor which doesn't have any initializer, call
18298         Block.AddThisVariable() to tell the flow analysis code that all
18299         struct elements must be initialized before control returns from
18300         the constructor.
18301
18302         * statement.cs (MyStructInfo): New public class.
18303         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18304         argument to this indexer.  If non-zero, check an individual struct
18305         member, not the whole struct.
18306         (FlowBranching.CheckOutParameters): Check struct members.
18307         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18308         overloaded versions of these methods which take an additional
18309         `int field_idx' argument to check struct members.
18310         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18311         overloaded versions of these methods which take an additional
18312         `string field_name' argument to check struct member.s
18313         (VariableInfo): Implement the IVariable interface.
18314         (VariableInfo.StructInfo): New public property.  Returns the
18315         MyStructInfo instance of the variable if it's a struct or null.
18316         (Block.AddThisVariable): New public method.  This is called from
18317         Constructor.Emit() for non-static `struct' constructor which do
18318         not have any initializer.  It creates a special variable for the
18319         "this" instance variable which will be checked by the flow
18320         analysis code to ensure that all of the struct's fields are
18321         initialized before control returns from the constructor.
18322         (UsageVector): Added support for struct members.  If a
18323         variable/parameter is a struct with N members, we reserve a slot
18324         in the usage vector for each member.  A struct is considered fully
18325         initialized if either the struct itself (slot 0) or all its
18326         members are initialized.
18327
18328 2002-08-08  Martin Baulig  <martin@gnome.org>
18329
18330         * driver.cs (Driver.MainDriver): Only report an error CS5001
18331         if there were no compilation errors.
18332
18333         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18334         `UnsafeContext' property to determine whether the parent is in
18335         unsafe context rather than checking the parent's ModFlags:
18336         classes nested in an unsafe class are unsafe as well.
18337
18338 2002-08-08  Martin Baulig  <martin@gnome.org>
18339
18340         * statement.cs (UsageVector.MergeChildren): Distinguish between
18341         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18342         we return.  Added test17() and test18() to test-154.cs.
18343
18344 2002-08-08  Martin Baulig  <martin@gnome.org>
18345
18346         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18347         Family access, make sure the invoking type isn't a subclass of the
18348         queried type (that'd be a CS1540).
18349
18350         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18351         this method which takes an additional `Type invocation_type'.
18352
18353         * expression.cs (BaseAccess.DoResolve): Use the base type as
18354         invocation and query type.
18355         (MemberAccess.DoResolve): If the lookup failed and we're about to
18356         report a CS0122, try a lookup with the ec.ContainerType - if this
18357         succeeds, we must report a CS1540.
18358
18359 2002-08-08  Martin Baulig  <martin@gnome.org>
18360
18361         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18362         (MethodGroupExpr): Implement the IMemberExpr interface.
18363
18364         * expression (MemberAccess.ResolveMemberAccess): No need to have
18365         any special code for MethodGroupExprs anymore, they're now
18366         IMemberExprs.   
18367
18368 2002-08-08  Martin Baulig  <martin@gnome.org>
18369
18370         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18371         Family, FamANDAssem and FamORAssem permissions.
18372         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18373
18374 2002-08-08  Martin Baulig  <martin@gnome.org>
18375
18376         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18377         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18378         or loop block.
18379
18380 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18381
18382         * driver.cs: implemented /resource option to embed managed resources.
18383
18384 2002-08-07  Martin Baulig  <martin@gnome.org>
18385
18386         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18387         (FieldBase.HasFieldInitializer): New public property.
18388         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18389         returns the field initializer and makes sure it is only resolved once.
18390         (TypeContainer.EmitFieldInitializers): Call
18391         FieldBase.GetInitializerExpression to get the initializer, this ensures
18392         that it isn't resolved multiple times.
18393
18394         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18395         the resolving process (SimpleName/MemberLookup) that we're currently
18396         emitting a field initializer (which must not access any instance members,
18397         this is an error CS0236).
18398
18399         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18400         argument, if the `IsFieldInitializer' flag is set, we must report and
18401         error CS0236 and not an error CS0120.   
18402
18403 2002-08-07  Martin Baulig  <martin@gnome.org>
18404
18405         * ecore.cs (IMemberExpr): New public interface.
18406         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18407         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18408         if the expression is an IMemberExpr.
18409
18410         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18411         to be null, implicitly default to `this' if we're non-static in
18412         this case.  Simplified the code a lot by using the new IMemberExpr
18413         interface.  Also fixed bug #28176 here.
18414
18415 2002-08-06  Martin Baulig  <martin@gnome.org>
18416
18417         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18418         ParameterReferences during semantic analysis so that we can do a
18419         type-only search when resolving Cast, TypeOf and SizeOf.
18420         (block): Pass the `current_local_parameters' to the Block's
18421         constructor.
18422
18423         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18424         argument to the constructor.
18425         (ConstructorInitializer.Resolve): Create a temporary implicit
18426         block with the parameters.
18427
18428         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18429         references here if we aren't doing a type-only search.
18430
18431         * statement.cs (Block): Added constructor which takes a
18432         `Parameters parameters' argument.
18433         (Block.Parameters): New public property.
18434
18435         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18436         to `Parameters' and made it public readonly.
18437
18438 2002-08-06  Martin Baulig  <martin@gnome.org>
18439
18440         * ecore.cs (Expression.Warning): Made this public as well.
18441
18442         * report.cs (Report.Debug): Print the contents of collections.
18443
18444 2002-08-06  Martin Baulig  <martin@gnome.org>
18445
18446         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18447         used to tell Resolve() which kinds of expressions it may return.
18448         (Expression.Resolve): Added overloaded version of this method which
18449         takes a `ResolveFlags flags' argument.  This can be used to tell
18450         Resolve() which kinds of expressions it may return.  Reports a
18451         CS0118 on error.
18452         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18453         ResolveFlags.SimpleName.
18454         (Expression.Error118): Added overloaded version of this method which
18455         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18456         which kinds of expressions are allowed.
18457
18458         * expression.cs (Argument.ResolveMethodGroup): New public method.
18459         Resolves an argument, but allows a MethodGroup to be returned.
18460         This is used when invoking a delegate.
18461
18462         * TODO: Updated a bit.
18463
18464 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18465
18466         Fixed compilation with csc.
18467
18468         * ecore.cs: Expression.Error made public. Is this correct? Should
18469         Warning be made public too?
18470
18471         * expression.cs: use ea.Location instead of ea.loc.
18472         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18473
18474 2002-08-06  Martin Baulig  <martin@gnome.org>
18475
18476         * ecore.cs (Expression.loc): Moved the location here instead of
18477         duplicating it in all derived classes.
18478         (Expression.Location): New public property.
18479         (Expression.Error, Expression.Warning): Made them non-static and
18480         removed the location argument.
18481         (Expression.Warning): Added overloaded version which takes an
18482         `int level' argument.
18483         (Expression.Error118): Make this non-static and removed the
18484         expression and location arguments.
18485         (TypeExpr): Added location argument to the constructor.
18486
18487         * expression.cs (StaticCallExpr): Added location argument to
18488         the constructor.
18489         (Indirection, PointerArithmetic): Likewise.
18490         (CheckedExpr, UnCheckedExpr): Likewise.
18491         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18492         (StringPtr): Likewise.
18493
18494
18495 2002-08-05  Martin Baulig  <martin@gnome.org>
18496
18497         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18498
18499         * assign.cs (Assign.DoResolve): Check whether the source
18500         expression is a value or variable.
18501
18502         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18503         while resolving the corresponding blocks.
18504
18505         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18506         an error, don't silently return null.
18507
18508         * statement.cs (Block.AddVariable): Do the error reporting here
18509         and distinguish between CS0128 and CS0136.
18510         (Block.DoResolve): Report all unused labels (warning CS0164).
18511         (LabeledStatement): Pass the location to the constructor.
18512         (LabeledStatement.HasBeenReferenced): New property.
18513         (LabeledStatement.Resolve): Set it to true here.
18514
18515         * statement.cs (Return.Emit): Return success even after reporting
18516         a type mismatch error (CS0126 or CS0127), this is what csc does and
18517         it avoids confusing the users with any consecutive errors.
18518
18519 2002-08-05  Martin Baulig  <martin@gnome.org>
18520
18521         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18522
18523         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18524
18525         * expression.cs (MemberAccess.DoResolve): Silently return if an
18526         error has already been reported.
18527
18528         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18529         error has already been reported.
18530
18531 2002-08-05  Martin Baulig  <martin@gnome.org>
18532
18533         * statement.cs (UsageVector): Only initialize the `parameters'
18534         vector if we actually have any "out" parameters.
18535
18536 2002-08-05  Martin Baulig  <martin@gnome.org>
18537
18538         * expression.cs (Binary.ResolveOperator): When combining delegates,
18539         they must have the same type.
18540
18541 2002-08-05  Martin Baulig  <martin@gnome.org>
18542
18543         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18544         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18545         work with the ms runtime and we also don't need it: if we're a
18546         PropertyBuilder and not in the `indexer_arguments' hash, then we
18547         are a property and not an indexer.
18548
18549         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18550         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18551         since the latter one doesn't work with the ms runtime.
18552
18553 2002-08-03  Martin Baulig  <martin@gnome.org>
18554
18555         Fixed bugs #27998 and #22735.
18556
18557         * class.cs (Method.IsOperator): New public field.
18558         (Method.CheckBase): Report CS0111 if there's already a method
18559         with the same parameters in the current class.  Report CS0508 when
18560         attempting to change the return type of an inherited method.
18561         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18562         and it's not marked abstract or extern.
18563         (PropertyBase): New abstract base class for Property and Indexer.
18564         (PropertyBase.CheckBase): Moved here from Property and made it work
18565         for indexers.
18566         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18567         the same so we can reuse it there.
18568         (Property, Indexer): Derive from PropertyBase.
18569         (MethodSignature.inheritable_property_signature_filter): New delegate
18570         to find properties and indexers.
18571
18572         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18573         argument and improved error reporting.
18574
18575         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18576         EmptyReadOnlyParameters and made it a property.
18577
18578         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18579         version of this method which takes a `PropertyInfo indexer'.
18580         (TypeManager.RegisterIndexer): New method.
18581
18582         * class.cs: Added myself as author of this file :-)
18583
18584 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18585
18586         * class.cs: fixed compilation on windoze.
18587
18588 2002-08-03  Martin Baulig  <martin@gnome.org>
18589
18590         * interface.cs (Interface.GetInterfaceBases): Check whether all
18591         base interfaces are at least as accessible than the current one.
18592
18593         * class.cs (TypeContainer.GetClassBases): Check whether base types
18594         are at least as accessible than the current type.
18595         (TypeContainer.AsAccessible): Implemented and made non-static.
18596         (MemberBase.CheckParameters): Report errors if the accessibility
18597         checks fail.
18598
18599         * delegate.cs (Delegate.Delegate): The default visibility is
18600         internal for top-level types and private for nested types.
18601         (Delegate.Define): Report errors if the accessibility checks fail.
18602
18603         * enum.cs (Enum.Enum): The default visibility is internal for
18604         top-level types and private for nested types.
18605         (Enum.DefineType): Compute the correct visibility.
18606
18607         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18608         function which takes a `bool is_toplevel' instead of a TypeContainer.
18609
18610         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18611         builtin type.
18612
18613 2002-08-02  Martin Baulig  <martin@gnome.org>
18614
18615         * expression.cs (LocalVariableReferenc): Added constructor which
18616         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18617         (LocalVariableReference.IsReadOnly): New property.
18618         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18619         variable is readonly, use our own readonly flag to do this; you can
18620         use the new constructor to get a writable reference to a read-only
18621         variable.
18622
18623         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18624         reference to the local variable.
18625
18626 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * rootcontext.cs (ResolveCore): Also include System.Exception
18629
18630         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18631         we reach an EmptyStatement.
18632
18633         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18634         is also fine.
18635
18636         * expression.cs (Binary.ResolveOperator): Check error result in
18637         two places.
18638
18639         use brtrue/brfalse directly and avoid compares to null.
18640
18641 2002-08-02  Martin Baulig  <martin@gnome.org>
18642
18643         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18644         Fixes bug #28407, added test-155.cs.
18645
18646 2002-08-01  Martin Baulig  <martin@gnome.org>
18647
18648         * class.cs (Event.EmitDefaultMethod): Make this work with static
18649         events.  Fixes #28311, added verify-3.cs.
18650
18651 2002-08-01  Martin Baulig  <martin@gnome.org>
18652
18653         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18654         `is_disposable' fields.
18655         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18656         `hm.is_disposable' if we're using the collection pattern.
18657         (Foreach.EmitCollectionForeach): Use the correct type for the
18658         enumerator's local variable, only emit the try/finally block if
18659         necessary (fixes #27713).
18660
18661 2002-08-01  Martin Baulig  <martin@gnome.org>
18662
18663         * ecore.cs (Expression.report118): Renamed to Error118 and made
18664         it public static.
18665
18666         * statement.cs (Throw.Resolve): Check whether the expression is of
18667         the correct type (CS0118) and whether the type derives from
18668         System.Exception (CS0155).
18669         (Catch.Resolve): New method.  Do the type lookup here and check
18670         whether it derives from System.Exception (CS0155).
18671         (Catch.CatchType, Catch.IsGeneral): New public properties.
18672
18673         * typemanager.cs (TypeManager.exception_type): Added.
18674
18675 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * driver.cs: Updated About function.
18678
18679 2002-07-31  Martin Baulig  <martin@gnome.org>
18680
18681         Implemented Control Flow Analysis.
18682
18683         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18684         (EmitContext.CurrentBranching): Added.
18685         (EmitContext.StartFlowBranching): Added.
18686         (EmitContext.EndFlowBranching): Added.
18687         (EmitContext.KillFlowBranching): Added.
18688         (EmitContext.IsVariableAssigned): Added.
18689         (EmitContext.SetVariableAssigned): Added.
18690         (EmitContext.IsParameterAssigned): Added.
18691         (EmitContext.SetParameterAssigned): Added.
18692         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18693         Added control flow analysis stuff here.
18694
18695         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18696         resolve the expression as lvalue.
18697         (LocalVariableReference.DoResolve): Check whether the variable has
18698         already been assigned.
18699         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18700         the parameter as assigned here.
18701         (ParameterReference.DoResolve): Check whether the parameter has already
18702         been assigned.
18703         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18704         expression as lvalue.
18705
18706         * statement.cs (FlowBranching): New class for the flow analysis code.
18707         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18708         (LabeledStatement.IsDefined): New public property.
18709         (LabeledStatement.AddUsageVector): New public method to tell flow
18710         analyis that the label may be reached via a forward jump.
18711         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18712         flow analysis.
18713         (VariableInfo.Number): New public field.  This is used by flow analysis
18714         to number all locals of a block.
18715         (Block.CountVariables): New public property.  This is the number of
18716         local variables in this block (including the locals from all parent
18717         blocks).
18718         (Block.EmitMeta): Number all the variables.
18719
18720         * statement.cs: Added flow analysis support to all classes.
18721
18722 2002-07-31  Martin Baulig  <martin@gnome.org>
18723
18724         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18725         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18726         then use this argument.
18727
18728         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18729
18730         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18731         use this to specify /define options.
18732
18733 2002-07-29  Martin Baulig  <martin@gnome.org>
18734
18735         * statement.cs (Fixed): Moved all code that does variable lookups
18736         and resolvings from Emit to Resolve.
18737
18738         * statement.cs (For): Moved all code that does variable lookups
18739         and resolvings from Emit to Resolve.
18740
18741         * statement.cs (Using): Moved all code that does variable lookups
18742         and resolvings from Emit to Resolve.
18743
18744 2002-07-29  Martin Baulig  <martin@gnome.org>
18745
18746         * attribute.cs (Attribute.Resolve): Explicitly catch a
18747         System.NullReferenceException when creating the
18748         CustromAttributeBuilder and report a different warning message.
18749
18750 2002-07-29  Martin Baulig  <martin@gnome.org>
18751
18752         * support.cs (ParameterData.ParameterName): Added method to
18753         get the name of a parameter.
18754
18755         * typemanager.cs (TypeManager.IsValueType): New public method.
18756
18757 2002-07-29  Martin Baulig  <martin@gnome.org>
18758
18759         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18760         is a flag which specifies that it's either ref or out.
18761         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18762         the out parameter to `out Parameter.Modifier mod', also set the
18763         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18764
18765         * support.cs (InternalParameters.ParameterModifier): Distinguish
18766         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18767         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18768
18769         * expression.cs (Argument.GetParameterModifier): Distinguish
18770         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18771         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18772
18773 2002-07-29  Martin Baulig  <martin@gnome.org>
18774
18775         * expression.cs (ParameterReference.ParameterReference): Added
18776         `Location loc' argument to the constructor.
18777
18778         * cs-parser.jay: Pass location to ParameterReference.
18779
18780 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18781
18782         * statement.cs (Try): Initialize the location.
18783
18784         * cs-parser.jay: pass location to Try.
18785
18786         * expression.cs (Unary.Reduce): Change the prototype to return
18787         whether a constant fold could be performed or not.  The result is
18788         returned in an out parameters.  In the case of Indirection and
18789         AddressOf, we want to perform the full tests.
18790
18791 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18792
18793         * statement.cs (Statement.Emit): Flag dead code.
18794
18795 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18796
18797         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18798
18799 2002-07-27  Martin Baulig  <martin@gnome.org>
18800
18801         * class.cs (MethodData.Define): Put back call to
18802         TypeManager.AddMethod(), accidentally commented this out.
18803
18804         * report.cs (Debug): New public method to print debugging information,
18805         this is `[Conditional ("DEBUG")]'.
18806
18807 2002-07-26  Martin Baulig  <martin@gnome.org>
18808
18809         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18810         (switch_statement): Push the current_block to the switch_stack and
18811         pop it again when we're done with the switch.
18812         (switch_section): The new block is a child of the current_block.
18813         Fixes bug #24007, added test-152.cs.
18814
18815 2002-07-27  Martin Baulig  <martin@gnome.org>
18816
18817         * expression.cs (Invocation.EmitArguments): When calling a varargs
18818         function with only its fixed arguments, we need to pass an empty
18819         array.
18820
18821 2002-07-27  Martin Baulig  <martin@gnome.org>
18822
18823         Mono 0.13 has been released.
18824
18825 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * driver.cs: Rename --resource to --linkres, because that is what
18828         we do currently, we dont support --resource yet.
18829
18830         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18831
18832 2002-07-25  Martin Baulig  <martin@gnome.org>
18833
18834         * class.cs (MethodData): New public class.  This is a `method builder'
18835         class for a method or one accessor of a Property/Indexer/Event.
18836         (MethodData.GetMethodFlags): Moved here from MemberBase.
18837         (MethodData.ApplyAttributes): Likewise.
18838         (MethodData.ApplyObsoleteAttribute): Likewise.
18839         (MethodData.ApplyConditionalAttribute): Likewise.
18840         (MethodData.ApplyDllImportAttribute): Likewise.
18841         (MethodData.CheckAbstractAndExternal): Likewise.
18842         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18843         (MethodData.Emit): Formerly known as Method.Emit().
18844         (MemberBase): Moved everything which was specific to a single
18845         accessor/method to MethodData.
18846         (Method): Create a new MethodData and call Define() and Emit() on it.
18847         (Property, Indexer, Event): Create a new MethodData objects for each
18848         accessor and call Define() and Emit() on them.
18849
18850 2002-07-25  Martin Baulig  <martin@gnome.org>
18851
18852         Made MethodCore derive from MemberBase to reuse the code from there.
18853         MemberBase now also checks for attributes.
18854
18855         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18856         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18857         as virtual.
18858         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18859         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18860         (MemberBase.ApplyAttributes): New virtual method; applies the
18861         attributes to a method or accessor.
18862         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18863         (MemberBase.ApplyConditionalAttribute): Likewise.
18864         (MemberBase.ApplyDllImportAttribute): Likewise.
18865         (MemberBase.CheckAbstractAndExternal): Likewise.
18866         (MethodCore.ParameterTypes): This is now a property instead of a
18867         method, it's initialized from DoDefineParameters().
18868         (MethodCore.ParameterInfo): Removed the set accessor.
18869         (MethodCore.DoDefineParameters): New protected virtual method to
18870         initialize ParameterTypes and ParameterInfo.
18871         (Method.GetReturnType): We can now simply return the MemberType.
18872         (Method.GetMethodFlags): Override the MemberBase version and add
18873         the conditional flags.
18874         (Method.CheckBase): Moved some code from Define() here, call
18875         DoDefineParameters() here.
18876         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18877         here to avoid some larger code duplication.
18878         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18879         ensure that abstract and external accessors don't declare a body.
18880
18881         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18882         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18883         lookup in the attribute's parent classes, so we need to abort as soon
18884         as we found the first match.
18885         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18886         the attribute has no arguments.
18887
18888         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18889         of a Method.
18890
18891 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18892
18893         * cs-parser.jay: reverted previous patch.
18894
18895 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18896
18897         * cs-parser.jay: fixed bug #22119.
18898
18899 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18900
18901         * attribute.cs: fixed compilation. The error was:
18902         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18903         be assigned to before control leaves the current method."
18904         [FIXME:  Filed as bug #28186: MCS must report this error.]
18905
18906 2002-07-25  Martin Baulig  <martin@gnome.org>
18907
18908         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18909         method to pull the condition name ouf of a Conditional attribute.
18910         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18911         the obsolete message and error flag out of an Obsolete attribute.
18912
18913         * class.cs (Method.GetMethodFlags): New public method to get the
18914         TypeManager.MethodFlags for this method.
18915         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18916         private methods.
18917         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18918         if we're overriding a virtual function, set the new private variable
18919         `parent_method'; call the new TypeManager.AddMethod().
18920
18921         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18922         the MethodBuilder and the Method in a PtrHashtable.
18923         (TypeManager.builder_to_method): Added for this purpose.
18924         (TypeManager.MethodFlags): Added IsObsoleteError.
18925         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18926         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18927         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18928         the message from the attribute.
18929
18930 2002-07-24  Martin Baulig  <martin@gnome.org>
18931
18932         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18933         preprocessor directives, ensure that the argument to #define/#undef is
18934         exactly one identifier and that it's actually an identifier.
18935
18936         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18937         did not work ....
18938
18939 2002-07-24  Martin Baulig  <martin@gnome.org>
18940
18941         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18942         initialize it to TypeManager.object_type in the constructor.
18943         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18944         of the `hm.get_current' method if we're using the collection pattern.
18945         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18946         for the explicit conversion to make it work when we're using the collection
18947         pattern and the `Current' property has a different return type than `object'.
18948         Fixes #27713.
18949
18950 2002-07-24  Martin Baulig  <martin@gnome.org>
18951
18952         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18953         does not match, but don't report any errors.  This method is called in
18954         order for all methods in a MethodGroupExpr until a matching method is
18955         found, so we don't want to bail out if the first method doesn't match.
18956         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18957         matches, report the 123.  Fixes #28070.
18958
18959 2002-07-24  Martin Baulig  <martin@gnome.org>
18960
18961         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18962         TypeManager.TypeToCoreType() to the top of the method so the
18963         following equality checks will work.  Fixes #28107.
18964
18965 2002-07-24  Martin Baulig  <martin@gnome.org>
18966
18967         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18968         operand is of type uint, and the other operand is of type sbyte,
18969         short or int, the operands are converted to type long." -
18970         Actually do what this comment already told us.  Fixes bug #28106,
18971         added test-150.cs.
18972
18973 2002-07-24  Martin Baulig  <martin@gnome.org>
18974
18975         * class.cs (MethodBase): New abstract class.  This is now a base
18976         class for Property, Indexer and Event to avoid some code duplication
18977         in their Define() and DefineMethods() methods.
18978         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18979         generic methods for Define() and DefineMethods().
18980         (FieldBase): Derive from MemberBase, not MemberCore.
18981         (Property): Derive from MemberBase, not MemberCore.
18982         (Property.DefineMethod): Moved all the code from this method to the
18983         new MethodBase.DefineAccessor(), just call it with appropriate
18984         argumetnts.
18985         (Property.Define): Call the new Property.DoDefine(), this does some
18986         sanity checks and we don't need to duplicate the code everywhere.
18987         (Event): Derive from MemberBase, not MemberCore.
18988         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18989         accessors, this will also make them work with interface events.
18990         (Indexer): Derive from MemberBase, not MemberCore.
18991         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18992         (Indexer.Define): Use the new MethodBase functions.
18993
18994         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18995         argument to the constructor.
18996         (Interface.FindMembers): Added support for interface events.
18997         (Interface.PopluateEvent): Implemented.
18998
18999         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19000
19001 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19002
19003         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19004         but this is required to check for a method name being the same as
19005         the containing class.  
19006
19007         Handle this now.
19008
19009 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19010
19011         * interface.cs: initialize variable.
19012
19013 2002-07-23  Martin Baulig  <martin@gnome.org>
19014
19015         Implemented the IndexerName attribute in interfaces.
19016
19017         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19018         name if this is an explicit interface implementation.
19019         (Indexer.InterfaceIndexerName): New public variable.  If we're
19020         implementing an interface indexer, this is the IndexerName in that
19021         interface.  Otherwise, it's the IndexerName.
19022         (Indexer.DefineMethod): If we're implementing interface indexer,
19023         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19024         and Pending.ImplementIndexer methods.
19025         (Indexer.Define): Also define the PropertyBuilder if we're
19026         implementing an interface indexer and this is neither an explicit
19027         interface implementation nor do the IndexerName match the one in
19028         the interface.
19029
19030         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19031         If a method is defined here, then we always need to create a proxy
19032         for it.  This is used when implementing interface indexers.
19033         (Pending.IsInterfaceIndexer): New public method.
19034         (Pending.ImplementIndexer): New public method.
19035         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19036         This is used when implementing interface indexers to define a proxy
19037         if necessary.
19038         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19039         define a proxy if necessary.
19040
19041         * interface.cs (Interface.IndexerName): New public variable.
19042         (Interface.PopulateIndexer): Set the IndexerName.
19043         (Interface.DefineIndexers): New private method.  Populate all the
19044         indexers and make sure their IndexerNames match.
19045
19046         * typemanager.cs (IndexerPropertyName): Added support for interface
19047         indexers.
19048
19049 2002-07-22  Martin Baulig  <martin@gnome.org>
19050
19051         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19052         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19053         ret if HasReturnLabel.
19054         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19055         variables.
19056
19057         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19058         and set the ec.LoopBeginTryCatchLevel.
19059         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19060         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19061         the current ec.TryCatchLevel, the branch goes out of an exception
19062         block.  In this case, we need to use Leave and not Br.
19063
19064 2002-07-22  Martin Baulig  <martin@gnome.org>
19065
19066         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19067         block unless the block does not always return or it is contained in
19068         another try { ... } catch { ... } block.  Fixes bug #26506.
19069         Added verify-1.cs to the test suite.
19070
19071 2002-07-22  Martin Baulig  <martin@gnome.org>
19072
19073         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19074         then we do not always return.  Fixes bug #24985.
19075
19076 2002-07-22  Martin Baulig  <martin@gnome.org>
19077
19078         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19079         lookup on a per-class level; ie. walk up the class hierarchy until we
19080         found at least one applicable method, then choose the best among them.
19081         Fixes bug #24463 and test-29.cs.
19082
19083 2002-07-22  Martin Baulig  <martin@gnome.org>
19084
19085         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19086         return types of the methods.  The return type is not part of the
19087         signature and we must not check it to make the `new' modifier work.
19088         Fixes bug #27999, also added test-147.cs.
19089         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19090
19091         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19092         on the method's return type.
19093
19094 2002-07-21  Martin Baulig  <martin@gnome.org>
19095
19096         * assign.cs: Make this work if the rightmost source is a constant and
19097         we need to do an implicit type conversion.  Also adding a few more tests
19098         to test-38.cs which should have caught this.
19099
19100         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19101         target in the makefile for this.  The makefile.gnu is primarily intended
19102         for end-users who don't want to debug the compiler.
19103
19104 2002-07-21  Martin Baulig  <martin@gnome.org>
19105
19106         * assign.cs: Improved the Assign class so it can now handle embedded
19107         assignments (X = Y = Z = something).  As a side-effect this'll now also
19108         consume less local variables.  test-38.cs now passes with MCS, added
19109         a few new test cases to that test.
19110
19111 2002-07-20  Martin Baulig  <martin@gnome.org>
19112
19113         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19114         instructions.  Fixes bug #27977, also added test-146.cs.
19115
19116 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19117
19118         * cs-tokenizer.cs: fixed getHex ().
19119
19120 2002-07-19  Martin Baulig  <martin@gnome.org>
19121
19122         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19123         not Type.GetType() to lookup the array type.  This is needed when
19124         we're constructing an array of a user-defined type.
19125         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19126         single-dimensional arrays, but also for single-dimensial arrays of
19127         type decimal.
19128
19129 2002-07-19  Martin Baulig  <martin@gnome.org>
19130
19131         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19132         this function is called, it's not allowed to share LocalBuilders
19133         among ILGenerators.
19134
19135 2002-07-19  Martin Baulig  <martin@gnome.org>
19136
19137         * expression.cs (Argument.Resolve): Report an error 118 when trying
19138         to pass a type as argument.
19139
19140 2002-07-18  Martin Baulig  <martin@gnome.org>
19141
19142         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19143         Conv_R_Un for the signed `long' type.
19144
19145 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19146
19147         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19148         `expr' for the temporary result, as that will fail if we do
19149         multiple resolves on the same expression.
19150
19151 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19152
19153         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19154         ec.TypeContainer for looking up aliases. 
19155
19156         * class.cs (TypeContainer): Remove LookupAlias from here.
19157
19158         * decl.cs (DeclSpace); Move here.
19159
19160 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * class.cs (FindMembers): Only call filter if the constructor
19163         bulider is not null.
19164
19165         Also handle delegates in `NestedTypes' now.  Now we will perform
19166         type lookups using the standard resolution process.  This also
19167         fixes a bug.
19168
19169         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19170         This uses Expressions (the limited kind that can be parsed by the
19171         tree) instead of strings.
19172
19173         * expression.cs (ComposedCast.ToString): Implement, used to flag
19174         errors since now we have to render expressions.
19175
19176         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19177         FormArrayType. 
19178
19179         * ecore.cs (SimpleName.ToString): ditto.
19180
19181         * cs-parser.jay: Instead of using strings to assemble types, use
19182         Expressions to assemble the type (using SimpleName, ComposedCast,
19183         MemberAccess).  This should fix the type lookups in declarations,
19184         because we were using a different code path for this.
19185
19186         * statement.cs (Block.Resolve): Continue processing statements
19187         even when there is an error.
19188
19189 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19190
19191         * class.cs (Event.Define): Also remove the `remove' method from
19192         the list of pending items.
19193
19194         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19195         generate more compact code. 
19196
19197 2002-07-17  Martin Baulig  <martin@gnome.org>
19198
19199         * const.cs (Const.LookupConstantValue): Add support for constant
19200         `unchecked' and `checked' expressions.
19201         Also adding test case test-140.cs for this.
19202
19203 2002-07-17  Martin Baulig  <martin@gnome.org>
19204
19205         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19206         check whether mi.ReturnType implements the IEnumerator interface; the
19207         `==' and the IsAssignableFrom() will fail in this situation.
19208
19209 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19210
19211         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19212         here too.
19213
19214 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19215
19216         * expression.cs: fixed bug #27811.
19217
19218 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19221         Molaro: when we are a ref, the value already contains a pointer
19222         value, do not take the address of it.
19223
19224 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19225         * removed mb-parser.jay and mb-tokenizer.cs
19226
19227 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19228
19229         * expression.cs: check against the building corlib void type.
19230
19231 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19232
19233         * ecore.cs: fix for valuetype static readonly fields: when 
19234         initializing them, we need their address, not the address of a copy.
19235
19236 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19237
19238         * typemanager.cs: register also enum_type in corlib.
19239
19240 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19241
19242         * class.cs: allow calling this (but not base) initializers in structs.
19243
19244 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19245
19246         * ecore.cs: make sure we compare against the building base types
19247         in GetTypeSize ().
19248
19249 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19250
19251         * typemanager.cs: fix TypeToCoreType() to handle void and object
19252         (corlib gets no more typerefs after this change).
19253
19254 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19255
19256         * expression.cs (ArrayCreation.EmitArrayArguments): use
19257         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19258
19259         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19260         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19261         array indexes, the runtime actually forbids them.
19262
19263         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19264         for array arguments here.
19265
19266         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19267         instead of the default for ValueTypes.
19268
19269         (New.DoEmit): Use IsValueType instead of
19270         IsSubclassOf (value_type)
19271         (New.DoResolve): ditto.
19272         (Invocation.EmitCall): ditto.
19273
19274         * assign.cs (Assign): ditto.
19275
19276         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19277         Statements *are* currently doing part of their resolution during
19278         Emit.  
19279
19280         Expressions do always resolve during resolve, but statements are
19281         only required to propagate resolution to their children.
19282
19283 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19286
19287         (LoadAssembly): Do not add the dll if it is already specified
19288
19289         (MainDriver): Add the System directory to the link path at the end,
19290         after all the other -L arguments. 
19291
19292         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19293         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19294         ldelem.u1) and using the opposite for sbytes.
19295
19296         This fixes Digger, and we can finally run it.
19297
19298         * driver.cs (UnixParseOption): Move the option parsing here.  
19299         (CSCParseOption): Implement CSC-like parsing of options.
19300
19301         We now support both modes of operation, the old Unix way, and the
19302         new CSC-like way.  This should help those who wanted to make cross
19303         platform makefiles.
19304
19305         The only thing broken is that /r:, /reference: and /lib: are not
19306         implemented, because I want to make those have the same semantics
19307         as the CSC compiler has, and kill once and for all the confussion
19308         around this.   Will be doing this tomorrow.
19309
19310         * statement.cs (Unsafe.Resolve): The state is checked during
19311         resolve, not emit, so we have to set the flags for IsUnsfe here.
19312
19313 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19314
19315         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19316         not catch the Error_ObjectRefRequired in SimpleName (as it is
19317         possible to have a class/instance variable name that later gets
19318         deambiguated), we have to check this here.      
19319
19320 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19321
19322         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19323         make static and put into Expression.
19324
19325         (Event.Define): Register the private field of the event with the 
19326         TypeManager so that GetFieldFromEvent can get at it.
19327
19328         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19329         keep track of the private field associated with an event which
19330         has no accessors.
19331
19332         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19333         private field.
19334
19335         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19336
19337 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * expression.cs (Binary.EmitBranchable): this routine emits the
19340         Binary expression in a branchable context.  This basically means:
19341         we need to branch somewhere, not just get the value on the stack.
19342
19343         This works together with Statement.EmitBoolExpression.
19344
19345         * statement.cs (Statement.EmitBoolExpression): Use
19346         EmitBranchable. 
19347
19348 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * statement.cs (For): Reduce the number of jumps in loops.
19351
19352         (For): Implement loop inversion for the For statement.
19353
19354         (Break): We can be breaking out of a Try/Catch controlled section
19355         (foreach might have an implicit try/catch clause), so we need to
19356         use Leave instead of Br.
19357
19358         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19359         now).  If the instace expression supports IMemoryLocation, we use
19360         the AddressOf method from the IMemoryLocation to extract the
19361         address instead of emitting the instance.
19362
19363         This showed up with `This', as we were emitting the instance
19364         always (Emit) instead of the Address of This.  Particularly
19365         interesting when This is a value type, as we dont want the Emit
19366         effect (which was to load the object).
19367
19368 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19371
19372         * statement.cs (Checked): Set the CheckedState during the resolve
19373         process too, as the ConvCast operations track the checked state on
19374         the resolve process, and not emit.
19375
19376         * cs-parser.jay (namespace_member_declaration): Flag that we have
19377         found a declaration when we do.  This is used to flag error 1529
19378
19379         * driver.cs: Report ok when we display the help only.
19380
19381 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19382
19383         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19384
19385 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19386
19387         * cs-tokenizer.cs (define): We also have to track locally the
19388         defines.  AllDefines is just used for the Conditional Attribute,
19389         but we also need the local defines for the current source code. 
19390
19391 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19392
19393         * statement.cs (While, For, Do): These loops can exit through a
19394         Break statement, use this information to tell whether the
19395         statement is the last piece of code.
19396
19397         (Break): Flag that we break.
19398
19399         * codegen.cs (EmitContexts): New `Breaks' state variable.
19400
19401 2002-07-03  Martin Baulig  <martin@gnome.org>
19402
19403         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19404         modifiers in method declarations in structs.  Otherwise, you won't
19405         be able to override things like Object.Equals().
19406
19407 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * class.cs (Method, Property, Indexer): Do not allow the public
19410         modifier to be used in explicit interface implementations.
19411
19412         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19413         override modifiers in method declarations in structs
19414
19415 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19416
19417         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19418         integer or real overflow, report an error
19419
19420 2002-07-02  Martin Baulig  <martin@gnome.org>
19421
19422         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19423         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19424         to tell the runtime about our newly created System.Object and
19425         System.ValueType types.
19426
19427 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19428
19429         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19430         struct instead of Ldarg/Starg.
19431
19432 2002-07-02  Martin Baulig  <martin@gnome.org>
19433
19434         * expression.cs (Indirection.Indirection): Call
19435         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19436
19437 2002-07-02  Martin Baulig  <martin@gnome.org>
19438
19439         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19440         ValueType, call TypeManager.TypeToCoreType() on it.
19441         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19442         the OpCodes.Newarr argument.
19443
19444 2002-07-02  Martin Baulig  <martin@gnome.org>
19445
19446         * expression.cs (Invocation.EmitCall): When compiling corlib,
19447         replace all calls to the system's System.Array type to calls to
19448         the newly created one.
19449
19450         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19451         System.Array methods.
19452         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19453         from the system's System.Array type which must be replaced.
19454
19455 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19456
19457         * typemanager.cs: load unverifiable_code_ctor so we can build
19458         corlib using the correct type. Avoid using GetTypeCode() with
19459         TypeBuilders.
19460         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19461         TypeManager.object_type to allow building corlib.
19462
19463 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19464
19465         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19466
19467 2002-07-01  Martin Baulig  <martin@gnome.org>
19468
19469         * class.cs: Make the last change actually work, we need to check
19470         whether `ifaces != null' to avoid a crash.
19471
19472 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19473
19474         * class.cs: when we build structs without fields that implement
19475         interfaces, we need to add the interfaces separately, since there is
19476         no API to both set the size and add the interfaces at type creation
19477         time.
19478
19479 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19480
19481         * expression.cs: the dimension arguments to the array constructors
19482         need to be converted if they are a long.
19483
19484 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19485
19486         * class.cs: don't emit ldarg.0 if there is no parent constructor
19487         (fixes showstopper for corlib).
19488
19489 2002-06-29  Martin Baulig  <martin@gnome.org>
19490
19491         MCS now compiles corlib on GNU/Linux :-)
19492
19493         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19494         ie. check for MethodImplOptions.InternalCall.
19495
19496         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19497         and TypeManager.attribute_type are null, so we must explicitly check
19498         whether parent is not null to find out whether it's an attribute type.
19499         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19500         and SetBuilder, not only if the property is neither abstract nor external.
19501         This is necessary to set the MethodImplOptions on the accessor methods.
19502         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19503         SetBuilder, see Property.Emit().
19504
19505         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19506         populate "System.Object", "System.ValueType" and "System.Attribute" since
19507         they've already been populated from BootCorlib_PopulateCoreTypes().
19508
19509 2002-06-29  Martin Baulig  <martin@gnome.org>
19510
19511         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19512         is the NullLiteral, we also need to make sure that target_type is not
19513         an enum type.   
19514
19515 2002-06-29  Martin Baulig  <martin@gnome.org>
19516
19517         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19518         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19519         before calling BootstrapCorlib_ResolveDelegate ().
19520
19521 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19522
19523         * statement.cs: fixed build-breaker. All tests passed ok.
19524
19525 2002-06-27  Martin Baulig  <martin@gnome.org>
19526
19527         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19528         for System.Decimal when compiling corlib.
19529
19530 2002-06-27  Martin Baulig  <martin@gnome.org>
19531
19532         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19533         switch blocks which contain nothing but a default clause.
19534
19535 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19536
19537        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19538
19539 2002-06-27  Martin Baulig  <martin@gnome.org>
19540
19541         * ecore.cs (PropertyExpr.PropertyExpr): Call
19542         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19543
19544         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19545         is already a TypeBuilder.
19546
19547 2002-06-27  Martin Baulig  <martin@gnome.org>
19548
19549         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19550         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19551         the "from an array-type to System.Array" case.  This makes it work
19552         when compiling corlib.
19553
19554 2002-06-27  Martin Baulig  <martin@gnome.org>
19555
19556         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19557         non-static PropertyExpr, set its InstanceExpression.  This makes
19558         the `ICollection.Count' property work in System/Array.cs.
19559
19560 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19561
19562         * driver.cs: Made error handling more consistent.  Errors now
19563         tracked by Report class, so many methods which used to return int
19564         now return void.  Main() now prints success/failure and 
19565         errors/warnings message.
19566
19567         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19568         the magic number return values (123 and 124).  Now, if the
19569         expected error occurs, the compiler exits with success (exit value
19570         0).  If the compilation completes without seeing that particular
19571         error, the compiler exits with failure (exit value 1).  The
19572         makefile in mcs/errors has been changed to handle the new behaviour.
19573
19574         * report.cs: Made 'expected error' number a property and renamed
19575         it from 'Probe' to 'ExpectedError'.
19576
19577         * genericparser.cs: Removed error handling support, since it is
19578         now all done by Report class.
19579
19580         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19581         class, so parse() no longer returns an int.
19582
19583         * namespace.cs: Use Report.Error instead of GenericParser.error
19584
19585 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19586
19587         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19588         TypeContainer.AddOperator): At the front of the list put the
19589         explicit implementations, so they get resolved/defined first. 
19590
19591 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19592
19593         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19594         interface type is implemented by this TypeContainer.  Used during
19595         explicit interface implementation.
19596
19597         (Property.Define, Indexer.Define, Method.Define): Validate that
19598         the given interface in the explicit implementation is one of the
19599         base classes for the containing type.
19600
19601         Also if we are explicitly implementing an interface, but there is
19602         no match in the pending implementation table, report an error.
19603
19604         (Property.Define): Only define the property if we are
19605         not explicitly implementing a property from an interface.  Use the
19606         correct name also for those properties (the same CSC uses,
19607         although that is really not needed).
19608
19609         (Property.Emit): Do not emit attributes for explicitly implemented
19610         properties, as there is no TypeBuilder.
19611
19612         (Indexer.Emit): ditto.
19613
19614         Hiding then means that we do not really *implement* a pending
19615         implementation, which makes code fail.
19616
19617 2002-06-22  Martin Baulig  <martin@gnome.org>
19618
19619         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19620         the return value of Object.GetType().  [FIXME: we need to do this whenever
19621         we get a type back from the reflection library].
19622
19623 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19624
19625         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19626
19627 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * attribute.cs: Return null if we can not look up the type.
19630
19631         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19632         the interface types found.
19633
19634         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19635         interface types found.
19636
19637         * typemanager.cs (GetInterfaces): Make this routine returns alll
19638         the interfaces and work around the lame differences between
19639         System.Type and System.Reflection.Emit.TypeBuilder in the results
19640         result for GetInterfaces.
19641
19642         (ExpandInterfaces): Given an array of interface types, expand and
19643         eliminate repeated ocurrences of an interface.  This expands in
19644         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19645         be IA, IB, IC.
19646
19647 2002-06-21  Martin Baulig  <martin@gnome.org>
19648
19649         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19650         on System.Enum.
19651
19652 2002-06-21  Martin Baulig  <martin@gnome.org>
19653
19654         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19655         and called with one of the core types, return the corresponding typebuilder for
19656         that type.
19657
19658         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19659         element type.
19660
19661 2002-06-21  Martin Baulig  <martin@gnome.org>
19662
19663         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19664         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19665         (Expression.ConvertReferenceExplicit): Likewise.
19666
19667         * expression.cs (ElementAccess.DoResolve): Likewise.
19668         (ElementAccess.DoResolveLValue): Likewise.
19669
19670 2002-06-10  Martin Baulig  <martin@gnome.org>
19671
19672         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19673         add the "value" parameter to the parameter list.
19674
19675         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19676         to our caller.
19677
19678 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19679
19680         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19681         the argument to an int, uint, long or ulong, per the spec.  Also
19682         catch negative constants in array creation.
19683
19684 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19685
19686         * class.cs: do not allow the same interface to appear twice in
19687         the definition list.
19688
19689 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19690
19691         * ecore.cs: don't use ldlen with System.Array.
19692
19693 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19694
19695         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19696
19697 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19698
19699         * modifiers.cs: produce correct field attributes for protected
19700         internal. Easy fix so miguel can work on ther harder stuff:-)
19701
19702 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * pending.cs: New file.  Move the code from class.cs here.
19705         Support clearning the pending flag for all methods (when not doing
19706         explicit interface implementation).
19707
19708 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19709
19710         * rootcontext.cs: added a couple more types needed to bootstrap.
19711
19712 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19713
19714         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19715         constructor in the type, instead of any constructor in the type
19716         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19717         a bug in the Mono runtime when applying the params attribute). 
19718
19719 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19720         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19721
19722 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19723
19724         * expression.cs (Unary.ResolveOperator): Use TypeManager
19725         to resolve the type.
19726
19727 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19728
19729         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19730         attached.
19731
19732         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19733         with each member too.
19734
19735         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19736         field builders too - this takes care of the enum member case.
19737
19738 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19739
19740         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19741         address-of operator on both value types and pointers.
19742
19743 2002-06-10  Martin Baulig  <martin@gnome.org>
19744
19745         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19746         PropertyBuilder to the `property_builders' list.
19747
19748         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19749         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19750         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19751         find any indexers which are inherited from an interface.
19752
19753 2002-06-09  Martin Baulig  <martin@gnome.org>
19754
19755         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19756         the same type as the constant if necessary.  There's also a test-130.cs
19757         for this.
19758
19759         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19760
19761         * typemanager.cs (TypeManager.ChangeType): Previously known as
19762         Enum.ChangeEnumType().
19763
19764 2002-06-09  Martin Baulig  <martin@gnome.org>
19765
19766         * expression.cs (Cast.TryReduce): Added support for consts.
19767
19768 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19769
19770         * class.cs (Accessor): Hold attributes information so we can pass
19771         it along.
19772
19773         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19774         Modify to pass in attributes attached to the methods.
19775
19776         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19777
19778         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19779         to handle the Accessor kind :-)
19780
19781         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19782
19783 2002-06-08  Martin Baulig  <martin@gnome.org>
19784
19785         * expression.cs (Unary.TryReduceNegative): Added support for
19786         ULongConstants.
19787
19788 2002-06-08  Martin Baulig  <martin@gnome.org>
19789
19790         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19791         name can't be found in the `defined_names' - the caller will do a
19792         MemberLookup in this case and thus find methods in System.Enum
19793         such as Enum.IsDefined().
19794
19795 2002-06-08  Martin Baulig  <martin@gnome.org>
19796
19797         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19798         Convert.ChangeType() which works with TypeBuilder created types.
19799         (Enum.LookupEnumValue, Enum.Define): Use it here.
19800
19801         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19802         `TypeBuilder.BaseType != null' check.
19803         (TypeContainer.FindMembers): Only lookup parent members if we
19804         actually have a parent.
19805         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19806         (ConstructorInitializer.Resolve): Likewise.
19807
19808         * interface.cs (Interface.FindMembers): Added
19809         `TypeBuilder.BaseType != null' check.
19810
19811         * rootcontext.cs (RootContext.ResolveCore): Added
19812         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19813         classes_second_stage.
19814
19815         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19816         debug_type and trace_type when compiling with --nostdlib.       
19817
19818 2002-06-07  Martin Baulig  <martin@gnome.org>
19819
19820         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19821         (AddField): Set it to true when adding a non-static field.
19822         (DefineType): Use `have_nonstatic_fields' to find out whether we
19823         have non-static fields, not `Fields != null'.
19824
19825 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19828         dereferencing a null on the static-field code path)
19829
19830 2002-05-30  Martin Baulig  <martin@gnome.org>
19831
19832         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19833         to take command line arguments.  Use reflection to call the new
19834         custom `Initialize' function on the symbol writer and pass it the
19835         command line arguments.
19836
19837         * driver.cs (--debug-args): New command line argument to pass command
19838         line arguments to the symbol writer.
19839
19840 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19841
19842         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19843         the target type for indexers and properties.  Thanks to Joe for
19844         catching this.
19845
19846 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19847
19848         * typemanager.cs (MethodFlags): returns the method flags
19849         (Obsolete/ShouldIgnore) that control warning emission and whether
19850         the invocation should be made, or ignored. 
19851
19852         * expression.cs (Invocation.Emit): Remove previous hack, we should
19853         not do this on matching a base type, we should do this based on an attribute
19854
19855         Only emit calls to System.Diagnostics.Debug and
19856         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19857         on the command line.
19858
19859         * rootcontext.cs: Global settings for tracing and debugging.
19860
19861         * cs-tokenizer.cs (define): New utility function to track
19862         defines.   Set the global settings for TRACE and DEBUG if found.
19863
19864 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19865
19866         * interface.cs (Populate*): Pass in the TypeContainer as well as
19867         the DeclSpace as parameters so that we can create EmitContexts and
19868         then use that to apply attributes etc.
19869
19870         (PopulateMethod, PopulateEvent, PopulateProperty)
19871         (PopulateIndexer): Apply attributes everywhere.
19872
19873         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19874         etc.
19875
19876         (ApplyAttributes): Update accordingly.
19877
19878         We now apply interface attributes for all members too.
19879
19880 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * class.cs (Indexer.Define); Correctly check if we are explicit
19883         implementation (instead of checking the Name for a ".", we
19884         directly look up if the InterfaceType was specified).
19885
19886         Delay the creation of the PropertyBuilder.
19887
19888         Only create the PropertyBuilder if we are not an explicit
19889         interface implementation.   This means that explicit interface
19890         implementation members do not participate in regular function
19891         lookups, and hence fixes another major ambiguity problem in
19892         overload resolution (that was the visible effect).
19893
19894         (DefineMethod): Return whether we are doing an interface
19895         implementation. 
19896
19897         * typemanager.cs: Temporary hack until we get attributes in
19898         interfaces (Ravi is working on that) and we get IndexerName
19899         support in interfaces.
19900
19901         * interface.cs: Register the indexers as properties.
19902
19903         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19904         warning, I have verified that this is a bug in the .NET runtime
19905         (JavaScript suffers of the same problem).
19906
19907         * typemanager.cs (MemberLookup): When looking up members for
19908         interfaces, the parent of an interface is the implicit
19909         System.Object (so we succeed in searches of Object methods in an
19910         interface method invocation.  Example:  IEnumerable x;  x.ToString
19911         ()) 
19912
19913 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * class.cs (Event): Events should also register if they do
19916         implement the methods that an interface requires.
19917
19918         * typemanager.cs (MemberLookup); use the new GetInterfaces
19919         method. 
19920
19921         (GetInterfaces): The code used to lookup interfaces for a type is
19922         used in more than one place, factor it here. 
19923
19924         * driver.cs: Track the errors at the bottom of the file, we kept
19925         on going.
19926
19927         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19928         instance if the method we are calling is static!
19929
19930 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19931
19932         * attribute.cs (ApplyAttributes): Make this function filter out
19933         the IndexerName attribute (as that attribute in reality is never
19934         applied) and return the string constant for the IndexerName
19935         attribute. 
19936
19937         * class.cs (TypeContainer.Emit): Validate that all the indexers
19938         have the same IndexerName attribute, and if so, set the
19939         DefaultName attribute on the class. 
19940
19941         * typemanager.cs: The return value might contain other stuff (not
19942         only methods).  For instance, consider a method with an "Item"
19943         property and an Item method.
19944
19945         * class.cs: If there is a problem with the parameter types,
19946         return. 
19947
19948 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19949
19950         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19951         looks at user defined conversion after making a call to 
19952         StandardConversionExists - we need this for overload resolution.
19953
19954         * expression.cs : Update accordingly the various method calls.
19955
19956         This fixes 2 bugs filed against implicit user defined conversions 
19957
19958 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19959
19960         * statement.cs: Track the result of the assignment.
19961
19962 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19963
19964         * expression.cs (MemberAccess): Improved error reporting for
19965         inaccessible members.
19966
19967 2002-05-22  Martin Baulig  <martin@gnome.org>
19968
19969         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19970         itself with debugging support.
19971
19972 2002-05-22  Martin Baulig  <martin@gnome.org>
19973
19974         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19975         Removed, this isn't needed anymore.
19976
19977 2002-05-20  Martin Baulig  <martin@gnome.org>
19978
19979         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19980         be underlying type for an enum.
19981
19982 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19985         that splits out the loading of just the core types.
19986
19987         * rootcontext.cs (ResolveCore): Split the struct resolution in
19988         two, so we can load the enumeration underlying types before any
19989         enums are used.
19990
19991         * expression.cs (Is): Bandaid until we fix properly Switch (see
19992         bug #24985 for details).
19993
19994         * typemanager.cs (ImplementsInterface): The hashtable will contain
19995         a null if there are no interfaces implemented.
19996
19997 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * cs-parser.jay (indexer_declarator): It is fine to have array
20000         parameters
20001
20002 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20003
20004         * typemanager.cs: (RegisterBuilder): New function used to register
20005         TypeBuilders that implement interfaces.  Since
20006         TypeBuilder.GetInterfaces (as usual) does not work with lame
20007         Reflection.Emit. 
20008         (AddUserType): register interfaces.
20009
20010         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20011         dealing with TypeBuilder.  Also, arrays are showing up as
20012         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20013         methods can not be invoked on them!
20014
20015         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20016         (ImplicitReferenceConversionExists): Split out from
20017         StandardConversionExists. 
20018
20019         * expression.cs (As): We were only implementing one of the three
20020         cases for the as operator.  We now implement them all.
20021         (Is): Implement the various other cases for Is as well.
20022
20023         * typemanager.cs (CACHE): New define used to control if we want or
20024         not the FindMembers cache.  Seems to have a negative impact on
20025         performance currently
20026
20027         (MemberLookup): Nested types have full acess to
20028         enclosing type members
20029
20030         Remove code that coped with instance/static returns for events, we
20031         now catch this in RealFindMembers.
20032
20033         (RealFindMembers): only perform static lookup if the instance
20034         lookup did not return a type or an event.  
20035
20036 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20037
20038         * assign.cs (CompoundAssign): We pass more semantic information
20039         now to Compound Assignments than we did before: now we have all
20040         the information at hand, and now we resolve the target *before* we
20041         do the expression expansion, which allows the "CacheValue" method
20042         to have the effect we intended (before, a [x] += 1 would generate
20043         two differen ArrayAccess expressions from the ElementAccess,
20044         during the resolution process).
20045
20046         (CompoundAssign.DoResolve): Resolve target and original_source here.
20047
20048 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20049
20050         * expression.cs (ArrayAccess): dropped debugging information. 
20051
20052         * typemanager.cs: Small bug fix: I was always returning i_members,
20053         instead of one of i_members or s_members (depending on which had
20054         the content).
20055
20056         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20057         method is invoked before any code generation takes place, and it
20058         is a mechanism to inform that the expression will be invoked more
20059         than once, and that the method should use temporary values to
20060         avoid having side effects
20061
20062         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20063
20064         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20065         implementation.
20066
20067         * expression.cs (Indirection, ArrayAccess): Add support for
20068         CacheTemporaries in these two bad boys. 
20069
20070         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20071         ldobj or ldind_ref.  
20072         (StoreFromPtr): Handle stobj as well.
20073
20074         * expression.cs (UnaryMutator): Share more code.
20075
20076         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20077         down: I was not tracking the Filter function as well, which
20078         was affecting the results of the cache.
20079
20080 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * attribute.cs: Remove the hack to handle the CharSet property on
20083         StructLayouts. 
20084
20085 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20086
20087         * attribute.cs (DoResolve): More uglyness, we now only try to
20088         resolve the attribute partially, to extract the CharSet
20089         information (only if we are a StructLayout attribute).  Otherwise 
20090
20091         (GetExtraTypeInfo): Add some code to conditionally kill in the
20092         future this.   I am more and more convinced that the .NET
20093         framework has special code to handle the attribute setting on
20094         certain elements.
20095
20096         * expression.cs (IsParamsMethodApplicable): Revert my previous
20097         foreach change here, it was wrong.
20098
20099 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20100
20101         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20102         (pp_expr): do not abort on unknown input, just return.
20103         (eval): abort if there are pending chars.
20104
20105         * attribute.cs (Attribute.Resolve): Positional parameters are
20106         optional.  Deal with that case.
20107
20108         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20109         the Ansi/Unicode/Auto information for the type.
20110
20111         (TypeContainer.DefineType): instantiate the EmitContext here, as
20112         we will be using it during the type definition (to resolve
20113         attributes) and during the emit phase.
20114
20115         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20116         to pull type information out of the attributes
20117
20118         (Attribute.Resolve): track the constructor builder, and allow for
20119         multiple invocations (structs and classes will use this).
20120
20121         * ecore.cs (MemberLookupFinal): new version with all the
20122         parameters customizable.
20123
20124         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20125         constructors.  Return if the result value is null (as the error
20126         would have been flagged already by MemberLookupFinal)
20127
20128         Do not allow instances of abstract classes or interfaces to be
20129         created.
20130
20131         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20132         We have to compare the assembly property here when dealing with
20133         FamANDAssem and Assembly access modifiers, because we might be
20134         creating an assembly from *modules* (that means that we are not
20135         getting TypeBuilders for types defined in other modules that are
20136         part of this assembly).
20137
20138         (Method.Emit): If the method is marked abstract and has a body,
20139         emit an error. 
20140
20141         (TypeContainer.DefineMembers): If both the defined member and the
20142         parent name match are methods, then do not emit any warnings: let
20143         the Method.Define routine take care of flagging warnings.  But if
20144         there is a mismatch (method overrides something else, or method is
20145         overriwritten by something, then emit warning).
20146
20147         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20148         set to null, this means `do not check for the return type on the
20149         signature'. 
20150
20151         (Method.Define): set the return type for the method signature to
20152         null, so that we get methods with the same name and parameters and
20153         different return types.  This is used to flag warning 114 (you are
20154         hiding a method, and you probably want to use the new/override
20155         keywords instead).
20156
20157         * typemanager.cs (MemberLookup): Implemented proper access
20158         control, closing a long standing set of bug reports.  The problem
20159         was that the Framework only has two bits: Public and NonPublic,
20160         and NonPublic includes private and protected methods, but we need
20161         to enforce the FamANDAssem, FamOrAssem and Family. 
20162
20163 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20164
20165         * statement.cs (GotoCase): Return true: Ammounts to giving up
20166         knowledge on whether we return or not, and letting the other case
20167         be responsible for it.
20168
20169 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20170
20171         * driver.cs: Do not load directories for each file processed, only
20172         do it if there is a pattern.
20173
20174         * ecore.cs: Report readonly assigns here as well, as we might have
20175         been resolved only by MemberAccess.
20176
20177         (SimpleName.SimpleNameResolve): Also be useful for LValue
20178         resolution.   We need this to propagate assign to local readonly variables
20179
20180         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20181         do not want to reuse potential criteria memory.
20182
20183         * class.cs (MyEventBuilder): Set reflected_type;
20184
20185         * ecore.cs (Constantify): Added support for constifying bools.
20186
20187         (RootContext.LookupType): Added a cache for values looked up in
20188         the declaration space.
20189
20190         * typemanager.cs (FindMembers): Now is a front-end to
20191         RealFindMembers, and provides a two-level hashtable-based cache to
20192         the request.  
20193
20194         15% performance improvement: from 22.5 to 19.2 seconds.
20195
20196         * expression.cs (IsParamsMethodApplicable): use foreach.
20197         (Invocation.DoResolve): ditto.
20198         (New.DoResolve): ditto.
20199         (ArrayCreation.DoResolve): ditto.
20200
20201         * ecore.cs (FindMostEncompassingType): use foreach.
20202
20203         * delegate.cs (NewDelegate.DoResolve): Use foreach
20204
20205         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20206         (RemoveMethods): use foreach.
20207
20208         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20209         nested foreach statements instead of for, and also break out of
20210         the inner loop once a match is found.
20211
20212         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20213
20214 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20215
20216         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20217         we actually unwrap the expression to allow for extra information
20218         to be extracted. 
20219
20220         * expression.cs: Use Shr_Un on unsigned operations. 
20221
20222 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20223
20224         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20225         applicable operators was not being considered correctly. This closes
20226         the bug Miguel reported.
20227
20228 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20229
20230         * attribute.cs: check that the type derives from System.Attribute
20231         and report the correct error in that case (moved the duplicate code to
20232         its own method, too).
20233
20234 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20235
20236         * attribute.cs: lookup attribute type name as the spec says: first the
20237         bare attribute name and then name + "Attribute" (nant compiles with
20238         mcs after this fix).
20239
20240 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20241
20242         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20243         Because of the way we parse things, we should try to see if a
20244         UIntConstant can fit in an integer.
20245
20246 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20247
20248         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20249         when we are in an explicit context.
20250
20251         (ConvertReferenceExplicit): When converting from Iface type S to Class
20252         T make sure the rules are implemented as an OR.
20253
20254         * parameter.cs (ParameterType): Make it a property for now although the
20255         purpose really isn't anything immediate.
20256
20257         * expression.cs (Is*Applicable): Do better checking on the parameter type
20258         of a ref/out parameter. The ones from the system assemblies are already 
20259         marked with the correct type so we don't need to do any correction.
20260
20261         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20262         the object type is standard too so include that.
20263
20264 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20265
20266         * ecore.cs (StandardConversionExists): Augment with missing code:
20267         deal with IntConstant, LongConstants and Enumerations.
20268
20269         * assign.cs: Report the error, instead of failing silently
20270
20271         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20272         typecontainer that they are declared, because the
20273         typecontainer/namespace will have the list of using clauses that
20274         need to be applied.
20275
20276         Assembly Attributes were escaping the normal registration
20277         mechanism. 
20278
20279         (EmitCode): Apply attributes within an EmitContext that represents
20280         the container they were declared on.
20281
20282         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20283
20284 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20285
20286         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20287         Revamp completely - make much cleaner as we now operate only
20288         on a set of Types.
20289
20290         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20291         to implement the logic detailed in the spec more correctly.
20292
20293         (UserDefinedConversion): Update accordingly.
20294
20295 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20296
20297         * statement.cs: Return flow analysis information up.
20298
20299         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20300         and the default.
20301
20302         (token): Do not consume an extra character before calling
20303         decimal_digits.
20304
20305 2002-05-06  Piers Haken <piersh@friskit.com>
20306
20307         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20308
20309 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20312         EmitContext during the instance constructor initializer
20313         resolution, to stop access to instance variables.
20314
20315         This is mandated by the spec, last paragraph of the `constructor
20316         initializers' section. 
20317
20318 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * cs-parser.jay, class.cs (Accessor): new class used to represent
20321         an accessor (get or set).  In the past we used `null' to represent
20322         a missing accessor.  But this is ambiguous because there was no
20323         way to tell in abstract indexers/properties if one of them was
20324         specified.
20325
20326         Now there is a way of addressing that.
20327
20328         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20329         instead of FindMembers.
20330
20331         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20332         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20333
20334         * attribute.cs: Treat indexers and properties as the same in terms
20335         of applying attributes
20336
20337         * ecore.cs (FindMostEncompassedType): Use statically initialized
20338         EmptyExpressions()s like we do elsewhere to avoid creating useless
20339         objects (and we take this out of the tight loop).
20340
20341         (GetConversionOperators): Move the code to extract the actual
20342         operators to a separate routine to clean things up.
20343
20344 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20345
20346         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20347         events are always registered FieldBuilders.
20348
20349         * class.cs (FieldBase): New class shared by Fields 
20350
20351         * delegate.cs: If we are a toplevel delegate, use our full name.
20352         If we are a nested delegate, then only use our tail name.
20353
20354 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20355
20356         * expression.cs (IsApplicable): Ensure that we add the "&" to
20357         ref/out types before comparing it with the type of the argument.
20358
20359         (IsParamsMethodApplicable): Ditto.
20360
20361         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20362         silly me ;-)
20363
20364         * delegate.cs : Handle the case when we have more than one applicable
20365         method. Flag an error only when we finish checking all.
20366
20367 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20368
20369         * expression.cs: Add support for boolean static initializers.
20370
20371 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20372
20373         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20374
20375         * parameter.cs (ComputeParameterTypes,
20376         ComputeAndDefineParameterTypes): Better error handling: now we
20377         clear the `types' cache if we fail during any of the type lookups.
20378         We also return the status code correctly to our caller
20379
20380         * delegate.cs: If we fail to define a delegate, abort the extra
20381         steps. 
20382
20383         * expression.cs (Binary.ResolveOperator): for
20384         operator==(object,object) and operator !=(object, object) we also
20385         have to verify that there is an implicit conversion from one to
20386         the other.
20387
20388         (ArrayAccess.DoResolve): Array Access can operate on
20389         non-variables. 
20390
20391 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * assign.cs (CompoundAssign): A new class used as a "flag" that
20394         the assignment actually is happening as part of a compound
20395         assignment operator.
20396
20397         During compound assignment, a few new rules exist to enable things
20398         like:
20399
20400         byte b |= 1 + 2
20401
20402         From the spec:
20403
20404         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20405         to the type of x) if y is implicitly convertible to the type of x,
20406         and the operator is a builtin operator and the return type of the
20407         operator is explicitly convertible to the type of x. 
20408
20409         * rootcontext.cs: Reset warning level to 2.  4 catches various
20410         "interesting" features in mcs, we must clean this up at some
20411         point, but currently am trying to kill other bugs ;-)
20412
20413         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20414         in container classes as well.  
20415
20416         * expression.cs (Binary.ResolveOperator): Handle string case
20417         before anything else (as operator overloading does emit an error
20418         before doing anything else).
20419
20420         This code could go away when we move to a table driven model, but
20421         i could not come up with a good plan last night.
20422
20423 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20424
20425         * typemanager.cs (CSharpName): reimplementation using regex.
20426         * class.cs: added null check for fields in Emit
20427         * rootcontext.cs: set warninglevel to 4
20428
20429 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * typemanager.cs (CSharpName): reimplemented with Lupus
20432         suggestion.
20433
20434 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * statement.cs (If): correclty implement Resolve, because we were
20437         not catching sem errors in there.  The same process is needed
20438         everywhere else. 
20439         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20440
20441
20442         (Statement.Warning_DeadCodeFound): Factorize code.
20443         (While): Report dead code here too.
20444
20445         (Statement): Added Resolve virtual method to allow
20446         for resolution split from the emit code.
20447
20448 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20449
20450         * statement.cs (EmitBoolExpression): No longer try to resolve the
20451         expression here.    
20452         (MakeBoolean): New utility function that resolve, implicitly
20453         converts to boolean and tags the expression. 
20454
20455
20456         (If, Do): Implement dead code elimination.
20457         (While): Implement loop inversion
20458
20459         (Do, While, For, If): Resolve the expression prior to calling our
20460         code generation.
20461
20462 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20463
20464         * class.cs:
20465           - added method Report28 (warning: program has more than one entry point)
20466           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20467           - modified method Method.Define, the part at the end of the method
20468
20469         * rootcontext.cs: added static public Location EntryPointLocation;
20470           
20471         * ../errors/cs0028.cs : Add test case for the above warning.              
20472
20473         * typemanager.cs:
20474           - modified method CSharpName to allow arrays of primitive type to
20475             be printed nicely (e.g. instead of System.Int32[][] it now prints
20476             int[][])
20477           - added method CSharpSignature: returns the signature of a method
20478             in string format to be used in reporting errors, warnings, etc.
20479
20480         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20481         with String.Empty.
20482
20483 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20484
20485         * delegate.cs (Define): Fix extremely silly bug where I was
20486         setting the type of the 'object' parameter of the BeginInvoke
20487         method to System.IAsyncResult instead of System.Object ;-)
20488
20489 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20492         here. 
20493
20494         (Constructor.Emit): return if we fail to initialize the
20495         constructor.  Another door closed!  
20496
20497         * expression.cs (New.DoResolve): Improve error message (from -6 to
20498         1501).  Use DeclaredOnly lookup to find the exact constructor.
20499
20500         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20501         loop.  This is useful.
20502
20503         * cs-parser.jay: Adjust the default parameters so that destructors
20504         have the proper signature.
20505
20506 2002-04-26  Martin Baulig  <martin@gnome.org>
20507
20508         * driver.cs (LoadAssembly): If `assembly' contains any characters
20509         which are only valid in path names and not in assembly names
20510         (currently slash, backslash and point), use Assembly.LoadFrom ()
20511         instead of Assembly.Load () on the `assembly' (before iteration
20512         over the link_paths).
20513
20514 2002-04-26  Martin Baulig  <martin@gnome.org>
20515
20516         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20517
20518 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20519
20520         * class.cs (Property): use the new typemanager.MemberLookup
20521
20522         (TypeContainer.MemberLookup): Implement using the
20523         TypeManager.MemberLookup now. 
20524
20525         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20526         and return MemberInfos, so that these can be used without an
20527         EmitContext (what we had before).
20528
20529 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20530
20531         * expression.cs: Fix the case where the argument to params if the
20532         type of the params.  I omitted handling this before.   Fixed
20533
20534 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20535
20536         * driver.cs: Call BootCorlib_PopulateCoreType
20537
20538         * class.cs (Property.CheckBase): Check for properties only, not
20539         for all members. 
20540
20541         * interface.cs: Temporary hack: try/catch around the
20542         CustomAttributeBuilder, because I am getting an exception that I
20543         do not understand.
20544
20545         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20546         types whose definitions are required to be there (attributes are
20547         defined before standard types).
20548
20549         Compute definitions as we boot the various types, as they are used
20550         immediately (value_type class will need object_type, but if we do
20551         not initialize object_type, we will pass a null, which will let
20552         the runtime pick the System.Object from the existing corlib, which
20553         is not what we want).
20554
20555 2002-04-22  Patrik Torstensson <totte@labs2.com>
20556
20557         * cs-tokenizer.cs: fixed a number of trim() issues.
20558
20559 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20560
20561         * expression.cs (Argument.Type): Ensure that we return the correct
20562         type when we have out or ref parameters [in which case we 
20563         append a "&"].
20564
20565 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20566
20567         * class.cs (Property, Indexer): Allow extern modifier in there. 
20568
20569         * typemanager.cs (InitBaseTypes): Initializes object_type and
20570         value_type, since those will be used early on during the bootstrap
20571         process to compile corlib.
20572
20573         (InitCoreTypes): Move code from here to InitBaseTypes.
20574
20575 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20576
20577         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20578         single-dimension arrays as using the ldlen opcode.  
20579
20580         Daniel Lewis discovered this optimization.  
20581
20582         * typemanager.cs: Add signature for System.Array::get_Length
20583
20584 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20585
20586         * statement.cs: report the error when the foreach does not apply to an
20587         array nor a collection.
20588
20589 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20590
20591         * expression.cs: Add implicit conversions to the operator ~.
20592
20593         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20594
20595         * typemanager.cs: Locate the decimal constructor.
20596
20597 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20598
20599         * attribute.cs: use the new property of TypeOf.
20600         * expression.cs: added 'get' property around typearg.
20601
20602         These changes fix a build breaker reported by NickD. Is this the
20603         correct way to fix?  If not, please, revert my changes and make it
20604         work :-).
20605
20606 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20607
20608         * attribute.cs: Add support for typeof in attribute invocations.
20609         I am not sure that this is right though.
20610
20611 2002-04-14  Duncan Mak  <duncan@ximian.com>
20612
20613         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20614         Binary.Operator.Division case.
20615
20616 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20617
20618         * class.cs (DefineType): Ensure that we do a proper check on
20619         attribute types and also register it with the TypeManager.
20620
20621         (TypeContainer.Targets): The default for attribute types is
20622         AttributeTargets.All.
20623
20624         * attribute.cs (ApplyAttributes): Registering the attribute type
20625         is done elsewhere, not when we discover we have a Usage attribute.
20626
20627 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20628
20629         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20630         and get rid of is_delegate parameter.
20631
20632         * everywhere : update.
20633
20634 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20635
20636         * cs-parser.jay (compilation_unit): Revamp completely to use
20637         some new ideas that I got from Rhys' grammar to solve the problems
20638         with assembly level attributes.
20639
20640         (outer_declaration): New grammar production.
20641
20642         (attribute_sections): Add.
20643
20644         (opt_attributes): Base on attribute_sections
20645
20646         (namespace_declaration): Allow opt_attributes to tackle the case
20647         when we have assembly level attributes - we are clever in this
20648         regard now ;-)
20649
20650         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20651         attributes in the non-global context.
20652
20653         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20654         instead of SetGlobalAttributes.
20655
20656         * class.cs, rootcontext.cs : Ensure we define and generate 
20657         attribute types before anything else.
20658
20659         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20660         and flag the new error -20 for the case when the attribute type
20661         does not have valid targets specified. csc does not catch this.
20662
20663         * ../errors/errors.txt : update for error # -20
20664
20665 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20666
20667         * support.cs (InternalParameters.ParameterModifier): Do some null
20668         checking and return sane values.
20669
20670         * class.cs (Method.Define): If we are a PInvoke method, ensure
20671         that we are static and extern. Report error # 601
20672
20673         * ../errors/cs0601.cs : Add test case for the above error.
20674
20675 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20676
20677         * rootcontext.cs (attribute_types): We need to keep type of
20678         all attribute types separately and emit code for them first.
20679
20680         (RegisterAttribute) : Implement.
20681
20682         * class.cs (DefineType): Check if the current Type is a custom
20683         attribute type and register it accordingly.
20684
20685         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20686         adding the first attribute twice and rename to
20687
20688         (SetGlobalAttributes): this.
20689
20690         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20691         lookups.
20692
20693         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20694         if we are processing global arguments. Hmm, I am unsure of this.
20695
20696 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20697
20698         * expression.cs: added static array of strings to avoid calling
20699         Enum.ToString () for Operator in Binary. Significant recover of
20700         performance.
20701
20702 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * class.cs (FindMembers): Allow the Builders of the various
20705         members to be null.  If they are skip them.  This only happens
20706         during the PInvoke declaration.
20707
20708 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20711         failure, so we do not keep going afterwards.
20712
20713         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20714         wanted to pass `false' as the `is_delegate' argument.  If this is
20715         the case, why not use delegate_type == null to mean `is_delegate =
20716         false' and anything else as is_delegate = true.
20717
20718 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20719
20720         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20721         code for the section, not the beginning of the tests.
20722
20723 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20724
20725         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20726
20727         * expression.cs (Binary): same.  Warn about errors where we have
20728         Enum/Enum in operator + as well.
20729
20730 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20731
20732         * statement.cs:
20733                 - added support for switch(bool)
20734                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20735                 - add TableSwitchEmit() to handle table-based switch statements
20736
20737 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20738
20739         * expression.cs (Invocation.OverloadResolve): Factor out code which
20740         does parameter compatibility checking with arguments so that we can 
20741         re-use the code even from Delegate.VerifyApplicability
20742
20743         (VerifyArgumentsCompat): Move above code here.
20744
20745         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20746         and instead make a call to the above method.
20747
20748 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20749
20750         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20751         We use it to keep track of classes which are attribute types.
20752
20753 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * delegate.cs (Delegate.Define): Correctly define the types in the
20756         presence of fixed and array parameters.
20757
20758         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20759         doing FindMembers.
20760
20761         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20762         include NonPublic after the first iteration.
20763
20764         * class.cs (Indexer.CheckBase): Only check if both parents are
20765         non-null. 
20766
20767         * cs-parser.jay (accessor_body): If empty, set to null.
20768
20769         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20770         same code path here to resolve constants names that we did have in
20771         MemberAccess.DoResolve.  There is too much code duplicated here.
20772
20773 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20774
20775         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20776
20777         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20778         to MakeUnionSet.
20779
20780         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20781         tokens, numbers and strings.
20782
20783         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20784         parenthesis.
20785
20786         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20787         asyncronous parameters and the regular parameters.  
20788
20789         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20790         specify the target directory.
20791
20792         * expression.cs: (This.DoResolve): Simplify
20793         (As.Emit): Optimize, do not generate IsInst if the expression is
20794         always of the given type.
20795
20796         (Is.DoResolve): Bug fix, we were reporting both always/never for
20797         the is expression.
20798
20799         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20800         creating too many unnecessary arrays.
20801
20802 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20803
20804         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20805         fields instead of rolling our own initializer.   Takes care of all
20806         implicit conversions, and drops unnecessary static checks/argument.
20807
20808 2002-03-31  Dick Porter  <dick@ximian.com>
20809
20810         * driver.cs: use the GetDirectories() return values properly, and
20811         use "/" as path separator.
20812
20813 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20814
20815         * expression.cs (Unary): Optimize - - expr into expr.
20816         (Binary): Optimize a + (-b) into a -b.
20817
20818         * codegen.cs (CodeGen): Made all methods static.
20819
20820 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20821
20822         * rootcontext.cs: 
20823
20824         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20825         TypeBuilder property.
20826
20827         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20828         instead. 
20829
20830         * tree.cs: Removed the various RecordXXXX, and replaced with a
20831         single RecordDecl.  Removed all the accessor methods, and just
20832         left a single access point Type 
20833
20834         * enum.cs: Rename DefineEnum to DefineType.
20835
20836         * decl.cs: New abstract method `DefineType' used to unify the
20837         Defines for Enumerations, Interfaces, TypeContainers and
20838         Delegates.
20839
20840         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20841         LookupBaseClasses method that used to live in class.cs and
20842         interface.cs here, and renamed to FindType.
20843
20844         * delegate.cs: Implement DefineType.  Take advantage of the
20845         refactored pattern for locating the parent builder without taking
20846         the parent_builder argument (which we know does not work if we are
20847         nested, and triggering a toplevel definition).
20848
20849 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20850
20851         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20852         accessibility of a member has changed during override and report
20853         an error if so.
20854
20855         * class.cs (Method.Define, Property.Define): Only complain on
20856         overrides if the method is private, any other accessibility is
20857         fine (and since we just checked the permission is the same, we are
20858         good to go).
20859
20860         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20861         and elif are processed always.  The other pre-processing
20862         directives are only processed if we are "taking" the path
20863
20864 2002-03-29  Martin Baulig  <martin@gnome.org>
20865
20866         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20867         current location is not Null.
20868
20869         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20870         a separate method so we can profile it.
20871
20872         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20873         `span.Seconds' are just seconds, but no minutes or hours.
20874         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20875
20876 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20877
20878         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20879         Remove the gratuitous set of Final:
20880
20881                                 // If an interface implementation, then we can set Final.
20882                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20883                                     implementing.DeclaringType.IsInterface)
20884                                         flags |= MethodAttributes.Final;
20885
20886         I do not know what I was smoking when I used that.
20887
20888
20889         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20890         step into fixing the name resolution issues for delegates and
20891         unifying the toplevel name resolution.
20892
20893 2002-03-28  Martin Baulig  <martin@gnome.org>
20894
20895         * class.cs (Method.Emit): If we have a symbol writer, call its
20896         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20897         tell it about the current method.
20898
20899         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20900         writer that we're going to emit the first byte of IL code for a new
20901         statement (a new source line).
20902         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20903         EmitContext.Mark() before emitting any code.
20904
20905         * location.cs (SymbolDocument): Return null when we're Null.
20906
20907         * statement.cs (Statement): Moved the `Location loc' variable here.
20908         (Statement.EmitBoolExpression): If we have a symbol writer, call
20909         ec.Mark() before emitting any code to tell it that we're at the
20910         beginning of a new statement.
20911         (StatementExpression): Added `Location' argument to the constructor.
20912         (Block): Added public readonly variable `StartLocation' and public
20913         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20914         (Block): Added constructor which takes a start and end location.
20915         (Block.SetEndLocation): New method. This sets the end location.
20916         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20917         local variables we create.
20918         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20919         each statement and do also mark the begin and end of the block.
20920
20921         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20922         tell it the current lexer.Location, use Location.Null for the end of the
20923         block.
20924         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20925         current block, set its end location using SetEndLocation().
20926         (statement_expression): StatementExpression constructor now takes the
20927         lexer.Location as additional argument.
20928         (for_statement, declare_local_variables): Likewise.
20929         (declare_local_variables): When creating a new implicit block, use the
20930         new Block constructor and pass it the lexer.Location.
20931
20932 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20935         members also on the parent interfaces recursively.
20936
20937 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20938
20939         * report.cs: Use new formats, since Gonzalo finished the missing
20940         bits. 
20941
20942         * expression.cs (Binary.ResolveOperator): added missing operator|
20943         operator& and operator^ for bool/bool.
20944
20945         * cs-parser.jay: CheckDef now takes a Location argument that is
20946         used to report errors more precisly (instead of reporting the end
20947         of a definition, we try to track something which is a lot closer
20948         to the source of the problem).
20949
20950         * cs-tokenizer.cs: Track global token use, so we can properly flag
20951         the use of #define/#undef after the first token has been seen.
20952
20953         Also, rename the reportXXXX to Error_DescriptiveName
20954
20955         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20956         TypeContainer, so that Enum and Interface can use this too.
20957
20958         * class.cs (TypeContainer.LookupInterfaceOrClass,
20959         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20960         `builder' argument.  Typically this was used to pass the parent
20961         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20962         the definition).  
20963
20964         The problem is that a nested class could trigger the definition of
20965         a toplevel class, and the builder would be obviously wrong in that
20966         case. 
20967
20968         So we drop this argument, and we compute dynamically the
20969         TypeBuilder/ModuleBuilder (the correct information was available
20970         to us anyways from DeclSpace.Parent)
20971
20972         * interface.cs (Interface.DefineInterface): Drop builder
20973         parameter cleanup like class.cs
20974
20975         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20976         like class.cs
20977
20978         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20979         values. 
20980
20981         (Try.Emit): Propagate the returns value from the statement.
20982
20983         (Return.Emit): Even if we are leavning 
20984
20985         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20986
20987         * modifiers.cs: Fix the computation of MethodAttributes flags.
20988
20989 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20990
20991         * driver.cs: allow compilation of files that start with '/'.
20992         Add a default case when checking the argument of --target.
20993
20994 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20995
20996         * interface.cs: Implement the same search algorithm for types in
20997         the interface code.
20998
20999         * delegate.cs: Do not allow multiple definition.
21000
21001         * Recovered ChangeLog that got accidentally amputated
21002
21003         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21004
21005         * rootcontext.cs: Load manually enum to allow core classes to
21006         contain enumerations.
21007
21008         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21009         Update to new static methods in TypeManager.
21010
21011         * typemanager.cs (GetMethod, GetConstructor): Use our
21012         implementation of FindMembers to find the members, since during
21013         corlib compilation, the types are TypeBuilders and GetMethod and
21014         GetConstructor do not work.
21015
21016         Make all methods in TypeManager static.
21017
21018         (InitCodeHelpers): Split the functionality from
21019         the InitCodeTypes function.
21020
21021         * driver.cs: Call InitCodeHelpers after we have populated the
21022         types. 
21023
21024         * cs-parser.jay (delegate_declaration): we did not used to compute
21025         the delegate name correctly for void delegates.
21026
21027 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21028
21029         * rootcontext.cs (RootContext): Init the interface_resolve_order
21030         and type_container_resolve_order always.
21031
21032         (ResolveCore, BootstrapCorlib_ResolveClass,
21033         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21034         compiler when compiling with --nostdlib
21035
21036         * class.cs (TypeContainer.DefineType): Check that our parent is
21037         not null.  This test is most important when we are bootstraping
21038         the core types.
21039
21040         * codegen.cs: Split out the symbol writing code.
21041
21042 2002-03-25  Martin Baulig  <martin@gnome.org>
21043
21044         * driver.cs (-g): Made -g an alias for --debug.
21045
21046 2002-03-24  Martin Baulig  <martin@gnome.org>
21047
21048         * codegen.cs (SymbolWriter): New public variable. Returns the
21049         current symbol writer.
21050         (CodeGen): Added `bool want_debugging_support' argument to the
21051          constructor. If true, tell the ModuleBuild that we want debugging
21052         support and ask it for the ISymbolWriter.
21053         (Save): If we have a symbol writer, call it's Close() method after
21054         saving the assembly.
21055
21056         * driver.c (--debug): New command line argument to create a
21057         debugger information file.
21058
21059         * location.cs (SymbolDocument): New public property. Returns an
21060         ISymbolDocumentWriter object for the current source file or null
21061         if we don't have a symbol writer.
21062
21063 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21064
21065         * driver.cs (LoadAssembly): Correctly return when all the paths
21066         have been tried and not before.
21067
21068         * statement.cs (Switch.Emit): return the actual coverage for this
21069         statement (returns/not-returns)
21070
21071         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21072         switch of the statement if we are the last switch section.  That
21073         kills two problems: try/catch problems (we used to emit an empty
21074         nop at the end) and switch statements where all branches would
21075         return. 
21076
21077 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * driver.cs: Add default assemblies (the equivalent to the
21080         Microsoft CSC.RSP file)
21081
21082         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21083         also update tokens_seen and set it to false.
21084
21085         * driver.cs: Implement --recurse for Mike.
21086
21087         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21088         correctly splitting out the paths.
21089
21090 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21091
21092         * interface.cs (Interface.PopulateProperty): Instead of using
21093         `parent' as the declaration space for the set parameters, use
21094         `this' 
21095
21096         * support.cs (InternalParameters): InternalParameters constructor
21097         takes a DeclSpace instead of a TypeContainer.
21098
21099         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21100         types are being initialized, load the address of it before calling
21101         the function.  
21102
21103         (New): Provide a mechanism to disable the generation of local
21104         value type temporaries when the caller will be providing us with
21105         an address to store it.
21106
21107         (ArrayCreation.EmitDynamicInitializers): Use it.
21108
21109 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21110
21111         * expression.cs (Invocation.EmitArguments): Only probe for array
21112         property if there is more than one argument.  Sorry about that.
21113
21114         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21115         empty param arrays.
21116
21117         * class.cs (Method.LabelParameters): Fix incorrect code path that
21118         prevented the `ParamArrayAttribute' from being applied to the
21119         params attribute.
21120
21121 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21122
21123         * support.cs (ReflectionParameters): Correctly compute whether the
21124         last argument is a params array.  Fixes the problem with
21125         string.Split ('a')
21126
21127         * typemanager.cs: Make the assemblies array always be non-null
21128         (empty, but non-null)
21129
21130         * tree.cs (RecordDecl): New function that abstracts the recording
21131         of names.  This reports error 101, and provides a pointer to the
21132         previous declaration.  Fixes a crash in the compiler.
21133
21134         * cs-parser.jay (constructor_declaration): Update to new grammar,
21135         and provide a constructor_body that can be empty.
21136
21137 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21138
21139         * driver.cs: Add support for --resources.
21140
21141         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21142         Make all types for the various array helper methods be integer.
21143
21144         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21145         CheckState to ConvCast.
21146
21147         (ConvCast): Now it takes a `checked' state argument, to avoid
21148         depending on the emit context for the conversion, and just using
21149         the resolve time setting.
21150
21151         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21152         instead of Invocation.EmitArguments.  We do not emit the original
21153         arguments, instead we emit those which have been converted to
21154         unsigned int expressions.
21155
21156         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21157
21158         * codegen.cs: ditto.
21159
21160         * expression.cs (LocalVariableReference): Drop the use of the
21161         Store function that depended on the variable index.
21162
21163         * statement.cs (VariableInfo): Drop the `Idx' property from this
21164         class, as this is not taking into account the indexes for
21165         temporaries tat we generate during the execution, getting the
21166         indexes wrong.
21167
21168         * class.cs: First emit class initializers, then call the parent
21169         constructor. 
21170
21171         * expression.cs (Binary): Fix opcode emision.
21172         (UnaryMutator.EmitCode): Support checked code generation
21173
21174         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21175         matches for events for both the Static and Instance scans,
21176         pointing to the same element.   Fix that.
21177
21178 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21179
21180         * rootcontext.cs (ResolveTree): Always set the
21181         interface_resolve_order, because nested interfaces will be calling
21182         into us.
21183
21184         * class.cs (GetInterfaceOrClass): Track the same resolution
21185         process used by TypeManager.LookupType.  This fixes the nested
21186         type lookups in class declarations (separate path from
21187         LookupType). 
21188
21189         (TypeContainer.DefineType): Also define nested interfaces.
21190         (TypeContainer.RegisterOrder): New public function used to
21191         register the order in which child interfaces need to be closed.
21192
21193         Nested interfaces need to be closed after their parents have been
21194         created. 
21195
21196         * interface.cs (InterfaceAttr): Put all the logic for computing
21197         the interface attribute here. 
21198
21199         (DefineInterface): Register our interface order with the
21200         RootContext or with the TypeContainer depending on the case.
21201
21202 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21203
21204         * cs-parser.jay: rework foreach statement to work with the new
21205         changes to the policy on SimpleNames.
21206
21207         * report.cs: support Stacktrace on warnings as well.
21208
21209         * makefile: drop --unsafe and /unsafe from the compile.
21210
21211 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21212
21213         * ecore.cs (StandardConversionExists): Modify to take an Expression
21214         as the first parameter. Ensure we do null -> reference type conversion
21215         checking.
21216
21217         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21218         temporary Expression objects.
21219
21220 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21221
21222         * interface.cs: workaround bug in method overloading resolution
21223         (there is already a bugzilla bug for it).
21224
21225 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21226
21227         We could also solve this problem by having a separate path for
21228         performing type lookups, instead of DoResolve, we could have a
21229         ResolveType entry point, and only participating pieces of the
21230         production (simplename, deref, array) would implement this. 
21231
21232         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21233         signal SimpleName to only resolve type names and not attempt to
21234         resolve anything else.
21235
21236         * expression.cs (Cast): Set the flag.
21237
21238         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21239
21240         * class.cs: Only report 108 if there is no `new' modifier.
21241
21242         * cs-parser.jay: rework foreach statement to work with the new
21243         changes to the policy on SimpleNames.
21244         
21245         * report.cs: support Stacktrace on warnings as well.
21246
21247         * makefile: drop --unsafe and /unsafe from the compile.
21248
21249 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21250
21251         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21252         lookups here, instead of doing that at parse time.  This means
21253         that our grammar will not introduce `LocalVariableReferences' as
21254         expressions at this point.  That solves the problem of code like
21255         this:
21256
21257         class X {
21258            static void Main ()
21259            { int X = 1;
21260             { X x = null }}}
21261
21262         This is only half the fix.  The full fix requires parameters to
21263         also be handled in this way.
21264
21265         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21266         makes the use more obvious of the DeclSpace.  The
21267         ec.TypeContainer.TypeBuilder is now only used to pull the
21268         TypeBuilder for it.
21269
21270         My theory is that I can get rid of the TypeBuilder completely from
21271         the EmitContext, and have typecasts where it is used (from
21272         DeclSpace to where it matters).  
21273
21274         The only pending problem is that the code that implements Aliases
21275         is on TypeContainer, and probably should go in DeclSpace.
21276
21277         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21278         lookups here, instead of doing that at parse time.  This means
21279         that our grammar will not introduce `LocalVariableReferences' as
21280         expressions at this point.  That solves the problem of code like
21281         this:
21282
21283         class X {
21284            static void Main ()
21285            { int X = 1;
21286             { X x = null }}}
21287
21288         This is only half the fix.  The full fix requires parameters to
21289         also be handled in this way.
21290
21291         * class.cs (Property.DefineMethod): When implementing an interface
21292         method, set newslot, when implementing an abstract method, do not
21293         set the flag (before we tried never setting it, or always setting
21294         it, which is the difference).
21295         (Indexer.DefineMethod): same.
21296         (Method.DefineMethod): same.
21297
21298         * ecore.cs: Only set the status used flag if we get back a Field.
21299
21300         * attribute.cs: Temporary hack, so Paolo can keep working.
21301
21302 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21303
21304         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21305         the unmanaged type in the case we have a MarshalAs attribute.
21306
21307         (Resolve): Handle the case when we are parsing the special MarshalAs
21308         attribute [we need to store the unmanaged type to use later]
21309
21310         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21311         MarshalAs Attribute.
21312
21313         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21314         on parameters and accordingly set the marshalling info.
21315
21316 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21317
21318         * class.cs: Optimizing slightly by removing redundant code after
21319         we switched to the `NoTypes' return value.
21320         (Property.DefineMethod): use NoTypes here too.
21321
21322         This fixes the bug I introduced in my last batch of changes.
21323
21324 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21325
21326         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21327
21328         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21329         Enums since those are types too. 
21330
21331         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21332
21333         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21334         thanks to a call during the lookup process.
21335
21336 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21337
21338         * statement.cs (Foreach): Lots of work to accomodate a particular
21339         kind of foreach statement that I had not kept in mind.  It is
21340         possible to have foreachs on classes that provide a GetEnumerator
21341         method that return objects that implement the "pattern" for using
21342         a foreach, there is no need to support GetEnumerator
21343         specifically. 
21344
21345         This is needed to compile nant.
21346
21347         * decl.cs: Only report 114 if the member is not `Finalize' and if
21348         the warning level is at least 2.
21349
21350         * class.cs: Moved the compare function from Method to
21351         MethodSignature. 
21352
21353         (MethodSignature.InheritableMemberSignatureCompare): Add new
21354         filter function that is used to extract inheritable methods from a
21355         class. 
21356
21357         (Method.Define): Use the new `inheritable_method_signature_filter'
21358         delegate
21359
21360         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21361         command. 
21362
21363 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21364
21365         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21366
21367         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21368
21369         * expression.cs: Pass location information to
21370         ConvertImplicitStandard. 
21371
21372         * class.cs: Added debugging code to track return values from
21373         interfaces. 
21374
21375 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21376
21377         * expression.cs (Is.DoResolve): If either side of the `is' is an
21378         interface, do not flag the warning.
21379
21380         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21381         for interfaces
21382
21383         * report.cs: Allow for --fatal to be used with --probe.
21384
21385         * typemanager.cs (NoTypes): Move the definition for the empty Type
21386         array here. 
21387
21388         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21389         properties. 
21390         (TypeContainer.DefineProxy): New function used to proxy to parent
21391         implementations when implementing interfaces.
21392         (TypeContainer.ParentImplements): used to lookup if our parent
21393         implements a public function that is required by an interface.
21394         (TypeContainer.VerifyPendingMethods): Hook this up.
21395
21396         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21397         `modules' and `assemblies' arraylists into arrays.  We only grow
21398         these are the very early start up of the program, so this improves
21399         the speedof LookupType (nicely measured).
21400
21401         * expression.cs (MakeByteBlob): Replaced unsafe code with
21402         BitConverter, as suggested by Paolo.
21403
21404         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21405         folding of string concatenation, but if either side is a string,
21406         and the other is not, then return null, and let the runtime use
21407         the concatenation on the string plus the object (using
21408         `Object.ToString'). 
21409
21410 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21411
21412         Constant Folding has been implemented now.
21413
21414         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21415         the error instead on types that are not supported in one's
21416         complement. 
21417
21418         * constant.cs (Constant and all children): New set of functions to
21419         perform implict and explicit conversions.
21420
21421         * ecore.cs (EnumConstant): Implement the new functions to perform
21422         conversion by proxying to the child expression.
21423
21424         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21425         own separate setting that can not be turned off from the command
21426         line using --unchecked or --checked and is only controlled using
21427         the checked/unchecked statements and expressions.  This setting is
21428         used by the constant folder to flag errors.
21429
21430         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21431         ConstantCheckState as well.   
21432
21433         During Resolve, they also have to flag the state, because the
21434         constant folder runs completely in the Resolve phase.
21435
21436         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21437         well.
21438
21439 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21440
21441         * cfold.cs: New file, this file contains the constant folder.
21442
21443         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21444         argument to track whether we are using the resulting address to
21445         load or store a value and provide better error messages. 
21446
21447         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21448         new AddressOf arguments.
21449
21450         * statement.cs (Foreach.EmitCollectionForeach): Update
21451
21452         * expression.cs (Argument.Emit): Call AddressOf with proper
21453         arguments to track usage.
21454
21455         (New.DoEmit): Call AddressOf with new arguments.
21456
21457         (Unary.Emit): Adjust AddressOf call.
21458
21459 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21460
21461         * cs-parser.jay (member_access): Change the case for pre-defined types
21462         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21463         this suggestion.
21464
21465         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21466         a method body.
21467
21468         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21469         essentially like methods and apply attributes like MethodImplOptions to them too.
21470
21471         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21472         not being null.
21473
21474         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21475         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21476         is the DeclSpace.
21477
21478         * Update code everywhere accordingly.
21479
21480         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21481
21482         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21483
21484 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21485
21486         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21487         try performing lookups against those instead of jumping straight into using
21488         the 'using' clauses.
21489
21490         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21491
21492         (LookupType): Perform lookups in implicit parents too.
21493
21494         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21495         sequence as RootContext.LookupType. 
21496
21497         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21498         the various cases of namespace lookups into this method.
21499
21500 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21501
21502         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21503         in positional arguments)
21504
21505         * class.cs (Operator): Update the AllowedModifiers to contain
21506         extern. 
21507
21508         * cs-parser.jay: Update operator declaration to allow for the
21509         operator body to be empty.
21510
21511         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21512         values. 
21513
21514 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21515
21516         * class.cs (Method.Emit): Label parameters.
21517
21518         * driver.cs: Return 1 or 0 as the program exit code.
21519
21520 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * expression.cs: Special case the `null' object when trying to
21523         auto-compute the type, as anything can be explicitly converted to
21524         that. 
21525
21526         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21527         spotting this Paolo.
21528
21529         (Expression.ImplicitNumericConversion): Perform comparissions of
21530         the type using the underlying type in the case of an enumeration
21531         rather than using the enumeration type for the compare.
21532
21533         Cope with the underlying == type case, which is not possible to
21534         catch before. 
21535
21536         (Expression.ConvertNumericExplicit): Perform comparissions of
21537         the type using the underlying type in the case of an enumeration
21538         rather than using the enumeration type for the compare.
21539
21540         * driver.cs: If the user does not supply an extension, assume .exe
21541
21542         * cs-parser.jay (if_statement): Rewrote so that we can track the
21543         location for the if statement.
21544
21545         * expression.cs (Binary.ConstantFold): Only concat strings when
21546         the operation is "+", not everything ;-)
21547
21548         * statement.cs (Statement.EmitBoolExpression): Take a location
21549         argument. 
21550         (If, While, Do): Track location.
21551
21552         * expression.cs (Binary.ResolveOperator): In the object + string
21553         case, I was missing a call to ConvertImplicit
21554
21555 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21556
21557         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21558         Location arguments. Ensure we use RootContext.LookupType to do our work
21559         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21560
21561         * interface.cs (PopulateMethod): Handle the type of the parameter being
21562         null gracefully.
21563
21564         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21565         have a params method with no fixed arguments and a call is made with no
21566         arguments.
21567
21568 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21569
21570         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21571         the verbatim-string-literal
21572
21573         * support.cs (InternalParameters.ParameterModifier): handle null
21574         fixed parameters.
21575         (InternalParameters.ParameterType): ditto.
21576
21577         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21578         duplicating the name of the variable parameter.
21579         (GetParameterByName): Fix bug where we were not looking up array
21580         paramters if they were the only present (thanks Paolo!).
21581         (GetParameterInfo): We only have an empty set of types if both
21582         fixed and array are set to null.
21583         (GetParameterInfo-idx): Handle FixedParameter == null
21584
21585         * cs-parser.jay: Handle the case where there is no catch
21586         statements (missing null test).
21587
21588 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21589
21590         * driver.cs (MainDriver): Be conservative on our command line
21591         handling.
21592
21593         Catch DirectoryNotFoundException when calling GetFiles.
21594
21595         (SplitPathAndPattern): Used to split the input specification into
21596         a path and a pattern that we can feed to Directory.GetFiles.
21597
21598 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21599
21600         * statement.cs (Fixed): Implement the last case of the Fixed
21601         statement (string handling).
21602
21603         * expression.cs (StringPtr): New class used to return a char * to
21604         a string;  Used by the Fixed statement.
21605
21606         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21607
21608         * expression.cs (Binary.ResolveOperator): Remove redundant
21609         MemberLookup pn parent type.
21610         Optimize union call, we do not need a union if the types are the same.
21611         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21612         type.
21613
21614         Specialize the use of MemberLookup everywhere, instead of using
21615         the default settings. 
21616
21617         (StackAlloc): Implement stackalloc keyword.
21618
21619         * cs-parser.jay: Add rule to parse stackalloc.
21620
21621         * driver.cs: Handle /h, /help, /?
21622
21623         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21624         before we supported unsafe code.
21625
21626         * makefile: add --unsafe to the self compilation of mcs.
21627
21628 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21629
21630         * expression.cs (PointerArithmetic): New class that is used to
21631         perform pointer arithmetic.
21632         (Binary.Resolve): Handle pointer arithmetic
21633         Handle pointer comparission.
21634         (ArrayPtr): Utility expression class that is used to take the
21635         address of an array.
21636
21637         (ElementAccess): Implement array access for pointers
21638
21639         * statement.cs (Fixed): Implement fixed statement for arrays, we
21640         are missing one more case before we are done.
21641
21642         * expression.cs (Indirection): Implement EmitAssign and set the
21643         ExprClass to Variable.  This allows pointer dereferences to be
21644         treated as variables, and to have values assigned to them.
21645
21646         * ecore.cs (Expression.StoreFromPtr): New utility function to
21647         store values dereferencing.
21648
21649 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21650
21651         * expression.cs (Binary.ResolveOperator): Ensure that we are
21652         not trying to operate on a void type - this fixes the reported
21653         bug.
21654
21655         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21656         the parent implementation is sealed.
21657
21658         * ../errors/cs0239.cs : Add.
21659
21660         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21661
21662         * typemanager.cs (unverifiable_code_type): Corresponds to 
21663         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21664         which have unsafe code in them.
21665
21666         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21667         unsafe context.
21668
21669 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21670
21671         * cs-tokenizer.cs: Add support for @"litreal strings"
21672
21673         Make tokenizer accept pre-processor directives
21674         on any column (remove the old C-like limitation). 
21675
21676         * rootcontext.cs (EmitCode): Emit any global attributes.
21677         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21678
21679         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21680
21681         * cs-parser.jay: Add support for global attributes.  
21682
21683 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21684
21685         * expression.cs (Indirection): New helper class.  Unary will
21686         create Indirection classes to be able to implement the
21687         IMemoryLocation interface on it.
21688
21689 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21690
21691         * cs-parser.jay (fixed_statement): reference the right statement.
21692
21693         * statement.cs (Fixed.Emit): Finish implementing the fixed
21694         statement for the &x case.
21695
21696 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * class.cs (Property.Define, Method.Define): Remove newslot when
21699         `implementing'.  
21700
21701         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21702         wrong.  NewSlot should only be used if the `new' keyword is present.
21703
21704         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21705         locating our system dir.  Sorry about this.
21706
21707 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21708
21709         * driver.cs (GetSystemDir): Compute correctly the location of our
21710         system assemblies.  I was using the compiler directory instead of
21711         the library directory.
21712
21713 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21714
21715         * expression.cs (BetterFunction): Put back in what Miguel commented out
21716         since it is the correct fix. The problem is elsewhere ;-)
21717
21718         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21719         parameters of the parms method are themselves compatible or not !
21720
21721         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21722         to check that a class implements an interface before saying that an implicit
21723         conversion was allowed. Use ImplementsInterface to do the checking.
21724
21725 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * class.cs (Method.Define): Track whether we are an explicit
21728         implementation or not.  And only call DefineMethodOverride if we
21729         are an explicit implementation.
21730
21731         (Property.DefineMethod): Ditto.
21732
21733 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21734
21735         * expression.cs (BetterFunction): Catch hideous bug which was
21736          preventing us from detecting ambiguous calls due to implicit casts i.e
21737         cs0121.
21738
21739 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21740
21741         * support.cs (Pair): Remove un-needed method.  I figured why I was
21742         getting the error in cs-parser.jay, the variable in a foreach loop
21743         is readonly, and the compiler does not really treat this as a variable.
21744
21745         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21746         instead of EQUALS in grammar.  
21747
21748         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21749
21750         * expression.cs (Unary.DoResolve): Check whether the argument is
21751         managed or not.
21752
21753 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21754
21755         * support.cs: Api for Pair to set a value.  Despite the fact that
21756         the variables are public the MS C# compiler refuses to compile
21757         code that accesses the field if the variable is part of a foreach
21758         statement. 
21759
21760         * statement.cs (Fixed): Begin implementation of the fixed
21761         statement.
21762
21763         (Block.AddVariable): Return the VariableInfo on success and null
21764         on failure instead of true/false. 
21765
21766         * cs-parser.jay (foreach): Catch errors on variables already
21767         defined (we were ignoring this value before) and properly unwind
21768         the block hierarchy
21769
21770         (fixed_statement): grammar for the fixed statement.
21771
21772 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21773
21774         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21775         pointer types to be incretemented.
21776
21777         (SizeOf): Implement.
21778
21779         * cs-parser.jay (pointer_member_access): Implement
21780         expr->IDENTIFIER production.
21781
21782         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21783         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21784         on safe contexts.
21785
21786         (Unary): Implement indirection.
21787
21788         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21789         use in non-unsafe context).
21790
21791         (SimpleName.DoResolve): Check for pointers in field access on safe
21792         contexts. 
21793
21794         (Expression.LoadFromPtr): Factor the load-indirect code in this
21795         function.  This was duplicated in UnboxCast and ParameterReference
21796
21797 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21798
21799         * expression.cs (ComposedCast): report an error if a pointer cast
21800         is used in a safe region.
21801
21802         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21803         pointer type casts in unsafe context.
21804
21805         * codegen.cs (EmitContext): Set up IsUnsafe.
21806
21807         * cs-parser.jay (non_expression_type): Add productions for pointer
21808         casts. 
21809
21810         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21811         code.  We should not use force into static mode if the method is
21812         not virtual.  Fixes bug in MIS
21813
21814         * statement.cs (Do.Emit, While.Emit, For.Emit,
21815         Statement.EmitBoolExpression): Add support to Do and While to
21816         propagate infinite loop as `I do return' semantics.
21817
21818         Improve the For case to also test for boolean constants.
21819
21820         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21821         to the list of attributes we can add.
21822
21823         Remove `EmitContext' argument.
21824
21825         * class.cs (Method.Define): Apply parameter attributes.
21826         (Constructor.Define): Apply parameter attributes.
21827         (MethodCore.LabelParameters): Move here the core of labeling
21828         parameters. 
21829
21830         * support.cs (ReflectionParameters.ParameterModifier,
21831         InternalParameters.ParameterModifier): Use IsByRef on the type and
21832         only return the OUT bit for these parameters instead of in/out/ref
21833         flags.
21834
21835         This is because I miss-understood things.  The ParameterInfo.IsIn
21836         and IsOut represent whether the parameter has the [In] and [Out]
21837         attributes set.  
21838
21839 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21840
21841         * ecore.cs (FieldExpr.Emit): Release temporaries.
21842
21843         * assign.cs (LocalTemporary.Release): new function.
21844
21845         * codegen.cs (EmitContext.GetTemporaryStorage,
21846         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21847         temporary storage.  Now we can "put back" localbuilders when we
21848         are done with them
21849
21850 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21853         need to make a copy of the variable to generate verifiable code.
21854
21855 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * driver.cs: Compute dynamically the system directory.
21858
21859         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21860         Slower, but more generally useful.  Used by the abstract
21861         registering implementation. 
21862
21863         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21864         the rules for the special rule on Type/instances.  First check if
21865         we have the same name, and if so, try that special static path
21866         rather than the instance path.
21867
21868 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21871         for, while and if.
21872
21873         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21874         Enum, ValueType, Delegate or Array for non-corlib compiles.
21875
21876         * cs-tokenizer.cs: Catch long identifiers (645)
21877
21878         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21879         piece of code.
21880
21881         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21882         fix, we were returning too early, so we were not registering
21883         pending methods from abstract classes.
21884
21885         Do not register pending methods if the class is abstract.
21886
21887         * expression.cs (Conditional.DoResolve): Report circular implicit
21888         conversions when we neecd to compute it for conditional
21889         expressions. 
21890
21891         (Is.DoResolve): If the expression is always of the provided type,
21892         flag warning 183.  If the expression can not ever be of the
21893         provided type flag warning 184.
21894
21895         * class.cs: Catch 169 as well.
21896
21897         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21898         read. 
21899
21900 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21901
21902         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21903
21904 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21905
21906         * interface.cs: (PopulateMethod): Check for pointers being defined
21907         only if the unsafe context is active.
21908         (PopulateProperty): ditto.
21909         (PopulateIndexer): ditto.
21910
21911         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21912         specified.  If pointers are present, make sure that they are
21913         present in an unsafe context.
21914         (Constructor, Constructor.Define): ditto.
21915         (Field, Field.Define): ditto.
21916         (Property, Property.Define): ditto.
21917         (Event, Event.Define): ditto.
21918
21919         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21920         hashtable if there are classes or structs defined.
21921
21922         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21923         code, as the constant resolution moved.
21924
21925         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21926         the metadata, so we can flag error 133. 
21927
21928         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21929         pointer is being declared in an unsafe context.
21930
21931 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21932
21933         * modifiers.cs (Modifiers.Check): Require a Location argument.
21934         Report error 227 for Unsafe use.
21935
21936         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21937
21938         * statement.cs (For.Emit): If the test is null, then report that
21939         we do `return', as we wont reach anything afterwards.
21940
21941         (Switch.SwitchGoverningType): Track the expression that matched
21942         the conversion.
21943
21944         * driver.cs: Allow negative numbers as an error code to flag.
21945
21946         * cs-parser.jay: Handle 1551.
21947
21948         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21949
21950 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * cs-parser.jay: Report 1518 (type declaration can only contain
21953         class, struct, interface, enum or delegate)
21954
21955         (switch_label): Report 1523 (keywords `case' or `default' must
21956         preced code)
21957
21958         (opt_switch_sections): Report 1522 (empty switch)
21959
21960         * driver.cs: Report 1515 (response file specified multiple times)
21961         Report 1516 (Source file specified multiple times).
21962
21963         * expression.cs (Argument.Resolve): Signal 1510
21964
21965         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21966         access not allowed in static code)
21967
21968 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21969
21970         * typemanager.cs (IsPointerType): Utility method which we are going
21971         to need a lot.
21972
21973         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21974         the object type, so we take care of that.
21975
21976         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21977
21978         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21979         added to non-params parameters :-)
21980
21981         * typemanager.cs (CSharpName): Include 'void' type too. 
21982
21983         (void_ptr_type): Include in the set of core types.
21984
21985         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21986         duplicating code.
21987
21988         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21989         an unsafe context.
21990
21991         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21992         completely forgotten about it.
21993
21994 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21995
21996         * cs-parser.jay (pointer_type): Add. This begins our implementation
21997         of parsing rules for unsafe code.
21998
21999         (unsafe_statement): Implement.
22000
22001         (embedded_statement): Modify to include the above.
22002
22003         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22004
22005         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22006         if the current context is an unsafe one.
22007
22008         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22009         are handled differently, we need separate rules for them.
22010
22011         (local_variable_declaration): Update to use local_variable_pointer_type
22012         to allow variable declarations of unmanaged pointer types.
22013
22014         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22015         in unsafe contexts.
22016
22017         * ../errors/cs0214.cs : Add.
22018
22019 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22020
22021         * makefile: remove 'response' file when cleaning.
22022
22023 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22024
22025         * cs-parser.jay: Report 1524.
22026
22027 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * typemanager.cs (RegisterMethod): drop checking if we have
22030         registered this from here
22031
22032 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * class.cs (Method.EmitDestructor): Implement calling our base
22035         destructor. 
22036
22037         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22038         value of InFinally.
22039
22040         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22041         this routine and will wrap the call in a try/catch block.  Deal
22042         with the case.
22043
22044 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22045
22046         * ecore.cs (Expression.MemberLookup): instead of taking a
22047         parameter `same_type' that was used to tell whether we could
22048         access private members we compute our containing type from the
22049         EmitContext.
22050
22051         (FieldExpr): Added partial support for volatile fields.  This does
22052         not work for volatile fields exposed from assemblies, as I can not
22053         figure out how to extract the modreq from it.
22054
22055         Updated all the source files to use this.
22056
22057         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22058         because it is referenced by MemberLookup very often. 
22059
22060 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22061
22062         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22063         TypeBuilder.GetCustomAttributes to retrieve what we need.
22064
22065         Get rid of redundant default_member_attr_type as this is the same as
22066         default_member_type which already exists.
22067
22068         * interface.cs, attribute.cs : Update accordingly.
22069
22070 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22071
22072         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22073         work for TYpeBuilders though.  Ravi, can you please fix this?
22074
22075         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22076
22077         * expression.cs (Argument.Emit): Handle the case of ref objects
22078         being passed to ref functions;  
22079
22080         (ParameterReference.EmitLoad): Loads the content of the pointer
22081         without dereferencing.
22082
22083 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22084
22085         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22086
22087 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22088
22089         * class.cs (Indexer.DefineMethod): Incorporate the interface
22090         type in the name of the method if we are doing explicit interface
22091         implementation.
22092
22093         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22094
22095         (BetterConversion): Fix extremely trivial bug where we were referring to
22096         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22097         again !
22098
22099         * ../errors/bug16.cs : Add although we have fixed it.
22100
22101 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * expression.cs (BaseIndexer): Begin implementation.
22104
22105         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22106
22107         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22108         production directly to remove a shift/reduce, and implement
22109         explicit interface implementation.
22110
22111         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22112         after a floating point suffix.
22113
22114         * expression.cs (DoNumericPromotions): Improved the conversion for
22115         uint/uint.  If we have a constant, we avoid doing a typecast to a
22116         larger type.
22117
22118         * class.cs (Indexer): Implement explicit interface implementation
22119         for indexers.
22120
22121 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22122
22123         * class.cs: make the default instance constructor public and hidebysig.
22124
22125 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22126
22127         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22128         so we can call it from elsewhere.
22129
22130         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22131         we emit it internally if the class has a defined indexer; otherwise the user
22132         emits it by decorating the class definition with the DefaultMemberAttribute.
22133
22134         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22135         attribute is not used on a type which defines an indexer.
22136
22137         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22138         character when we skip whitespace.
22139
22140         * ../errors/cs0646.cs : Add.
22141
22142 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22143
22144         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22145         again. 
22146
22147         * makefile: Add practical target `mcs3.exe' which builds the third
22148         generation compiler. 
22149
22150         * expression.cs (New): Fix structures constructor calling.
22151
22152         * class.cs (Property, Method, Indexer): Emit Final flag on the
22153         method if we are an interface implementation and we are not
22154         abstract. 
22155
22156         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22157         whether this property is referencing a `base' method.
22158
22159         * expression.cs (Invocation.EmitCall): take an extra argument:
22160         is_base, this is used to determine whether the `call' or
22161         `callvirt' opcode should be used.
22162
22163
22164         * delegate.cs: update EmitCall.
22165
22166         * class.cs (Method.Define): Set NewSlot for the cases where we are
22167         not implementing an interface method.
22168
22169         (Property.Define): ditto.
22170
22171 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22172
22173         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22174         'r'.  Allows mcs to parse itself fully.
22175
22176 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22177
22178         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22179         of the number of initializers that require the InitializeArray method.
22180
22181         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22182         update the above field where necessary.
22183
22184         (MakeByteBlob): Update accordingly.
22185
22186         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22187         greater than 2.
22188
22189         (EmitDynamicInitializers): Update in accordance with the new optimization.
22190
22191         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22192         same OpCode applies.
22193
22194         * cs-parser.jay : Fix some glaring errors I introduced.
22195
22196 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22197
22198         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22199         so that we can check for name clashes there too.
22200
22201         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22202         for interface indexers.
22203
22204         * interfaces.cs (Define): Emit the default member attribute.
22205
22206         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22207         variable was being referred to while setting the value ;-)
22208
22209 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22210
22211         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22212         byte-by-byte information when we know the data is zero.
22213
22214         Make the block always a multiple of 4, because
22215         DefineInitializedData has a bug.
22216
22217         * assign.cs: Fix, we should assign from the temporary, not from
22218         the source. 
22219
22220         * expression.cs (MakeByteBlob): Fix my incorrect code.
22221
22222 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22223
22224         * typemanager.cs (EnumToUnderlying): This function is used to get
22225         the underlying type from an enumeration, because it does not
22226         always work. 
22227
22228         * constant.cs: Use the I4_S form for values between -128 and 127.
22229
22230         * statement.cs (Block.LookupLabel): Looks up a label.
22231         (Block): Drop support for labeled blocks.
22232
22233         (LabeledStatement): New kind of statement that represents a label
22234         only.
22235
22236         (Goto): Finally implement this bad boy.
22237
22238         * cs-parser.jay: Update to reflect new mechanism to implement
22239         labels.
22240
22241 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22242
22243         * codegen.cs (EmitContext.This): a codegen property that keeps the
22244         a single instance of this instead of creating many different this
22245         instances. 
22246
22247         * delegate.cs (Delegate.DoResolve): Update to use the property;
22248
22249         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22250
22251         * expression.cs (BaseAccess.DoResolve): Ditto.
22252
22253 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22254
22255         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22256         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22257
22258         (InitCoreTypes): Update accordingly.
22259
22260         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22261         so we can quickly store the state.
22262
22263         (ApplyAttributes): Set the correct implementation flags
22264         for InternalCall methods.
22265
22266 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22267
22268         * expression.cs (EmitCall): if a method is not virtual, then do
22269         not use callvirt on it.
22270
22271         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22272         user defined stuff) requires the use of stobj, which takes an
22273         address on the stack instead of an array and an index.  So emit
22274         the Ldelema operation for it.
22275
22276         (EmitStoreOpcode): Use stobj for valuetypes.
22277
22278         (UnaryMutator.EmitCode): Use the right 1 value depending on
22279         whether we are dealing with int64/uint64, float or doubles.
22280
22281         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22282         constructors that I implemented last night.
22283
22284         (Constructor.IsDefault): Fix to work properly for static
22285         constructors.
22286
22287         * cs-parser.jay (CheckDef): report method signature errors.
22288         Update error number 103 to be 132.
22289
22290         * decl.cs: New AdditionResult enumeration value: MethodExists.
22291         Although we do this check for methods later on in the semantic
22292         analysis, catching repeated default constructors is so easy that
22293         we catch these here. 
22294
22295         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22296         promotions code.
22297
22298         (ParameterReference.EmitAssign, Emit): handle
22299         bools as bytes.
22300
22301         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22302         (ArrayAccess.EmitStoreOpcode): ditto.
22303
22304         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22305
22306         * expression.cs (MakeByteBlob): Complete all the missing types
22307         (uint, short, ushort, byte, sbyte)
22308
22309         * class.cs: Only init instance field initializers on instance
22310         constructors. 
22311
22312         Rename `constructors' to instance_constructors. 
22313
22314         (TypeContainer.AddConstructor): Only add constructors to the list
22315         if it is not static.
22316
22317         Make sure that we handle default_static_constructor independently
22318         everywhere where we handle instance_constructors
22319
22320 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22321
22322         * class.cs: Do not lookup or create a base initializer for a
22323         static constructor.
22324
22325         (ConstructorInitializer.Resolve): use the proper type to lookup
22326         for constructors.
22327
22328         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22329
22330         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22331         in DeclSpace. 
22332
22333         * decl.cs: CloseType is now an virtual method, the default
22334         implementation just closes this type.
22335
22336 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22337
22338         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22339         to PreserveSig by default. Also emit HideBySig on such methods.
22340
22341         Basically, set the defaults to standard values.
22342
22343         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22344         argument, if candidate is better, it can't be worse than the best !
22345
22346         (Invocation): Re-write bits to differentiate between methods being
22347         applicable in their expanded form and their normal form - for params
22348         methods of course.
22349
22350         Get rid of use_standard everywhere as only standard conversions are allowed
22351         in overload resolution. 
22352
22353         More spec conformance.
22354
22355 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22356
22357         * driver.cs: Add --timestamp, to see where the compiler spends
22358         most of its time.
22359
22360         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22361         `this' in static code.
22362
22363         (SimpleName.DoResolve): Implement in terms of a helper function
22364         that allows static-references to be passed upstream to
22365         MemberAccess.
22366
22367         (Expression.ResolveWithSimpleName): Resolve specially simple
22368         names when called by MemberAccess to implement the special
22369         semantics. 
22370
22371         (Expression.ImplicitReferenceConversion): Handle conversions from
22372         Null to reference types before others, as Null's type is
22373         System.Object. 
22374
22375         * expression.cs (Invocation.EmitCall): Handle the special case of
22376         calling methods declared on a reference type from a ValueType
22377         (Base classes System.Object and System.Enum)
22378
22379         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22380         the left hand side is a TypeExpr, not on every enumeration. 
22381
22382         (Binary.Resolve): If types are reference types, then do a cast to
22383         object on operators != and == of both arguments.
22384
22385         * typemanager.cs (FindMembers): Extract instance and static
22386         members if requested.
22387
22388         * interface.cs (PopulateProperty): Use void_type instead of null
22389         as the return type for the setter method.
22390
22391         (PopulateIndexer): ditto.
22392
22393 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22394
22395         * support.cs (ReflectionParameters): Fix minor bug where we
22396         were examining the wrong parameter for the ParamArray attribute.
22397
22398         Cope with requests for the type of the parameter at position
22399         greater than the params parameter's. We now return the element
22400         type of the params array as that makes more sense.
22401
22402         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22403         accordingly as we no longer have to extract the element type
22404         ourselves.
22405
22406         (Invocation.OverloadResolve): Update.
22407
22408 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22409
22410         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22411         against IEnumerator, test whether the return value is a descendant
22412         of the IEnumerator interface.
22413
22414         * class.cs (Indexer.Define): Use an auxiliary method to implement
22415         the other bits of the method definition.  Begin support for
22416         explicit interface implementation.
22417
22418         (Property.DefineMethod): Use TypeManager.void_type instead of null
22419         for an empty return value.
22420
22421 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22422
22423         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22424         dealing with a FieldExpr which is composed of a FieldBuilder, in
22425         the code path we did extract the constant, but we should have
22426         obtained the underlying value to be able to cast it (otherwise we
22427         end up in an infinite loop, this is what Ravi was running into).
22428
22429         (ArrayCreation.UpdateIndices): Arrays might be empty.
22430
22431         (MemberAccess.ResolveMemberAccess): Add support for section
22432         14.5.4.1 that deals with the special case of E.I when E is a type
22433         and something else, that I can be a reference to a static member.
22434
22435         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22436         handle a particular array type to create byte blobs, it is just
22437         something we dont generate byteblobs for.
22438
22439         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22440         arguments. 
22441
22442         * location.cs (Push): remove the key from the hashtable that we
22443         are about to add.   This happens for empty files.
22444
22445         * driver.cs: Dispose files after we have parsed them.
22446
22447         (tokenize): new function that only runs the tokenizer on its
22448         input, for speed testing.
22449
22450 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22451
22452         * class.cs (Event.Define): Define the private field only if there
22453         are no accessors defined.
22454
22455         * expression.cs (ResolveMemberAccess): If there is no associated
22456         field with the event, that means we have an event defined with its
22457         own accessors and we should flag error cs0070 since transforming
22458         ourselves into a field is not valid in that case.
22459
22460         * ecore.cs (SimpleName.DoResolve): Same as above.
22461
22462         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22463         and charset to sane values.
22464
22465 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22466
22467         * assign.cs (DoResolve): Perform check on events only if they 
22468         are being accessed outside the declaring type.
22469
22470         * cs-parser.jay (event_declarations): Update rules to correctly
22471         set the type of the implicit parameter etc.
22472
22473         (add_accessor, remove_accessor): Set current local parameters.
22474
22475         * expression.cs (Binary): For delegate addition and subtraction,
22476         cast the return value from the method into the appropriate delegate
22477         type.
22478
22479 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22480
22481         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22482         of these as the workaround is unnecessary.
22483
22484         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22485         delegate data - none of that is needed at all.
22486
22487         Re-write bits to extract the instance expression and the delegate method
22488         correctly.
22489
22490         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22491         on delegates too.
22492
22493         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22494         of attaching attributes instead of duplicating code everywhere.
22495
22496         * everywhere : Update code to do attribute emission using the above method.
22497
22498 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22499
22500         * expression.cs (IsParamsMethodApplicable): if there are not
22501         parameters, return immediately.
22502
22503         * ecore.cs: The 0 literal can be implicity converted to an enum
22504         type. 
22505
22506         (SimpleName.DoResolve): First lookup the type, then lookup the
22507         members. 
22508
22509         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22510         want to get its address.  If the InstanceExpression is not
22511         addressable, store the result in a temporary variable, then get
22512         the address of it.
22513
22514         * codegen.cs: Only display 219 errors on warning level or above. 
22515
22516         * expression.cs (ArrayAccess): Make it implement the
22517         IMemoryLocation interface.
22518
22519         (Binary.DoResolve): handle the operator == (object a, object b)
22520         and operator != (object a, object b) without incurring into a
22521         BoxedCast (because 5 != o should never be performed).
22522
22523         Handle binary enumerator operators.
22524
22525         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22526         value type, otherwise use Ldelem_ref.
22527
22528         Use precomputed names;
22529
22530         (AddressOf): Implement address of
22531
22532         * cs-parser.jay (labeled_statement): Fix recursive block
22533         addition by reworking the production.
22534
22535         * expression.cs (New.DoEmit): New has a special case:
22536                 
22537                  If we are dealing with a ValueType, we have a few
22538                  situations to deal with:
22539                 
22540                     * The target of New is a ValueType variable, that is
22541                       easy, we just pass this as the variable reference
22542                 
22543                     * The target of New is being passed as an argument,
22544                       to a boxing operation or a function that takes a
22545                       ValueType.
22546                 
22547                       In this case, we need to create a temporary variable
22548                       that is the argument of New.
22549
22550
22551 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22552
22553         * rootcontext.cs (LookupType): Check that current_type is not null before
22554         going about looking at nested types.
22555
22556         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22557         not implement the IAssignMethod interface any more.
22558
22559         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22560         where we tranform them into FieldExprs if they are being resolved from within
22561         the declaring type.
22562
22563         * ecore.cs (SimpleName.DoResolve): Do the same here.
22564
22565         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22566
22567         * ../errors/bug10.cs : Add.
22568
22569         * ../errors/cs0070.cs : Add.
22570
22571         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22572
22573         * assign.cs : Get rid of EventIsLocal everywhere.
22574
22575 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22576
22577         * ecore.cs (ConvertIntLiteral): finished the implementation.
22578
22579         * statement.cs (SwitchLabel): Convert the value we are using as a
22580         key before looking up the table.
22581
22582 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22583
22584         * codegen.cs (EmitTopBlock): Require a Location argument now.
22585
22586         * cs-parser.jay (constructor_declarator): We need to setup
22587         current_local_parameters before we parse the
22588         opt_constructor_initializer, to allow the variables to be bound
22589         to the constructor arguments.
22590
22591         * rootcontext.cs (LookupType): First lookup nested classes in our
22592         class and our parents before we go looking outside our class.
22593
22594         * expression.cs (ConstantFold): Extract/debox the values at the
22595         beginnning. 
22596
22597         * rootcontext.cs (EmitCode): Resolve the constants first before we
22598         resolve the types.  This is not really needed, but it helps debugging.
22599
22600         * statement.cs: report location.
22601
22602         * cs-parser.jay: pass location to throw statement.
22603
22604         * driver.cs: Small bug fix.
22605
22606         * report.cs: Updated format to be 4-zero filled digits.
22607
22608 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22609
22610         * expression.cs (CheckIndices): Fix minor bug where the wrong
22611         variable was being referred to ;-)
22612
22613         (DoEmit): Do not call EmitStaticInitializers when the 
22614         underlying type is System.Object.
22615
22616 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22617
22618         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22619         and do the usual workaround for SRE.
22620
22621         * class.cs (MyEventBuilder.EventType): New member to get at the type
22622         of the event, quickly.
22623
22624         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22625
22626         * assign.cs (Assign.DoResolve): Handle the case when the target
22627         is an EventExpr and perform the necessary checks.
22628
22629         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22630         interface.
22631
22632         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22633
22634         (EventExpr): Set the type in the constructor itself since we 
22635         are meant to be born fully resolved.
22636
22637         (EventExpr.Define): Revert code I wrote earlier.
22638                 
22639         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22640         instance expression is null. The instance expression is a This in that case
22641         or a null, depending on whether it is a static method or not.
22642
22643         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22644         refers to more than one method.
22645
22646         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22647         and accordingly flag errors.
22648
22649 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22652
22653 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22654
22655         * location.cs (ToString): Provide useful rutine.
22656
22657 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22658
22659         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22660         objects, return the actual integral boxed.
22661
22662         * statement.cs (SwitchLabel): define an ILLabel for each
22663         SwitchLabel. 
22664
22665         (Switch.CheckSwitch): If the value is a Literal, extract
22666         the underlying literal.
22667
22668         Also in the unused hashtable we had, add the SwitchLabel so we can
22669         quickly look this value up.
22670
22671         * constant.cs: Implement a bunch of new constants.  Rewrite
22672         Literal based on this.  Made changes everywhere to adapt to this.
22673
22674         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22675         dereferencing array only once, and also copes with enumrations.
22676
22677         bytes are two bytes wide, not one.
22678
22679         (Cast): Perform constant conversions.
22680
22681         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22682         wrappers to the literals here.
22683
22684         * expression.cs (DoNumericPromotions): long literals can converted
22685         to ulong implicity (this is taken care of elsewhere, but I was
22686         missing this spot).
22687
22688         * ecore.cs (Expression.Literalize): Make the return type Literal,
22689         to improve type checking.
22690
22691         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22692
22693 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22694
22695         * literal.cs: Revert code from ravi that checked the bounds.  The
22696         bounds are sane by the definition of the type itself. 
22697
22698         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22699         need to actually look up in our parent hierarchy for interfaces
22700         implemented. 
22701
22702         * const.cs: Use the underlying type for enumerations
22703
22704         * delegate.cs: Compute the basename for the delegate creation,
22705         that should fix the delegate test case, and restore the correct
22706         Type Lookup semantics in rootcontext
22707
22708         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22709         referencing a nested type with the Reflection API is using the "+"
22710         sign. 
22711
22712         * cs-parser.jay: Do not require EOF token at the end.
22713
22714 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22715
22716         * rootcontext.cs (LookupType): Concatenate type names with
22717         a '.' instead of a '+' The test suite passes again.
22718
22719         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22720         field of the enumeration.
22721
22722         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22723         the case when the member is an EventExpr.
22724
22725         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22726         static has an associated instance expression.
22727
22728         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22729
22730         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22731
22732         * class.cs (Event.Define): Register event and perform appropriate checks
22733         for error #111.
22734
22735         We define the Add and Remove methods even if the use provides none because
22736         in that case, we provide default implementations ourselves.
22737
22738         Define a private field of the type of the event. This is done by the CSC compiler
22739         and we should be doing it too ;-)
22740
22741         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22742         More methods we use in code we generate.
22743
22744         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22745         is important.
22746
22747         (InitCoreTypes): Update accordingly for the above.
22748
22749         * class.cs (Event.Emit): Generate code for default accessors that we provide
22750
22751         (EmitDefaultMethod): Do the job in the above.
22752
22753         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22754         appropriate place.
22755
22756 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22759         builders even if we were missing one.
22760
22761         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22762         pass the Basename as our class name instead of the Name.  The
22763         basename will be correctly composed for us.
22764
22765         * parameter.cs (Paramters): Now takes a Location argument.
22766
22767         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22768         make all the code call directly LookupType in RootContext and take
22769         this chance to pass the Location information everywhere.
22770
22771         * Everywhere: pass Location information.
22772
22773 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22774
22775         * class.cs (Constructor.Define): Updated way of detecting the
22776         length of the parameters.
22777
22778         (TypeContainer.DefineType): Use basename as the type name for
22779         nested types.
22780
22781         (TypeContainer.Define): Do not recursively define types here, as
22782         definition is taken care in order by the RootContext.
22783
22784         * tree.cs: Keep track of namespaces in a per-file basis.
22785
22786         * parameter.cs (Parameter.ComputeSignature): Update to use
22787         DeclSpace. 
22788
22789         (Parameters.GetSignature): ditto.
22790
22791         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22792         instead of a TypeContainer.
22793
22794         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22795         resolve names.  Because we need to be resolve in our context, not
22796         our parents.
22797
22798         * driver.cs: Implement response files.
22799
22800         * class.cs (TypeContainer.DefineType): If we are defined, do not
22801         redefine ourselves.
22802
22803         (Event.Emit): Emit the code for add/remove handlers.
22804         (Event.Define): Save the MethodBuilders for add/remove.
22805
22806         * typemanager.cs: Use pair here too.
22807
22808         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22809         DictionaryEntry requires the first argument to be non-null.  
22810
22811         (enum_declaration): Compute full name for registering the
22812         enumeration.
22813
22814         (delegate_declaration): Instead of using
22815         formal_parameter_list, use opt_formal_parameter_list as the list
22816         can be empty.
22817
22818         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22819         (EventParsing): New property that controls whether `add' and
22820         `remove' are returned as tokens or identifiers (for events);
22821
22822 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22823
22824         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22825         use MyEventBuilder only and let it wrap the real builder for us.
22826
22827         (MyEventBuilder): Revamp constructor etc.
22828
22829         Implement all operations that we perform on EventBuilder in precisely the same
22830         way here too.
22831
22832         (FindMembers): Update to use the EventBuilder member.
22833
22834         (Event.Emit): Update accordingly.
22835
22836 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22837
22838         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22839         by calling the appropriate methods.
22840
22841         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22842         useful.
22843
22844         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22845
22846 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22847
22848         * delegate.cs (Delegate.Populate): Check that the return type
22849         and various parameters types are indeed accessible.
22850
22851         * class.cs (Constructor.Define): Same here.
22852
22853         (Field.Define): Ditto.
22854
22855         (Event.Define): Ditto.
22856
22857         (Operator.Define): Check that the underlying Method defined itself
22858         correctly - so it's MethodBuilder should not be null.
22859
22860         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22861         expression happens to be null.
22862
22863         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22864         members but as of now we don't seem to be able to do anything really useful with it.
22865
22866         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22867         not the EventBuilder.
22868
22869 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22870
22871         * cs-tokenizer.cs: Add support for defines.
22872         Add support for #if, #elif, #else, #endif
22873
22874         (eval_var): evaluates a variable.
22875         (eval): stubbed for evaluating functions.
22876
22877         * cs-parser.jay: Pass the defines information
22878
22879         * driver.cs: Add --define command line option.
22880
22881         * decl.cs: Move MemberCore here.
22882
22883         Make it the base class for DeclSpace.  This allows us to catch and
22884         report 108 and 109 for everything now.
22885
22886         * class.cs (TypeContainer.Define): Extract all the members
22887         before populating and emit the warning 108 (new keyword required
22888         to override) instead of having each member implement this.
22889
22890         (MemberCore.Define): New abstract method, we will be using this in
22891         the warning reporting engine in Populate.
22892
22893         (Operator.Define): Adjust to new MemberCore protocol. 
22894
22895         * const.cs (Const): This does not derive from Expression, it is a
22896         temporary object we use to create fields, it is a MemberCore. 
22897
22898         * class.cs (Method.Define): Allow the entry point to be in a
22899         specific class.
22900
22901         * driver.cs: Rewrite the argument handler to clean it up a bit.
22902
22903         * rootcontext.cs: Made it just an auxiliary namespace feature by
22904         making everything static.
22905
22906         * driver.cs: Adapt code to use RootContext type name instead of
22907         instance variable.
22908
22909         * delegate.cs: Remove RootContext argument.
22910
22911         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22912         argument. 
22913
22914         * class.cs (Event.Define): The lookup can fail.
22915
22916         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22917
22918         * expression.cs: Resolve the this instance before invoking the code.
22919
22920 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22921
22922         * cs-parser.jay: Add a production in element_access that allows
22923         the thing to become a "type" reference.  This way we can parse
22924         things like "(string [])" as a type.
22925
22926         Note that this still does not handle the more complex rules of
22927         casts. 
22928
22929
22930         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22931
22932         * ecore.cs: (CopyNewMethods): new utility function used to
22933         assemble the list of methods from running FindMembers.
22934
22935         (MemberLookup): Rework FindMembers so that 
22936
22937 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22938
22939         * class.cs (TypeContainer): Remove Delegates who fail to be
22940         defined.
22941
22942         * delegate.cs (Populate): Verify that we dont get null return
22943         values.   TODO: Check for AsAccessible.
22944
22945         * cs-parser.jay: Use basename to emit error 574 (destructor should
22946         have the same name as container class), not the full name.
22947
22948         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22949         possible representation.  
22950
22951         Also implements integer type suffixes U and L.
22952
22953 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * expression.cs (ArrayCreation.DoResolve): We need to do the
22956         argument resolution *always*.
22957
22958         * decl.cs: Make this hold the namespace.  Hold the root context as
22959         well.
22960         (LookupType): Move here.
22961
22962         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22963
22964         * location.cs (Row, Name): Fixed the code, it was always returning
22965         references to the first file.
22966
22967         * interface.cs: Register properties defined through interfaces.
22968
22969         * driver.cs: Add support for globbing on the command line
22970
22971         * class.cs (Field): Make it derive from MemberCore as well.
22972         (Event): ditto.
22973
22974 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22975
22976         * class.cs (Event::Define): Check that the type of the event is a delegate
22977         type else flag error #66.
22978
22979         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22980         same.
22981
22982         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22983         values of EntryPoint, CharSet etc etc.
22984
22985         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22986
22987         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22988         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22989         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22990         which needs this to do its work.
22991
22992         * ../errors/cs0066.cs : Add.
22993
22994 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22997         helper functions.
22998
22999         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23000         clears out the parameters field.
23001         (MemberSignatureCompare): Cleanup
23002
23003         (MemberCore): New base class used to share code between MethodCore
23004         and Property.
23005
23006         (RegisterRequiredImplementations) BindingFlags.Public requires
23007         either BindingFlags.Instace or Static.  Use instance here.
23008
23009         (Property): Refactored code to cope better with the full spec.
23010
23011         * parameter.cs (GetParameterInfo): Return an empty array instead
23012         of null on error.
23013
23014         * class.cs (Property): Abstract or extern properties have no bodies.
23015
23016         * parameter.cs (GetParameterInfo): return a zero-sized array.
23017
23018         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23019         method modifier validation to the typecontainer so we can reuse
23020         this on properties.
23021
23022         (MethodCore.ParameterTypes): return an empty sized array of types.
23023
23024         (Property.Define): Test property modifier validity.
23025
23026         Add tests for sealed/override too.
23027
23028         (Method.Emit): abstract or extern methods have no bodies.
23029
23030 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23031
23032         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23033         thing.
23034
23035         (Method::Define, ::Emit): Modify accordingly.
23036
23037         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23038
23039         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23040
23041         * makefile: Pass in /unsafe.
23042
23043 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23044
23045         * class.cs (MakeKey): Kill routine.
23046
23047         * class.cs (TypeContainer.Define): Correctly define explicit
23048         method implementations (they require the full interface name plus
23049         the method name).
23050
23051         * typemanager.cs: Deply the PtrHashtable here and stop using the
23052         lame keys.  Things work so much better.
23053
23054         This of course broke everyone who depended on `RegisterMethod' to
23055         do the `test for existance' test.  This has to be done elsewhere.
23056
23057         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23058         the object stupid Equals method (because, that like fails all over
23059         the place).  We still do not use it.
23060
23061         * class.cs (TypeContainer.SetRequiredInterface,
23062         TypeContainer.RequireMethods): Killed these two routines and moved
23063         all the functionality to RegisterRequiredImplementations.
23064
23065         (TypeContainer.RegisterRequiredImplementations): This routine now
23066         registers all the implementations required in an array for the
23067         interfaces and abstract methods.  We use an array of structures
23068         which can be computed ahead of time to reduce memory usage and we
23069         also assume that lookups are cheap as most classes will not
23070         implement too many interfaces.
23071
23072         We also avoid creating too many MethodSignatures.
23073
23074         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23075         clear the "pending" bit if we find that there are problems with
23076         the declaration.
23077
23078         (TypeContainer.VerifyPendingMethods): Update to report errors of
23079         methods that look like implementations but are not.
23080
23081         (TypeContainer.Define): Add support for explicit interface method
23082         implementation. 
23083
23084 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23085
23086         * typemanager.cs: Keep track of the parameters here instead of
23087         being a feature of the TypeContainer.
23088
23089         * class.cs: Drop the registration of parameters here, as
23090         InterfaceMethods are also interface declarations.
23091
23092         * delegate.cs: Register methods with the TypeManager not only with
23093         the TypeContainer.  This code was buggy.
23094
23095         * interface.cs: Full registation here.
23096
23097 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23098
23099         * expression.cs: Remove reducer for binary expressions, it can not
23100         be done this way.
23101
23102         * const.cs: Put here the code that used to go into constant.cs
23103
23104         * constant.cs: Put here the code for constants, this is a new base
23105         class for Literals.
23106
23107         * literal.cs: Make Literal derive from Constant.
23108
23109 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23110
23111         * statement.cs (Return.Emit): Report error 157 if the user
23112         attempts to return from a finally block.
23113
23114         (Return.Emit): Instead of emitting a return, jump to the end of
23115         the function.
23116
23117         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23118         LocalBuilder to store the result of the function.  ReturnLabel is
23119         the target where we jump.
23120
23121
23122 2001-12-09  Radek Doulik  <rodo@ximian.com>
23123
23124         * cs-parser.jay: remember alias in current namespace
23125
23126         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23127         namespaces
23128
23129         * class.cs (LookupAlias): lookup alias in my_namespace
23130
23131         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23132         aliases hashtable
23133         (LookupAlias): lookup alias in this and if needed in parent
23134         namespaces
23135
23136 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * support.cs: 
23139
23140         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23141         making things static.  I need this to avoid passing the
23142         TypeContainer when calling ParameterType.
23143
23144         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23145         that did string manipulation to compute the type and then call
23146         GetType.  Use Parameter.ParameterType instead.
23147
23148         * cs-tokenizer.cs: Consume the suffix for floating values.
23149
23150         * expression.cs (ParameterReference): figure out whether this is a
23151         reference parameter or not.  Kill an extra variable by computing
23152         the arg_idx during emission.
23153
23154         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23155         function that returns whether a parameter is an out/ref value or not.
23156
23157         (Parameter.ParameterType): The type of the parameter (base,
23158         without ref/out applied).
23159
23160         (Parameter.Resolve): Perform resolution here.
23161         (Parameter.ExternalType): The full type (with ref/out applied).
23162
23163         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23164         support for expressions on the using statement.
23165
23166 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * statement.cs (Using.EmitLocalVariableDecls): Split the
23169         localvariable handling of the using statement.
23170
23171         (Block.EmitMeta): Keep track of variable count across blocks.  We
23172         were reusing slots on separate branches of blocks.
23173
23174         (Try.Emit): Emit the general code block, we were not emitting it. 
23175
23176         Check the type of the declaration to be an IDisposable or
23177         something that can be implicity converted to it. 
23178
23179         Emit conversions if required.
23180
23181         * ecore.cs (EmptyExpression): New utility class.
23182         (Expression.ImplicitConversionExists): New utility function.
23183
23184 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23185
23186         * statement.cs (Using): Implement.
23187
23188         * expression.cs (LocalVariableReference): Support read only variables.
23189
23190         * statement.cs: Remove the explicit emit for the Leave opcode.
23191         (VariableInfo): Add a readonly field.
23192
23193 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23194
23195         * ecore.cs (ConvCast): new class used to encapsulate the various
23196         explicit integer conversions that works in both checked and
23197         unchecked contexts.
23198
23199         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23200         properly generate the overflow opcodes.
23201
23202 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23203
23204         * statement.cs: The correct type for the EmptyExpression is the
23205         element_type, not the variable type.  Ravi pointed this out.
23206
23207 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23208
23209         * class.cs (Method::Define): Handle PInvoke methods specially
23210         by using DefinePInvokeMethod instead of the usual one.
23211
23212         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23213         above to do the task of extracting information and defining the method.
23214
23215 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23216
23217         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23218         of the condition for string type.
23219
23220         (Emit): Move that here. 
23221
23222         (ArrayCreation::CheckIndices): Keep string literals in their expression
23223         form.
23224
23225         (EmitDynamicInitializers): Handle strings appropriately.
23226
23227 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23228
23229         * codegen.cs (EmitContext): Replace multiple variables with a
23230         single pointer to the current Switch statement.
23231
23232         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23233         EmitContext.
23234
23235 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23236
23237         * statement.cs 
23238
23239         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23240         default'.
23241
23242         (Foreach.Emit): Foreach on arrays was not setting
23243         up the loop variables (for break/continue).
23244
23245         (GotoCase): Semi-implented.
23246
23247 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23248
23249         * attribute.cs (CheckAttribute): Handle system attributes by using
23250         Attribute.GetAttributes to examine information we need.
23251
23252         (GetValidPlaces): Same here.
23253
23254         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23255
23256         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23257
23258         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23259
23260         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23261
23262         (Method::Emit): Handle the case when we are a PInvoke method.
23263
23264 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * expression.cs: Use ResolveWithSimpleName on compound names.
23267
23268 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23269
23270         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23271         before trying to reduce it.
23272
23273         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23274
23275         * constant.cs (LookupConstantValue): Implement.
23276
23277         (EmitConstant): Use the above in emitting the constant.
23278
23279         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23280         that are user-defined by doing a LookupConstantValue on them.
23281
23282         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23283         too, like above.
23284
23285 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23286
23287         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23288
23289         (BaseAccess.DoResolve): Implement.
23290
23291         (MemberAccess.DoResolve): Split this routine into a
23292         ResolveMemberAccess routine that can be used independently
23293
23294 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23295
23296         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23297         As that share bits of the implementation.  Is returns a boolean,
23298         while As returns the Type that is being probed.
23299
23300 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23301
23302         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23303         instead of a Literal - much easier.
23304
23305         (EnumInTransit): Remove - utterly useless :-)
23306
23307         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23308
23309         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23310
23311         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23312         chain when we have no associated expression.
23313
23314 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23315
23316         * constant.cs (Define): Use Location while reporting the errror.
23317
23318         Also emit a warning when 'new' is used and there is no inherited
23319         member to hide.
23320
23321         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23322         populated.
23323
23324         (LookupEnumValue): Implement to lookup an enum member's value and define it
23325         if necessary.
23326
23327         (Populate): Re-write accordingly to use the above routine.
23328
23329 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23330
23331         * expression.cs (This): Fix prototype for DoResolveLValue to
23332         override the base class DoResolveLValue.
23333
23334         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23335         declarations) 
23336
23337         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23338         (we need to load the address of the field here).  This fixes
23339         test-22. 
23340
23341         (FieldExpr.DoResolveLValue): Call the DoResolve
23342         function to initialize the Instance expression.
23343
23344         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23345         correctly the GetEnumerator operation on a value type.
23346
23347         * cs-parser.jay: Add more simple parsing error catches.
23348
23349         * statement.cs (Switch): Add support for string switches.
23350         Handle null specially.
23351
23352         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23353
23354 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23355
23356         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23357
23358         (declare_local_constant): New helper function.
23359
23360         * statement.cs (AddConstant): Keep a separate record of constants
23361
23362         (IsConstant): Implement to determine if a variable is a constant.
23363
23364         (GetConstantExpression): Implement.
23365
23366         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23367
23368         * statement.cs (IsVariableDefined): Re-write.
23369
23370 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23371
23372         * class.cs (TypeContainer::FindMembers): Look for constants
23373         in the case when we are looking for MemberTypes.Field
23374
23375         * expression.cs (MemberAccess::DoResolve): Check that in the
23376         case we are a FieldExpr and a Literal, we are not being accessed
23377         by an instance reference.
23378
23379         * cs-parser.jay (local_constant_declaration): Implement.
23380
23381         (declaration_statement): Implement for constant declarations.
23382
23383 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23384
23385         * statement.cs (Switch): Catch double defaults.
23386
23387         (Switch): More work on the switch() statement
23388         implementation.  It works for integral values now, need to finish
23389         string support.
23390
23391
23392 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23393
23394         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23395         integer literals into other integer literals.  To be used by
23396         switch. 
23397
23398 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23399
23400         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23401         some memory.
23402
23403         (EmitDynamicInitializers): Cope with the above since we extract data
23404         directly from ArrayData now.
23405
23406         (ExpectInitializers): Keep track of whether initializers are mandatory
23407         or not.
23408
23409         (Bounds): Make it a hashtable to prevent the same dimension being 
23410         recorded for every element in that dimension.
23411
23412         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23413         from being found.
23414
23415         Also fix bug which was causing the indices to be emitted in the reverse
23416         order.
23417
23418 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23419
23420         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23421         unfinished.  They do not work, because the underlying code is
23422         sloppy.
23423
23424 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23425
23426         * cs-parser.jay: Remove bogus fixme.
23427
23428         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23429         on Switch statement.
23430
23431 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23432
23433         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23434         the same. 
23435
23436         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23437         parameter. Apparently, any expression is allowed. 
23438
23439         (ValidateInitializers): Update accordingly.
23440
23441         (CheckIndices): Fix some tricky bugs thanks to recursion.
23442
23443         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23444         I was being completely brain-dead.
23445
23446         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23447         and re-write acordingly.
23448
23449         (DelegateInvocation): Re-write accordingly.
23450
23451         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23452
23453         (MakeByteBlob): Handle types more correctly.
23454
23455         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23456         initialization from expressions but it is incomplete because I am a complete
23457         Dodo :-|
23458
23459 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23460
23461         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23462         on If.  Basically, we have to return `true' (ie, we do return to
23463         our caller) only if both branches of the if return.
23464
23465         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23466         short-circuit operators, handle them as short circuit operators. 
23467
23468         (Cast.DoResolve): Resolve type.
23469         (Cast.Cast): Take an expression as the target type.
23470
23471         * cs-parser.jay (cast_expression): Remove old hack that only
23472         allowed a limited set of types to be handled.  Now we take a
23473         unary_expression and we resolve to a type during semantic
23474         analysis.
23475
23476         Use the grammar productions from Rhys to handle casts (this is
23477         not complete like Rhys syntax yet, we fail to handle that corner
23478         case that C# has regarding (-x), but we will get there.
23479
23480 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23481
23482         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23483         field which is an array type.
23484
23485         * cs-parser.jay (declare_local_variables): Support array initialization too.
23486
23487         * typemanager.cs (MakeKey): Implement.
23488
23489         (everywhere): Use the above appropriately.
23490
23491         * cs-parser.jay (for_statement): Update for array initialization while
23492         declaring variables.
23493
23494         * ecore.cs : The error message was correct, it's the variable's names that
23495         were misleading ;-) Make the code more readable.
23496
23497         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23498         the correct type etc.
23499
23500         (ConvertExplicit): Handle Enum types by examining the underlying type.
23501
23502 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23503
23504         * parameter.cs (GetCallingConvention): Always return
23505         CallingConventions.Standard for now.
23506
23507 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23508
23509         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23510         and `r' after calling DoNumericPromotions.
23511
23512         * ecore.cs: Fix error message (the types were in the wrong order).
23513
23514         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23515         BindingFlags.Instance as well 
23516
23517         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23518         implicit int literal conversion in an empty cast so that we
23519         propagate the right type upstream.
23520
23521         (UnboxCast): new class used to unbox value types.
23522         (Expression.ConvertExplicit): Add explicit type conversions done
23523         by unboxing.
23524
23525         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23526         the target type before applying the implicit LongLiterals to ULong
23527         literal cast.
23528
23529 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23530
23531         * cs-parser.jay (for_statement): Reworked the way For works: now
23532         we declare manually any variables that are introduced in
23533         for_initializer to solve the problem of having out-of-band code
23534         emition (that is what got for broken).
23535
23536         (declaration_statement): Perform the actual variable declaration
23537         that used to be done in local_variable_declaration here.
23538
23539         (local_variable_declaration): Do not declare anything, just pass
23540         the information on a DictionaryEntry
23541
23542 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23543
23544         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23545         re-write of the logic to now make it recursive.
23546
23547         (UpdateIndices): Re-write accordingly.
23548
23549         Store element data in a separate ArrayData list in the above methods.
23550
23551         (MakeByteBlob): Implement to dump the array data into a byte array.
23552
23553 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23554
23555         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23556         into CheckIndices.
23557
23558         * constant.cs (Define): Implement.
23559
23560         (EmitConstant): Re-write fully.
23561
23562         Pass in location info.
23563
23564         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23565         respectively.
23566
23567         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23568         DictionaryEntry since we need location info too.
23569
23570         (constant_declaration): Update accordingly.
23571
23572         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23573         code into another method : UpdateIndices.
23574
23575 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23576
23577         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23578         some type checking etc.
23579
23580 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23581
23582         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23583         bits to provide dimension info if the user skips doing that.
23584
23585         Update second constructor to store the rank correctly.
23586
23587 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23588
23589         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23590         and try to implement.
23591
23592         * ../errors/cs0150.cs : Add.
23593
23594         * ../errors/cs0178.cs : Add.
23595
23596 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23597
23598         * statement.cs: Implement foreach on multi-dimensional arrays. 
23599
23600         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23601         name of the params argument.
23602
23603         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23604         initializing the array.
23605
23606         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23607         we can use this elsewhere.
23608
23609         * statement.cs: Finish implementation of foreach for single
23610         dimension arrays.
23611
23612         * cs-parser.jay: Use an out-of-band stack to pass information
23613         around, I wonder why I need this.
23614
23615         foreach_block: Make the new foreach_block the current_block.
23616
23617         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23618         function used to return a static Parameters structure.  Used for
23619         empty parameters, as those are created very frequently.
23620
23621         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23622
23623 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23624
23625         * interface.cs : Default modifier is private, not public. The
23626         make verify test passes again.
23627
23628 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23629
23630         * support.cs (ReflectionParameters): Fix logic to determine
23631         whether the last parameter is a params one. Test 9 passes again.
23632
23633         * delegate.cs (Populate): Register the builders we define with
23634         RegisterParameterForBuilder. Test 19 passes again.
23635
23636         * cs-parser.jay (property_declaration): Reference $6 instead
23637         of $$ to get at the location.
23638
23639         (indexer_declaration): Similar stuff.
23640
23641         (attribute): Ditto.
23642
23643         * class.cs (Property): Register parameters for the Get and Set methods
23644         if they exist. Test 23 passes again.
23645
23646         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23647         call to EmitArguments as we are sure there aren't any params arguments. 
23648         Test 32 passes again.
23649
23650         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23651         IndexOutOfRangeException. 
23652
23653         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23654         Test 33 now passes again.
23655
23656 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23657
23658         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23659         broke a bunch of things.  Will have to come up with a better way
23660         of tracking locations.
23661
23662         * statement.cs: Implemented foreach for single dimension arrays.
23663
23664 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23665
23666         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23667         an error.  This removes the lookup from the critical path.
23668
23669         * cs-parser.jay: Removed use of temporary_loc, which is completely
23670         broken. 
23671
23672 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23673
23674         * support.cs (ReflectionParameters.ParameterModifier): Report
23675         whether the argument is a PARAMS argument or not.
23676
23677         * class.cs: Set the attribute `ParamArrayAttribute' on the
23678         parameter argument.
23679
23680         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23681         and cons_param_array_attribute (ConstructorInfo for
23682         ParamArrayAttribute)., 
23683
23684         * codegen.cs: Emit the return using the `Return' statement, that
23685         way we can report the error correctly for missing return values. 
23686
23687         * class.cs (Method.Emit): Clean up.
23688
23689         * expression.cs (Argument.Resolve): Take another argument: the
23690         location where this argument is used.  Notice that this is not
23691         part of the "Argument" class as to reduce the size of the
23692         structure (we know the approximate location anyways).
23693
23694         Test if the argument is a variable-reference, if not, then
23695         complain with a 206.
23696
23697         (Argument.Emit): Emit addresses of variables.
23698
23699         (Argument.FullDesc): Simplify.
23700
23701         (Invocation.DoResolve): Update for Argument.Resolve.
23702
23703         (ElementAccess.DoResolve): ditto.
23704
23705         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23706         method should be virtual, as this method is always virtual.
23707
23708         (NewDelegate.DoResolve): Update for Argument.Resolve.
23709
23710         * class.cs (ConstructorInitializer.DoResolve): ditto.
23711
23712         * attribute.cs (Attribute.Resolve): ditto.
23713
23714 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23715
23716         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23717
23718         * expression.cs (ParameterReference): Drop IStackStorage and implement
23719         IAssignMethod instead. 
23720
23721         (LocalVariableReference): ditto.
23722
23723         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23724         IAssignMethod instead. 
23725
23726 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23727
23728         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23729         enumerations that are used in heavily used structures derive from
23730         byte in a laughable and pathetic attempt to reduce memory usage.
23731         This is the kind of pre-optimzations that you should not do at
23732         home without adult supervision.
23733
23734         * expression.cs (UnaryMutator): New class, used to handle ++ and
23735         -- separatedly from the other unary operators.  Cleans up the
23736         code, and kills the ExpressionStatement dependency in Unary.
23737
23738         (Unary): Removed `method' and `Arguments' from this class, making
23739         it smaller, and moving it all to SimpleCall, so I can reuse this
23740         code in other locations and avoid creating a lot of transient data
23741         strucutres when not required.
23742
23743         * cs-parser.jay: Adjust for new changes.
23744
23745 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23746
23747         * enum.cs (Enum.Populate): If there is a failure during
23748         definition, return
23749
23750         * cs-parser.jay (opt_enum_base): we used to catch type errors
23751         here, but this is really incorrect.  The type error should be
23752         catched during semantic analysis.
23753
23754 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23755
23756         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23757         current_local_parameters as expected since I, in my stupidity, had forgotten
23758         to do this :-)
23759
23760         * attribute.cs (GetValidPlaces): Fix stupid bug.
23761
23762         * class.cs (Method::Emit): Perform check on applicability of attributes.
23763
23764         (Constructor::Emit): Ditto.
23765
23766         (Field::Emit): Ditto.
23767
23768         (Field.Location): Store location information.
23769
23770         (Property, Event, Indexer, Operator): Ditto.
23771
23772         * cs-parser.jay (field_declaration): Pass in location for each field.
23773
23774         * ../errors/cs0592.cs : Add.
23775
23776 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23777
23778         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23779
23780         (InitCoreTypes): Update accordingly.
23781
23782         (RegisterAttrType, LookupAttr): Implement.
23783
23784         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23785         info about the same.
23786
23787         (Resolve): Update to populate the above as necessary.
23788
23789         (Error592): Helper.
23790
23791         (GetValidPlaces): Helper to the above.
23792
23793         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23794
23795         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23796
23797 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23798
23799         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23800
23801         * ../errors/cs0617.cs : Add.
23802
23803 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23804
23805         * enum.cs (Emit): Rename to Populate to be more consistent with what
23806         we expect it to do and when exactly it is called.
23807
23808         * class.cs, rootcontext.cs : Update accordingly.
23809
23810         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23811         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23812
23813         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23814
23815         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23816         of a fieldinfo using the above, when dealing with a FieldBuilder.
23817
23818 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23819
23820         * ../errors/cs0031.cs : Add.
23821
23822         * ../errors/cs1008.cs : Add.
23823
23824         * ../errrors/cs0543.cs : Add.
23825
23826         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23827         enum type.
23828
23829         (FindMembers): Implement.
23830
23831         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23832         enums and delegates too.
23833
23834         (enum_types): Rename to builder_to_enum.
23835
23836         (delegate_types): Rename to builder_to_delegate.
23837
23838         * delegate.cs (FindMembers): Implement.
23839
23840 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23841
23842         * typemanager.cs (IsEnumType): Implement.
23843
23844         * enum.cs (Emit): Re-write parts to account for the underlying type
23845         better and perform checking etc.
23846
23847         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23848         of the underlying type.
23849
23850         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23851         value
23852
23853         * enum.cs (error31): Helper to report error #31.
23854
23855         * cs-parser.jay (enum_declaration): Store location of each member too.
23856
23857         * enum.cs (member_to_location): New hashtable. 
23858
23859         (AddEnumMember): Update location hashtable.
23860
23861         (Emit): Use the location of each member while reporting errors.
23862
23863 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23864
23865         * cs-parser.jay: A for_initializer if is a
23866         local_variable_declaration really ammount to have an implicit
23867         block with the variable declaration and no initializer for for.
23868
23869         * statement.cs (For.Emit): Cope with null initializers.
23870
23871         This fixes the infinite loop on for initializers.
23872
23873 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23874
23875         * enum.cs: More cleanup.
23876
23877         * ecore.cs: Remove dead code.
23878
23879         * class.cs (Property.Emit): More simplification.
23880         (Event.Emit): ditto.
23881
23882         Reworked to have less levels of indentation.
23883
23884 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23885
23886         * class.cs (Property): Emit attributes.
23887
23888         (Field): Ditto.
23889
23890         (Event): Ditto.
23891
23892         (Indexer): Ditto.
23893
23894         (Operator): Ditto.
23895
23896         * enum.cs (Emit): Ditto.
23897
23898         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23899         Enums too.
23900
23901         * class.cs (Field, Event, etc.): Move attribute generation into the
23902         Emit method everywhere.
23903
23904         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23905         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23906         as we had no way of defining nested enums !
23907
23908         * rootcontext.cs : Adjust code accordingly.
23909
23910         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23911
23912 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23913
23914         * expression.cs (EvalConstantExpression): Move into ecore.cs
23915
23916         * enum.cs (Enum): Rename some members and make them public and readonly
23917         according to our convention.
23918
23919         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23920         nothing else.
23921
23922         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23923
23924         (Enum::Emit): Write a simple version for now which doesn't try to compute
23925         expressions. I shall modify this to be more robust in just a while.
23926
23927         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23928
23929         (TypeContainer::CloseType): Create the Enum types too.
23930
23931         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23932
23933         * expression.cs (EvalConstantExpression): Get rid of completely.
23934
23935         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23936         user-defined values and other cases.
23937
23938         (IsValidEnumLiteral): Helper function.
23939
23940         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23941         out there in the case we had a literal FieldExpr.
23942
23943         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23944
23945         (Literalize): Revamp a bit to take two arguments.
23946
23947         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23948
23949 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23950
23951         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23952
23953         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23954
23955         (Resolve): Use the above to ensure we have proper initializers.
23956
23957 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23958
23959         * expression.cs (Expression::EvalConstantExpression): New method to 
23960         evaluate constant expressions.
23961
23962         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23963
23964 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23965
23966         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23967         in an array.
23968
23969         (Binary.ResolveOperator): Handle operator != (object a, object b)
23970         and operator == (object a, object b);
23971
23972         (Binary.DoNumericPromotions): Indicate whether the numeric
23973         promotion was possible.
23974
23975         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23976         Implement.  
23977
23978         Made the ArrayAccess implement interface IAssignMethod instead of
23979         IStackStore as the order in which arguments are passed reflects
23980         this.
23981
23982         * assign.cs: Instead of using expr.ExprClass to select the way of
23983         assinging, probe for the IStackStore/IAssignMethod interfaces.
23984
23985         * typemanager.cs: Load InitializeArray definition.
23986
23987         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23988         static data that can be used to initialize arrays. 
23989
23990 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23991
23992         * expression.cs: Handle operator== and operator!= for booleans.
23993
23994         (Conditioal.Reduce): Implement reducer for the ?: operator.
23995
23996         (Conditional.Resolve): Implement dead code elimination.
23997
23998         (Binary.Resolve): Catch string literals and return a new
23999         concatenated string.
24000
24001         (Unary.Reduce): Implement reduction of unary expressions.
24002
24003         * ecore.cs: Split out the expression core handling here.
24004
24005         (Expression.Reduce): New method used to perform constant folding
24006         and CSE.  This is needed to support constant-expressions. 
24007
24008         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24009         targets, and optimize for !x.
24010
24011 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24012
24013         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24014         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24015         set custom atttributes.
24016
24017         * literal.cs (Literal::GetValue): New abstract method to return the actual
24018         value of the literal, cast as an object.
24019
24020         (*Literal): Implement GetValue method.
24021
24022         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24023         expressions to the arraylist but objects of type Argument.
24024
24025         * class.cs (TypeContainer::Emit): Emit our attributes too.
24026
24027         (Method::Emit, Constructor::Emit): Ditto.
24028
24029         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24030         to be ignoring earlier.
24031
24032 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24033
24034         * attribute.cs (AttributeSection::Define): Implement to do the business
24035         of constructing a CustomAttributeBuilder.
24036
24037         (Attribute): New trivial class. Increases readability of code.  
24038
24039         * cs-parser.jay : Update accordingly.
24040
24041         (positional_argument_list, named_argument_list, named_argument): New rules
24042
24043         (attribute_arguments): Use the above so that we are more correct.
24044
24045 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24046
24047         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24048         to perform all checks for a method with a params parameter.
24049
24050         (Invocation::OverloadResolve): Update to use the above method and therefore
24051         cope correctly with params method invocations.
24052
24053         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24054         params too.
24055
24056         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24057         constructors in our parent too because we can't afford to miss out on 
24058         protected ones ;-)
24059
24060         * attribute.cs (AttributeSection): New name for the class Attribute
24061
24062         Other trivial changes to improve readability.
24063
24064         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24065         use the new class names.
24066
24067 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24068
24069         * class.cs (Method::Define): Complete definition for params types too
24070
24071         (Indexer::Define): Ditto.
24072
24073         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24074         Cope everywhere with a request for info about the array parameter.
24075
24076 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24077
24078         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24079
24080         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24081         local_variable_type to extract the string corresponding to the type.
24082
24083         (local_variable_type): Fixup the action to use the new helper method.
24084
24085         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24086         go.
24087
24088         * expression.cs : Clean out code which uses the above.
24089
24090 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24091
24092         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24093         and bale out if necessary by returning a false.
24094
24095         (RegisterProperty): Ditto.
24096
24097         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24098         and print out appropriate error messages.
24099
24100         * interface.cs (everywhere): Ditto.
24101
24102         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24103         location to constructor.
24104
24105         * class.cs (Property, Event, Indexer): Update accordingly.
24106
24107         * ../errors/cs111.cs : Added.
24108
24109         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24110         of a method, as laid down by the spec.
24111
24112         (Invocation::OverloadResolve): Use the above method.
24113
24114 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24115
24116         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24117         now take a TypeContainer and a Parameters object.
24118
24119         (ParameterData): Modify return type of ParameterModifier method to be 
24120         Parameter.Modifier and not a string.
24121
24122         (ReflectionParameters, InternalParameters): Update accordingly.
24123
24124         * expression.cs (Argument::GetParameterModifier): Same here.
24125
24126         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24127         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24128         symbol in it at all so maybe this is only for now.
24129
24130 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24131
24132         * support.cs (InternalParameters): Constructor now takes an extra argument 
24133         which is the actual Parameters class.
24134
24135         (ParameterDesc): Update to provide info on ref/out modifiers.
24136
24137         * class.cs (everywhere): Update call to InternalParameters to pass in
24138         the second argument too.
24139
24140         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24141         to return the modifier info [ref/out etc]
24142
24143         (InternalParameters, ReflectionParameters): Implement the above.
24144
24145         * expression.cs (Argument::ParameterModifier): Similar function to return
24146         info about the argument's modifiers.
24147
24148         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24149         too.
24150
24151         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24152         a new SetFormalParameters object which we pass to InternalParameters.
24153
24154 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24155
24156         * expression.cs (NewArray): Merge into the ArrayCreation class.
24157
24158 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24159
24160         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24161         NewUserdefinedArray into one as there wasn't much of a use in having
24162         two separate ones.
24163
24164         * expression.cs (Argument): Change field's name to ArgType from Type.
24165
24166         (Type): New readonly property which returns the proper type, taking into 
24167         account ref/out modifiers.
24168
24169         (everywhere): Adjust code accordingly for the above.
24170
24171         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24172         whether we are emitting for a ref or out parameter.
24173
24174         * expression.cs (Argument::Emit): Use the above field to set the state.
24175
24176         (LocalVariableReference::Emit): Update to honour the flag and emit the
24177         right stuff.
24178
24179         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24180
24181         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24182
24183         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24184
24185         (ReflectionParameters, InternalParameters): Implement the above method.
24186
24187         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24188         reporting errors.
24189
24190         (Invocation::FullMethodDesc): Ditto. 
24191
24192 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24193
24194         * cs-parser.jay: Add extra production for the second form of array
24195         creation. 
24196
24197         * expression.cs (ArrayCreation): Update to reflect the above
24198         change. 
24199
24200         * Small changes to prepare for Array initialization.
24201
24202 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24203
24204         * typemanager.cs (ImplementsInterface): interface might be null;
24205         Deal with this problem;
24206
24207         Also, we do store negative hits on the cache (null values), so use
24208         this instead of calling t.GetInterfaces on the type everytime.
24209
24210 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24211
24212         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24213
24214         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24215         split functionality out into different classes.
24216
24217         (New::FormArrayType): Move into NewBuiltinArray.
24218
24219         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24220         quite useless.
24221
24222         (NewBuiltinArray): New class to handle creation of built-in arrays.
24223
24224         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24225         account creation of one-dimensional arrays.
24226
24227         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24228
24229         (NewUserdefinedArray::DoResolve): Implement.
24230
24231         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24232
24233         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24234         we maintain inside the TypeManager. This is necessary to perform lookups on the
24235         module builder.
24236
24237         (LookupType): Update to perform GetType on the module builders too.     
24238
24239         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24240
24241         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24242
24243 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24244
24245         * expression.cs (New::DoResolve): Implement guts of array creation.
24246
24247         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24248
24249 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24250
24251         * expression.cs: Fix bug I introduced lsat night that broke
24252         Delegates. 
24253
24254         (Expression.Resolve): Report a 246 error (can not resolve name)
24255         if we find a SimpleName in the stream.
24256
24257         (Expression.ResolveLValue): Ditto.
24258
24259         (Expression.ResolveWithSimpleName): This function is a variant of
24260         ResolveName, this one allows SimpleNames to be returned without a
24261         warning.  The only consumer of SimpleNames is MemberAccess
24262
24263 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24264
24265         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24266         might arrive here.  I have my doubts that this is correct.
24267
24268         * statement.cs (Lock): Implement lock statement.
24269
24270         * cs-parser.jay: Small fixes to support `lock' and `using'
24271
24272         * cs-tokenizer.cs: Remove extra space
24273
24274         * driver.cs: New flag --checked, allows to turn on integer math
24275         checking. 
24276
24277         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24278         Threading.Monitor.Exit 
24279
24280 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24281
24282         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24283         Expression Class to be IndexerAccess.
24284
24285         Notice that Indexer::DoResolve sets the eclass to Value.
24286
24287 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24288
24289         * class.cs (TypeContainer::Emit): Emit code for indexers.
24290
24291         * assign.cs (IAssignMethod): New interface implemented by Indexers
24292         and Properties for handling assignment.
24293
24294         (Assign::Emit): Simplify and reuse code. 
24295
24296         * expression.cs (IndexerAccess, PropertyExpr): Implement
24297         IAssignMethod, clean up old code. 
24298
24299 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24300
24301         * typemanager.cs (ImplementsInterface): New method to determine if a type
24302         implements a given interface. Provides a nice cache too.
24303
24304         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24305         method.
24306
24307         (ConvertReferenceExplicit): Ditto.
24308
24309         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24310         various methods, with correct names etc.
24311
24312         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24313         Operator.UnaryNegation.
24314
24315         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24316         we have a unary plus or minus operator.
24317
24318         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24319         UnaryMinus.
24320
24321         * everywhere : update accordingly.
24322
24323         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24324         respectively.
24325
24326         * class.cs (Method::Define): For the case where we are implementing a method
24327         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24328         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24329
24330 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24331
24332         * interface.cs (FindMembers): Implement to work around S.R.E
24333         lameness.
24334
24335         * typemanager.cs (IsInterfaceType): Implement.
24336
24337         (FindMembers): Update to handle interface types too.
24338
24339         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24340         use IsAssignableFrom as that is not correct - it doesn't work.
24341
24342         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24343         and accordingly override EmitStatement.
24344
24345         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24346         using the correct logic :-)
24347
24348 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24349
24350         * ../errors/cs-11.cs : Add to demonstrate error -11 
24351
24352 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24353
24354         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24355         then pass this as a hint to ResolveLValue.
24356
24357         * expression.cs (FieldExpr): Add Location information
24358
24359         (FieldExpr::LValueResolve): Report assignment to readonly
24360         variable. 
24361
24362         (Expression::ExprClassFromMemberInfo): Pass location information.
24363
24364         (Expression::ResolveLValue): Add new method that resolves an
24365         LValue. 
24366
24367         (Expression::DoResolveLValue): Default invocation calls
24368         DoResolve. 
24369
24370         (Indexers): New class used to keep track of indexers in a given
24371         Type. 
24372
24373         (IStackStore): Renamed from LValue, as it did not really describe
24374         what this did.  Also ResolveLValue is gone from this interface and
24375         now is part of Expression.
24376
24377         (ElementAccess): Depending on the element access type
24378
24379         * typemanager.cs: Add `indexer_name_type' as a Core type
24380         (System.Runtime.CompilerServices.IndexerNameAttribute)
24381
24382         * statement.cs (Goto): Take a location.
24383
24384 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24385
24386         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24387         if two delegates are compatible.
24388
24389         (NewDelegate::DoResolve): Update to take care of the case when
24390         we instantiate a delegate from another delegate.
24391
24392         * typemanager.cs (FindMembers): Don't even try to look up members
24393         of Delegate types for now.
24394
24395 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24396
24397         * delegate.cs (NewDelegate): New class to take care of delegate
24398         instantiation.
24399
24400         * expression.cs (New): Split the delegate related code out into 
24401         the NewDelegate class.
24402
24403         * delegate.cs (DelegateInvocation): New class to handle delegate 
24404         invocation.
24405
24406         * expression.cs (Invocation): Split out delegate related code into
24407         the DelegateInvocation class.
24408
24409 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24410
24411         * expression.cs (New::DoResolve): Implement delegate creation fully
24412         and according to the spec.
24413
24414         (New::DoEmit): Update to handle delegates differently.
24415
24416         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24417         because of which we were printing out arguments in reverse order !
24418
24419         * delegate.cs (VerifyMethod): Implement to check if the given method
24420         matches the delegate.
24421
24422         (FullDelegateDesc): Implement.
24423
24424         (VerifyApplicability): Implement.
24425
24426         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24427         delegate invocations too.
24428
24429         (Invocation::Emit): Ditto.
24430
24431         * ../errors/cs1593.cs : Added.
24432
24433         * ../errors/cs1594.cs : Added.
24434
24435         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24436
24437 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24438
24439         * typemanager.cs (intptr_type): Core type for System.IntPtr
24440
24441         (InitCoreTypes): Update for the same.
24442
24443         (iasyncresult_type, asynccallback_type): Ditto.
24444
24445         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24446         correct.
24447
24448         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24449         too.
24450
24451         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24452         the builders for the 4 members of a delegate type :-)
24453
24454         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24455         type.
24456
24457         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24458
24459         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24460
24461 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24462
24463         * statement.cs (Break::Emit): Implement.   
24464         (Continue::Emit): Implement.
24465
24466         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24467         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24468         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24469         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24470         end loop
24471
24472         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24473         properties that track the label for the current loop (begin of the
24474         loop and end of the loop).
24475
24476 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24477
24478         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24479         use of emitting anything at all.
24480
24481         * class.cs, rootcontext.cs : Get rid of calls to the same.
24482
24483         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24484
24485         (Populate): Define the constructor correctly and set the implementation
24486         attributes.
24487
24488         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24489         have been defined.
24490
24491         (AddDelegateType): Implement.
24492
24493         (IsDelegateType): Implement helper method.
24494
24495         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24496
24497         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24498         and accordingly handle it.
24499
24500         * delegate.cs (Populate): Take TypeContainer argument.
24501         Implement bits to define the Invoke method. However, I still haven't figured out
24502         how to take care of the native int bit :-(
24503
24504         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24505         Qualify the name of the delegate, not its return type !
24506
24507         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24508         conversion.
24509
24510         (StandardConversionExists): Checking for array types turns out to be recursive.
24511
24512         (ConvertReferenceExplicit): Implement array conversion.
24513
24514         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24515
24516 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24517
24518         * cs-parser.jay (delegate_declaration): Store the fully qualified
24519         name as it is a type declaration.
24520
24521         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24522         readonly.
24523
24524         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24525         as TypeContainer::DefineType.
24526
24527         (Populate): Method in which all the definition of the various methods (Invoke)
24528         etc is done.
24529
24530         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24531         see.
24532
24533         (CloseDelegate): Finally creates the delegate.
24534
24535         * class.cs (TypeContainer::DefineType): Update to define delegates.
24536         (Populate, Emit and CloseType): Do the same thing here too.
24537
24538         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24539         delegates in all these operations.
24540
24541 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24542
24543         * expression.cs: LocalTemporary: a new expression used to
24544         reference a temporary that has been created.
24545
24546         * assign.cs: Handle PropertyAccess back here, so that we can
24547         provide the proper semantic access to properties.
24548
24549         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24550         a few more explicit conversions. 
24551
24552         * modifiers.cs: `NEW' modifier maps to HideBySig.
24553
24554         * expression.cs (PropertyExpr): Make this into an
24555         ExpressionStatement, and support the EmitStatement code path. 
24556
24557         Perform get/set error checking, clean up the interface.
24558
24559         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24560         them into toplevel access objects.
24561
24562 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24563
24564         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24565         SRE.
24566
24567         * typemanager.cs: Keep track here of our PropertyBuilders again to
24568         work around lameness in SRE.
24569
24570 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24571
24572         * expression.cs (LValue::LValueResolve): New method in the
24573         interface, used to perform a second resolution pass for LValues. 
24574
24575         (This::DoResolve): Catch the use of this in static methods.
24576
24577         (This::LValueResolve): Implement.
24578
24579         (This::Store): Remove warning, assigning to `this' in structures
24580         is 
24581
24582         (Invocation::Emit): Deal with invocation of
24583         methods on value types.  We need to pass the address to structure
24584         methods rather than the object itself.  (The equivalent code to
24585         emit "this" for structures leaves the entire structure on the
24586         stack instead of a pointer to it). 
24587
24588         (ParameterReference::DoResolve): Compute the real index for the
24589         argument based on whether the method takes or not a `this' pointer
24590         (ie, the method is static).
24591
24592         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24593         value types returned from functions when we need to invoke a
24594         method on the sturcture.
24595
24596
24597 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24598
24599         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24600         defining the type in the Modulebuilder or Typebuilder. This is to take
24601         care of nested types which need to be defined on the TypeBuilder using
24602         DefineNestedMethod.
24603
24604         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24605         methods in RootContext, only ported to be part of TypeContainer.
24606
24607         (TypeContainer::GetInterfaceOrClass): Ditto.
24608
24609         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24610
24611         * interface.cs (Interface::DefineInterface): New method. Does exactly
24612         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24613         too.
24614
24615         (Interface::GetInterfaces): Move from RootContext here and port.
24616
24617         (Interface::GetInterfaceByName): Same here.
24618
24619         * rootcontext.cs (ResolveTree): Re-write.
24620
24621         (PopulateTypes): Re-write.
24622
24623         * class.cs (TypeContainer::Populate): Populate nested types too.
24624         (TypeContainer::Emit): Emit nested members too.
24625
24626         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24627         instead just use the name argument passed in as it is already fully
24628         qualified.
24629
24630         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24631         to TypeContainer mapping to see if a type is user-defined.
24632
24633         * class.cs (TypeContainer::CloseType): Implement. 
24634
24635         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24636         the default constructor.
24637
24638         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24639         twice.
24640
24641         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24642
24643         * interface.cs (CloseType): Create the type here.
24644
24645         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24646         the hierarchy.
24647
24648         Remove all the methods which are now in TypeContainer.
24649
24650 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24651
24652         * delegate.cs (Define): Re-write bits to define the delegate
24653         correctly.
24654
24655 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24656
24657         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24658
24659         * expression.cs (ImplicitReferenceConversion): handle null as well
24660         as a source to convert to any reference type.
24661
24662         * statement.cs (Return): Perform any implicit conversions to
24663         expected return type.  
24664
24665         Validate use of return statement.  
24666
24667         * codegen.cs (EmitContext): Pass the expected return type here.
24668
24669         * class.cs (Method, Constructor, Property): Pass expected return
24670         type to EmitContext.
24671
24672 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24673
24674         * expression.cs: Make DoResolve take an EmitContext instead of a
24675         TypeContainer.
24676
24677         Replaced `l' and `location' for `loc', for consistency.
24678
24679         (Error, Warning): Remove unneeded Tc argument.
24680
24681         * assign.cs, literal.cs, constant.cs: Update to new calling
24682         convention. 
24683
24684         * codegen.cs: EmitContext now contains a flag indicating whether
24685         code is being generated in a static method or not.
24686
24687         * cs-parser.jay: DecomposeQI, new function that replaces the old
24688         QualifiedIdentifier.  Now we always decompose the assembled
24689         strings from qualified_identifier productions into a group of
24690         memberaccesses.
24691
24692 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24693
24694         * rootcontext.cs: Deal with field-less struct types correctly now
24695         by passing the size option to Define Type.
24696
24697         * class.cs: Removed hack that created one static field. 
24698
24699 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24700
24701         * statement.cs: Moved most of the code generation here. 
24702
24703 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24704
24705         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24706         seem very right.
24707
24708         (ElementAccess): Remove useless bits for now - keep checks as the spec
24709         says.
24710
24711 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24712
24713         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24714         and start performing checks according to the spec.
24715
24716 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24717
24718         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24719         rank_specifiers instead.
24720
24721         (rank_specifiers): Change the order in which the rank specifiers are stored
24722
24723         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24724
24725         * expression.cs (ElementAccess): Implement the LValue interface too.
24726
24727 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24728
24729         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24730         except that user defined conversions are not included.
24731
24732         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24733         perform the conversion of the return type, if necessary.
24734
24735         (New::DoResolve): Check whether we are creating an array or an object
24736         and accordingly do the needful.
24737
24738         (New::Emit): Same here.
24739
24740         (New::DoResolve): Implement guts of array creation.
24741
24742         (New::FormLookupType): Helper function.
24743
24744 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24745
24746         * codegen.cs: Removed most of the code generation here, and move the
24747         corresponding code generation bits to the statement classes. 
24748
24749         Added support for try/catch/finalize and throw.
24750
24751         * cs-parser.jay: Added support for try/catch/finalize.
24752
24753         * class.cs: Catch static methods having the flags override,
24754         virtual or abstract.
24755
24756         * expression.cs (UserCast): This user cast was not really doing
24757         what it was supposed to do.  Which is to be born in fully resolved
24758         state.  Parts of the resolution were being performed at Emit time! 
24759
24760         Fixed this code.
24761
24762 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24763
24764         * expression.cs: Implicity convert the result from UserCast.
24765
24766 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24767
24768         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24769         prevented it from working correctly. 
24770
24771         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24772         merely ConvertImplicit.
24773
24774 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24775
24776         * typemanager.cs: Make the LookupTypeContainer function static,
24777         and not per-instance.  
24778
24779         * class.cs: Make static FindMembers (the one that takes a Type
24780         argument). 
24781
24782         * codegen.cs: Add EmitForeach here.
24783
24784         * cs-parser.jay: Make foreach a toplevel object instead of the
24785         inline expansion, as we need to perform semantic analysis on it. 
24786
24787 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24788
24789         * expression.cs (Expression::ImplicitUserConversion): Rename to
24790         UserDefinedConversion.
24791
24792         (Expression::UserDefinedConversion): Take an extra argument specifying 
24793         whether we look for explicit user conversions too.
24794
24795         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24796
24797         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24798
24799         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24800         with the appropriate arguments.
24801
24802         * cs-parser.jay (cast_expression): Record location too.
24803
24804         * expression.cs (Cast): Record location info.
24805
24806         (Expression::ConvertExplicit): Take location argument.
24807
24808         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24809         to determine if we are doing explicit conversions.
24810
24811         (UserCast::Emit): Update accordingly.
24812
24813         (Expression::ConvertExplicit): Report an error if everything fails.
24814
24815         * ../errors/cs0030.cs : Add.
24816
24817 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24818
24819         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24820         virtual and newslot bits. 
24821
24822         * class.cs (TypeContainer::RegisterRequiredImplementations):
24823         Record methods we need.
24824
24825         (TypeContainer::MakeKey): Helper function to make keys for
24826         MethodBases, since the Methodbase key is useless.
24827
24828         (TypeContainer::Populate): Call RegisterRequiredImplementations
24829         before defining the methods.   
24830
24831         Create a mapping for method_builders_to_methods ahead of time
24832         instead of inside a tight loop.
24833
24834         (::RequireMethods):  Accept an object as the data to set into the
24835         hashtable so we can report interface vs abstract method mismatch.
24836
24837 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24838
24839         * report.cs: Make all of it static.
24840
24841         * rootcontext.cs: Drop object_type and value_type computations, as
24842         we have those in the TypeManager anyways.
24843
24844         Drop report instance variable too, now it is a global.
24845
24846         * driver.cs: Use try/catch on command line handling.
24847
24848         Add --probe option to debug the error reporting system with a test
24849         suite. 
24850
24851         * report.cs: Add support for exiting program when a probe
24852         condition is reached.
24853
24854 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24855
24856         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24857         we do a forcible conversion regardless of type, to check if 
24858         ForceConversion returns a null.
24859
24860         (Binary::error19): Use location to report error.
24861
24862         (Unary::error23): Use location here too.
24863
24864         * ../errors/cs0019.cs : Check in.
24865
24866         * ../errors/cs0023.cs : Check in.
24867
24868         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24869         case of a non-null MethodInfo object with a length of 0 !
24870
24871         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24872         an applicable member - according to the spec :-)
24873         Also fix logic to find members in base types.
24874
24875         (Unary::ResolveOperator): Same here.
24876
24877         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24878         as I was getting thoroughly confused between this and error19 :-)
24879
24880         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24881         (::FindMostEncompassedType): Implement.
24882         (::FindMostEncompassingType): Implement.
24883         (::StandardConversionExists): Implement.
24884
24885         (UserImplicitCast): Re-vamp. We now need info about most specific
24886         source and target types so that we can do the necessary conversions.
24887
24888         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24889         mathematical union with no duplicates.
24890
24891 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24892
24893         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24894         in order from base classes to child classes, so that we can in
24895         child classes look up in our parent for method names and
24896         attributes (required for handling abstract, virtual, new, override
24897         constructs: we need to instrospect our base class, and if we dont
24898         populate the classes in order, the introspection might be
24899         incorrect.  For example, a method could query its parent before
24900         the parent has any methods and would determine that the parent has
24901         no abstract methods (while it could have had them)).
24902
24903         (RootContext::CreateType): Record the order in which we define the
24904         classes.
24905
24906 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24907
24908         * class.cs (TypeContainer::Populate): Also method definitions can
24909         fail now, keep track of this.
24910
24911         (TypeContainer::FindMembers): Implement support for
24912         DeclaredOnly/noDeclaredOnly flag.
24913
24914         (Constructor::Emit) Return the ConstructorBuilder.
24915
24916         (Method::Emit) Return the MethodBuilder. 
24917         Check for abstract or virtual methods to be public.
24918
24919         * rootcontext.cs (RootContext::CreateType): Register all the
24920         abstract methods required for the class to be complete and the
24921         interface methods that must be implemented. 
24922
24923         * cs-parser.jay: Report error 501 (method requires body if it is
24924         not marked abstract or extern).
24925
24926         * expression.cs (TypeOf::Emit): Implement.
24927
24928         * typemanager.cs: runtime_handle_type, new global type.
24929
24930         * class.cs (Property::Emit): Generate code for properties.
24931
24932 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24933
24934         * expression.cs (Unary::ResolveOperator): Find operators on base type
24935         too - we now conform exactly to the spec.
24936
24937         (Binary::ResolveOperator): Same here.
24938
24939         * class.cs (Operator::Define): Fix minor quirk in the tests.
24940
24941         * ../errors/cs0215.cs : Added.
24942
24943         * ../errors/cs0556.cs : Added.
24944
24945         * ../errors/cs0555.cs : Added.
24946
24947 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24948
24949         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24950         single integer which is really efficient
24951
24952 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24953
24954         *  expression.cs (Expression::ImplicitUserConversion): Use location
24955         even in the case when we are examining True operators.
24956  
24957         * class.cs (Operator::Define): Perform extensive checks to conform
24958         with the rules for operator overloading in the spec.
24959
24960         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24961         some of the other conversions mentioned in the spec.
24962
24963         * typemanager.cs (array_type): New static member for the System.Array built-in
24964         type.
24965
24966         (cloneable_interface): For System.ICloneable interface.
24967
24968         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24969         we start resolving the tree and populating types.
24970
24971         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24972  
24973 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24974
24975         * expression.cs (Expression::ExprClassFromMemberInfo,
24976         Expression::Literalize): Create literal expressions from
24977         FieldInfos which are literals.
24978
24979         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24980         type casts, because they were wrong.  The test suite in tests
24981         caught these ones.
24982
24983         (ImplicitNumericConversion): ushort to ulong requires a widening
24984         cast. 
24985
24986         Int32 constant to long requires widening cast as well.
24987
24988         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24989         for integers because the type on the stack is not i4.
24990
24991 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24992
24993         * expression.cs (report118): require location argument. 
24994
24995         * parameter.cs: Do not dereference potential null value.
24996
24997         * class.cs: Catch methods that lack the `new' keyword when
24998         overriding a name.  Report warnings when `new' is used without
24999         anything being there to override.
25000
25001         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25002
25003         * class.cs: Only add constructor to hashtable if it is non-null
25004         (as now constructors can fail on define).
25005
25006         (TypeManager, Class, Struct): Take location arguments.
25007
25008         Catch field instance initialization in structs as errors.
25009
25010         accepting_filter: a new filter for FindMembers that is static so
25011         that we dont create an instance per invocation.
25012
25013         (Constructor::Define): Catch errors where a struct constructor is
25014         parameterless 
25015
25016         * cs-parser.jay: Pass location information for various new
25017         constructs. 
25018
25019         * delegate.cs (Delegate): take a location argument.
25020
25021         * driver.cs: Do not call EmitCode if there were problesm in the
25022         Definition of the types, as many Builders wont be there. 
25023
25024         * decl.cs (Decl::Decl): Require a location argument.
25025
25026         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25027         into integers, and find the most appropiate integer for it.
25028
25029         * literal.cs: Implement ULongLiteral.
25030
25031         * rootcontext.cs: Provide better information about the location of
25032         failure when CreateType fails.
25033
25034 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25035
25036         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25037         as well.
25038
25039         * expression.cs (Binary::CheckShiftArguments): Add missing type
25040         computation.
25041         (Binary::ResolveOperator): Add type to the logical and and logical
25042         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25043         before.
25044
25045         (Binary::DoNumericPromotions): In the case where either argument
25046         is ulong (and most signed types combined with ulong cause an
25047         error) perform implicit integer constant conversions as well.
25048
25049 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25050
25051         * expression.cs (UserImplicitCast): Method should always be
25052         non-null. 
25053         (Invocation::BetterConversion): Simplified test for IntLiteral.
25054
25055         (Expression::ImplicitNumericConversion): Split this routine out.
25056         Put the code that performs implicit constant integer conversions
25057         here. 
25058
25059         (Expression::Resolve): Become a wrapper around DoResolve so we can
25060         check eclass and type being set after resolve.
25061
25062         (Invocation::Badness): Remove this dead function
25063
25064         (Binary::ResolveOperator): Do not compute the expensive argumnets
25065         unless we have a union for it.
25066
25067         (Probe::Emit): Is needs to do an isinst and then
25068         compare against null.
25069
25070         (::CanConvert): Added Location argument.  If the Location argument
25071         is null (Location.Null), then we do not report errors.  This is
25072         used by the `probe' mechanism of the Explicit conversion.  We do
25073         not want to generate an error for something that the user
25074         explicitly requested to be casted.  But the pipeline for an
25075         explicit cast first tests for potential implicit casts.
25076
25077         So for now, if the Location is null, it means `Probe only' to
25078         avoid adding another argument.   Might have to revise this
25079         strategy later.
25080
25081         (ClassCast): New class used to type cast objects into arbitrary
25082         classes (used in Explicit Reference Conversions).
25083
25084         Implement `as' as well.
25085
25086         Reverted all the patches from Ravi below: they were broken:
25087
25088                 * The use of `level' as a mechanism to stop recursive
25089                   invocations is wrong.  That was there just to catch the
25090                   bug with a strack trace but not as a way of addressing
25091                   the problem.
25092
25093                   To fix the problem we have to *understand* what is going
25094                   on and the interactions and come up with a plan, not
25095                   just get things going.
25096
25097                 * The use of the type conversion cache that I proposed
25098                   last night had an open topic: How does this work across
25099                   protection domains.  A user defined conversion might not
25100                   be public in the location where we are applying the
25101                   conversion, a different conversion might be selected
25102                   (ie, private A->B (better) but public B->A (worse),
25103                   inside A, A->B applies, but outside it, B->A will
25104                   apply).
25105
25106                 * On top of that (ie, even if the above is solved),
25107                   conversions in a cache need to be abstract.  Ie, `To
25108                   convert from an Int to a Short use an OpcodeCast', not
25109                   `To convert from an Int to a Short use the OpcodeCast on
25110                   the variable 5' (which is what this patch was doing).
25111
25112 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25113
25114         * expression.cs (Invocation::ConversionExists): Re-write to use
25115         the conversion cache
25116
25117         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25118         cache all conversions done, not just user-defined ones.
25119
25120         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25121         to determine if a conversion exists instead of acutually trying to 
25122         perform the conversion. It's faster too.
25123
25124         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25125         and only then attempt the implicit conversion.
25126
25127 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25128
25129         * expression.cs (ConvertImplicit): Use a cache for conversions
25130         already found. Check level of recursion and bail out if necessary.
25131
25132 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25133
25134         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25135         Export standard methods that we expect for string operations.
25136
25137         * statement.cs (Block::UsageWarning): Track usage of variables and
25138         report the errors for not used variables.
25139
25140         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25141         operator. 
25142
25143 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * codegen.cs: remove unnneded code 
25146
25147         * expression.cs: Removed BuiltinTypeAccess class
25148
25149         Fix the order in which implicit conversions are
25150         done.  
25151
25152         The previous fixed dropped support for boxed conversions (adding a
25153         test to the test suite now)
25154
25155         (UserImplicitCast::CanConvert): Remove test for source being null,
25156         that code is broken.  We should not feed a null to begin with, if
25157         we do, then we should track the bug where the problem originates
25158         and not try to cover it up here.
25159
25160         Return a resolved expression of type UserImplicitCast on success
25161         rather than true/false.  Ravi: this is what I was talking about,
25162         the pattern is to use a static method as a "constructor" for
25163         objects. 
25164
25165         Also, do not create arguments until the very last minute,
25166         otherwise we always create the arguments even for lookups that
25167         will never be performed. 
25168
25169         (UserImplicitCast::Resolve): Eliminate, objects of type
25170         UserImplicitCast are born in a fully resolved state. 
25171
25172         * typemanager.cs (InitCoreTypes): Init also value_type
25173         (System.ValueType). 
25174
25175         * expression.cs (Cast::Resolve): First resolve the child expression.
25176
25177         (LValue): Add new method AddressOf to be used by
25178         the `&' operator.  
25179
25180         Change the argument of Store to take an EmitContext instead of an
25181         ILGenerator, because things like FieldExpr need to be able to call
25182         their children expression to generate the instance code. 
25183
25184         (Expression::Error, Expression::Warning): Sugar functions for
25185         reporting errors.
25186
25187         (Expression::MemberLookup): Accept a TypeContainer instead of a
25188         Report as the first argument.
25189
25190         (Expression::ResolvePrimary): Killed.  I still want to improve
25191         this as currently the code is just not right.
25192
25193         (Expression::ResolveMemberAccess): Simplify, but it is still
25194         wrong. 
25195
25196         (Unary::Resolve): Catch errors in AddressOf operators.
25197
25198         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25199         index to a byte for the short-version, or the compiler will choose
25200         the wrong Emit call, which generates the wrong data.
25201
25202         (ParameterReference::Emit, ::Store): same.
25203
25204         (FieldExpr::AddressOf): Implement.
25205
25206         * typemanager.cs: TypeManager: made public variable instead of
25207         property.
25208
25209         * driver.cs: document --fatal.
25210
25211         * report.cs (ErrorMessage, WarningMessage): new names for the old
25212         Error and Warning classes.
25213
25214         * cs-parser.jay (member_access): Turn built-in access to types
25215         into a normal simplename
25216
25217 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25218
25219         * expression.cs (Invocation::BetterConversion): Fix to cope
25220         with q being null, since this was introducing a bug.
25221
25222         * expression.cs (ConvertImplicit): Do built-in conversions first.
25223
25224 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25225
25226         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25227
25228 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25229
25230         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25231         I had introduced long ago (what's new ?).
25232
25233         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25234         the work of all the checking. 
25235         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25236         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25237
25238         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25239         that is the right way. 
25240
25241         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25242         overloading resolution. Use everywhere instead of cutting and pasting code.
25243
25244         (Binary::ResolveOperator): Use MakeUnionSet.
25245
25246         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25247         we have to convert to bool types. Not complete yet.
25248
25249 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25250
25251         * typemanager.cs (TypeManager::CSharpName): support ushort.
25252
25253         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25254         to provide an expression that performsn an implicit constant int
25255         conversion (section 6.1.6).
25256         (Expression::ConvertImplicitRequired): Reworked to include
25257         implicit constant expression conversions.
25258
25259         (Expression::ConvertNumericExplicit): Finished.
25260
25261         (Invocation::Emit): If InstanceExpression is null, then it means
25262         that we perform a call on this.
25263
25264 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25265
25266         * expression.cs (Unary::Emit): Remove some dead code.
25267         (Probe): Implement Resolve and Emit for `is'.
25268         (Expression::ConvertImplicitRequired): Attempt to do constant
25269         expression conversions here.  Maybe should be moved to
25270         ConvertImplicit, but I am not sure.
25271         (Expression::ImplicitLongConstantConversionPossible,
25272         Expression::ImplicitIntConstantConversionPossible): New functions
25273         that tell whether is it possible to apply an implicit constant
25274         expression conversion.
25275
25276         (ConvertNumericExplicit): Started work on explicit numeric
25277         conversions.
25278
25279         * cs-parser.jay: Update operator constants.
25280
25281         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25282         (Parameters::GetSignature): Hook up VerifyArgs here.
25283         (Parameters::VerifyArgs): Verifies that no two arguments have the
25284         same name. 
25285
25286         * class.cs (Operator): Update the operator names to reflect the
25287         ones that the spec expects (as we are just stringizing the
25288         operator names).
25289
25290         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25291         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25292         previous usage did only work for our methods.
25293         (Expression::ConvertImplicit): Handle decimal implicit numeric
25294         conversions as well.
25295         (Expression::InternalTypeConstructor): Used to invoke constructors
25296         on internal types for default promotions.
25297
25298         (Unary::Emit): Implement special handling for the pre/post
25299         increment/decrement for overloaded operators, as they need to have
25300         the same semantics as the other operators.
25301
25302         (Binary::ResolveOperator): ditto.
25303         (Invocation::ConversionExists): ditto.
25304         (UserImplicitCast::Resolve): ditto.
25305
25306 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25307
25308         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25309         operator, return after emitting body. Regression tests pass again !
25310
25311         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25312         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25313         (Invocation::OverloadResolve): Ditto.
25314         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25315
25316         * everywhere : update calls to the above methods accordingly.
25317
25318 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25319
25320         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25321
25322         * expression.cs (ExpressionStatement): New base class used for
25323         expressions that can appear in statements, so that we can provide
25324         an alternate path to generate expression that do not leave a value
25325         on the stack.
25326
25327         (Expression::Emit, and all the derivatives): We no longer return
25328         whether a value is left on the stack or not.  Every expression
25329         after being emitted leaves a single value on the stack.
25330
25331         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25332         facilties of ExpressionStatement if possible.
25333
25334         * cs-parser.jay: Update statement_expression.
25335
25336 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25337
25338         * driver.cs: Change the wording of message
25339
25340 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25341
25342         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25343         the type of the expression to the return type of the method if
25344         we have an overloaded operator match ! The regression tests pass again !
25345         (Unary::ResolveOperator): Ditto.
25346
25347         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25348         to find "op_Implicit", not "implicit" ;-)
25349         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25350         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25351
25352         * everywhere : Correct calls to the above accordingly.
25353
25354         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25355         (ConvertImplicit): Do user-defined conversion if it exists.
25356
25357 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25358
25359         * assign.cs: track location.
25360         (Resolve): Use implicit conversions on assignment.
25361
25362         * literal.cs: Oops.  Not good, Emit of short access values should
25363         pass (Bytes) or the wrong argument will be selected.
25364
25365         * expression.cs (Unary::Emit): Emit code for -expr.
25366
25367         (Unary::ResolveOperator): Handle `Substract' for non-constants
25368         (substract from zero from the non-constants).
25369         Deal with Doubles as well. 
25370
25371         (Expression::ConvertImplicitRequired): New routine that reports an
25372         error if no implicit conversion exists. 
25373
25374         (Invocation::OverloadResolve): Store the converted implicit
25375         expressions if we make them
25376
25377 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25378
25379         * class.cs (ConstructorInitializer): Take a Location argument.
25380         (ConstructorBaseInitializer): Same here.
25381         (ConstructorThisInitializer): Same here.
25382
25383         * cs-parser.jay : Update all calls accordingly.
25384
25385         * expression.cs (Unary, Binary, New): Take location argument.
25386         Update accordingly everywhere.
25387
25388         * cs-parser.jay : Update all calls to the above to take a location
25389         argument.
25390
25391         * class.cs : Ditto.
25392
25393 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25394
25395         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25396         (Invocation::BetterConversion): Same here
25397         (Invocation::ConversionExists): Ditto.
25398
25399         (Invocation::ConversionExists): Implement.
25400
25401 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25402
25403         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25404         Also take an additional TypeContainer argument.
25405
25406         * All over : Pass in TypeContainer as argument to OverloadResolve.
25407
25408         * typemanager.cs (CSharpName): Update to check for the string type and return
25409         that too.
25410
25411         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25412         a given method.
25413
25414 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25415
25416         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25417         (Invocation::BetterFunction): Implement.
25418         (Invocation::BetterConversion): Implement.
25419         (Invocation::ConversionExists): Skeleton, no implementation yet.
25420
25421         Okay, things work fine !
25422
25423 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25424
25425         * typemanager.cs: declare and load enum_type, delegate_type and
25426         void_type. 
25427
25428         * expression.cs (Expression::Emit): Now emit returns a value that
25429         tells whether a value is left on the stack or not.  This strategy
25430         might be reveted tomorrow with a mechanism that would address
25431         multiple assignments.
25432         (Expression::report118): Utility routine to report mismatches on
25433         the ExprClass.
25434
25435         (Unary::Report23): Report impossible type/operator combination
25436         utility function.
25437
25438         (Unary::IsIncrementableNumber): Whether the type can be
25439         incremented or decremented with add.
25440         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25441         complemented. 
25442         (Unary::ResolveOperator): Implement ++, !, ~,
25443
25444         (Invocation::Emit): Deal with new Emit convetion.
25445
25446         * All Expression derivatives: Updated their Emit method to return
25447         whether they leave values on the stack or not.
25448
25449         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25450         stack for expressions that are statements. 
25451
25452 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25453
25454         * expression.cs (LValue): New interface.  Must be implemented by
25455         LValue objects.
25456         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25457         LValue interface.
25458
25459         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25460         interface for generating code, simplifies the code.
25461
25462 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25463
25464         * expression.cs (everywhere): Comment out return statements in ::Resolve
25465         methods to avoid the warnings.
25466
25467 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25468
25469         * driver.cs (parse): Report error 2001 if we can not open the
25470         source file.
25471
25472         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25473         not resolve it.
25474
25475         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25476         object. 
25477
25478         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25479         otherwise nested blocks end up with the same index.
25480
25481         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25482
25483         * expression.cs:  Instead of having FIXMEs in the Resolve
25484         functions, throw exceptions so it is obvious that we are facing a
25485         bug. 
25486
25487         * cs-parser.jay (invocation_expression): Pass Location information.
25488
25489         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25490         Use a basename for those routines because .NET does not like paths
25491         on them. 
25492
25493         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25494         already defined.
25495
25496 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25497
25498         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25499         are loading the correct data types (throws an exception if not).
25500         (TypeManager::InitCoreTypes): Use CoreLookupType
25501
25502         * expression.cs (Unary::ResolveOperator): return the child
25503         expression for expressions which are just +expr.
25504         (Unary::ResolveOperator): Return negative literals for -LITERAL
25505         expressions (otherwise they are Unary {Literal}).
25506         (Invocation::Badness): Take into account `Implicit constant
25507         expression conversions'.
25508
25509         * literal.cs (LongLiteral): Implement long literal class.
25510         (IntLiteral): export the `Value' of the intliteral. 
25511
25512 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25513
25514         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25515
25516         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25517         instead of 'Operator'
25518
25519         * expression.cs (Binary::ResolveOperator): Update accordingly.
25520         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25521         and 'Minus'
25522
25523         * cs-parser.jay (unary_expression): Update to use the new names.
25524
25525         * gen-treedump.cs (GetUnary): Same here.
25526
25527         * expression.cs (Unary::Resolve): Implement.
25528         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25529         operators are found instead of making noise ;-)
25530         (Unary::ResolveOperator): New method to do precisely the same thing which
25531         Binary::ResolveOperator does for Binary expressions.
25532         (Unary.method, .Arguments): Add.
25533         (Unary::OperName): Implement.   
25534         (Unary::ForceConversion): Copy and Paste !
25535
25536         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25537         a unary operator.
25538
25539         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25540         for the inbuilt operators. Only overloading works for now ;-)
25541
25542 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25543
25544         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25545         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25546
25547         * expression.cs (This::Emit): Implement. 
25548         (This::Resolve): Implement.
25549         (TypeOf:Resolve): Implement.
25550         (Expression::ResolveSimpleName): Add an implicit this to instance
25551         field references. 
25552         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25553         Bind instance variable to Field expressions.
25554         (FieldExpr::Instance): New field used to track the expression that
25555         represents the object instance.
25556         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25557         binding 
25558         (FieldExpr::Emit): Implement.
25559
25560         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25561         the last instruction contains a return opcode to avoid generating
25562         the last `ret' instruction (this generates correct code, and it is
25563         nice to pass the peverify output).
25564
25565         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25566         initializer for static and instance variables.
25567         (Constructor::Emit): Allow initializer to be null in the case of
25568         static constructors.  Only emit initializer for instance
25569         constructors. 
25570
25571         (TypeContainer::FindMembers): Return a null array if there are no
25572         matches.
25573
25574         Also fix the code for the MemberTypes.Method branch, as it was not
25575         scanning that for operators (or tried to access null variables before).
25576
25577         * assign.cs (Assign::Emit): Handle instance and static fields. 
25578
25579         * TODO: Updated.
25580
25581         * driver.cs: Stop compilation if there are parse errors.
25582
25583         * cs-parser.jay (constructor_declaration): Provide default base
25584         initializer for non-static constructors.
25585         (constructor_declarator): Do not provide a default base
25586         initializers if none was specified.
25587         Catch the fact that constructors should not have parameters.
25588
25589         * class.cs: Do not emit parent class initializers for static
25590         constructors, that should be flagged as an error.
25591
25592 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25593
25594         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25595         Move back code into TypeContainer::Populate.
25596
25597 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25598
25599         * class.cs (TypeContainer::AddConstructor): Fix the check to
25600         compare against Name, not Basename. 
25601         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25602
25603         * cs-parser.jay : Update accordingly.
25604
25605         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25606         for methods, don't forget to look into the operators too.
25607         (RegisterMethodBuilder): Helper method to take care of this for
25608         methods, constructors and operators.
25609         (Operator::Define): Completely revamp.
25610         (Operator.OperatorMethod, MethodName): New fields.
25611         (TypeContainer::Populate): Move the registering of builders into
25612         RegisterMethodBuilder.
25613         (Operator::Emit): Re-write.
25614
25615         * expression.cs (Binary::Emit): Comment out code path to emit method
25616         invocation stuff for the case when we have a user defined operator. I am
25617         just not able to get it right !
25618
25619 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25620
25621         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25622         argument. 
25623
25624         (Expression::MemberLookup): Provide a version that allows to
25625         specify the MemberTypes and BindingFlags. 
25626
25627         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25628         so it was not fetching variable information from outer blocks.
25629
25630         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25631         Beforefieldinit as it was buggy.
25632
25633         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25634         that Ravi put here.  
25635
25636         * class.cs (Constructor::Emit): Only emit if block is not null.
25637         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25638         deal with this by semantically definining it as if the user had
25639         done it.
25640
25641         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25642         constructors as we now "emit" them at a higher level.
25643
25644         (TypeContainer::DefineDefaultConstructor): Used to define the
25645         default constructors if none was provided.
25646
25647         (ConstructorInitializer): Add methods Resolve and Emit. 
25648
25649         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25650
25651 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25652
25653         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25654         the default constructor builder with our hashtable for methodbuilders
25655         to methodcores.
25656
25657         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25658         and argument_count is 0 in which case we have a match.
25659         (Binary::ResolveOperator): More null checking and miscellaneous coding
25660         style cleanup.
25661
25662 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25663
25664         * rootcontext.cs (IsNameSpace): Compare against null.
25665
25666         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25667
25668         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25669         and Unary::Operator.
25670
25671         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25672         accordingly.
25673
25674         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25675         we have overloaded operators.
25676         (Binary::ResolveOperator): Implement the part which does the operator overload
25677         resolution.
25678
25679         * class.cs (Operator::Emit): Implement.
25680         (TypeContainer::Emit): Emit the operators we have too.
25681
25682         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25683         the case when we have a user-defined operator.
25684
25685 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25686
25687         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25688
25689 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25690
25691         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25692         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25693         (Constructor::Emit): Implement.
25694         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25695         if we have no work to do. 
25696         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25697         Emit method.
25698
25699         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25700         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25701
25702         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25703         of parent.parent.
25704
25705 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25706
25707         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25708         in the source.
25709         (Tree::RecordNamespace): Method to do what the name says ;-)
25710         (Tree::Namespaces): Property to get at the namespaces hashtable.
25711
25712         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25713         keep track.
25714
25715         * rootcontext.cs (IsNamespace): Fixed it :-)
25716
25717 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25718
25719         * class.cs (TypeContainer::FindMembers): Add support for
25720         constructors. 
25721         (MethodCore): New class that encapsulates both the shared aspects
25722         of a Constructor and a Method.  
25723         (Method, Constructor): Factored pieces into MethodCore.
25724
25725         * driver.cs: Added --fatal which makes errors throw exceptions.
25726         Load System assembly as well as part of the standard library.
25727
25728         * report.cs: Allow throwing exceptions on errors for debugging.
25729
25730         * modifiers.cs: Do not use `parent', instead use the real type
25731         container to evaluate permission settings.
25732
25733         * class.cs: Put Ravi's patch back in.  He is right, and we will
25734         have to cope with the
25735
25736 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25737
25738         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25739         FamORAssem, not FamANDAssem.
25740
25741 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25742
25743         * driver.cs: Added --parse option that only parses its input files
25744         and terminates.
25745
25746         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25747         incorrect.  IsTopLevel is not used to tell whether an object is
25748         root_types or not (that can be achieved by testing this ==
25749         root_types).  But to see if this is a top-level *class* (not
25750         necessarly our "toplevel" container). 
25751
25752 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25753
25754         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25755         parent instead of a direct call to GetType.
25756
25757 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25758
25759         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25760         Modifiers.TypeAttr. This should just be a call to that method.
25761
25762         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25763         object so that we can determine if we are top-level or not.
25764
25765         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25766         TypeContainer too.
25767
25768         * enum.cs (Enum::Define): Ditto.
25769
25770         * modifiers.cs (FieldAttr): Re-write.
25771
25772         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25773         (TypeContainer::HaveStaticConstructor): New property to provide access
25774         to precisely that info.
25775
25776         * modifiers.cs (MethodAttr): Re-write.
25777         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25778
25779         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25780         of top-level types as claimed.
25781
25782 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25783
25784         * expression.cs (MemberLookup): Fruitless attempt to lookup
25785         constructors.  Maybe I need to emit default constructors?  That
25786         might be it (currently .NET emits this for me automatically).
25787         (Invocation::OverloadResolve): Cope with Arguments == null.
25788         (Invocation::EmitArguments): new function, shared by the new
25789         constructor and us.
25790         (Invocation::Emit): Handle static and instance methods.  Emit
25791         proper call instruction for virtual or non-virtual invocations.
25792         (New::Emit): Implement.
25793         (New::Resolve): Implement.
25794         (MemberAccess:Resolve): Implement.
25795         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25796         to track instances.
25797         (FieldExpr::Resolve): Set type.
25798
25799         * support.cs: Handle empty arguments.
25800                 
25801         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25802         SimpleLookup): Auxiliary routines to help parse a qualifier
25803         identifier.  
25804
25805         Update qualifier_identifier rule.
25806
25807         * codegen.cs: Removed debugging messages.
25808
25809         * class.cs: Make this a global thing, this acts just as a "key" to
25810         objects that we might have around.
25811
25812         (Populate): Only initialize method_builders_to_methods once.
25813
25814         * expression.cs (PropertyExpr): Initialize type from the
25815         PropertyType. 
25816
25817         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25818         Resolve pattern.  Attempt to implicitly convert value to boolean.
25819         Emit code.
25820
25821         * expression.cs: Set the type for the int32/int32 argument case.
25822         (Binary::ResolveOperator): Set the return type to boolean for
25823         comparission operators
25824
25825         * typemanager.cs: Remove debugging print code.
25826
25827         (Invocation::Resolve): resolve type.
25828
25829         * class.cs: Allocate a MemberInfo of the correct size, as the code
25830         elsewhere depends on the test to reflect the correct contents.
25831
25832         (Method::) Keep track of parameters, due to System.Reflection holes
25833
25834         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25835         mapping here.
25836
25837         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25838         of the exact size and return that.
25839
25840         (Class::LookupMethodByBuilder): New function that maps
25841         MethodBuilders to its methods.  Required to locate the information
25842         on methods because System.Reflection bit us again.
25843
25844         * support.cs: New file, contains an interface ParameterData and
25845         two implementations: ReflectionParameters and InternalParameters
25846         used to access Parameter information.  We will need to grow this
25847         as required.
25848
25849         * expression.cs (Invocation::GetParameterData): implement a cache
25850         and a wrapper around the ParameterData creation for methods. 
25851         (Invocation::OverloadResolve): Use new code.
25852
25853 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25854
25855         * class.cs (TypeContainer::EmitField): Remove and move into 
25856         (Field::Define): here and modify accordingly.
25857         (Field.FieldBuilder): New member.
25858         (TypeContainer::Populate): Update accordingly.
25859         (TypeContainer::FindMembers): Implement.
25860
25861 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25862
25863         * statement.cs: (VariableInfo::VariableType): New field to be
25864         initialized with the full type once it is resolved. 
25865
25866 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25867
25868         * parameter.cs (GetParameterInfo): Use a type cache to compute
25869         things only once, and to reuse this information
25870
25871         * expression.cs (LocalVariableReference::Emit): Implement.
25872         (OpcodeCast::Emit): fix.
25873
25874         (ParameterReference::Resolve): Implement.
25875         (ParameterReference::Emit): Implement.
25876
25877         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25878         that are expressions need to stay as Expressions.
25879
25880         * typemanager.cs (CSharpName): Returns the C# name of a type if
25881         possible. 
25882
25883         * expression.cs (Expression::ConvertImplicit): New function that
25884         implements implicit type conversions.
25885
25886         (Expression::ImplicitReferenceConversion): Implements implicit
25887         reference conversions.
25888
25889         (EmptyCast): New type for transparent casts.
25890
25891         (OpcodeCast): New type for casts of types that are performed with
25892         a sequence of bytecodes.
25893
25894         (BoxedCast): New type used for casting value types into reference
25895         types.  Emits a box opcode.
25896
25897         (Binary::DoNumericPromotions): Implements numeric promotions of
25898         and computation of the Binary::Type.
25899
25900         (Binary::EmitBranchable): Optimization.
25901
25902         (Binary::Emit): Implement code emission for expressions.
25903
25904         * typemanager.cs (TypeManager): Added two new core types: sbyte
25905         and byte.
25906
25907 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25908
25909         * class.cs (TypeContainer::FindMembers): Method which does exactly
25910         what Type.FindMembers does, only we don't have to use reflection. No
25911         implementation yet.
25912
25913         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25914         typecontainer objects as we need to get at them.
25915         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25916
25917         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25918         typecontainer object.
25919
25920         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25921         of just a Report object.
25922
25923 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25924
25925         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25926         "remove_"
25927         (TypeContainer::Populate): Now define the delegates of the type too.
25928         (TypeContainer.Delegates): Property to access the list of delegates defined
25929         in the type.
25930
25931         * delegates.cs (Delegate::Define): Implement partially.
25932
25933         * modifiers.cs (TypeAttr): Handle more flags.
25934
25935 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25936
25937         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25938         and not <=
25939         (Operator::Define): Re-write logic to get types by using the LookupType method
25940         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25941         (Indexer::Define): Ditto.
25942         (Event::Define): Ditto.
25943         (Property::Define): Ditto.
25944
25945 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25946
25947         * class.cs (TypeContainer::Populate): Now define operators too. 
25948         (TypeContainer.Operators): New property to access the list of operators
25949         in a type.
25950         (Operator.OperatorMethodBuilder): New member to hold the method builder
25951         for the operator we are defining.
25952         (Operator::Define): Implement.
25953
25954 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25955
25956         * class.cs (Event::Define): Make the prefixes of the accessor methods
25957         addOn_ and removeOn_ 
25958
25959         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25960         of the location being passed in too. Ideally, this should go later since all
25961         error reporting should be done through the Report object.
25962
25963         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25964         (Populate): Iterate thru the indexers we have and define them too.
25965         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25966         for the get and set accessors.
25967         (Indexer::Define): Implement.
25968
25969 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25970
25971         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25972         my previous implementation, did not work.
25973
25974         * typemanager.cs: Add a couple of missing types (the longs).
25975
25976         * literal.cs: Use TypeManager.bool_type instead of getting it.
25977
25978         * expression.cs (EventExpr): New kind of expressions.
25979         (Expressio::ExprClassFromMemberInfo): finish
25980
25981 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25982
25983         * assign.cs: Emit stores to static fields differently.
25984
25985 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25986
25987         * Merge in changes and adjust code to tackle conflicts. Backed out my
25988         code in Assign::Resolve ;-) 
25989
25990 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25991
25992         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25993         instead Report.Error and also pass in the location.
25994         (CSharpParser::Lexer): New readonly property to return the reference
25995         to the Tokenizer object.
25996         (declare_local_variables): Use Report.Error with location instead of plain 
25997         old error.
25998         (CheckDef): Ditto.
25999
26000         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26001         (Operator.CheckBinaryOperator): Ditto.
26002
26003         * cs-parser.jay (operator_declarator): Update accordingly.
26004
26005         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26006         (CheckBinaryOperator): Same here.
26007
26008         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26009         on the name without any prefixes of namespace names etc. This is because we
26010         already might have something already fully qualified like 
26011         'System.Console.WriteLine'
26012
26013         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26014
26015 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26016
26017         * cs-tokenizer.cs (location): Return a string which also contains
26018         the file name.
26019
26020         * expression.cs (ElementAccess): New class for expressions of the
26021         type 'element access.'
26022         (BaseAccess): New class for expressions of the type 'base access.'
26023         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26024         respectively.
26025
26026         * cs-parser.jay (element_access): Implement action.
26027         (base_access): Implement actions.
26028         (checked_expression, unchecked_expression): Implement.
26029
26030         * cs-parser.jay (local_variable_type): Correct and implement.
26031         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26032
26033         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26034
26035         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26036         name and the specifiers.
26037
26038         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26039
26040         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26041         making them all public ;-)
26042
26043         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26044         class anyways.
26045
26046 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26047
26048         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26049         PropertyExprs.
26050         (FieldExpr, PropertyExprs): New resolved expressions.
26051         (SimpleName::MemberStaticCheck): Perform static checks for access
26052         to non-static fields on static methods. Maybe this should be
26053         generalized for MemberAccesses. 
26054         (SimpleName::ResolveSimpleName): More work on simple name
26055         resolution. 
26056
26057         * cs-parser.jay (primary_expression/qualified_identifier): track
26058         the parameter index.
26059
26060         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26061         (EmitContext::EmitBoolExpression): Chain to expression generation
26062         instead of temporary hack.
26063         (::EmitStatementExpression): Put generic expression code generation.
26064
26065         * assign.cs (Assign::Emit): Implement variable assignments to
26066         local variables, parameters and fields.
26067
26068 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26069
26070         * statement.cs (Block::GetVariableInfo): New method, returns the
26071         VariableInfo for a variable name in a block.
26072         (Block::GetVariableType): Implement in terms of GetVariableInfo
26073
26074         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26075         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26076
26077 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26078
26079         * cs-parser.jay (operator_declaration): Continue on my quest : update
26080         to take attributes argument.
26081         (event_declaration): Ditto.
26082         (enum_declaration): Ditto.
26083         (indexer_declaration): Ditto.
26084
26085         * class.cs (Operator::Operator): Update constructor accordingly.
26086         (Event::Event): Ditto.
26087
26088         * delegate.cs (Delegate::Delegate): Same here.
26089
26090         * enum.cs (Enum::Enum): Same here.
26091
26092 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26093
26094         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26095
26096         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26097
26098         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26099         being passed around as an arraylist.
26100         (Attributes::AddAttribute): Method to add attribute sections.
26101
26102         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26103         (struct_declaration): Update accordingly.
26104         (constant_declaration): Update.
26105         (field_declaration): Update.
26106         (method_header): Update.
26107         (fixed_parameter): Update.
26108         (parameter_array): Ditto.
26109         (property_declaration): Ditto.
26110         (destructor_declaration): Ditto.
26111
26112         * class.cs (Struct::Struct): Update constructors accordingly.
26113         (Class::Class): Ditto.
26114         (Field::Field): Ditto.
26115         (Method::Method): Ditto.
26116         (Property::Property): Ditto.
26117         (TypeContainer::OptAttribute): update property's return type.
26118
26119         * interface.cs (Interface.opt_attributes): New member.
26120         (Interface::Interface): Update to take the extra Attributes argument.
26121
26122         * parameter.cs (Parameter::Parameter): Ditto.
26123
26124         * constant.cs (Constant::Constant): Ditto.
26125
26126         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26127         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26128         the attributes as a parameter.
26129         (InterfaceProperty): Update constructor call.
26130         (InterfaceEvent): Ditto.
26131         (InterfaceMethod): Ditto.
26132         (InterfaceIndexer): Ditto.
26133
26134         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26135         pass the attributes too.
26136         (interface_event_declaration): Ditto.
26137         (interface_property_declaration): Ditto.
26138         (interface_method_declaration): Ditto.
26139         (interface_declaration): Ditto.
26140
26141 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26142
26143         * class.cs (Method::Define): Track the "static Main" definition to
26144         create an entry point. 
26145
26146         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26147         EntryPoint if we find it. 
26148
26149         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26150         (EmitContext::ig): Make this variable public.
26151
26152         * driver.cs: Make the default output file be the first file name
26153         with the .exe extension.  
26154
26155         Detect empty compilations
26156
26157         Handle various kinds of output targets.  Handle --target and
26158         rename -t to --dumper.
26159
26160         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26161         methods inherited from Expression return now an Expression.  This
26162         will is used during the tree rewriting as we resolve them during
26163         semantic analysis.
26164
26165         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26166         the spec.  Missing entirely is the information about
26167         accessability of elements of it.
26168
26169         (Expression::ExprClassFromMemberInfo): New constructor for
26170         Expressions that creates a fully initialized Expression based on
26171         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26172         a Type.
26173
26174         (Invocation::Resolve): Begin implementing resolution of invocations.
26175
26176         * literal.cs (StringLiteral):  Implement Emit.
26177
26178 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26179
26180         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26181         member.
26182
26183 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26184
26185         * cs-parser.jay (attribute_arguments): Implement actions.
26186         (attribute): Fix bug in production. Implement action.
26187         (attribute_list): Implement.
26188         (attribute_target): Implement.
26189         (attribute_target_specifier, opt_target_specifier): Implement
26190         (CheckAttributeTarget): New method to check if the attribute target
26191         is valid.
26192         (attribute_section): Implement.
26193         (opt_attributes): Implement.
26194
26195         * attribute.cs : New file to handle attributes.
26196         (Attribute): Class to hold attribute info.
26197
26198         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26199         (attribute_section): Modify production to use 2 different rules to 
26200         achieve the same thing. 1 s/r conflict down !
26201         Clean out commented, useless, non-reducing dimension_separator rules.
26202
26203         * class.cs (TypeContainer.attributes): New member to hold list
26204         of attributes for a type.
26205         (Struct::Struct): Modify to take one more argument, the attribute list.
26206         (Class::Class): Ditto.
26207         (Field::Field): Ditto.
26208         (Method::Method): Ditto.
26209         (Property::Property): Ditto.
26210
26211         * cs-parser.jay (struct_declaration): Update constructor call to
26212         pass in the attributes too.
26213         (class_declaration): Ditto.
26214         (constant_declaration): Ditto.
26215         (field_declaration): Ditto.
26216         (method_header): Ditto.
26217         (fixed_parameter): Ditto.
26218         (parameter_array): Ditto.
26219         (property_declaration): Ditto.
26220
26221         * constant.cs (Constant::Constant): Update constructor similarly.
26222         Use System.Collections.
26223
26224         * parameter.cs (Parameter::Parameter): Update as above.
26225
26226 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26227
26228         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26229         (TypeContainer.delegates): New member to hold list of delegates.
26230
26231         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26232         this time as I seem to be on crack ;-)
26233
26234 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26235
26236         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26237         tell whether an identifier represents a namespace.
26238
26239         * expression.cs (NamespaceExpr): A namespace expression, used only
26240         temporarly during expression resolution.
26241         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26242         utility functions to resolve names on expressions.
26243
26244 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26245
26246         * codegen.cs: Add hook for StatementExpressions. 
26247
26248         * class.cs: Fix inverted test for static flag in methods.
26249
26250 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26251
26252         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26253         to make it coincide with MS' number.
26254         (Operator::CheckBinaryOperator): Ditto.
26255
26256         * ../errors/errors.txt : Remove error numbers added earlier.
26257
26258         * ../errors/cs1019.cs : Test case for error # 1019
26259
26260         * ../errros/cs1020.cs : Test case for error # 1020
26261
26262         * cs-parser.jay : Clean out commented cruft.
26263         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26264         used anywhere - non-reducing rule.
26265         (namespace_declarations): Non-reducing rule - comment out.
26266
26267         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26268         with TypeContainer::AddEnum.
26269
26270         * delegate.cs : New file for delegate handling classes.
26271         (Delegate): Class for declaring delegates.
26272
26273         * makefile : Update.
26274
26275         * cs-parser.jay (delegate_declaration): Implement.
26276
26277 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26278
26279         * class.cs (Event::Define): Implement.
26280         (Event.EventBuilder): New member.
26281
26282         * class.cs (TypeContainer::Populate): Update to define all enums and events
26283         we have.
26284         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26285         readonly fields for all these cases ?
26286
26287 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26288
26289         * class.cs (Property): Revamp to use the convention of making fields readonly.
26290         Accordingly modify code elsewhere.
26291
26292         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26293         the Define method of the Property class.
26294
26295         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26296         trivial bug.
26297         (TypeContainer::Populate): Update to define all the properties we have. Also
26298         define all enumerations.
26299
26300         * enum.cs (Define): Implement.
26301
26302 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26303
26304         * cs-parser.jay (overloadable_operator): The semantic value is an
26305         enum of the Operator class.
26306         (operator_declarator): Implement actions.
26307         (operator_declaration): Implement.
26308
26309         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26310         validity of definitions.
26311         (Operator::CheckBinaryOperator): Static method to check for binary operators
26312         (TypeContainer::AddOperator): New method to add an operator to a type.
26313
26314         * cs-parser.jay (indexer_declaration): Added line to actually call the
26315         AddIndexer method so it gets added ;-)
26316
26317         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26318         already taken care of by the MS compiler ?  
26319
26320 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26321
26322         * class.cs (Operator): New class for operator declarations.
26323         (Operator::OpType): Enum for the various operators.
26324
26325 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26326
26327         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26328         ostensibly handle this in semantic analysis.
26329
26330         * cs-parser.jay (general_catch_clause): Comment out
26331         (specific_catch_clauses, specific_catch_clause): Ditto.
26332         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26333         (catch_args, opt_catch_args): New productions.
26334         (catch_clause): Rewrite to use the new productions above
26335         (catch_clauses): Modify accordingly.
26336         (opt_catch_clauses): New production to use in try_statement
26337         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26338         and re-write the code in the actions to extract the specific and
26339         general catch clauses by being a little smart ;-)
26340
26341         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26342         Hooray, try and catch statements parse fine !
26343
26344 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26345
26346         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26347         string from the hashtable of variables.
26348
26349         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26350         I end up making that mistake ;-)
26351         (catch_clauses): Fixed gross error which made Key and Value of the 
26352         DictionaryEntry the same : $1 !!
26353
26354 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26355
26356         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26357
26358         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26359         when the add and remove accessors are specified. 
26360
26361 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26362
26363         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26364         information about indexer_declarator.
26365         (indexer_declarator): Implement actions.
26366         (parsing_indexer): New local boolean used to keep track of whether
26367         we are parsing indexers or properties. This is necessary because 
26368         implicit_parameters come into picture even for the get accessor in the 
26369         case of an indexer.
26370         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26371
26372         * class.cs (Indexer): New class for indexer declarations.
26373         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26374         (TypeContainer::indexers): New member to hold list of indexers for the
26375         type.
26376
26377 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26378
26379         * cs-parser.jay (add_accessor_declaration): Implement action.
26380         (remove_accessor_declaration): Implement action.
26381         (event_accessors_declaration): Implement
26382         (variable_declarators): swap statements for first rule - trivial.
26383
26384         * class.cs (Event): New class to hold information about event
26385         declarations.
26386         (TypeContainer::AddEvent): New method to add an event to a type
26387         (TypeContainer::events): New member to hold list of events.
26388
26389         * cs-parser.jay (event_declaration): Implement actions.
26390
26391 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26392
26393         * cs-parser.jay (dim_separators): Implement. Make it a string
26394         concatenating all the commas together, just as they appear.
26395         (opt_dim_separators): Modify accordingly
26396         (rank_specifiers): Update accordingly. Basically do the same
26397         thing - instead, collect the brackets here.
26398         (opt_rank_sepcifiers): Modify accordingly.
26399         (array_type): Modify to actually return the complete type string
26400         instead of ignoring the rank_specifiers.
26401         (expression_list): Implement to collect the expressions
26402         (variable_initializer): Implement. We make it a list of expressions
26403         essentially so that we can handle the array_initializer case neatly too.
26404         (variable_initializer_list): Implement.
26405         (array_initializer): Make it a list of variable_initializers
26406         (opt_array_initializer): Modify accordingly.
26407
26408         * expression.cs (New::NType): Add enumeration to help us
26409         keep track of whether we have an object/delegate creation
26410         or an array creation.
26411         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26412         members to hold data about array creation.
26413         (New:New): Modify to update NewType
26414         (New:New): New Overloaded contructor for the array creation
26415         case.
26416
26417         * cs-parser.jay (array_creation_expression): Implement to call
26418         the overloaded New constructor.
26419
26420 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26421
26422         * class.cs (TypeContainer::Constructors): Return member
26423         constructors instead of returning null.
26424
26425 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26426
26427         * typemanager.cs (InitCoreTypes): Initialize the various core
26428         types after we have populated the type manager with the user
26429         defined types (this distinction will be important later while
26430         compiling corlib.dll)
26431
26432         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26433         on Expression Classification.  Now all expressions have a method
26434         `Resolve' and a method `Emit'.
26435
26436         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26437         generation from working.     Also add some temporary debugging
26438         code. 
26439
26440 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26441
26442         * codegen.cs: Lots of code generation pieces.  This is only the
26443         beginning, will continue tomorrow with more touches of polish.  We
26444         handle the fundamentals of if, while, do, for, return.  Others are
26445         trickier and I need to start working on invocations soon.
26446
26447         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26448         s.InitStatement. 
26449
26450         * codegen.cs (EmitContext): New struct, used during code
26451         emission to keep a context.   Most of the code generation will be
26452         here. 
26453
26454         * cs-parser.jay: Add embedded blocks to the list of statements of
26455         this block.  So code generation proceeds in a top down fashion.
26456
26457 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26458
26459         * statement.cs: Add support for multiple child blocks.
26460
26461 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26462
26463         * codegen.cs (EmitCode): New function, will emit the code for a
26464         Block of code given a TypeContainer and its ILGenerator. 
26465
26466         * statement.cs (Block): Standard public readonly optimization.
26467         (Block::Block constructors): Link children. 
26468         (Block::Child): Child Linker.
26469         (Block::EmitVariables): Emits IL variable declarations.
26470
26471         * class.cs: Drop support for MethodGroups here, delay until
26472         Semantic Analysis.
26473         (Method::): Applied the same simplification that I did before, and
26474         move from Properties to public readonly fields.
26475         (Method::ParameterTypes): Returns the parameter types for the
26476         function, and implements a cache that will be useful later when I
26477         do error checking and the semantic analysis on the methods is
26478         performed.
26479         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26480         and made a method, optional argument tells whether this is a class
26481         or a structure to apply the `has-this' bit.
26482         (Method::GetCallingConvention): Implement, returns the calling
26483         convention. 
26484         (Method::Define): Defines the type, a second pass is performed
26485         later to populate the methods.
26486
26487         (Constructor::ParameterTypes): implement a cache similar to the
26488         one on Method::ParameterTypes, useful later when we do semantic
26489         analysis. 
26490
26491         (TypeContainer::EmitMethod):  New method.  Emits methods.
26492
26493         * expression.cs: Removed MethodGroup class from here.
26494
26495         * parameter.cs (Parameters::GetCallingConvention): new method.
26496
26497 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26498
26499         * class.cs (TypeContainer::Populate): Drop RootContext from the
26500         argument. 
26501
26502         (Constructor::CallingConvention): Returns the calling convention.
26503         (Constructor::ParameterTypes): Returns the constructor parameter
26504         types. 
26505
26506         (TypeContainer::AddConstructor): Keep track of default constructor
26507         and the default static constructor.
26508
26509         (Constructor::) Another class that starts using `public readonly'
26510         instead of properties. 
26511
26512         (Constructor::IsDefault): Whether this is a default constructor. 
26513
26514         (Field::) use readonly public fields instead of properties also.
26515
26516         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26517         track of static constructors;  If none is used, turn on
26518         BeforeFieldInit in the TypeAttributes. 
26519
26520         * cs-parser.jay (opt_argument_list): now the return can be null
26521         for the cases where there are no arguments. 
26522
26523         (constructor_declarator): If there is no implicit `base' or
26524         `this', then invoke the default parent constructor. 
26525
26526         * modifiers.cs (MethodAttr): New static function maps a set of
26527         modifiers flags into a MethodAttributes enum
26528         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26529         MethodAttr, TypeAttr to represent the various mappings where the
26530         modifiers are used.
26531         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26532
26533 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26534
26535         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26536         method arguments.
26537
26538         * interface.cs (PopulateIndexer): Implemented the code generator
26539         for interface indexers.
26540
26541 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26542
26543         * interface.cs (InterfaceMemberBase): Now we track the new status
26544         here.  
26545
26546         (PopulateProperty): Implement property population.  Woohoo!  Got
26547         Methods and Properties going today. 
26548
26549         Removed all the properties for interfaces, and replaced them with
26550         `public readonly' fields. 
26551
26552 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26553
26554         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26555         initialize their hashtables/arraylists only when they are needed
26556         instead of doing this always.
26557
26558         * parameter.cs: Handle refs and out parameters.
26559
26560         * cs-parser.jay: Use an ArrayList to construct the arguments
26561         instead of the ParameterCollection, and then cast that to a
26562         Parameter[] array.
26563
26564         * parameter.cs: Drop the use of ParameterCollection and use
26565         instead arrays of Parameters.
26566
26567         (GetParameterInfo): Use the Type, not the Name when resolving
26568         types. 
26569
26570 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26571
26572         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26573         and instead use public readonly fields.
26574
26575         * class.cs: Put back walking code for type containers.
26576
26577 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26578
26579         * class.cs (MakeConstant): Code to define constants.
26580
26581         * rootcontext.cs (LookupType): New function.  Used to locate types 
26582
26583
26584 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26585
26586         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26587         this System.Reflection code is.  Kudos to Microsoft
26588
26589         * typemanager.cs: Implement a type cache and avoid loading all
26590         types at boot time.  Wrap in LookupType the internals.  This made
26591         the compiler so much faster.  Wow.  I rule!
26592
26593         * driver.cs: Make sure we always load mscorlib first (for
26594         debugging purposes, nothing really important).
26595
26596         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26597         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26598
26599         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26600         on namespaces that have been imported using the `using' keyword.
26601
26602         * class.cs (TypeContainer::TypeAttr): Virtualize.
26603         (Class::TypeAttr): Return attributes suitable for this bad boy.
26604         (Struct::TypeAttr): ditto.
26605         Handle nested classes.
26606         (TypeContainer::) Remove all the type visiting code, it is now
26607         replaced with the rootcontext.cs code
26608
26609         * rootcontext.cs (GetClassBases): Added support for structs. 
26610
26611 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26612
26613         * interface.cs, statement.cs, class.cs, parameter.cs,
26614         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26615         Drop use of TypeRefs, and use strings instead.
26616
26617 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26618
26619         * rootcontext.cs: 
26620
26621         * class.cs (Struct::Struct): set the SEALED flags after
26622         checking the modifiers.
26623         (TypeContainer::TypeAttr): new property, returns the
26624         TypeAttributes for a class.  
26625
26626         * cs-parser.jay (type_list): Oops, list production was creating a
26627         new list of base types.
26628
26629         * rootcontext.cs (StdLib): New property.
26630         (GetInterfaceTypeByName): returns an interface by type name, and
26631         encapsulates error handling here.
26632         (GetInterfaces): simplified.
26633         (ResolveTree): Encapsulated all the tree resolution here.
26634         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26635         types. 
26636
26637         * driver.cs: Add support for --nostdlib, to avoid loading the
26638         default assemblies.
26639         (Main): Do not put tree resolution here. 
26640
26641         * rootcontext.cs: Beginning of the class resolution.
26642
26643 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26644
26645         * rootcontext.cs: Provide better error reporting. 
26646
26647         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26648
26649         * rootcontext.cs (CreateInterface): Handle the case where there
26650         are no parent interfaces.
26651
26652         (CloseTypes): Routine to flush types at the end.
26653         (CreateInterface): Track types.
26654         (GetInterfaces): Returns an array of Types from the list of
26655         defined interfaces.
26656
26657         * typemanager.c (AddUserType): Mechanism to track user types (puts
26658         the type on the global type hash, and allows us to close it at the
26659         end). 
26660
26661 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26662
26663         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26664         RecordInterface instead.
26665
26666         * cs-parser.jay: Updated to reflect changes above.
26667
26668         * decl.cs (Definition): Keep track of the TypeBuilder type that
26669         represents this type here.  Not sure we will use it in the long
26670         run, but wont hurt for now.
26671
26672         * driver.cs: Smaller changes to accomodate the new code.
26673
26674         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26675         when done. 
26676
26677         * rootcontext.cs (CreateInterface):  New method, used to create
26678         the System.TypeBuilder type for interfaces.
26679         (ResolveInterfaces): new entry point to resolve the interface
26680         hierarchy. 
26681         (CodeGen): Property, used to keep track of the code generator.
26682
26683 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26684
26685         * cs-parser.jay: Add a second production for delegate_declaration
26686         with `VOID'.
26687
26688         (enum_body): Put an opt_comma here instead of putting it on
26689         enum_body or enum_member_declarations so we can handle trailing
26690         commas on enumeration members.  Gets rid of a shift/reduce.
26691
26692         (type_list): Need a COMMA in the middle.
26693
26694         (indexer_declaration): Tell tokenizer to recognize get/set
26695
26696         * Remove old targets.
26697
26698         * Re-add the parser target.
26699
26700 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26701
26702         * cs-parser.jay: Add precendence rules for a number of operators
26703         ot reduce the number of shift/reduce conflicts in the grammar.
26704
26705 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26706
26707         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26708         and put it here.
26709
26710         Get rid of old crufty code.
26711
26712         * rootcontext.cs: Use this to keep track of the parsed
26713         representation and the defined types available to the program. 
26714
26715         * gen-treedump.cs: adjust for new convention.
26716
26717         * type.cs: Split out the type manager, and the assembly builder
26718         from here. 
26719
26720         * typemanager.cs: the type manager will live here now.
26721
26722         * cil-codegen.cs: And the code generator here. 
26723
26724 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26725
26726         * makefile: Fixed up for easy making.
26727
26728 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26729
26730         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26731         the 
26732
26733         (unary_expression): Expand pre_increment_expression and
26734         post_decrement_expression to reduce a shift/reduce.
26735
26736 2001-07-11  Simon Cozens
26737
26738         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26739
26740         Improve allow_keyword_as_indent name.
26741
26742 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26743
26744         * Adjustments for Beta2. 
26745
26746 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26747
26748         * decl.cs: Added `Define' abstract method.
26749         (InTransit): new property, used to catch recursive definitions. 
26750
26751         * interface.cs: Implement `Define'. 
26752
26753         * modifiers.cs: Map Modifiers.constants to
26754         System.Reflection.TypeAttribute flags.
26755
26756         * class.cs: Keep track of types and user-defined types.
26757         (BuilderInit): New method for creating an assembly
26758         (ResolveType): New function to launch the resolution process, only
26759         used by interfaces for now.
26760
26761         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26762         that are inserted into the name space. 
26763
26764 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26765
26766         * ARGH.  I have screwed up my tree so many times due to the use of
26767         rsync rather than using CVS.  Going to fix this at once. 
26768
26769         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26770         load types.
26771
26772 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26773
26774         * Experiment successful: Use System.Type rather that our own
26775         version of Type.  
26776
26777 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26778
26779         * cs-parser.jay: Removed nsAliases from here.
26780
26781         Use new namespaces, handle `using XXX;' 
26782
26783         * namespace.cs: Reimplemented namespace handling, use a recursive
26784         definition of the class.  Now we can keep track of using clauses
26785         and catch invalid using clauses.
26786
26787 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26788
26789         * gen-treedump.cs: Adapted for all the renaming.
26790
26791         * expression.cs (Expression): this class now has a Type property
26792         which returns an expression Type.
26793
26794         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26795         `Type', as this has a different meaning now in the base
26796
26797 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26798
26799         * interface.cs, class.cs: Removed from all the sources the
26800         references to signature computation, as we can not do method
26801         signature computation during the parsing time, as we are not
26802         trying to solve at that point distinguishing:
26803
26804         class X {
26805                 void a (Blah x) {}
26806                 void a (NS.Blah x) {}
26807         }
26808
26809         Which depending on the context might be valid or not, as we do not
26810         know if Blah is the same thing as NS.Blah at that point.
26811
26812         * Redid everything so the code uses TypeRefs now instead of
26813         Types.  TypeRefs are just temporary type placeholders, that need
26814         to be resolved.  They initially have a pointer to a string and the
26815         current scope in which they are used.  This is used later by the
26816         compiler to resolve the reference to an actual Type. 
26817
26818         * DeclSpace is no longer a CIR.Type, and neither are
26819         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26820         are all DeclSpaces, but no Types. 
26821
26822         * type.cs (TypeRefManager): This implements the TypeRef manager,
26823         which keeps track of all the types that need to be resolved after
26824         the parsing has finished. 
26825
26826 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26827
26828         * ARGH.  We are going to have to store `foreach' as a class rather
26829         than resolving it, as we need to verify error 1579 after name
26830         resolution.   *OR* we could keep a flag that says `This request to
26831         IEnumerator comes from a foreach statement' which we can then use
26832         to generate the error.
26833
26834 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26835
26836         * class.cs (TypeContainer.AddMethod): we now add methods to the
26837         MethodGroup instead of the method hashtable.  
26838
26839         * expression.cs: Add MethodGroup abstraction, which gets us one
26840         step closer to the specification in the way we handle method
26841         declarations.  
26842
26843         * cs-parser.jay (primary_expression): qualified_identifier now
26844         tried to match up an identifier to a local variable reference or
26845         to a parameter reference.
26846
26847         current_local_parameters is now a parser global variable that
26848         points to the current parameters for the block, used during name
26849         lookup.
26850
26851         (property_declaration): Now creates an implicit `value' argument to
26852         the set accessor.
26853
26854 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26855
26856         * parameter.cs: Do not use `param' arguments as part of the
26857         signature, per the spec.
26858
26859 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26860
26861         * decl.cs: Base class for classes, structs and interfaces.  This
26862         is the "Declaration Space" 
26863
26864         * cs-parser.jay: Use CheckDef for checking declaration errors
26865         instead of having one on each function.
26866
26867         * class.cs: Factor out some code for handling error handling in
26868         accordance to the "Declarations" section in the "Basic Concepts"
26869         chapter in the ECMA C# spec.
26870
26871         * interface.cs: Make all interface member classes derive from
26872         InterfaceMemberBase.
26873
26874 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26875
26876         * Many things: all interfaces are parsed and generated in
26877         gen-treedump.  Support for member variables, constructors,
26878         destructors, properties, constants is there.
26879
26880         Beginning of the IL backend, but very little done, just there for
26881         testing purposes. 
26882
26883 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26884
26885         * cs-parser.jay: Fix labeled statement.
26886
26887         * cs-tokenizer.cs (escape): Escape " and ' always.
26888         ref_line, ref_name: keep track of the line/filename as instructed
26889         by #line by the compiler.
26890         Parse #line.
26891
26892 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26893
26894         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26895         to match the values in System.CodeDOM.
26896
26897         Divid renamed to Divide.
26898
26899         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26900         statements. 
26901         (Statements.set): remove.
26902
26903         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26904         statements. 
26905
26906         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26907         falseStatements always have valid values. 
26908
26909         * cs-parser.jay: Use System.CodeDOM now.
26910