2008-04-01 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2
3         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
4         null.
5
6 2008-04-01  Marek Safar  <marek.safar@gmail.com>
7
8         * nullable.cs, expression.cs: Use namespace instead heavily nested
9         monster abstract class.
10
11 2008-04-01  Marek Safar  <marek.safar@gmail.com>
12
13         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
14         lifting of null literal and user operators. Clean up of some temporary
15         nullable hacks.
16
17 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
18
19         Fix #368224, test-629.cs
20         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
21         if it crossed an unwind-protect boundary.
22         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
23         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
24         inside an unwind-protected region.
25         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
26         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
27         'leave' instead of a 'br' if unwind-protected.
28         (Iterator.EmitYieldBreak): Likewise.
29
30 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
31
32         * driver.cs: Only define versioninfo resources if no win32 resource
33         file was specified.
34
35 2008-03-28  Marek Safar  <marek.safar@gmail.com>
36
37         A fix for bug #372375
38         * convert.cs: Fixed boxing of nullable types.
39
40 2008-03-28  Marek Safar  <marek.safar@gmail.com>
41
42         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
43         type.
44
45 2008-03-28  Marek Safar  <marek.safar@gmail.com>
46
47         A fix for bug #374619
48         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
49         
50 2008-03-27  Marek Safar  <marek.safar@gmail.com>
51
52         * lambda.cs: Check return type only for invocation.
53         
54 2008-03-27  Marek Safar  <marek.safar@gmail.com>
55
56         A fix for bug #374214
57         * ecore.cs: Correctly report argument type mismatch.
58
59 2008-03-27  Marek Safar  <marek.safar@gmail.com>
60
61         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
62         and not rely on broken IsEnum.
63
64 2008-03-27  Marek Safar  <marek.safar@gmail.com>
65
66         * nullable.cs: New file, extracted from generic.cs.
67         
68         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
69
70 2008-03-27  Marek Safar  <marek.safar@gmail.com>
71
72         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
73         predefined comparison operators and null literals.
74         
75         * report.cs: New warning ID.
76         
77 2008-03-25  Marek Safar  <marek.safar@gmail.com>
78
79         A fix for bug #370577
80         * lambda.cs: Check return type too.
81
82 2008-03-25  Marek Safar  <marek.safar@gmail.com>
83
84         A fix for bug #372846
85         * class.cs: Automatic properties can be declared as unsafe.
86
87 2008-03-20  Marek Safar  <marek.safar@gmail.com>
88
89         * location.cs: Use string based concatenation.
90         
91         * expression.cs: LiftedBinaryOperator is gmcs only.
92         
93 2008-03-20  Marek Safar  <marek.safar@gmail.com>
94
95         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
96         conversions rules and expression trees.
97
98 2008-03-19  Marek Safar  <marek.safar@gmail.com>
99
100         * delegate.cs: Use extension method source as delegate target.
101
102 2008-03-19  Marek Safar  <marek.safar@gmail.com>
103
104         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
105         binary operations to be purely based on binary operations and optimized
106         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
107         and other ET refactoring.
108         
109         * typemanager.cs: Fixed warning.
110         
111 2008-03-17  Marek Safar  <marek.safar@gmail.com>
112
113         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
114         
115         * symbolwriter.cs: Fixed.
116
117 2008-03-17  Marek Safar  <marek.safar@gmail.com>
118
119         * anonymous.cs, driver.cs: Reset anonymous types counters.
120
121 2008-03-17  Marek Safar  <marek.safar@gmail.com>
122
123         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
124         
125         * class.cs: Use fullname for all type member definitions.
126         
127 2008-02-19  Martin Baulig  <martin@ximian.com>
128
129         * class.cs
130         (IMethodData.EmitExtraSymbolInfo): New interface method.
131         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
132         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
133         interface method here as an empty public virtual method.
134
135         * anonymous.cs
136         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
137         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
138         CodeGen.SymbolWriter.SetRealMethodName().       
139
140 2008-02-18  Martin Baulig  <martin@ximian.com>
141
142         * anonymous.cs
143         (ScopeInfo.EmitType): Override this and emit debugging
144         information for captured variables.
145         (RootScopeInfo.EmitType): Override this and emit symbol
146         information for a captured `this'.
147
148 2008-02-15  Martin Baulig  <martin@ximian.com>
149
150         * iterators.cs: Emit debugging info.
151
152         * codegen.cs
153         (EmitContext.Flags): Add `OmitDebuggingInfo'.
154         (EmitContext.OmitDebuggingInfo): New public property.
155
156         * statement.cs
157         (While): Override Emit() and don't emit symbol info there; do it
158         inside DoEmit() instead.
159         (Block.Emit): Omit symbol information while emitting the scope
160         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
161         block logic.
162         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
163         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
164         .ctor to make `IsIterator' work.
165
166 2008-03-14  Martin Baulig  <martin@ximian.com>
167
168         * symbolwriter.cs: Added the new symbol writer function from the
169         debugger's `terrania' branch; temporarily enclose them inside
170         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
171         my vacations.
172
173 2008-03-14  Martin Baulig  <martin@ximian.com>
174
175         * symbolwriter.cs
176         (SymbolWriter): Make this a public static class.
177
178         * codegen.cs
179         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
180         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
181
182 2008-03-14  Marek Safar  <marek.safar@gmail.com>
183
184         A fix for bug #370577
185         * statement.cs, lambda.cs: Added extra limitations when dealing with void
186         return type.
187         
188 2008-03-14  Marek Safar  <marek.safar@gmail.com>
189
190         * typemanager.cs (CSharpName): Made 250 times faster.
191
192 2008-03-13  Marek Safar  <marek.safar@gmail.com>
193
194         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
195         
196 2008-03-12  Marek Safar  <marek.safar@gmail.com>
197
198         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
199         crash when predefined field does not exist.
200         
201 2008-03-12  Marek Safar  <marek.safar@gmail.com>
202
203         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
204         
205 2008-03-12  Marek Safar  <marek.safar@gmail.com>
206
207         * class.cs (FixedField): Don't crash when contructors are missing.
208
209 2008-03-11  Marek Safar  <marek.safar@gmail.com>
210
211         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
212         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
213         check internal types accessibility for internal and external types.
214         Replaced EnumToUnderlying by GetEnumUnderlyingType.
215
216 2008-03-11  Marek Safar  <marek.safar@gmail.com>
217
218         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
219         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
220         attribute.cs, statement: Use corect instance of predefined types (work
221         related to #364674).
222
223 2008-03-07  Marek Safar  <marek.safar@gmail.com>
224
225         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
226         
227 2008-03-07  Marek Safar  <marek.safar@gmail.com>
228
229         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
230         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
231         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
232         predefined types clean up, delayed predefined types members initialization
233         (work related to #364674).
234
235 2008-03-05  Marek Safar  <marek.safar@gmail.com>
236
237         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
238         
239 2008-03-05  Marek Safar  <marek.safar@gmail.com>
240
241         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
242         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
243         predefined types clean up (work related to #364674).
244
245 2008-03-04  Marek Safar  <marek.safar@gmail.com>
246
247         * ecore.cs: Print an error message instead of throwing exception.
248         
249 2008-03-04  Marek Safar  <marek.safar@gmail.com>
250
251         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
252         expression.cs, statement.cs: Unififed null literal representation.
253
254 2008-03-03  Marek Safar  <marek.safar@gmail.com>
255
256         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
257         expression.cs: Refactored binary operators resolve phase and improved speed.
258         The nullable code is still missing and won't work correctly, more fixes
259         required.
260
261         It also fixes #323726, #324312, #324248, and many other unreported issues.
262
263 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
264
265         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
266         instead of 'gmcs'.
267
268 2008-02-27  Marek Safar  <marek.safar@gmail.com>
269
270         * ecore.cs: Clean-up and split BetterConversion.
271         
272 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
273
274         Fix #363791
275         * enum.cs (EnumMember.Value): Only access 'value' if
276         ResolveValue says it's ok.
277         (EnumMember.DoResolveValue): Don't set prev_member.value.
278         (Enum.GetDefinition): Reverse arguments of Equals --
279         EnumMember.Value can return 'null'.
280
281         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
282
283 2008-02-22  Marek Safar  <marek.safar@gmail.com>
284
285         * generic.cs, expression.cs: More ongoing work on expression trees.
286         
287 2008-02-21  Marek Safar  <marek.safar@gmail.com>
288
289         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
290         handle missing matches when mutiple operators exist.
291         
292 2008-02-20  Marek Safar  <marek.safar@gmail.com>
293
294         A fix for bug #363218
295         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
296         initializers.
297         
298 2008-02-20  Marek Safar  <marek.safar@gmail.com>
299
300         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
301         update. This time to deal correctly with SideEffectConstant expression used
302         as an argument for another constant folding.
303
304 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
305
306         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
307         MethodBuilder.
308
309 2008-02-19  Marek Safar  <marek.safar@gmail.com>
310
311         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
312
313 2008-02-19  Marek Safar  <marek.safar@gmail.com>
314
315         A fix for bug #328136
316         * expression.cs: Do not fold immediately LogicalAnd operators when the left
317         side is a false constant, because we still need to evaluate the right-hand
318         side.
319
320         * statement.cs (If): Emit two types of boolean constants (simple constant,
321         side-effect constant).
322
323 2008-02-19  Marek Safar  <marek.safar@gmail.com>
324
325         * constant.cs (SideEffectConstant): Don't emit boolean constant.
326
327         * expression.cs: Fold immediately LogicalAnd operators when both sides are
328         constants.
329
330 2008-02-18  Marek Safar  <marek.safar@gmail.com>
331
332         A fix for bug #361457
333         * ecore.cs (IsApplicable): Params methods have lower priority.
334
335         * support.cs: Return correct parameter modifier for params types.
336
337 2008-02-18  Marek Safar  <marek.safar@gmail.com>
338
339         * generic.cs (TypeParameter): Cache attribute target name.
340
341         * support.cs: Removed unused variable.
342
343         * typemanager.cs: Removed debugging leftover.
344
345         * ecore.cs: Use local type instead of a property;
346
347         * class.cs (VerifyMembers): Consider also parent to test whether type member
348         is local or public.
349
350         * expression.cs (FullMethodDesc): Removed.
351
352         * attribute.cs (IsValidArgumentType): Made static.
353
354 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
355
356         Cleanup to be more readable.
357         * Makefile (GMCS_PROFILE): Remove.
358         (COMPILER_NAME): New helper.
359
360 2008-02-15  Miguel de Icaza  <miguel@novell.com>
361
362         * cs-tokenizer.cs: if a conditional expression happens inside a
363         (...) this also means that we do not need to de-ambiguate between
364         an parenthesized expression and a cast.
365
366         Fixes 346484.
367
368         * constant.cs (SideEffectConstant): a constant value that happens
369         to have a side effect.
370
371         Fixes the build regressions introduced by the fix for #359789
372
373 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
374
375         * expression.cs (Conditional.Emit): when emitting the ternary
376         operator, use local variables to generate code verifiable code.
377
378         The verifier cannot infer that the type on stack before the
379         stloc.0 is executed is of type ParentB. This happens because the
380         stack merge algorithm uses only parent types when deciding which
381         is the common type.  This is described in Part III 1.8.1.3 of ECMA
382         335.
383
384         This code compiled with mcs is not verifiable under MS. The MS
385         verifier picks the first common interface of Foo and Bar, which is
386         wrong, but doesn't use a full join type of the 2 interfaces.
387
388         CSC uses a clever hack to compile such code in a verifiable
389         way. It stores the intermediate values in a local variable with
390         the expected type.
391
392         Fixes: #358102
393
394 2008-02-14  Miguel de Icaza  <miguel@novell.com>
395
396         * expression.cs: Do not fold BitwiseAnd operators when the left
397         side is a false constant, because we still need to evaluate the
398         right-hand side.
399
400         Fixes #359789
401
402         * support.cs: Instead of throwing an InternalErrorException when
403         the position of the stream is outside the boundary of our buffer,
404         reset the state of the reader, and restart the reading from the
405         beginning of the file.
406
407 2008-02-14  Marek Safar  <marek.safar@gmail.com>
408
409         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
410
411 2008-02-14  Marek Safar  <marek.safar@gmail.com>
412
413         A fix for bug #361686
414         * decl.cs: A protected types used inside a private class which parents
415         derives from the protected class are accessible.
416
417 2008-02-13  Marek Safar  <marek.safar@gmail.com>
418
419         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
420         the parameterless constructor.
421
422 2008-02-13  Marek Safar  <marek.safar@gmail.com>
423
424         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
425         lookup methods to use standard member cache when doing member lookup.
426
427 2008-02-12  Marek Safar  <marek.safar@gmail.com>
428
429         * driver.cs: Don't report full path for referenced module as assembly error.
430
431 2008-02-12  Marek Safar  <marek.safar@gmail.com>
432
433         * Makefile: Fixed `qh' target to work on all machines.
434
435         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
436         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
437         and HasElementType with TypeManager implementation.
438
439 2008-02-08  Marek Safar  <marek.safar@gmail.com>
440
441         A fix for bugs #325134, #359749
442         * expression.cs, ecore.cs: Try to resolve an extension method even if the
443         first binds point to non-method member expression.
444
445 2008-02-08  Marek Safar  <marek.safar@gmail.com>
446
447         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
448
449 2008-02-08  Marek Safar  <marek.safar@gmail.com>
450
451         A fix for bugs #321394, #323028
452         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
453         Reworked naive IsAccessibleAs implementation to handle nested types.
454
455 2008-02-05  Jb Evain  <jbevain@novell.com>
456
457         * class.cs: use generic type comparison for parameters
458         as well.
459
460 2008-02-05  Marek Safar  <marek.safar@gmail.com>
461
462         A fix for bug #325372
463         * class.cs: Use generic type comparison when testing method signatures.
464
465 2008-02-05  Marek Safar  <marek.safar@gmail.com>
466
467         A fix for bug #357047
468         * ecore.cs: Applied C# 3.0 changes to better conversion.
469
470 2008-02-05  Marek Safar  <marek.safar@gmail.com>
471
472         A fix for bug #358374
473         * cs-parser.jay: Correctly set modifiers for all constructor types.
474
475 2008-02-04  Marek Safar  <marek.safar@gmail.com>
476
477         A fix for bug #355251
478         * generic.cs: Added base class constraint based type inference.
479
480 2008-02-01  Marek Safar  <marek.safar@gmail.com>
481
482         A fix for bug #357255
483         * decl.cs: One more missing visibility check.
484
485 2008-02-01  Marek Safar  <marek.safar@gmail.com>
486
487         * support.cs: Fixed broken return.
488
489 2008-01-25  Marek Safar  <marek.safar@gmail.com>
490
491         * report.cs: Correctly reset warnings count after probing.
492
493 2008-01-25  Martin Baulig  <martin@ximian.com>
494
495         * namespace.cs
496         (NamespaceEntry.SymbolFileID): Make this work again after
497         MemberName.ToString() is gone.
498
499 2008-01-25  Marek Safar  <marek.safar@gmail.com>
500
501         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
502         expressions.
503
504 2008-01-25  Marek Safar  <marek.safar@gmail.com>
505
506         * generic.cs: Use full implicit conversion for type inference fixing.
507
508 2008-01-24  Marek Safar  <marek.safar@gmail.com>
509
510         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
511         Fixed user operator conversions.
512
513 2008-01-24  Marek Safar  <marek.safar@gmail.com>
514
515         * generic.cs: Do nullable type to null comparison optimization during
516         resolve phase.
517
518 2008-01-24  Marek Safar  <marek.safar@gmail.com>
519
520         A fix for bug #355163
521         * generic.cs: Enabled l-value resolve on nullable expressions.
522
523 2008-01-24  Marek Safar  <marek.safar@gmail.com>
524
525         A fix for bug #353986
526         * class.cs: Ingore static ctors with parameters for any further checks.
527
528 2008-01-24  Marek Safar  <marek.safar@gmail.com>
529
530         A fix for bug #354310
531         * namespace.cs: Removed redundant check.
532
533 2008-01-24  Marek Safar  <marek.safar@gmail.com>
534
535         A fix for bug #354928
536         * expression.cs: ElementInitializers can be resolved only once.
537
538 2008-01-24  Marek Safar  <marek.safar@gmail.com>
539
540         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
541         Condition expressions.
542
543 2008-01-23  Marek Safar  <marek.safar@gmail.com>
544
545         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
546
547 2008-01-22  Marek Safar  <marek.safar@gmail.com>
548
549         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
550         not allowed.
551
552         * generic.cs: Implemented coalesce expression.
553
554 2008-01-22  Marek Safar  <marek.safar@gmail.com>
555
556         A fix for bug #355145
557         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
558         expression tree type inference.
559
560 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
561
562         Fix #354663
563         * expression.cs (Binary.IsUnsignedType): Fix typo.
564
565 2008-01-22  Marek Safar  <marek.safar@gmail.com>
566
567         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
568
569 2008-01-22  Marek Safar  <marek.safar@gmail.com>
570
571         A fix for bug #355161
572         * ecore.cs, expression.cs: Wider range of extension method supported
573         expressions.
574
575 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
576
577         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
578         AssemblyBuilder to operate in compiler context. Fixes mcs part of
579         bug #354970.
580
581 2008-01-22  Marek Safar  <marek.safar@gmail.com>
582
583         A fix for bug #355148
584         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
585
586 2008-01-22  Miguel de Icaza  <miguel@novell.com>
587
588         * expression.cs (CreateExpressionTree): Add support for or and
589         logical or, and indent following the coding conventions.
590
591         * typemanager.cs (LinqExpression): renamed from
592         ExpressionTreeManager, for a shorter name.
593
594         Use TypeManager.CoreLookupType to lookup types from our core
595         assemblies and turn those into "Type" variables.
596
597         Consumers that previously used "Namespace" and "Type" from this
598         class should instead use the TypeExpression which is a type that
599         is fully resolved (without involving the regular C# resolution
600         rules). 
601
602         This typically looks like this:
603
604         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
605         new MemberAccess (texpr, name, type_arguments, loc)
606
607         This avoids the problem in: #355178
608
609 2008-01-21  Marek Safar  <marek.safar@gmail.com>
610
611         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
612         feature in parser only as we do in other cases.
613         
614 2008-01-21  Marek Safar  <marek.safar@gmail.com>
615
616         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
617         typemanager.cs: A refactoring of params arguments to reuse existing
618         expressions (params -> array initializer) to emit params argument instead
619         of specialized handling.
620         It was required by expression tree implementation and it has other benefits
621         as well, we now apply same optimization for params arguments as we do for
622         array initializers.
623         
624 2008-01-18  Marek Safar  <marek.safar@gmail.com>
625
626         A fix for bug #353526
627         * generic.cs: A type inference of params arguments may not required any
628         temporary array creation.
629         
630 2008-01-18  Marek Safar  <marek.safar@gmail.com>
631
632         A fix for bug #353534
633         * generic.cs, ecore.cs, expression.cs: A method group type inference is
634         supported for delegates only.
635         
636 2008-01-18  Marek Safar  <marek.safar@gmail.com>
637
638         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
639         type for more than 1 candidates.
640         
641 2008-01-18  Marek Safar  <marek.safar@gmail.com>
642
643         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
644         expressions.
645         
646 2008-01-16  Marek Safar  <marek.safar@gmail.com>
647
648         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
649         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
650         operator) expressions. 
651                 
652 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
653
654         * statement.cs: Avoid declaring an IL variable for this_variable since it is
655         not accessed from the generated IL.
656
657 2008-01-14  Marek Safar  <marek.safar@gmail.com>
658
659         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
660         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
661         statement.cs: The first expression tree implementation drop, mostly
662         infrastructure work.
663
664 2008-01-14  Marek Safar  <marek.safar@gmail.com>
665
666         * ecore.cs (IsNestedChild): Refactored.
667
668 2008-01-11  Marek Safar  <marek.safar@gmail.com>
669
670         * lambda.cs: Don't use a cast on unknown expression statement.
671
672 2008-01-10  Geoff Norton  <gnorton@novell.com>
673
674         * cs-tokenizer.cs: One more token to distinguish between method and lambda
675         arguments
676
677 2008-01-09  Marek Safar  <marek.safar@gmail.com>
678
679         * doc.cs: Report better /doc crash details.
680         
681 2008-01-09  Marek Safar  <marek.safar@gmail.com>
682
683         A fix for bug #352536
684         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
685
686 2008-01-08  Marek Safar  <marek.safar@gmail.com>
687
688         A fix for bug #352287
689         * ecore.cs, expression.cs: Do `this' access checking in all member access
690         expressions.
691         
692 2008-01-08  Marek Safar  <marek.safar@gmail.com>
693
694         * rootcontext.cs, driver.cs: Switch to linq mode by default.
695         
696         * report.cs: Reset message stacks.
697         
698 2008-01-08  Marek Safar  <marek.safar@gmail.com>
699
700         * generic.cs (InferInPhases): Correctly calculate params position.
701         
702 2008-01-08  Marek Safar  <marek.safar@gmail.com>
703
704         * cs-tokenizer.cs: No need to parse full string when parsing lambda
705         arguments.
706
707 2008-01-07  Marek Safar  <marek.safar@gmail.com>
708
709         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
710         
711         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
712         
713         * driver.cs: Updated --help option.
714         
715 2008-01-07  Marek Safar  <marek.safar@gmail.com>
716
717         * generic.cs (InferParamsTypeArguments): Removed.
718         (InferInPhases): Add params type inference.
719         (LowerBoundInference): Fixed scoring mechanism.
720         
721         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
722         
723 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
724
725         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
726         byte array for unsigned "baked" assemblies.
727
728 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
729
730         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
731         array for assemblies that are not strongnamed.
732
733 2008-01-04  Marek Safar  <marek.safar@gmail.com>
734
735         A fix for bug #351481
736         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
737         declaring type for nested generic types.
738         
739 2008-01-04  Marek Safar  <marek.safar@gmail.com>
740
741         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
742         instead of ToString.
743         
744 2008-01-03  Marek Safar  <marek.safar@gmail.com>
745
746         A fix for bug #351047
747         * expression.cs (Binary.ResolveOperator): Allow equality operators between
748         null and structs only when equality and inequality operators are defined
749         either as an user-operators or predefined operators.
750         
751 2008-01-03  Marek Safar  <marek.safar@gmail.com>
752
753         A fix for bug #351047
754         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
755         
756 2008-01-03  Marek Safar  <marek.safar@gmail.com>
757
758         A fix for bug #351257
759         * cs-tokenizer.cs: Advance line number for '\r' correctly.
760         
761 2008-01-03  Marek Safar  <marek.safar@gmail.com>
762
763         A fix for bug #351157
764         * class.cs (Using): Fixed yet another broken cloning.
765         
766         (Block): Put back more sensible default value for statements.
767         
768 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
769
770         * codegen.cs: Allow AssemblyVersion with only major version component.
771         Fixes bug #351055.
772
773 2007-12-29  Marek Safar  <marek.safar@gmail.com>
774
775         A fix for bug #324654
776         * class.cs: Use FullName property as member name.
777
778 2007-12-28  Marek Safar  <marek.safar@gmail.com>
779
780         A fix for bug #342117
781         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
782         constructor constraint.
783
784 2007-12-28  Marek Safar  <marek.safar@gmail.com>
785
786         A fix for bug #338273
787         * class.cs (ProbertyBase): Access modifier checks are required for overrides
788         only.
789
790 2007-12-28  Marek Safar  <marek.safar@gmail.com>
791
792         A fix for bug #350839
793         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
794
795 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
796
797         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
798         GHOP:
799         
800         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
801
802         * statement.cs: Changed some Hashtables to use HybridDictionaries
803         instead. It was observed that some HashTables only contained a few
804         items in the vast majority of cases. Since HybridDictionary is
805         more efficient on small sets (<10 elements), "known_variables"
806         from class ExplicitBlock as well as "labels" and "constants " from
807         class Block were changed to HybridDictionaries. 
808
809         Atsai results: (56216kb->54987kb)
810
811         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
812
813
814 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
815
816         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
817         GHOP:
818         
819         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
820         
821         * expression.cs: foreach loop to for loop, saved on allocation of
822         enumerator (59333kb->59141kb)
823
824         * statement.cs. Changed foreach loops to for loops, saved on
825         allocation of enumerator (59141kb->59006kb)
826
827         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
828         when constructed with no specified capacity. This was causing a
829         few ArrayLists to allocate more memory than they would potentially
830         need in the Block class and MemberCache class. Setting the
831         ArrayLists to construct with a capacity of 1 saves some
832         memory. (56216kb->55585kb)
833
834 2007-12-27  Marek Safar  <marek.safar@gmail.com>
835
836         A fix for bug #347189 (2nd issue)
837         * expression.cs (MemberAccess): Nested type can be found in base non-generic
838         type.
839
840 2007-12-27  Miguel de Icaza  <miguel@novell.com>
841         
842         * report.cs: Do not use colors if stdout and stderr are not a
843         terminal.
844
845 2007-12-27  Marek Safar  <marek.safar@gmail.com>
846
847         A fix for bug #346998
848         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
849         overloads.
850
851 2007-12-27  Marek Safar  <marek.safar@gmail.com>
852
853         A fix for bug #343465
854         * class.cs: Explicit method name for nested types uses dots only.
855
856 2007-12-27  Marek Safar  <marek.safar@gmail.com>
857
858         A fix for bug #343707
859         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
860
861 2007-12-27  Marek Safar  <marek.safar@gmail.com>
862
863         * ecore.cs: Report type inference errors only when arguments count matches
864         parameter count.
865         
866         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
867         
868         * expression.cs, report.cs: New warning.
869         
870         * typemanager.cs: Catch anonymous method type too.
871
872 2007-12-23  Marek Safar  <marek.safar@gmail.com>
873
874         A fix for bug #346379
875         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
876
877 2007-12-23  Marek Safar  <marek.safar@gmail.com>
878
879         A fix for bug #347359
880         * expression.cs (Invocation): Don't resolve already resolved expression.
881
882 2007-12-23  Marek Safar  <marek.safar@gmail.com>
883
884         A fix for bug #347189
885         * class.cs (FixedField): Use non-dependent code only in the define phase.
886
887 2007-12-23  Marek Safar  <marek.safar@gmail.com>
888
889         A fix for bug #348076
890         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
891
892 2007-12-22  Marek Safar  <marek.safar@gmail.com>
893
894         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
895         discovered extension methods.
896
897 2007-12-22  Marek Safar  <marek.safar@gmail.com>
898
899         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
900         method.
901
902 2007-12-21  Miguel de Icaza  <miguel@novell.com>
903
904         * report.cs (ErrorMessage): Add support for using colors on
905         terminals that support it. 
906
907 2007-12-21  Marek Safar  <marek.safar@gmail.com>
908
909         * ecore.cs: Use information about expanded params for error reporting.
910
911 2007-12-21  Marek Safar  <marek.safar@gmail.com>
912
913         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
914         and logic for params overloads.
915         
916 2007-12-15  Miguel de Icaza  <miguel@novell.com>
917
918         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
919         as this is also created from the parser.  Fixes #349034
920
921 2007-12-12  Miguel de Icaza  <miguel@novell.com>
922
923         * statement.cs (Throw.CloneTo): it is valid to have empty
924         expressions for throw. 
925
926 2007-12-03  Marek Safar  <marek.safar@gmail.com>
927
928         * cs-parser.jay: Set delegate constraint parsing region correctly.
929
930 2007-12-03  Marek Safar  <marek.safar@gmail.com>
931
932         A fix for bug #345467
933         * typemanager.cs (IsEqual): Compare generic parameters position only.
934         
935 2007-11-28  Marek Safar  <marek.safar@gmail.com>
936
937         * expression.cs (BaseAccess): Type arguments can be null.
938
939 2007-11-27  Raja R Harinath  <harinath@gmail.com>
940
941         * statement.cs (Block.Resolve): Ensure flow-branching tree is
942         consistent even when an error has occured.
943         (Switch.Resolve): Likewise.
944
945 2007-11-22  Marek Safar  <marek.safar@gmail.com>
946
947         A fix for bug #334505
948         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
949         overrides.
950         
951 2007-11-22  Marek Safar  <marek.safar@gmail.com>
952
953         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
954         refactorings required to resolve extension methods correctly when mixing
955         generics and non-generics members.
956         
957 2007-11-20  Marek Safar  <marek.safar@gmail.com>
958
959         A fix for bug #342584
960         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
961         conversion.
962         
963 2007-11-19  Marek Safar  <marek.safar@gmail.com>
964
965         A fix for bug #342512
966         * delegate.cs: Use delegate argument expression when is available. Don't
967         emit virtual call when class is sealed.
968         
969 2007-11-16  Marek Safar  <marek.safar@gmail.com>
970
971         A fix for bug #325423
972         * assign.cs (FieldInitializer): Use resolved expression for emit.
973         
974         * class.cs: Print less confusing error message.
975         
976 2007-11-16  Marek Safar  <marek.safar@gmail.com>
977
978         * cs-tokenizer.cs: Removed GMCS ifdefs.
979         
980         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
981         mcs.
982         
983         * cs-parser.jay: Disabled nullable check.
984         
985         * generic-mcs: Copied more generic stuff.
986                 
987 2007-11-16  Marek Safar  <marek.safar@gmail.com>
988
989         * gcs-parser.jay: Merged to cs-parser.jay.
990         
991         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
992         * *.csproj, *.sources: Updated to use only jay parser file.
993
994 2007-11-16  Marek Safar  <marek.safar@gmail.com>
995
996         * gcs-parser.jay: Added nullable and default expression feature checks.
997         
998 2007-11-16  Marek Safar  <marek.safar@gmail.com>
999
1000         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
1001         it fixes many TODOs and hidden bugs.
1002         
1003         * expression: Removed duplicate error check.
1004
1005 2007-11-15  Marek Safar  <marek.safar@gmail.com>
1006
1007         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
1008         implicitly type local variable only when it is used in a declaration.
1009
1010 2007-11-15  Marek Safar  <marek.safar@gmail.com>
1011
1012         * attribute.cs: Use CS0612 for empty strings.
1013
1014 2007-11-14  Marek Safar  <marek.safar@gmail.com>
1015
1016         * lambda.cs, statement.cs: Contextual return may act as a statement.
1017
1018 2007-11-14  Marek Safar  <marek.safar@gmail.com>
1019
1020         A fix for a regression cause by #324222
1021         * class.cs: Don't report unused even when it implements an interface.
1022         
1023 2007-11-13  Marek Safar  <marek.safar@gmail.com>
1024
1025         A fix for bug #341205
1026         * ecore.cs, expression.cs: Method group expression cannot do static
1027         method access with an instance reference check before overloading takes
1028         a place.
1029         
1030 2007-11-13  Marek Safar  <marek.safar@gmail.com>
1031
1032         A fix for bug #325359
1033         * class.cs: Use predictable name for automatically generated property.
1034         
1035 2007-11-12  Marek Safar  <marek.safar@gmail.com>
1036
1037         A fix for bug #324996
1038         * expression.cs (Is): Handle case where D is nullable and T is not
1039         correctly.
1040         
1041         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
1042         
1043 2007-11-12  Marek Safar  <marek.safar@gmail.com>
1044
1045         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
1046         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
1047         Flush small error reporting changes.
1048         
1049 2007-11-09  Marek Safar  <marek.safar@gmail.com>
1050
1051         A fix for bug #324996
1052         * expression.cs: Rewrote Is expression implementation to work with
1053         generics, nullable types, anonymous method. A const result expression 
1054         uses existing infrastructure instead of custom not fully-featured one.
1055         
1056 2007-11-08  Marek Safar  <marek.safar@gmail.com>
1057
1058         A fix for bug #340202
1059         * class.cs: Consider generics for volatile field.
1060
1061 2007-11-08  Marek Safar  <marek.safar@gmail.com>
1062
1063         A fix for bug #335594
1064         * expression.cs: Use conversion rules when handling string addition.
1065         
1066 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1067
1068         A fix for bug #336651
1069         * expression.cs: Fixed a crash when probing is on.
1070         
1071 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1072
1073         A fix for bug #324242
1074         * covert.cs: Added a conversion from any nullable-type with an 
1075         underlying enum-type to the type System.Enum.
1076         
1077 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1078
1079         A fix for bug #324222
1080         * class.cs: Report all non-used event fields.
1081         
1082 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1083
1084         A fix for bug #325161
1085         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
1086         qualifier for generic types.
1087         
1088 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1089
1090         A fix for bug #322971
1091         * expression.cs, ecore.cs: Added intermediate result value check for
1092         indexers. 
1093         
1094 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1095
1096         A fix for bug #324754
1097         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
1098         when it was requested.
1099
1100 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1101
1102         A fix for bug #325101
1103         * expression.cs: Do type not value comparison for `is' expression.
1104
1105 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1106
1107         A fix for bug #320236
1108         * convert.cs: Don't apply user conversion on underlying target type.
1109
1110 2007-11-06  Marek Safar  <marek.safar@gmail.com>
1111
1112         * expression.cs: Don't use unresolved expression for error reporting.
1113  
1114 2007-11-06  Marek Safar  <marek.safar@gmail.com>
1115
1116         A fix for bugs #337712, #324490
1117         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
1118         overloading resolution too.
1119         
1120         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
1121         the process consistent and more robust.
1122         
1123         * expression.cs, linq.cs, report.cs: Update.
1124
1125 2007-11-02  Marek Safar  <marek.safar@gmail.com>
1126
1127         A fix for bug #332909
1128         * attribute.cs: Resolve attributes in correct context using error
1129         handling procedure.
1130         
1131         * rootcontext.cs: Define Obsolete attribute members as core members.
1132         
1133 2007-11-02  Marek Safar  <marek.safar@gmail.com>
1134
1135         * statement.cs: Removed unused methods.
1136         
1137 2007-10-31  Wade Berrier  <wberrier@novell.com>
1138
1139         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
1140         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
1141         during 'make dist')
1142
1143 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1144
1145         A fix for bug #338102
1146         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
1147         methods registered as non-generics.
1148         
1149 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1150
1151         A fix for bugs #337712, #324490
1152         * delegate.cs: Delegate covariance and contravariance is not allowed for
1153         value types.
1154         
1155 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1156
1157         A fix for bug #337719 
1158         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
1159         `from' keyword.
1160         
1161 2007-10-30  Marek Safar  <marek.safar@gmail.com>
1162  
1163         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
1164
1165 2007-10-29  Marek Safar  <marek.safar@gmail.com>
1166  
1167         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
1168         query expressions.
1169
1170 2007-10-29  Raja R Harinath  <rharinath@novell.com>
1171
1172         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1173
1174 2007-10-29  Marek Safar  <marek.safar@gmail.com>
1175  
1176         A fix for bug #334652
1177         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1178         extension methods when we have not found the best candidate in normal
1179         container.
1180
1181 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1182
1183         * AssemblyInfo.cs: Keep up-to-date.
1184
1185 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1186
1187         * Makefile: Fixed generics compiler name.
1188         
1189 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1190
1191         * lambda.test: removed, lambda parsing is done differently.
1192         
1193         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1194
1195 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
1196
1197         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1198
1199 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1200
1201         * Makefile, *.sources : All C# compilers are in mcs folder.
1202         
1203         * *.cs: Use existing 2_1 define for smcs.
1204
1205 2007-10-26  Marek Safar  <marek.safar@gmail.com>
1206
1207         A fix for bug #335847
1208         * assign.cs, expression.cs: Couple of changes to avoid creating a
1209         temporary variable for each object initializer assignment statement. It
1210         simplifies struct initialization too, otherwise two temporary variables
1211         would be required.
1212         Implemented optimization of redundant default element initializers.
1213         
1214 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1215
1216         A fix for bug #336766
1217         * expression.cs (Class.CheckBase): Use generic name when method is
1218         generic.
1219         
1220 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1221
1222         A fix for bug #334737
1223         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1224         variable and not variable argument for prepared copies.
1225
1226 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1227
1228         A fix for bug #325110
1229         * class.cs, expression.cs, attribute.cs: Use open generic method when
1230         checking conditional attribute.
1231         
1232 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1233
1234         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
1235         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1236         FeatureIsNotAvailable.
1237
1238 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1239
1240         ** C# 3.0 Partial methods
1241         
1242         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1243         methods support. Because of member cache issue with generics only
1244         non-generics partial methods are fully supported.
1245         
1246 2007-10-23  Marek Safar  <marek.safar@gmail.com>
1247         
1248         * class.cs, decl.cs: Rewrote member overloads check to cope with 
1249         generics and to use member cache for member checking. It also improves
1250         performance and fixes remaining overloads issues.
1251         
1252 2007-10-20  Marek Safar  <marek.safar@gmail.com>
1253         
1254         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1255         roottypes.cs, typemanager.cs:
1256                 
1257         A member cache creation logic changed to add members immediately and
1258         not rely on fallback. The member cache is now only prefered way
1259         how to access and find type declaration members. It saves 5 MB of memory
1260         during MWF compilation and makes code ready for more optimizations and
1261         clean-ups, it's also a pre-requirement for partial methods.
1262         
1263 2007-10-18  Raja R Harinath  <harinath@gmail.com>
1264
1265         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1266         handling for generic parameters.
1267
1268 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1269         
1270         * class.cs (FixedField): Removed redundant volatile check.
1271         
1272 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1273         
1274         * class.cs, decl.cs: Fixed overload members verification to do only one
1275         check per possible collision.
1276         
1277 2007-10-13  Marek Safar  <marek.safar@gmail.com>
1278         
1279         A fix for bug #325478
1280         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1281         and create only one disposable flags container.
1282         
1283 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1284         
1285         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1286         * statement.cs (Fixed): Fixed variables cloning.
1287         
1288 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1289         
1290         A fix for bug #333342
1291         * class.cs (EventField): Don't mark value type event as synchronized. 
1292         
1293 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1294         
1295         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1296         inference to identify best candidate method correctly.
1297         (ProperyExpr): A range variable is read only and cannot be modified.
1298         
1299 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1300         
1301         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1302         logic to identify best candidate method correctly.
1303         
1304 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1305         
1306         * location.cs (Equals, GetHashCode): Removed.
1307         
1308 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1309         
1310         * report.cs: Implemented message recorder. It is used mainly for lambda
1311         expressions to capture otherwise swallowed error messages.
1312         
1313         * anonymous.cs, lambda.cs.cs: Do full parameters check.
1314
1315         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1316         and not at the top.
1317         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1318                 
1319         * expression.cs (MemberAccess): Always report lookup failure.
1320         
1321         * location.cs: Implemented Equals, GetHashCode.
1322         
1323         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1324         
1325 2007-10-10  Jb Evain  <jbevain@novell.com>
1326
1327         * codegen.cs: re-enable assembly version check.
1328
1329 2007-10-09  Marek Safar  <marek.safar@gmail.com>
1330         
1331         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1332         checks.
1333         
1334         * namespace.cs (UsingAlias): Do correct version check.
1335         
1336 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1337         
1338         * expresison.cs, ecore.cs: Issue extension method error message when
1339         appropriate.
1340         
1341         * rootcontext.cs: Added ISO_2 compiler mode option.
1342
1343 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1344         
1345         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1346          message.
1347         
1348 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1349         
1350         * attribute.cs (GetString, GetBoolean): Work with both literal and
1351         constant.
1352         
1353         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1354         Moved method overload specific methods to MethodGroupExpr.
1355         
1356         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1357         it should be less memory consuming.
1358         
1359 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1360
1361         * codegen.cs: remove the assembly version check until the buildbot is
1362         fixed.
1363
1364 2007-10-07  Jb Evain  <jbevain@novell.com>
1365
1366         * attribute.cs (Attribute.GetString): if the value
1367         expression is a StringConstant, return its string value.
1368
1369 2007-10-07  Jb Evain  <jbevain@novell.com>
1370
1371         * typemanager.cs: add `assembly_version_attribute_type`.
1372         * codegen.cs: on attribute emission, check that the
1373         AssemblyVersionAttribute doesn't overflow.
1374
1375 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1376         
1377         A fix for bug #324677
1378         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1379         parent container of a scope container with currently resolved one. 
1380         
1381 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1382         
1383         A fix for bug #325534
1384         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1385         only.
1386         
1387 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1388         
1389         A fix for bug #327504
1390         * class.cs (Operator.Define): Refactored implicit and explicit user
1391         operator conversion rules.
1392         
1393 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1394         
1395         A fix for bug #327520
1396         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1397         
1398 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1399         
1400         A fix for bug #328022
1401         * class.cs (MethodData.Define): Use correct method to check whether
1402         a method implementents an accessor.
1403         
1404 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1405         
1406         A fix for bug #330069
1407         * statement.cs (Fixed.Resolve): Read the first array element only when
1408         an array is instantiated. 
1409         
1410 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1411         
1412         * expression.cs, assign.cs, generics.cs: Print correct operator when
1413         compound assignment is used.
1414         
1415 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1416         
1417         A fix for bug #325841
1418         * expression.cs (ArrayAccess): Use full argument cloning only for
1419         string compound concatenation.
1420         
1421 2007-10-03  Marek Safar  <marek.safar@gmail.com>
1422         
1423         A fix for bug #328774
1424         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1425         assignment.
1426         (PropertyExpr.EmitAssign): Fixed string concatenation compound
1427         assignment.
1428
1429 2007-10-03  Raja R Harinath  <rharinath@novell.com>
1430
1431         Fix #328490
1432         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1433         Event accessibility checks here.  Remove some bogus code that
1434         accidently made GenericMethods work.
1435         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1436
1437 2007-09-25  Marek Safar  <marek.safar@gmail.com>
1438         
1439         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1440         
1441         * statement.cs (Block): Refactored AddVariable to allow error handling
1442         customization.
1443         
1444         * generic.cs: New stub.
1445         
1446 2007-09-23  Marek Safar  <marek.safar@gmail.com>
1447         
1448         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1449         flag.
1450         
1451 2007-09-17  Marek Safar  <marek.safar@gmail.com>
1452
1453         * class.cs: Use partial container to record whether any partial part
1454         contains static field initializer and therefore default contructor has
1455         to be defined.
1456         
1457 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1458
1459         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1460         mono-list when only one of two partial parts has defined accessibility
1461         modifier.
1462         
1463 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1464
1465         A fix for bug #82845
1466         
1467         * class.cs (TypeContainer): Set correct resolve context for all field
1468         initializers.
1469         
1470 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1471
1472         * assign.cs: Fixed a crash when field is resolved twice with an error.
1473         
1474         * codegen.cs: Changed InFieldInitializer to be flag.
1475         
1476         * anonymous.cs, ecore.cs, expression.cs: Update after
1477         IsInFieldInitializer rename.
1478         
1479         * const.cs: Removed unused parameter.
1480         
1481         * class.cs: Changed the way how we resolve and emit field initializers.
1482         The field initilizers have to have access to contructor block to emit
1483         compiler generated code.
1484
1485 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1486
1487         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1488         generics use TypeContainer instead.
1489         
1490 2007-09-12  Marek Safar  <marek.safar@gmail.com>
1491         
1492         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1493
1494         * lambda.cs (ResolveParameters): Use more powerful
1495         InflateGenericArgument.
1496         
1497         * parameters.cs: Better exception message.
1498                 
1499 2007-09-10  Marek Safar  <marek.safar@gmail.com>
1500
1501         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1502         correct expression block type. 
1503         
1504         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1505         
1506         * expression.cs (Invocation): Extracted method group resolve to
1507         DoResolveOverload.
1508         
1509 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1510
1511         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1512         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1513         
1514         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1515         generic extension methods.
1516
1517 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1518
1519         A fix for bug #82676 (Do I get it right now?)
1520         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1521         object before a standard conversion is applied.
1522         
1523 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1524
1525         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1526         #82676.
1527         
1528 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1529
1530         A fix for bug #82676
1531         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1532         non-generic interface types.
1533         
1534 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1535
1536         A fix for bug #82690
1537         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1538         
1539 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1540
1541         A fix for bug #82571
1542         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1543         modifier for container based methods.
1544         
1545 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1546
1547         A fix for bug #82676
1548         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1549         any interface-type T means to any of interface type T.
1550
1551 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1552
1553         * namespace.cs: We have 2 versions of System.Core assembly.
1554
1555 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1556
1557         A fix for bug #82652
1558         * class.cs (Class.GetClassBases): Compare types and not expressions.
1559
1560 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1561
1562         A fix for bug #82620
1563         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1564         actually never worked before.
1565         (IndexerAccess): Emit prepared arguments before they are modified.
1566         
1567 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1568
1569         A fix for bug #82563
1570         * assign.cs: Revert wrong fix.
1571         
1572         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1573         correctly.
1574         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1575         Instead of ldelema/stdind we have to use temporary variables to handle
1576         cases like String.Concat (params string[]).
1577         
1578 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1579
1580         * class.cs: EmitAttributes to Emit rename.
1581         
1582         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1583         null.
1584         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1585         GetClsCompliantAttributeValue execution.
1586         
1587 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1588
1589         * anonymous.cs: Use shorter type prefix.
1590         
1591         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1592         when exist.
1593         
1594         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1595         variables when probing is on.
1596         
1597         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1598         unresolved variables.
1599         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1600         handle transparent identifiers.
1601         
1602 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1603
1604         * attribute.cs (IsClsCompliant): Add nullable types test.
1605         
1606 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1607
1608         * doc.cs : catch other types of exception than XmlException to
1609           report CS1570. Fixed bug #82565.
1610
1611 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1612
1613         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1614         The number of delegate parameters has to match.
1615         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1616         arrays.
1617
1618 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1619
1620         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1621         to fix problem with private arguments.
1622
1623 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1624
1625         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1626         
1627         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1628         
1629         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1630         empty. Add cloning suport.
1631         
1632         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1633
1634 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1635
1636         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1637         to create EmptyCast. It handles EmptyConstantCast specialization for
1638         constants.
1639         
1640 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1641
1642         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1643         (EmitArrayArgument): One routine for array arguments.
1644         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1645         
1646 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1647
1648         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1649
1650 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1651
1652         * anonymous.cs: MemberLookupFinal update.
1653
1654         * class.cs (ConstructorInitializer): Is expression based.
1655         
1656         * delegate.cs: MethodGroupExpr update.
1657         
1658         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1659         messages.
1660         (Error_MemberLookupFailed): Customizable error override.
1661         (MethodGroupExpr): Keep queried type for later usage.
1662         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1663         resolve.
1664         
1665         * expression.cs: Error_MemberLookupFailed refactoring.
1666         (New.DoResolve): Resolve as much as possible.
1667         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1668         customization for invalid member types.
1669
1670         * statement.cs: MethodGroupExpr update.
1671         
1672 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1673
1674         * modifier.cs (Check): Check all modifiers and not only accessibility
1675         ones.
1676
1677 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1678
1679         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1680         type and not an expression.
1681
1682 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1683
1684         * statement.cs (Catch.Clone): Type and variable can be null.
1685
1686 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1687
1688         A fix for bug #81979
1689         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1690         I am really not sure whether this is the best fix.
1691         
1692         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1693         only once.
1694         
1695 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1696
1697         ** C# 3.0 Object and collection initializers (major re-write)
1698         
1699         * assign.cs (DoResolve): Initializers are not assign related.
1700         
1701         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1702         used during collection or object initialization.
1703         
1704         * expression.cs (Error_InvalidArguments): Add initializers specific
1705         messages. More will come later because it requires some general
1706         refactoring.
1707         (New.DoResolve): Better error handling for unsafe types.
1708         (EmptyExpressionStatement): New class.
1709         (ElementInitializer): An object initializer expression.
1710         (CollectionElementInitializer): A collection initializer expression.
1711         (CollectionOrObjectInitializers): A block of object or collection
1712         initializers.
1713         (NewInitialize): New expression with element/object initializers.
1714         
1715         * statement.cs: Reverted object/collection initializer hacks.
1716         
1717         * typemanager.cs (CSharpName): Filter __arglist type.
1718         
1719 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1720
1721         ** C# 3.0 Anonymous Types (update to the latest standard)
1722         
1723         * expression.cs (Binary.ResolveOperator): Threat all null based types
1724         same.
1725         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1726         (AnonymousTypeParameter): Updated.
1727         
1728         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1729         (AnonymousTypeClass): New anonymous type container.
1730         
1731         * class.cs (AddField): Return operation result.
1732         
1733         * generic.cs: Another empty TypeArguments overload.
1734         
1735         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1736         are stored at top of normal hierarchy.
1737         
1738         * typemanager.cs (CSharpName): Filter anonymous types.
1739         
1740 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1741
1742         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1743         as single Concat call. How could we miss that :-(
1744         
1745 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1746
1747         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1748         
1749 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1750
1751         * expression.cs: Fix the previous commit, the creation of the
1752         arguments array list needs also to be conditional on the arguments
1753         not being null.
1754
1755         * class.cs: Add a little bit of help to help narrow down problems.
1756
1757         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1758         not try to copy in that case. 
1759
1760         * driver.cs: When building SMCS, include a new different set of
1761         default assemblies here.   Do this here so we can control whether
1762         to include the default assemblies with /noconfig.
1763
1764 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1765
1766         A fix for bug #81979
1767         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1768         only.
1769
1770 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1771
1772         A fix for bug #82300
1773
1774         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1775         we are in probing scope.
1776
1777 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1778
1779         A fix for bug #82301
1780
1781         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1782         (Statement.CloneTo): Clone and not map children blocks.
1783
1784 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #82299
1787
1788         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1789         variable too.
1790         
1791         * statement.cs (Statement.CloneTo): Clone variables before statements
1792         to allow remaping of local variables.
1793
1794 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1795
1796         A fix for bug #82296
1797
1798         * anonymous.cs,
1799         * report.cs: Log crash details for future clone problems.
1800         
1801         * statement.cs (Return.Clone): Don't clone non-existent expression.
1802
1803 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1804
1805         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1806         (Class.AddBasesForPart): Move CS0537 check here from ...
1807         * cs-parser.jay (class_declaration): ... here.  Move calling of
1808         'AddBasesForPart' to ...
1809         (class_bases): ... here.
1810         (struct_declaration, interface_declaration): Update to changes.
1811
1812 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1813
1814         A fix for bug #81923
1815
1816         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1817         conversion is allowed.
1818
1819 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1820
1821         A fix for bug #81564
1822
1823         * ecore.cs (EventExpr): Add IsBase handling.
1824
1825         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1826         too.    
1827         
1828 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1829
1830         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1831         * cs-parser.jay: Some whitespace cleanups.
1832         (current_delegate): New.
1833         (type_name): New.
1834         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1835         a dummy code block, and use 'type_name' instead of 'member_name'.
1836         (interface_declaration, class_declaration): Likewise.
1837         (delegate_declaration): Likewise.  Rearrange slightly and use
1838         'current_delegate'.
1839         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1840         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1841
1842 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1843
1844         A fix for bug #82039
1845
1846         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1847         available.
1848
1849         * typemanager.cs (CSharpName): Split to string overload.
1850
1851 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1852
1853         * expression.cs,
1854         * report.cs: Updated warning CS0472.
1855
1856 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1857
1858         A fix for bug #82181
1859         * cs-parser.jay,
1860         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1861
1862 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1863
1864         A fix for bug #82277
1865         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1866
1867 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1868
1869         ** C# 3.0 Type Inference (major bits are working)
1870         
1871         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1872         (.ImplicitStandardConversionExists): Uses compatible.
1873         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1874         (.InferReturnType): New method.
1875         (.Compatible): Refactored.
1876         (.ResolveParameters): Uses factory to create resolved parameters.
1877         (.CompatibleMethod): Add probing mode support.
1878         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1879         clearly distinguish between 2 different operations.
1880         (LambdaMethod): Moved to lambda.cs.
1881         (AnonymousMethod): Removed unused fields and methods.
1882         (AnonymousDelegate): Simplified.
1883         
1884         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1885         
1886         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1887         
1888         * delegate.cs (Delegate): New mehods to reduce code duplication.
1889         (.GetConstructor): New method.
1890         (.GetInvokeMethod): New method.
1891         (DelegateCreation): Updated.
1892         
1893         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1894         does not exist.
1895         (OverloadResolve): Made probing little bit faster.
1896         
1897         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1898         when probing is on.
1899         
1900         * generic.cs (TypeInferenceContext): Dummy implementation.
1901         
1902         * iterators.cs: Updated after Resolve/Define rename.
1903         
1904         * lambda.cs (LambdaExpression)
1905         (.ResolveParameters): Handles both type of arguments and type inference too.
1906         
1907         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1908         (InflateTypes): Updated.
1909         
1910         * support.cs (InflateTypes): Changed signature and updated.
1911         
1912         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1913         (MemberLookup_FindMembers): More MS tricks.
1914         (GetParameterData): Ditto.
1915         (GetDelegateParameters): Uses quick path for dynamic types.
1916         
1917 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1918
1919         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1920         only.
1921
1922 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1923
1924         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1925         syntax.
1926         
1927 2007-07-26  Jb Evain  <jbevain@novell.com>
1928
1929         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1930         which takes a boolean 'report_errors', similar to the GetMethod.
1931         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1932         in .net 2.1, do not report errors here.
1933
1934         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1935         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1936         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1937         in .net 2.1.
1938
1939         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1940         of the type InternalsVisibleToAttribute before the first call
1941         to CoreLookupType which is allowed to fail (third boolean parameter
1942         to true). Because, during the resolution for a type that is not
1943         immediately found, we try to check if the type is not defined in
1944         a friend assembly, and to do so, we need the
1945         InternalVisibleToAttribute.
1946
1947 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1948
1949         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1950         feature that allows structs to be compared against null and inline
1951         the result as true or false.
1952
1953         Notice that the same code is not permitted inside a generic block
1954         of code that would do:
1955
1956         class Foo<T> where T : struct {
1957             bool Eval (T x)
1958             {
1959                  return x == null;
1960             }
1961         }
1962
1963         It is only allowed if the type of T is not bound (no where
1964         clause).   In my opinion, this CSC 2 behavior is broken but people
1965         seem to be using it (IronRuby does, a few bug reports on bugzilla
1966         have it and some people have complained about it).
1967
1968         All of the users that depend on this behavior have code that is
1969         very likely broken. 
1970         
1971         * report.cs (Warning, Error): make these take object arguments,
1972         not strings, as that allows us to take advantage of Format.
1973
1974 2007-07-20  William Holmes  <billholmes54@gmail.com>
1975
1976         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1977           Left member variable for the Count.
1978         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1979           MemberName.CountTypeArguments to avoid a NRE. 
1980
1981         This code is contributed under the MIT X11 license
1982
1983 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1984
1985         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1986
1987 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1988
1989         * doc.cs : generic method arguments are written as ``x while generic
1990           type arguments are `x. Combined with the previous change, fixed bug
1991           #79706.
1992
1993 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1994
1995         Fix #82120
1996         * expression.cs (Binary.ResolveOperator): When converting
1997         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1998
1999 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
2000
2001         * doc.cs : when T: or whatever x: is specified, it does not really
2002           check the doc comment's syntax correctness. Fixed bug #82006.
2003
2004 2007-07-18  Marek Safar  <marek.safar@gmail.com>
2005
2006         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
2007         LambdaExpression better.
2008         
2009         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
2010         
2011         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
2012         
2013         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
2014         as it can be generated.
2015         
2016         * expression.cs (Invocation.Error_InvalidArguments): Show correct
2017         modifiers.
2018         
2019         * lambda.cs (LambdaExpression): Refactored to share same code with
2020         AnonymousMethodExpression.
2021         
2022 2007-07-17  Marek Safar  <marek.safar@gmail.com>
2023
2024         * anonymous.cs (MakeName): Include host name for easier debugging.
2025         (LambdaMethod): New class for lambda spcecific stuff.
2026         
2027         * attribute.cs: Set EmitContext return type.
2028
2029         * class.cs: Set EmitContext return type.
2030         
2031         * codegen.cs (EmitContext): Return type cannot be null to stop messing
2032         with null/void meaning.
2033         
2034         * iterators.cs (ContainerType): Implemented.
2035         
2036         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
2037         
2038         * statement.cs (Return): Updated to lambda expressions.
2039         (Block.CloneTo): Parent can be null.
2040                 
2041 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2042
2043         A fix for bug #81917
2044         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
2045         
2046         * class.cs (FixedField): Check whether field is in unsafe scope.
2047
2048         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
2049         (FieldExpr.Emit): Fixed buffers cannot be volatile.
2050
2051         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
2052         FieldExpr.
2053         
2054         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
2055                 
2056 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2057
2058         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2059         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2060         from Report class.
2061
2062 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2063
2064         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2065         
2066 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2067
2068         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
2069         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
2070         
2071         * codegen.cs(EmitContext): Add ProbingMode flag.
2072         
2073         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
2074         
2075         * driver.cs: For now set both warning values.
2076         
2077         * ecore.cs (SimpleName): Name is readonly.
2078         (MethodGroup.OverloadResolve): One quick path for probing.
2079         
2080         * expression.cs (Unary): Set Oper r/o.
2081         (Binary): Set Oper r/o.
2082         (ParameterReference): Set few instance variables as r/o.
2083         (ParameterReference.DoResolveBase): Don't capture aruments when 
2084         the probing is on.
2085         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
2086         (Arglist): arguments are private.
2087         (SizeOf): type is private and r/o.
2088         (MemberAccess): arguments are private.
2089
2090         * report.cs: Enhanced reporting on/off capabilities.
2091         
2092         * lambda.cs: Uses ec.IsInProbingMode.
2093         (ContextualReturn): Derives from return.
2094         
2095         * rootcontext.cs: For now set both warning values.
2096         
2097         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
2098         copy if one exists.
2099         (Return.Resolve): Don't die immediately.
2100         (Block.Resolve): Speed-up probing.
2101         (Block.CloneTo): Clone only child blocks.
2102
2103 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
2104
2105         * iterators.cs: reverted Miguel's latest change (r81925) as it
2106         breaks the build in System.
2107
2108 2007-07-13  Miguel de Icaza  <miguel@novell.com>
2109
2110         * iterators.cs (Yield.CheckContext): Check for the iterator type
2111         also here as we can call into Yield even in codepaths that are not
2112         directly checked by
2113         (MethodOrOperator is the only path that was checked).
2114
2115         In addition to the standard check, use a more specific check for
2116         constructors to report a more verbose error. 
2117
2118 2007-07-12  Miguel de Icaza  <miguel@novell.com>
2119
2120         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
2121         report the warning and continue 
2122
2123         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
2124         values on the stack on the call to Emit.   Use EmitStatement if
2125         possible, or using Emit + Pop if not possible.   Fixes #82064
2126
2127 2007-07-12  Raja R Harinath  <rharinath@novell.com>
2128
2129         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
2130         avoid try...finally in some cases.
2131
2132 2007-07-10  Marek Safar  <marek.safar@gmail.com>
2133
2134         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
2135         
2136         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
2137         instead of method. Re-use standard error handling.
2138         (ConstructorInitializer.Emit): Simplified.
2139         
2140         * delegate.cs: Updated after Invocation.EmitCall change.
2141         
2142         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
2143         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
2144         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
2145         method and don't permanently changing input arguments.
2146         (MethodGroupExpr): Introduced resolved best_candidate, when method group
2147         is resolved it has one of the candidates is the best one which is later
2148         used to emit. Removed a few unused method.
2149         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
2150
2151         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
2152         (Binary.ResolveOperator): Ditto.
2153         (ConditionalLogicalOperator.DoResolve): Ditto.
2154         (Invocation): Uses method group.
2155         (Invocation.DoResolve): Simplified.
2156         (Invocation.EmitCall): Removed useless is_static.
2157         (Invocation.Emit): Delegate to method group.
2158         (Invocation.EmitStatement): Simplified.
2159         (New): Uses method group.
2160         (MemberAccess.DoResolve): Don't destroy original expression.
2161         
2162         * statement.cs (ForEach.Resolve): Use null for no method arguments.
2163         
2164 2007-07-04  Marek Safar  <marek.safar@gmail.com>
2165
2166         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
2167         
2168         * anonymous.cs,
2169         * lambda.cs: Add custom error message type.
2170
2171 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2172
2173         * lambda.cs: Simplified little bit.
2174         
2175         * parameter.cs: Introduced ImplicitLambdaParameter.
2176         (Parameters.CreateFullyResolved): New factory instead of ctor.
2177         
2178         * anonymous.cs,
2179         * class.cs,
2180         * delegate.cs: Updated parameter creation.
2181         
2182 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2183
2184         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2185         arguments.
2186         
2187         * generic.cs: Synchronized with gmcs.
2188         
2189 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2190
2191         * class.cs (Indexer): Check return type as soon as possible.
2192         
2193         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2194         members too.
2195         
2196         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2197         
2198         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2199         
2200         * parameter.cs (Parameter): Use expression type when it is available.
2201         
2202         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2203         method modifier for the first parameter only.
2204
2205 2007-06-24  Marek Safar  <marek.safar@gmail.com>
2206
2207         A fix for bug #81938
2208         * typemanager.cs (ChangeType): Fixed couple of char conversions.
2209         
2210         * constant.cs: Tide up an exception message.
2211
2212 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2213
2214         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2215         an uninitialized variable is used.
2216         
2217         * expression.cs (LocalVariableReference.DoResolve): Ditto.
2218
2219 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2220
2221         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2222         not found error handling.
2223
2224         * expression.cs (ArrayCreation): Removed redundant fields and little bit
2225         simplified.
2226         (ArrayCreation.ResolveArrayElement): To be ready to customization.
2227         (ArrayCreation.DoResolve): Simplified.
2228         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2229         its own resolve process.
2230         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2231
2232 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2233
2234         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2235         more error details.
2236         
2237 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2238
2239         * cs-tokenizer.cs: Removed var related stuff.
2240         
2241         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2242         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2243         a type and a keyword at same time.
2244         
2245         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2246         matches to "var".
2247         
2248         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2249         implicitly typed arrays, more changes will follow.
2250         
2251         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2252         
2253 2007-06-19  Marek Safar  <marek.safar@gmail.com>
2254
2255         * ecore.cs (VarExpr): Removed Handled field.
2256         
2257         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2258         build-in assign functionality.
2259         (ForEach.Resolve): Removed all implicitly typed local variable code and
2260         simplified.
2261         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2262         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2263
2264 2007-06-18  Marek Safar  <marek.safar@gmail.com>
2265
2266         * assign.cs: Removed implicitly typed local variable check.
2267         
2268         * expression.cs (LocalVariableReference.DoResolve): Add check for self
2269         referencing implicitly typed local variable.
2270         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2271         variable here.
2272         
2273         * statement.cs (Fixed): Removed unsupported implicitly typed local
2274         variable code.
2275
2276 2007-06-15  Marek Safar  <marek.safar@gmail.com>
2277
2278         * decl.cs (MemberName): Moved all Unbound stuff to parser.
2279
2280 2007-06-14  Marek Safar  <marek.safar@gmail.com>
2281
2282         A fix for bugs #81855 and #76274
2283         * attribute.cs (AttachTo): Always set owner for global attributes to
2284         prefined owner.
2285         
2286         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2287         usefull too.
2288         
2289         * cs-parser.jay: Assembly and module attributes must precede all other
2290         elements except using clauses and extern alias declarations.
2291
2292 2007-06-13  Marek Safar  <marek.safar@gmail.com>
2293
2294         A fix for bug #81748
2295         * cs-tokenizer.cs,
2296         * expression.cs: More checks for non ISO-1 features.
2297
2298 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2299
2300         A fix for bug #81807
2301         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2302         present inside switch statement and it is required by nullable check.
2303
2304 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2305
2306         A fix for bug #81840
2307         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2308         when type matching fails.
2309         
2310         * namespace.cs: Tiny error message change.
2311
2312 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2313
2314         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2315         reporting. Added automatic property check.
2316         
2317         * class.cs: Updated after CheckAbstractAndExtern relocation.
2318         (AEventPropertyAccessor.GetSignatureForError): Customized.
2319         
2320 2007-06-11  Marek Safar  <marek.safar@gmail.com>
2321
2322         * class.cs (DefineBaseTypes): Base type can be undefined.
2323         
2324         * ecore.cs (TypeLookup): Minor refactoring.
2325         (DoResolveAsTypeStep): Removed redundant check.
2326
2327         * namespace.cs (Lookup): Removed redundant check.
2328                 
2329         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
2330         ResolveAsTypeTerminal step.
2331         (BootstrapCorlib_*): Simplified.
2332         (PopulateCoreType): Core types can be now external.
2333
2334 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2335
2336         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2337          verification only.
2338          (InferTypeArguments): Infers anonymous expression type arguments.
2339          (Compatible): Split to Compatible and InferTypeArguments. 
2340         
2341         * lambda.cs: Updated.
2342
2343 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2344
2345         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2346
2347 2007-06-07  Raja R Harinath  <harinath@gmail.com>
2348
2349         Fix #80477, cs0135-2.cs, cs0135-3.cs
2350         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2351         names to the "known" variables list.
2352         (Block.CheckInvariantMeaningInBlock): Handle the fact the
2353         parameter names are also "known".
2354         (Block.CheckError136): Remove.
2355         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
2356         null.
2357
2358 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2359
2360         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2361
2362 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2363
2364         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2365         internal error not an user error.
2366          
2367         * expression.cs (IsApplicable): Refactored to make debugging easier.
2368
2369         * support.cs: More tricks for non-mono runtimes.
2370         
2371         * typemanager.cs (CoreLookupType): Made public.
2372         (InitSystemCore): All linq specific stuff moved to linq.cs
2373
2374 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2375
2376         * typemanager.cs (CSharpSignature): One more missing build-in types
2377         replacement.
2378         More tricks for non-mono runtime.
2379
2380 2007-06-05  Raja R Harinath  <harinath@gmail.com>
2381
2382         * statement.cs (Block.CheckError136_InParents): Remove.
2383         (Block.AddVariable): Use GetParameterInfo instead.
2384         (ToplevelBlock.ProcessArguments): Likewise.
2385
2386 2007-06-04  Raja R Harinath  <rharinath@novell.com>
2387
2388         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
2389         information too.
2390         (ToplevelBlock.GetParameterInfo): Split out of ...
2391         (ToplevelBlock.GetParameterRefernce): ... this.
2392         (ToplevelBlock.ParameterMap): Remove.
2393         * expression.cs (ParameterReference): Update to use
2394         ToplevelParameterInfo.
2395
2396         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2397         regression.
2398
2399         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2400         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2401
2402         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2403         (ToplevelBlock.ProcessParameters) ... here.
2404         (ToplevelBlock..ctor): Invoke it.
2405
2406         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2407         new parameters.
2408
2409         * statement.cs (IKnownVariable): New interface.
2410         (LocalInfo): Implement it.
2411         (ToplevelParameterInfo): New class.
2412         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2413         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
2414         GetKnownVariableInfo.
2415
2416 2007-06-03  Raja R Harinath  <harinath@gmail.com>
2417
2418         Partly speed up CS0136 error checks.
2419         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2420         'recurse' parameter.
2421         (Block.DoCheckError136): Only check errors in parameters.  Move
2422         local variable checks ...
2423         (Block.AddVariable): ... here, and ...
2424         (ToplevelBlock.ResolveMeta): ... here.
2425
2426 2007-06-02  Raja R Harinath  <harinath@gmail.com>
2427
2428         * statement.cs (Block.IsChildOf): Remove.
2429
2430         * statement.cs (Statement.Clone): Move special case code ...
2431         (Block.CloneTo): ... here.
2432
2433 2007-05-29  Raja R Harinath  <rharinath@novell.com>
2434
2435         * statement.cs (ToplevelBlock.container): Remove field.  It's
2436         redundant with 'Parent'.
2437         (ToplevelBlock.ContainerBlock): Remove accessor.
2438         (ToplevelBlock..ctor): Update to changes.  Register anonymous
2439         child with parent here, ...
2440         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
2441         current_block.
2442         (start_anonymous): Don't save current_block.
2443         (top_current_block): Remove.
2444
2445         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2446         (Block.Resolve): Update to changes.
2447         (Block..ctor): Move setting of "correct" 'Toplevel'
2448         and 'Explicit' fields to ...
2449         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2450
2451 2007-05-27  Raja R Harinath  <harinath@gmail.com>
2452
2453         Kill Block.Implicit
2454         * statement.cs (Block.Implicit): Remove.
2455         (Block): Update to changes.
2456         * flowanalysis.cs: Likewise.
2457
2458         Mildly speed up CheckInvariantMeaningInBlock
2459         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2460         Recursively call AddKnownVariable to all enclosing blocks.
2461         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2462         Remove recursive calls.
2463         (Block): Update to changes.
2464
2465         New ExplicitBlock invariants
2466         * statement.cs (Block.Explicit): New field.  It points to the
2467         immediately enclosing non-implicit block.
2468         (Block..ctor): Maintain the invariant.
2469         * cs-parser.jay: Take advantage of invariant.
2470
2471         Introduce ExplicitBlock
2472         * statement.cs (ExplicitBlock): New.
2473         (ToplevelBlock): Derive from it.
2474         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2475         sense of flag.
2476         (Block.Implicit): Update to changes.
2477         * cs-parser.jay: Update to changes.
2478
2479         Remove unused field
2480         * codegen.cs (EmitContext.IsLastStatement): Remove.
2481         * statement.cs (Block.DoEmit): Update to changes.
2482
2483 2007-05-25  Raja R Harinath  <rharinath@novell.com>
2484
2485         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2486         modifying current_block directly.
2487
2488 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
2489         
2490         * class.cs: Implemented automatic properties (C# 3.0)
2491           Thanks to Marek for the help.
2492
2493 2007-05-23  Raja R Harinath  <rharinath@novell.com>
2494
2495         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2496         variable as assigned, note also that all its components are
2497         assigned too.
2498         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
2499
2500 2007-05-19  Marek Safar  <marek.safar@gmail.com>
2501
2502         * anonymous.cs, class.cs: Emit Compiler generated attribute when
2503         member is marked as compiler generated.
2504         
2505         * decl.cs (MemberCore): Refactored ModFlags into property.
2506
2507         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2508         (Check): Check only accessibility modifiers.
2509
2510 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2511
2512         Track all assignable slots in one bit array
2513         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2514         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2515         logic from VariableMap constructor here.  Use the same 'offset'
2516         variable that's later used for computing offsets of local
2517         variables.
2518         * flowanalysis.cs (UsageVector.parameters): Remove.
2519         (UsageVector): Update to changes.
2520         (VariableMap): Remove.
2521
2522         Avoid creating ParameterMap in every block
2523         * statement.cs (Block.ParameterMap): Move ...
2524         (ToplevelBlock.ParameterMap): ... here.
2525         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2526         only once.
2527         * flowanalysis.cs (FlowBranching.param_map): Remove.
2528         (FlowBranching.UsageVector): Update to changes.
2529         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2530
2531         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2532
2533         * expression.cs (ParameterReference): Distinguish between block
2534         where parameter was referenced and declared.
2535
2536 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2537
2538         * flowanalysis.cs, statement.cs: Put back improved error handling.
2539
2540 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2541         
2542         * assign.cs:
2543         * expression.cs:
2544           Imporved object and collection initialization (C# 3.0).
2545
2546 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2547
2548         A fix for bug #81380
2549         * expression.cs (Is.DoResolve): Only value types have constant `is'
2550         behaviour.
2551
2552 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2553
2554         * statement.cs (ToplevelBlock.child): Remove.
2555
2556 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2557
2558         Rationalize ResolveMeta: refactoring
2559         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2560         out constant handling code into ...
2561         (Block.DoResolveConstants): ... this.
2562
2563         Rationalize ResolveMeta: kill local_map
2564         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2565         (Block.AssignableSlots): New.
2566         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2567         for locals -- move code from VariableMap here.  Avoid unnecessary
2568         allocations.
2569         * flowanalysis.cs (FlowBranching.local_map): Remove.
2570         (FlowBranching..ctor): Use Block.AssignableSlots.
2571         (VariableMap): Remove unused constructors.
2572
2573 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2574
2575         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2576
2577 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2578
2579         * typemanager.cs (IsFriendAssembly): Should not be called for building
2580         assembly.
2581
2582 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2583
2584         * literal.cs (NullConstant): Print null in all cases.
2585         
2586         * expression.cs (Binary.ResolveOperator): Implemented delegate
2587          comparison based on C# 2.0 changes.
2588
2589 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2590
2591         This code is contributed under the MIT X11 license
2592         
2593         The following enables support for several C# 3.0 language features:
2594         
2595         * cs-tokenizer.cs: Added support for the "var" keyword.
2596         
2597         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2598           Added VarExpr class to facilitate type inferencing.
2599         
2600         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2601           to support anonymous types.
2602         
2603         * assign.cs: Added support for type inferencing and initialization.
2604         
2605         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2606         
2607         * expression.cs: Added implicit array support to ArrayCreation.
2608           Added 5 types and 1 interface:
2609           
2610           IInitializable                Implementing classes can inject initializing
2611                                         statements after object instantiation.
2612           
2613           Initializer                   Stores data for object initialization.
2614           
2615           AnonymousType                 An expression for anonymous types.
2616           
2617           AnonymousTypeParameter        Stores data about an anonymous type's field.
2618           
2619           NewInitialize                 An expression for object initialization.
2620           
2621           CollectionInitialize          An expression for collection initialization.
2622         
2623         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2624           statements.
2625
2626 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2627
2628         A fix for bug #81500
2629         * cs-tokenizer.cs: Add special handling for coalescing operator.
2630
2631 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2632
2633         A fix for bug #81529
2634         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2635         its value from base class until it is redefined.
2636
2637 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2638
2639         Fix regression in cs0631-3.cs
2640         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2641         fallback.  Make error fallback catch more cases.
2642
2643 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2644
2645         * cs-parser.jay: Allow parameters in operator declarations to have
2646         attributes. 
2647
2648 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2649
2650         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2651         exists. 
2652
2653         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2654         inside the ContextualReturn, it does not have to be an
2655         ExpressionStatement. 
2656
2657 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2658
2659         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2660         set, set it.
2661
2662 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2663
2664         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2665         method in two methods: ResolveNoDefine and Resolve.
2666
2667         ResolveNoDefine will stop just after ResolveTopBlock has been
2668         called.   
2669
2670         Resolve will then continue by creating a method and issuing the
2671         call to method.Define ().
2672
2673         (AnonymousMethod): Split and implement the new Resolve and
2674         ResolveNoDefine as well.
2675
2676         * lambda.cs (LambdaExpression): Split the anonymous method
2677         resolution code into a separate routine (CoreCompatibilityTest)
2678         from DoCompatibleTest.
2679
2680         (LambdaExpression.TryBuild): New method, this method tries to
2681         build the LambdaExpression with the given set of types to be used
2682         as the types for the various parameters of the lambda expression. 
2683
2684         If the compilation succeed with the given types, the infered type
2685         of the Anonymous method is returned, otherwise null is returned.
2686
2687 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2688
2689         A fix for bug #81414
2690         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2691
2692 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2693
2694         * cs-tokenizer.cs: Change various identifiers here from the
2695         camelCasing to the recommended Linux-like style for instance
2696         variables from the Coding Guidelines. 
2697
2698 2007-04-19  Martin Baulig  <martin@ximian.com>
2699
2700         * convert.cs
2701         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2702         System.Enum to System.ValueType.
2703
2704 2007-04-13  Martin Baulig  <martin@ximian.com>
2705
2706         Rewrote implicit reference conversions.  We need to distinguish
2707         between implicit reference conversions (13.1.4) and implicit
2708         boxing conversions (13.1.5).
2709
2710         According to the spec, there's an an implicit conversion
2711         "From a one-dimensional array-type S[] to IList<T> and base
2712         interfaces of this interface, provided there is an implicit
2713         reference conversion from S to T."  Note that this does not
2714         include boxing conversions.
2715
2716         * convert.cs
2717         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2718         (Convert.ImplicitReferenceConversion): Split into
2719         ImplicitReferenceConversionCore() and
2720         ImplicitBoxingConversionExist().
2721         (Convert.ImplicitReferenceConversionExists): Use the new
2722         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2723
2724 2007-04-12  Martin Baulig  <martin@ximian.com>
2725
2726         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2727         `TypeManager.null_type' checks up to the top of the method.
2728
2729 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2730
2731         A fix for bug #81350
2732         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2733         extension methods.
2734
2735 2007-04-11  Martin Baulig  <martin@ximian.com>
2736
2737         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2738         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2739         to make this work for generic classes; fixes #79561.
2740
2741 2007-04-11  Martin Baulig  <martin@ximian.com>
2742
2743         * expression.cs (As): Add support for nullable types; fixes #79371.
2744
2745 2007-04-11  Martin Baulig  <martin@ximian.com>
2746
2747         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2748         `type.FullName' is null; fixes #80243.
2749
2750 2007-04-11  Martin Baulig  <martin@ximian.com>
2751
2752         * expression.cs (Invocation.IsApplicable): Don't modify the method
2753         if type inference succeeded, but the method was not applicable.
2754         Fixes #81250.
2755
2756 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2757
2758         A fix for bug #81324
2759         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2760         internal and external namespaces containers.
2761
2762 2007-04-10  Martin Baulig  <martin@ximian.com>
2763
2764         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2765         TypeManager.DropGenericMethodArguments() so we also call
2766         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2767
2768 2007-04-10  Martin Baulig  <martin@ximian.com>
2769
2770         * iterators.cs (Iterator.CreateIterator): Don't crash if
2771         `method.ReturnType' is null.  This happens if something went wrong
2772         while resolving that typ (we already reported an error in this case).
2773
2774 2007-04-10  Martin Baulig  <martin@ximian.com>
2775
2776         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2777         generic interfaces; report the CS0144 directly.
2778
2779 2007-04-10  Martin Baulig  <martin@ximian.com>
2780
2781         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2782         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2783
2784 2007-04-10  Martin Baulig  <martin@ximian.com>
2785
2786         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2787
2788 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2789
2790         A better fix
2791         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2792         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2793
2794         Fix #81338
2795         * statement.cs (For.Resolve): If resolution fails, use
2796         KillFlowBranching.
2797
2798 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2799
2800         * anonymous.cs (MakeName): Make faster and zero-based.
2801         (VerifyExplicitParameterCompatibility): Back to mode where generic
2802         parameter is ignored.
2803         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2804
2805         * class.cs (EmitType): Method can emit another new method.
2806
2807         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2808
2809         * driver.cs: Updated.
2810
2811         * lambda.cs: Reuse predefined empty parameters.
2812
2813         * parameter.cs: Updated
2814
2815         * support.cs: Implemented InflateTypes.
2816
2817         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2818         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2819
2820 2007-04-03  Martin Baulig  <martin@ximian.com>
2821
2822         Fix #80632.
2823
2824         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2825         version of TypeManager.IsOverride() which also works with generic
2826         types.  
2827
2828 2007-04-03  Martin Baulig  <martin@ximian.com>
2829
2830         Fix #81044.
2831
2832         * convert.cs
2833         (Convert.ExplicitReferenceConversion): We need to cast when
2834         converting from IList<T> to S[].
2835
2836 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2837
2838         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2839         at this level.
2840         
2841         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2842
2843 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2844
2845         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2846         argument and return type inferring.
2847
2848         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2849         (ReturnType): Turned to property.
2850
2851         * statement.cs (Return): Implemented return type inferring.
2852
2853         * support.cs (ReflectionParameters): Use local types if possible.
2854
2855 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2856
2857         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2858         (FlowBranching.UsageVector): Update to changes.
2859
2860         Prepare to kill 'Reachability'
2861         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2862         argument of constructor.
2863
2864 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2865
2866         Prepare to kill 'Reachability'
2867         * flowanalysis.cs (UsageVector.is_unreachable): New.
2868         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2869         'reachability', and verify they're consistent.
2870
2871         Fix #81121
2872         * expression.cs (New.EmitStatement): Handle type parameters here too.
2873
2874 2007-03-29  Martin Baulig  <martin@ximian.com>
2875
2876         Fix #79148.
2877
2878         * anonymous.cs
2879         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2880         CompilerGeneratedClass.
2881         (ScopeInfo.EmitScopeInstance): Make this protected.
2882         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2883         `ec.CurrentAnonymousMethod.Scope == Scope'.
2884
2885         * statement.cs (Block.ScopeInfo): Make this a property.
2886
2887 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2888
2889         Prepare to kill 'Reachability'
2890         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2891         (FlowBranching.UsageVector.Reachability): Remove property.
2892         (FlowBranching.UsageVector.IsUnreachable): New property.
2893         (FlowBranching.UsageVector.ResetBarrier): New.
2894         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2895         * codegen.cs, statement.cs: Update to changes.
2896
2897 2007-03-27  Martin Baulig  <martin@ximian.com>
2898
2899         Fix #81209.
2900
2901         * decl.cs
2902         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2903         generic types.
2904
2905 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2906
2907         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2908         instead of TriState.  Remove all mention of TriState.
2909
2910         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2911         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2912         and maintain invariants.
2913
2914 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2915
2916         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2917
2918 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2919
2920         * expression.cs: Stop using obsolete 2.0 opcodes.
2921
2922 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2923
2924         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2925         one of the latests Martin's fixes.
2926
2927 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2928
2929         * expression.cs: On BigEndian systems, swap the bytes, temporary
2930         solution until we get a new bitconverter class.
2931
2932 2007-03-23  Martin Baulig  <martin@ximian.com>
2933
2934         Fix #81158.
2935
2936         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2937         "Method" and "Method`1".  Normally, a cache lookup is done on the
2938         "Method" form (ie. without the generic arity), but this one makes
2939         lookups on the full form work as well.
2940
2941 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2942
2943         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2944         unused properties.
2945
2946 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2947         * class.cs: 
2948         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2949         ordered_member_list, to TypeBuilder to store members to be defined
2950         in the order they were parsed in.
2951         - ordered_explicit_member_list contains all properties indexers
2952           and methods that are defined as explicit implementation of an
2953           interface or base class.
2954         - ordered_member_list contains all properties indexers and methods
2955           that are not defined as explicit implementation of an interface
2956           or base class.
2957
2958         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2959         functionality in these removed classes has been replaced with 
2960         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2961         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2962
2963         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2964         to CheckForDuplications inside GetMethod and SetMethod Define Method
2965         to handle method property and indexer name conflicts.
2966
2967         Fixes #79434
2968
2969         All code is contributed under the MIT/X11 license.
2970
2971 2007-03-20  Martin Baulig  <martin@ximian.com>
2972
2973         * class.cs (TypeContainer.Interfaces): Removed; they're now
2974         included in `TypeContainer.Types'.
2975
2976 2007-03-20  Martin Baulig  <martin@ximian.com>
2977
2978         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2979
2980         * class.cs (TypeContainer.CreateType): New public method.  This is
2981         now called before DefineType() to create the TypeBuilders.
2982         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2983         has already been created by CreateType().
2984         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2985         don't resolve our base classes here; this has been moved into
2986         DefineBaseTypes().  We're now called from CreateType().
2987         (TypeContainer.DefineBaseTypes): New private method; resolve our
2988         base classes here.  We're now called from DefineType().
2989
2990         * rootcontext.cs
2991         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2992         our types first to create all the TypeBuilders.  After that, call
2993         TypeContainer.DefineType() on all the types which'll resolve their
2994         base classes and setup the resolve order.
2995
2996 2007-03-20  Martin Baulig  <martin@ximian.com>
2997
2998         * class.cs (TypeContainer.Enums): Removed; they're now included in
2999         `TypeContainer.Types'.  
3000
3001 2007-03-20  Martin Baulig  <martin@ximian.com>
3002
3003         * class.cs
3004         (TypeContainer.DefineType): Don't call ResolveMembers() here.
3005         (TypeContainer.DoResolveMembers): Call DefineType() on our
3006         `compiler_generated' classes; moved here from DefineNestedTypes().
3007
3008         * rootcontext.cs
3009         (RootContext.ResolveTree): Call ResolveMembers() on all
3010         TypeContainer's in the `type_container_resolve_order'.
3011
3012 2007-03-19  Marek Safar  <marek.safar@gmail.com>
3013
3014         * class.cs: Use corlib to handle InternalMethodImplAttribute.
3015
3016 2007-03-17  Marek Safar  <marek.safar@gmail.com>
3017
3018         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
3019         implementation flags.
3020
3021 2007-03-17  Marek Safar  <marek.safar@gmail.com>
3022
3023         * class.cs: More optimizations for type parameters.
3024
3025 2007-03-15  Marek Safar  <marek.safar@gmail.com>
3026
3027         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
3028
3029         * ecore.cs, parameter.cs: More common code for both corlibs.
3030
3031         * typemanager.cs (IsGenericMethod): Simplified.
3032
3033 2007-03-15  Raja R Harinath  <rharinath@novell.com>
3034
3035         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3036         'returns'.
3037         * statement.cs, iterators.cs, lambda.cs: Update to changes.
3038
3039         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
3040         unconditionally.  Simplify explanation.
3041         (Try.Resolve, Using.Resolve): Likewise.
3042
3043 2007-03-15  Martin Baulig  <martin@ximian.com>
3044
3045         Fix #80731.
3046
3047         * decl.cs (DeclSpace): If we're a partial class, use our
3048         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
3049
3050 2007-03-15  Raja R Harinath  <rharinath@novell.com>
3051
3052         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3053         'throws'.
3054         (FlowBranching.UsageVector): Update to changes.
3055         (FlowBranching.MergeSiblings): Likewise.
3056         * statement.cs: Likewise.
3057
3058 2007-03-15  Martin Baulig  <martin@ximian.com>
3059
3060         Fix #79302.
3061
3062         * decl.cs
3063         (MemberCache): Added a special .ctor for type parameters.
3064
3065         * typemanager.cs
3066         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
3067         `MemberCache'.  
3068
3069 2007-03-09  Martin Baulig  <martin@ximian.com>
3070
3071         * enum.cs (Enum): Make this a TypeContainer.
3072         (EnumMember): Derive from `Const'.
3073
3074         * const.cs
3075         (Const.DoResolveValue): New protected virtual method; move most of
3076         the functionality of ResolveValue() here so we can override it in
3077         `EnumMember'.
3078         (Const.CreateConstantReference): Make this virtual.
3079
3080         * class.cs (Kind): Add `Kind.Enum'.
3081         (TypeContainer.Emit): Don't emit the enums here; they're already
3082         in the `RootContext.typecontainer_resolve_order'.
3083
3084         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
3085         here; they're already in the `typecontainer_resolve_order'.
3086
3087         * ecore.cs (EnumConstant.ConvertImplicitly): Add
3088         TypeManager.DropGenericTypeArguments().
3089
3090         * typemanager.cs
3091         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
3092         (TypeManager.IsEnumType): Likewise.
3093         (TypeManager.EnumToUnderlying): Likewise.
3094         (TypeManager.IsEqual): Add support for enums.
3095
3096 2007-03-12  Raja R Harinath  <rharinath@novell.com>
3097
3098         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
3099         DefaultParameterValueAttribute to be undefined, say if System.dll
3100         is not referenced.
3101
3102 2007-03-11  Marek Safar  <marek.safar@gmail.com>
3103
3104         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
3105         any mscorlib.
3106
3107 2007-03-10  Marek Safar  <marek.safar@gmail.com>
3108
3109         * class.cs, parameter.cs: Unified parameters verification.
3110
3111 2007-03-08  Martin Baulig  <martin@ximian.com>
3112
3113         * cs-parser.jay (constructor_header): Pass the location to the
3114         newly created TopLevelBlock.
3115
3116 2007-03-07  Martin Baulig  <martin@ximian.com>
3117
3118         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
3119
3120 2007-03-06  Miguel de Icaza  <miguel@novell.com>
3121
3122         * convert.cs (ExplicitReferenceConversionExists): Sync this method
3123         with the changes from David, fixes the build.
3124
3125 2007-03-05  David Mitchell  <dmitchell@logos.com>
3126
3127         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
3128         and its base interfaces to a one-dimensional array type S[],
3129         provided there is an implicit or explicit reference conversion
3130         from S to T.
3131
3132 2007-03-03  Marek Safar  <marek.safar@gmail.com>
3133
3134         * cs-tokenizer.cs: Implemented basic linq grammar.
3135
3136         * driver.cs: Set linq lang version on demand.
3137
3138 2007-02-26  Marek Safar  <marek.safar@gmail.com>
3139
3140         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
3141
3142 2007-02-25  Marek Safar  <marek.safar@gmail.com>
3143
3144         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
3145         (Fixes #80455)
3146
3147         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
3148         here.
3149         Check property and event extern attributes.
3150
3151         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
3152         charset.
3153
3154 2007-02-24  Marek Safar  <marek.safar@gmail.com>
3155
3156         A fix for bug #80407
3157         * ecore.cs: Don't report ambiguity error when methods have same parent.
3158
3159 2007-02-23  Marek Safar  <marek.safar@gmail.com>
3160
3161         A fix for bug #80878
3162         * class.cs, cs-parser.jay: Event property can host anonymous methods.
3163
3164 2007-02-22  Marek Safar  <marek.safar@gmail.com>
3165
3166         * attribute.cs: Enable ExtensionAttribute presence test.
3167
3168 2007-02-22  Marek Safar  <marek.safar@gmail.com>
3169
3170         * class.cs: Warn about missing GetHashCode only when Equals is override.
3171
3172         * decl.cs: Check accessibility of type arguments.
3173
3174         * typemanager.cs: Correctly report nullable array.
3175
3176 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3177
3178         * class.cs, report.cs: Capture more details when things go wrong.
3179
3180 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3181
3182         A fix for bug #80650
3183         * cs-parser.jay: Anonymous container starts at constructor declaration
3184         and not at block beginning because it has to be usable in constructor
3185         initializer.
3186
3187         * statement.cs: Use context location and not block one for error reporting.
3188
3189 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3190
3191         A fix for bug #78712
3192         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3193         too.
3194
3195 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3196
3197         A fix for bug #80493 by Atsushi Enomoto
3198         * cs-parser.jay: Ignore invalid attribute target.
3199
3200 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3201  
3202         * cs-tokenizer.cs: Ignore '\0' as white space character.
3203
3204 2007-02-17  Miguel de Icaza  <miguel@novell.com>
3205
3206         * cs-parser.jay: Add support for lambda expressions to the mcs
3207         compiler as well.
3208
3209         * lambda.cs: Only clone when we are probing, not on the final call
3210         (Compatible is the final call). 
3211
3212         * statement.cs (CloneContext): Introduce class to provide block
3213         remapping during clone.
3214
3215         All statements Clone themselves now.
3216
3217         (Clone): special handling for blocks, when we clone a block, we
3218         register the block inside this routine, as children of the block
3219         might trigger a lookup. 
3220         
3221         * expression.cs: Add support for CloneContext in all expressions. 
3222         
3223 2007-02-17  Marek Safar  <marek.safar@gmail.com>
3224  
3225         A fix for bug #80493
3226         * statement.cs: Report ambiguous warning when interfaces are not related.
3227
3228 2007-02-15  Marek Safar  <marek.safar@gmail.com>
3229
3230         C# 3.0 extension methods.
3231
3232         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3233         cannot be used directly.
3234
3235         * class.cs (Class.Emit): Emit extension attribute if any class method
3236         is extension method.
3237         (Method.Define): Add basic extension method validation conditions.
3238         (Method.Emit): Emit extension attribute for method.
3239
3240         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3241         extension method exists. Currently we follow same approach as Microsoft
3242         does, emit even if a method or a class are private but this can change
3243         later.
3244
3245         * cs-parser.jay: Add handling of `this' keyword in method parameters
3246         context.
3247
3248         * decl.cs (DeclSpace.IsStaticClass): New property.
3249         (MemberCache.FindExtensionMethods): Looks for extension methods with
3250         defined name and extension type.
3251
3252         * doc.cs: Updated after OverloadResolve changes.
3253
3254         * driver.cs: Add new soft reference to System.Core.dll.
3255
3256         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3257         (ExtensionMethodGroupExpr): Represents group of extension methods.
3258
3259         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3260         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3261         to MethodGroupExpr and made non-static for easier customization.
3262         (Invocation.DoResolve): Add extension method lookup when no standard
3263         method was found.
3264         (MemberAccess.DoResolve): Try extension methods if no member exists.
3265
3266         * modifiers.cs: Add METHOD_EXTENSION modifier.
3267
3268         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3269         as well as candidate extension type.
3270         (ComputeNamespaces): When assembly constains extension methods registers
3271         them.
3272         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3273         extension method lookup.
3274         (Namespace.LookupExtensionMethod): Looks for extension method in this
3275         namespace.
3276         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3277         find a method which matches name and extensionType.
3278
3279         * parameter.cs (Parameter): Add This modifer.
3280         (HasExtensionMethodModifier): New property.
3281         (Resolve): Add extension parameter check.
3282         (ModFlags): turned to property to exclude this modifier as it is not real
3283         parameter modifier.
3284         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3285
3286         * support.cs (ParameterData): Add ExtensionMethodType.
3287         (ReflectionParameters): Implemented ExtensionMethodType interface property.
3288
3289         * typemanager.cs: Add type and ctor extension attribute type.
3290
3291 2007-02-15  Miguel de Icaza  <miguel@novell.com>
3292
3293         * report.cs (DisableErrors, EnableErrors): used to prevent error
3294         output when we are "trying" to compile various methods with
3295         different types. 
3296
3297         * ecore.cs (Expression): Add Clone method that calls the virtual
3298         CloneTo method.  The current CloneTo method in Expression throws
3299         an exception so we can track down all the places where this must
3300         be implemented (not using abstract, because that would be a lot of
3301         up-front-work before we can start testing the implementation
3302         idea). 
3303
3304         Important: we only need Clone capabilities for expressions created
3305         by the parser, as the expressions we will be cloning are
3306         expressions in the pre-resolved state.   This vastly simplifies
3307         the work required. 
3308         
3309         (SimpleName): Add CloneTo that does nothing.
3310         (EmptyCast): Add CloneTo.
3311         
3312         * expression.cs (Binary): Implement CloneTo.
3313         (Invocation.IsApplicable): Store the current ec in
3314         EmitContext.TempEc and restore it on return.  This is used so we
3315         do not have to sprinkle hundres of methods with an extra
3316         EmitContext, we know that the only user is the lambda expression
3317         ImplicitConversionExists code. 
3318         
3319         (Argument): Add Cloning capabilities.
3320         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3321         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3322         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3323         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3324         IndexerAccess): Add Clone capability.
3325
3326         (LocalVariableReference, This): TODO: needs cloned Block mapping.
3327
3328         (Argument): Add cloning capability.
3329
3330         * assign.cs (Assign): Implement CloneTo.
3331
3332         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3333         
3334         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3335         version by calling Convert with the EmitContext (that we are
3336         currently storing in ec, this is not great, but will do for now,
3337         to avoid passing EmitContext parameters to hundreds of functions
3338         that do not need them now).
3339
3340         (SetExpression): Remove, it is not needed.
3341         
3342         (ContextualReturn): Implement CloneTo.
3343
3344         * statement.cs (Statement): Implement cloning infrastructure,
3345         similar to expressions.
3346
3347         (Block): Partial implementation of Clone for statements.
3348
3349         (Return): Implement clone.
3350         
3351         * constant.cs (Constant.CloneTo): New method, does nothing.
3352
3353         * codegen.cs (TempEc): Add a static EmitContext as a temporary
3354         solution, until we decide how to exactly do this.  
3355         
3356 2007-02-14  Marek Safar  <marek.safar@gmail.com>
3357  
3358         A fix for bug #80493
3359         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3360         a property is override we need to use second accessor.
3361
3362 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3363  
3364         A fix for bug #80418
3365         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3366         methods.
3367
3368 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3369
3370         Another fix for bug #80749
3371         * pending.cs: Abstract class has priority over interfaces.
3372
3373 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3374
3375         Another fix for bug #80749
3376         * pending.cs: Abstract class has priority over interfaces.
3377
3378 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3379
3380         Another fix for bug #80749
3381         * pending.cs: Abstract class has priority over interfaces.
3382
3383 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3384
3385         Another fix for bug #80749
3386         * pending.cs: Abstract class has priority over interfaces.
3387
3388 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3389
3390         * class.cs Better error message.
3391
3392         * driver.cs: Add shorter versions of -optimize option.
3393
3394 2007-02-13  Martin Baulig  <martin@ximian.com>
3395
3396         * class.cs (Constructor.Emit): Check the return value of
3397         ec.ResolveTopBlock() and return on error.
3398
3399 2007-02-13  Raja R Harinath  <rharinath@novell.com>
3400
3401         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3402         message to fix error message regression.
3403
3404 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3405
3406         * delegate.cs: Delegate creation expression cannot be of Nullable type.
3407
3408 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3409
3410         A fix for bug #80749
3411         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3412         its parent container.
3413
3414         * class.cs (DefineFieldInitializers): Each initializer can has different
3415         resolve context.
3416
3417         * const.cs: Updated.
3418
3419 2007-02-11  Miguel de Icaza  <miguel@novell.com>
3420
3421         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3422         now all the heavy lifting to check that embedded statements or
3423         expressions have the right form is done in the ContextualReturn.
3424
3425         (ContextualReturn): New class.  
3426
3427         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3428         method that can be invoked to report 201, so we do not replicate
3429         this everywhere.
3430
3431         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3432         
3433         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3434         treating tabs as spaces. 
3435
3436 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3437
3438         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3439         * assign.cs: Use full implicit conversion for right side check.
3440
3441 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3442
3443         * statement.cs (Switch): Switch over boolean type is not standardized.
3444
3445 2007-02-08  Marek Safar  <marek.safar@gmail.com>
3446
3447         A fix for bug #80755
3448         * decl.cs (FindBaseEvent): Don't use method cache for events.
3449
3450 2007-02-07  Marek Safar  <marek.safar@gmail.com>
3451
3452         * cs-parser.jay: Better syntax error handling.
3453
3454         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3455         instead of underlying type value.
3456
3457 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3458
3459         * driver.cs: Check define identifier before is registered.
3460
3461         * namespace.cs: Use existing error message.
3462
3463         * report.cs: New warning.
3464
3465 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3466
3467         A fix for bug #80742
3468         * expression.cs: Delegate Invoke method can be called directly.
3469
3470 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3471
3472         A fix for bug #80676
3473         * class.cs (IsEntryPoint): The Main method can have params modifier.
3474
3475 2007-02-04  Miguel de Icaza  <miguel@novell.com>
3476
3477         * parameter.cs (Parameter, Parameters): Add Clone method.
3478
3479         * anonymous.cs (Compatible): Turn method into virtual method, so
3480         LambdaExpression can implement a different behavior.
3481
3482         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3483         out the basic checking here, so it can be used by
3484         LambdaExpressions.
3485         
3486         * lambda.cs: Introduce "Compatible" function that will do the
3487         heavy lifting.
3488
3489 2007-02-02  Marek Safar  <marek.safar@gmail.com>
3490
3491         * attribute.cs: Unified one error message.
3492
3493         * class.cs (Class): Use type attributes and not properties to test static
3494         class.
3495         (IsEntryPoint): Don's pass local variable.
3496
3497         * convert.cs: Removed duplicate check.
3498
3499         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3500
3501         * driver.cs: Don't crash when soft reference does not exist.
3502
3503         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3504         (UsingEntry): Removed redundant allocation.
3505
3506         * parameter.cs: Add fast path for type parameters.
3507
3508         * support.cs: Don't allocate attribute when it's not used.
3509
3510 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3511
3512         * anonymous.cs
3513         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3514         this into a virtual method, so we can override it in LambdaExpression.
3515
3516         * driver.cs: Improve diagnostics in case of failure. 
3517
3518         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3519         write a function that is slightly more complex and that parses:
3520
3521         type identifier [, type identifier]* )
3522
3523         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3524         this expression:
3525
3526                 (canEmpty ? i >= 0 : i > 0)
3527
3528 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3529
3530         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3531         exception on possibly valid code.
3532
3533 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3534
3535         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3536         Push/PopPosition.
3537         (parse_opt_type_arguments): Remove.  It's almost the same as
3538         parse_less_than.
3539         (parse_namespace_or_typename): Use parse_less_than.
3540
3541 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3542
3543         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3544         this bug took a few hours to find, because the state saved and
3545         restored by PushPosition and PopPosition was ignoring the state of
3546         parse_generic_less_than.
3547
3548         I can also now remove the handling of OP_LT and OP_GT, this solves
3549         the big mistery.
3550         
3551         * cs-tokenizer.cs: store the location for the ARROW token, we use
3552         that in the parser.
3553
3554         (PushPosition, PopPosition): save/restore also `current_token',
3555         restore `parse_generic_less_than' (was missing).
3556
3557         (parse_opt_type_arguments): use parse_type, not
3558         parse_namespace_or_typename to parse types.
3559
3560         * lambda.cs: Empty new file, will eventually have the lambda
3561         expression implementation.
3562
3563         * lambda.test: used to test the internal tokenizer. 
3564
3565         * report.cs (FeatureIsNotISO1): Rename from
3566         FeatureIsNotStandardized, because it was about the language level
3567         (1 vs 2) it was not about standarization.
3568
3569         (FeatureRequiresLINQ): New.
3570
3571         * support.cs (SeekableStreamReader): Only require that the reader
3572         is a TextReader, not a StreamReader, so we can plug StringReader. 
3573
3574         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3575         given position in the input stream the following tokens can be
3576         parsed as a type followed by an identifier.
3577
3578         (is_punct): after a '(' if parse_type_and_parameter returns true,
3579         then return a special token OPEN_PARENS_LAMBDA which is used to
3580         avoid reduce/reduce errors in the grammar for the
3581         lambda_expression rules.
3582
3583         (parse_type): implement a type parser inside the
3584         tokenizer, the parser only returns true or false depending on
3585         whether the input at a given position can be parsed as a type.
3586
3587         (peek_token): new method used during type parsing.
3588
3589 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3590
3591         Fix #80531
3592         * anonymous.cs (ScopeInfo.InflateParameters): New.
3593         (AnonymousContainer.Resolve): Use it to redirect types of
3594         delegate parameters.
3595
3596 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3597
3598         Fix #80530
3599         * expression.cs (Error_InvalidArguments): Don't use two different
3600         messages for CS1503.  Use ExtraInformation and
3601         SymbolRelatedToPreviousError instead.
3602
3603         Fix #80358
3604         * decl.cs (DeclSpace.initialize_type_params): Don't access
3605         'type_params' of a partial class directly.
3606
3607 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3608
3609         * constant.cs: Removed a handful of out-of-range checks that were
3610         not necessary. 
3611
3612 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3613
3614         * expression.cs (CheckUselessComparison): Add additional check for char
3615         constants.
3616
3617         * namespace.cs: Fixed typo.
3618
3619 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3620
3621         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3622         gone, instead we inline the test, preventing the needless casts to
3623         longs, ulongs and doubles for the parameters, avoiding calls to
3624         methods that overchecked stuff, and instead inlined things
3625         nicely. 
3626
3627 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3628
3629         * cs-parser.jay: Better parameter error handling.
3630
3631 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3632
3633         A fix for bug #80368, #80522
3634         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3635         whether array initializer contains constants only.
3636         (ArrayCreation.Emit): Use better formula to decide when
3637         are array initializers for static initialization.
3638         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3639         have to emit even constants otherwise they are pre-initialized.
3640
3641 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3642             Raja R Harinath  <rharinath@novell.com>
3643
3644         Fix emit order of 'get' vs. 'set'.
3645         * support.cs (Accessors): New.
3646         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3647         Note the order in which accessors are declared in the source.
3648         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3649         Refactored from Property.Define and Indexer.Define.
3650         (PropertyBase.DefineAccessors): New helper that calls the above in
3651         appropriate order as noted by the parser.
3652         (Property.Define, Indexer.Define): Update to changes.
3653         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3654
3655 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3656
3657         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3658         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3659         there's an implicit conversion from the current type to the target
3660         type before converting the underlying constant.
3661
3662 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3663
3664         * const.cs (ResolveValue): Updated after constant conversion was made more
3665         generic.
3666
3667         * constant.cs (GetAttributableValue): constant to object conversion is
3668         used for attributes only.
3669         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3670         constant conversions.
3671         (LongConstant.ConvertImplicitly): Ditto.
3672
3673         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3674         (ImplicitConversionStandard): Handle constant conversion as extra step.
3675         It solves the issue when constant conversion was called indirectly like
3676         inside array initializer and constant folding was skipped.
3677
3678         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3679         this change.
3680
3681         * statement.cs(ImplicitConversionStandard): Updated after constant
3682         conversion was made more generic.
3683
3684 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3685
3686         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3687         Constraints, solves the problem where the compiler incorrectly
3688         reported that a type parameter was not constrained to a class (Bug
3689         80518)
3690
3691 2007-01-14  Marek Habersack  <grendello@gmail.com>
3692
3693         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3694
3695 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3696
3697         A fix for bug #80368
3698         * assign.cs (FieldInitializer): New class implements field
3699         initializer statement.
3700
3701         * attribute.cs: Update after FieldMember rename.
3702
3703         * class.cs (PropertyBasedMember): New common class for property based
3704         types.
3705         (InterfaceMemberBase): New base class for all members which can be used as
3706         an interface members.
3707         (MethodCore): Moved really common code to InterfaceMemberBase.
3708         (Method.Define): Equal and GetHasCode detection is relevant for methods
3709         only.
3710         (MethodData.Define): Don't assume that public event implements an
3711         interface automatically.
3712         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3713         modifier is used.
3714         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3715         (FieldMember): Merged with FieldBase.
3716         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3717         event extern modifier can be used.
3718         (EventField.EventFieldAccessor): Moved event field specific code here.
3719         (Event.AllowedModifiers): Even event can be extern.
3720         (Event.FindOutBaseMethod): New override specific to events.
3721         (Indexer.parameters): Reintroduce parameters because base class holds
3722         only properties common data.
3723         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3724         need do extra parameters check.
3725
3726         * const.cs: Update after FieldMember rename.
3727
3728         * decl.cs (MemberCache.FindBaseEvent): New method.
3729
3730         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3731         to reflect that indexer is now derived from PropertyBased.
3732
3733         * ecore.cs (GetMemberType): Made public.
3734         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3735         obsolete event.
3736
3737         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3738         
3739         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3740         (RegisterEvent): Removed.
3741         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3742         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3743
3744 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3745
3746         Fix #80249
3747         * statement.cs (CollectionForeach.TryType): Prefer generic
3748         GetEnumerator over non-generic variant.  Fix code to follow comments.
3749
3750 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3751
3752         Fix #80446
3753         * support.cs (ReflectionParameter): Don't use an invalid index on
3754         the generic parameter data.
3755
3756 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3757
3758         * driver.cs: Just add a tiny bit of infrastructure.
3759
3760 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3761
3762         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3763         where field type is struct from current assembly.
3764         
3765         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3766         it is possible.
3767
3768 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3769
3770         A fix for bug #80381
3771         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3772         the core types.
3773
3774         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3775         messages.
3776         (Namespace.LookupType): Always use core types from corlib when speficied.
3777
3778         * report.cs: A new warning.
3779
3780         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3781         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3782         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3783
3784         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3785         (InitCoreTypes): Set expression type of object_type and value_type
3786         immediately after lookup.
3787
3788 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3789
3790         * cs-tokenizer.cs: Accept Pc class characters (Connector
3791         Punctuation) as valid identifiers.  Fixes #78259
3792
3793         * expression.cs (Invocation.DoResolve): Moved the check for the
3794         use of `this' for doing method calls to the Invocation resolution
3795         step, after overload resolution has taken place instead of doing
3796         the check at the low-level `This.DoResolve' level.
3797
3798         The `This.DoResolve'(appens before overload resolution, so it has
3799         no way of knowing if the method that will be called will be
3800         instace or static, triggering an erroneous report for cs0188 (Bug
3801         78113).
3802
3803         We now do the check for instance method invocations after we know
3804         what method will be called.
3805
3806         (This.CheckThisUsage): Move the actual use of this structure
3807         checking into its own method and expose it. 
3808
3809         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3810         EmitContext.
3811
3812         Exceptions: Null.ConvertImplicitly,
3813         Constant.ImplicitConversionRequired as there are too many call
3814         sites for passing the ec. 
3815
3816         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3817         EmitContext, if the value is null, then we do not try to provide
3818         the extra information from the error (If a userdefined conversion
3819         exists, as UserDefinedConversion requires a non null-EmitContext).
3820
3821         Fixes: #80347
3822
3823 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3824
3825         * flowanalysis.cs (MyBitVector): Document some invariants.
3826         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3827         introduced below, and add a couple of others, 
3828
3829 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3830
3831         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3832         GetPropertyFromAccessor and GetEventFromAccessor.
3833         
3834         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3835         overrides non-obsolete one.
3836         (Indexer.Define): Error message has been moved to the parser.
3837
3838         * cs-parser.jay: Better syntax errors handling.
3839
3840         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3841         when an invocation has no arguments.
3842
3843         * ecore.cs: Removed not used caching.
3844
3845         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3846         implementation.
3847
3848         * report.cs: Add a new warning.
3849
3850         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3851
3852         * typemanager.cs (enumeration_type): Removed.
3853         (CSharpSignature): Reuses IsSpecialMethod.
3854         (IsEqual): Hack for MS BCL.
3855         (GetPropertyFromAccessor): New method.
3856         (GetEventFromAccessor): New method.
3857         (IsSpecialMethod): Fixed to handle more cases.
3858
3859 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3860
3861         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3862         Made white spaces array static.
3863
3864         * ecore.cs (RemoveGenericArity): Optimized.
3865
3866         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3867         10 times faster).
3868         (MyBitVector.initialize_vector): Simplified.
3869
3870 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3871
3872         * ecore.cs: Am not entirely happy with this hack, but it seems to
3873         address the issue in 80257 (a small test case for
3874         CreativeDocs.NET). 
3875
3876         I set the MethodGroupExpr.Type to an internal compiler type
3877         (itself in this case) to force the resolution to take place.   Why
3878         it does not take place with a null is beyond me.
3879
3880 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3881
3882         A fix for bug #80288
3883         * expression.cs (ResolveOperator): Consider user defined conversion for
3884         logical and operator too.
3885         (EmitBranchable): Optimization for logical and when full constant folding
3886         could not be applied but one operand is constant.
3887
3888 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3889
3890         * class.cs (GetClassBases): Write 5 times every day, will never use
3891         FullName for error reporting.
3892
3893         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3894
3895 2006-12-19  Martin Baulig  <martin@ximian.com>
3896
3897         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3898         the symbol file info here.
3899
3900 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3901
3902         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3903         of `elseif' is taking then following sections are not taking.
3904         Fixes an issue reported on mono mailing list.
3905
3906 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3907
3908         A fix for bug #80300
3909         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3910         a caller is not taking.
3911
3912 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3913
3914         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3915         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3916         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3917         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3918         * class.cs: Update to changes.
3919
3920 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3921
3922         A fix for bug #79934
3923         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3924         partial container.
3925
3926         * class.cs (ResolveMembers): Register an iterator in current container and
3927         not in shared one.
3928
3929 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3930
3931         Fix test-543.cs
3932         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3933         satisfy a params annotated parameter.
3934
3935 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3936
3937         A fix for bug #77014
3938         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3939         paramters correctly and not rely on hacks in Parameters class.
3940         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3941         at any possition.
3942         (Invocation.VerifyArgumentsCompat): Ditto.
3943         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3944         any possition.
3945
3946         * parameter.cs (HasParams): Don't assume that params is the last one.
3947
3948         * support.cs (ReflectionParameters.ctor): Look for params attribute
3949         correctly.
3950         (ReflectionParameters.ParameterType): Removed hack when we returned last
3951         parameter for out of range parameters.
3952         (ParameterName, ParameterModifier): Ditto.
3953
3954 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3955
3956         A fix for bug #79987
3957         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3958         when assembly is not CLS compliant but type is. I have no idea why is this
3959         allowed.
3960
3961         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3962
3963 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3964
3965         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3966         in struct constructors, they are basically no-ops.
3967
3968 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3969
3970         * cs-tokenizer.cs (Position): Save preprocessor status too.
3971
3972 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3973
3974         A fix for bug #77794
3975         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3976
3977 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3978
3979         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3980         Fixes #69299.
3981         (pp_expr): Report error for an invalid expression.
3982         (handle_preprocessing_directive): Simplified; add more error checking.
3983
3984 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3985
3986         A fix for bug #74939
3987         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3988         directives handling.
3989
3990 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3991
3992         A fix for bugs #80093, and #75984
3993         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3994         logic, it seems to me as it worked before "by coincidence".
3995         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3996         (cleanup): Enabled endif check.
3997
3998 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3999
4000         A fix for bug #80162
4001         * statement.cs (CollectionForeach.TryType): Generics and non-generics
4002         enumerators are never ambiguous.
4003
4004 2006-12-08  Raja R Harinath  <rharinath@novell.com>
4005
4006         Fix #80060
4007         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
4008
4009 2006-12-06  Marek Safar  <marek.safar@gmail.com>
4010
4011         A fix for bug #80144
4012         * class.cs (EventProperty.Define): Explicit implementation means
4013         that an even is used.
4014
4015 2006-12-06  Marek Safar  <marek.safar@gmail.com>
4016
4017         Fixes the operators implementation (part II)
4018
4019         * cfold.cs (DoConstantNumericPromotions): Renamed to
4020         DoBinaryNumericPromotions and simplified.
4021         (BinaryFold): Couple of conversion fixes; simplified.
4022
4023         * constant.cs, ecore.cs, literal.cs
4024         (ToType): Renamed to ConvertImplicitly.
4025         (Reduce): Renamed to ConvertExplicitly.
4026
4027         * class.cs, convert.cs: Updated.
4028
4029         * expression.cs: TryReduce doesn't throw an exception.
4030
4031 2006-12-01  Marek Safar  <marek.safar@gmail.com>
4032
4033         A fix for bug #80108
4034         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
4035         compatible.
4036
4037 2006-11-30  Marek Safar  <marek.safar@gmail.com>
4038
4039         Fixes unary operators implementation (part I)
4040         Also fixes #80026
4041
4042         * cfold.cs (Error_CompileTimeOverflow): Made internal
4043
4044         * const.cs (IConstant): Changed to use reference to constant and
4045         not constant itself.
4046         Updated IConstant implementations.
4047
4048         * constant.cs (CreateConstant): New factory method.
4049         Updated IConstant implementation.
4050
4051         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
4052
4053         * ecore.cs: Updated to use CreateConstantReference.
4054
4055         * enum.cs: Reflects IConstant changes.
4056
4057         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4058
4059         * literal.cs (NullConstant): Change to be independently usable.
4060
4061 2006-11-29  Martin Baulig  <martin@ximian.com>
4062
4063         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4064         we need to emit the scope initializer before calling the base .ctor.
4065
4066         * anonymous.cs: Merged back from the new anonymous methods branch.
4067         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
4068
4069         * expression.cs (ParameterReference.DoResolveBase): Create a
4070         "normal" ScopeInfo when capturing parameters rather than using the
4071         root scope; this makes things work with anonymous methods having
4072         parameters.
4073
4074         * statement.cs
4075         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
4076
4077 2006-11-22  Marek Safar  <marek.safar@gmail.com>
4078
4079         A fix for bug #79987
4080         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
4081         check to a base class.
4082         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
4083         only when assembly has missing attribute.
4084         * report.cs: Update.
4085
4086 2006-11-21  Marek Safar  <marek.safar@gmail.com>
4087
4088         * cs-tokenizer.cs: Merged with gmcs version.
4089
4090 2006-11-20  Marek Safar  <marek.safar@gmail.com>
4091
4092         * cs-tokenizer.cs,
4093         * cs-parser.jay: Better error message when partial keyword is misplaced.
4094
4095 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
4096
4097         A fix for bug #79810
4098         report.cs: CS1058 only applies to 2.0 profile (gmcs).
4099         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
4100         a RuntimeWrappedException by default.
4101
4102 2006-11-18  Marek Safar  <marek.safar@gmail.com>
4103
4104         A fix for bug #79843
4105         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
4106         implementation.
4107         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
4108
4109 2006-11-18  Marek Safar  <marek.safar@gmail.com>
4110
4111         * driver.cs, namespace.cs: Uses faster IndexOf version.
4112
4113 2006-11-17  Marek Safar  <marek.safar@gmail.com>
4114
4115         A fix for bug #79941
4116         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
4117         operators.
4118         (Operator.Define): Implicit/Explicit operator of same type is duplicate
4119         even if internal name is different.
4120         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
4121         (UserDefinedConversion): Simplified as the operators cannot be internal.
4122         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
4123         conversions.
4124         (MethodLookup): Replaced EmitContext with parentType.
4125         * expression.cs: Updated.
4126
4127 2006-11-09  Raja R Harinath  <rharinath@novell.com>
4128
4129         * driver.cs (BadAssembly): Handle all the ugliness of
4130         DefineDynamicAssembly.
4131
4132 2006-11-08  Raja R Harinath  <rharinath@novell.com>
4133
4134         Address parts of #58244 -- most of what's left is in the runtime
4135         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
4136         CS1509 error checks, and handle them for all assembly loads, not
4137         just the first invocation.
4138         (LoadModule): Likewise.  Move handling of 'adder_method' ...
4139         * codegen.cs (AssemblyClass.AddModule): ... here.
4140
4141 2006-11-02  Marek Safar  <marek.safar@gmail.com>
4142
4143         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
4144         IEnumerable<T> is ambiguous.
4145
4146 2006-10-31  Marek Safar  <marek.safar@gmail.com>
4147
4148         A fix for bug #67689
4149         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
4150         GetEnumerator is ambiguous.
4151
4152         * report.cs: Add new warning.
4153
4154 2006-10-29  Marek Safar  <marek.safar@gmail.com>
4155
4156         A fix for bug #78602
4157         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4158         to protected member can be nested type.
4159
4160 2006-10-28  Marek Safar  <marek.safar@gmail.com>
4161
4162         A fix for bug #78965
4163         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4164         to protected member must derive from current type.
4165
4166 2006-10-27  Marek Safar  <marek.safar@gmail.com>
4167
4168         assign.cs: Reuses error method.
4169
4170         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
4171         instead of type for constants.
4172         (Expression.Error_ValueAssignment): Common error method.
4173
4174         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4175         for any assignment.
4176
4177 2006-10-27  Marek Safar  <marek.safar@gmail.com>
4178
4179         A fix for bug #79081
4180         * expression.cs (MemberAccess.DoResolve): Check nested type
4181         accessibility.
4182
4183 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
4184
4185         * doc.cs : nested delegates were not handled. Fixed bug #79754.
4186
4187 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4188
4189         A fix for bug #76591
4190         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4191
4192 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4193
4194         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4195         type forwarder of the same type multiple times.
4196
4197 2006-10-26  Raja R Harinath  <rharinath@novell.com>
4198
4199         Fix #78820
4200         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4201         instance as an rvalue, even when we later resolve as an lvalue.
4202
4203 2006-10-25  Martin Baulig  <martin@ximian.com>
4204
4205         * anonymous.cs: Fix #79673.
4206
4207 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
4208
4209         A fix for bug #79666
4210         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4211         ignored when is optimized (= default value) as its value is already set.
4212
4213 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4214
4215         A fix for bug #79724
4216         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4217         TypeContainer for type lookup.
4218
4219 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4220
4221         A fix for bug #79231
4222         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4223         * expression.cs (OverloadResolve): Always convert type name for
4224         an error message.
4225         (ResolveNamespaceOrType): Don't confuse a nested type with any 
4226         other member.
4227
4228 2006-10-18  Martin Baulig <martin@ximian.com>
4229
4230         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4231
4232 2006-10-17  Miguel de Icaza  <miguel@novell.com>
4233
4234         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4235         an int32, but requesting an int64 from the conversion
4236
4237 2006-10-12  Martin Baulig  <martin@ximian.com>
4238
4239         * anonymous.cs
4240         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
4241         
4242 2006-10-12  Martin Baulig  <martin@ximian.com>
4243
4244         * statement.cs
4245         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4246
4247 2006-10-11  Miguel de Icaza  <miguel@novell.com>
4248
4249         * convert.cs: Remove broken code: I was doing the "Existance"
4250         tests for Implicit conversions.
4251
4252 2006-10-10  Miguel de Icaza  <miguel@novell.com>
4253
4254         * convert.cs: Added one missing case in
4255         ImplicitStandardConversionExists uint64 to intptr.
4256
4257         Fixes #59800
4258         
4259         * typemanager.cs (uintptr_type): another core known type.   
4260
4261         * ecore.cs (OperatorCast): routine used to do cast operations that
4262         depend on op_Explicit.  We could change some of the Decimal
4263         conversions to use this.
4264
4265         This one has a probe mechanism that checks both types for an op_
4266         which it coudl be used to eliminate two classes: CastToDecimal
4267         and CastFromDecimal.
4268
4269         * convert.cs: Implement the conversions documented in #59800
4270         
4271 2006-10-10  Martin Baulig  <martin@ximian.com>
4272
4273         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4274         before RootScope.ResolveMembers().
4275
4276         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4277         `CurrentType' if appropriate.
4278
4279 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
4280
4281         A fix for bug #78568
4282         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4283         when contains binary operators.
4284         * cs-parser.jay: Updated.
4285
4286 2006-10-09  Martin Baulig  <martin@ximian.com>
4287
4288         * delegate.cs
4289         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4290         moved that into Define() and also do the other type parameter
4291         checks there.  Fixes #79094.  Added gtest-292.cs.
4292
4293         * expression.cs
4294         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4295         since that doesn't include type parameters; don't use `Ldelema'
4296         for type parameters.  Fixes #78980.  Added gtest-293.cs.
4297
4298 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
4299
4300         A fix for #77796
4301         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4302         conversion is allowed.
4303
4304 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4305
4306         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4307         error reporting when no error occurs.
4308
4309 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4310
4311         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4312         does not exist.
4313
4314 2006-10-06  Raja R Harinath  <rharinath@novell.com>
4315
4316         Fix #79584
4317         * class.cs (DefineTypeBuilder): Check circular dependencies before
4318         setting the parent of the TypeBuilder.
4319         (CheckRecursiveDefinition): Don't use 'BaseType', since
4320         it may not be valid until after DefineTypeBuilder.  Use
4321         'base_type' instead.
4322
4323 2006-10-04  Martin Baulig  <martin@ximian.com>
4324
4325         Merged the Anonymous Methods patch.
4326
4327         * anonymous.cs, iterators.cs: The new anonymous methods code.
4328
4329         * statement.cs (Variable): New public abstract class.
4330         (LocalInfo.Variable): New public property.
4331         (LocalInfo.ResolveVariable): New public method.
4332         (Block.Flags): Add `IsIterator'.
4333         (Block.AddVariable): Improved the CS0136 check.
4334         (Block.AnonymousChildren): New public property.
4335         (Block.AddAnonymousChild): New public method.
4336         (ToplevelBlock): Update to use the new anonymous method framework.
4337         (ToplevelBlock.ctor): `container' is now a `Block' and not a
4338         `ToplevelBlock'; this is required to correctly implement the
4339         CS0136 check.
4340         (Fixed, Using): Use `TemporaryVariable' instead of directly
4341         creating the `LocalBuilder'.
4342
4343         * parameter.cs (Parameter.ResolveVariable): New public method.
4344         (Parameters.ResolveVariable): Likewise.
4345
4346         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4347
4348         * class.cs (TypeContainer): Replaced the `iterators' list and
4349         corresponding methods with a list of `CompilerGeneratedClass'es.
4350         (TypeContainer.ResolveMembers): New public method.
4351         (Method): `IIteratorContainer' has been replaced by
4352         `IAnonymousHost'.
4353
4354         * expression.cs (VariableReference): New public abstract base
4355         class for `LocalVariableReference', `ParameterReference' and
4356         `This'.
4357
4358         * codegen.cs (EmitContext): Removed `capture_context',
4359         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4360         (EmitContext.EmitThis): Removed.
4361
4362         * cs-parser.jay: Replace `iterator_container' with
4363         `anonymous_host'.       
4364
4365 2006-10-04  Martin Baulig  <martin@ximian.com>
4366
4367         * generic.cs (GenericMethod): Don't make this abstract.
4368         (Constraints.Clone): Added dummy implementation.
4369
4370 2006-10-04  Raja R Harinath  <harinath@gmail.com>
4371
4372         Fix #79577
4373         * namespace.cs (LookForAnyGenericType): Avoid nullref on
4374         'declspaces'.  Avoid allocating arrays willy-nilly.
4375
4376         Fix #79553
4377         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4378         cases out of the switch.
4379
4380 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4381
4382         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4383         message when non-generic type is used with the type arguments.
4384         * expression.cs: Updated.
4385
4386 2006-09-28  Raja R Harinath  <rharinath@novell.com>
4387
4388         Fix #79013
4389         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4390         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4391         Change semantics slightly.  Don't insist on having only one
4392         temporary EmptyExpression -- just throttle the creation of new ones.
4393
4394         Fix #79451
4395         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4396         non-interfaces too.  If no methods are found, don't try to create
4397         a MethodGroupExpr.
4398
4399 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4400
4401         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4402         generic type.
4403
4404         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4405         us produce better error message.
4406
4407 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
4408
4409         * expression.cs (Binary.ResolveOperator): Warn about a side effect
4410         of the `|' operator.
4411
4412         * report.cs: A new warning added.
4413
4414 2006-09-27  Martin Baulig  <martin@ximian.com>
4415
4416         * generic.cs (GenericMethod): Don't make this abstract.
4417
4418 2006-09-27  Martin Baulig  <martin@ximian.com>
4419
4420         * report.cs
4421         (InternalErrorException): Added overloaded ctor taking a params array.
4422
4423 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
4424
4425         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4426         Fixed the cases when same error was reported twice.
4427
4428         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4429         now report symbol information.
4430
4431 2006-09-25  Martin Baulig  <martin@ximian.com>
4432
4433         * class.cs: Completely unified with the gmcs version.
4434
4435 2006-09-25  Martin Baulig  <martin@ximian.com>
4436
4437         * typemanager.cs (TypeManager.IsNullableType): New public function.
4438         (TypeManager.IsNullableTypeOf): Likewise.
4439         (TypeManager.IsNullableValueType): Likewise.
4440
4441         * class.cs (MethodCore): Added the `GenericMethod' argument from
4442         gmcs and also unified all classes derived from `MethodCore' with gmcs.
4443
4444 2006-09-24  Raja R Harinath  <harinath@gmail.com>
4445
4446         * convert.cs: Unify with gmcs version.
4447
4448 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4449
4450         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4451         verify them as well.
4452
4453         * report.cs: New warning.
4454
4455 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4456
4457         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4458         for anonymous block with out argument.
4459
4460 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4461
4462         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4463         not used private events only.
4464
4465 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
4466
4467         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4468
4469         * const.cs (Const.Define): Check for constant type.
4470         (Const.IsConstantTypeValid): Looks for valid constant types.
4471
4472         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4473
4474         * ecore.cs (EmptyConstantCast): New common class for all constant based
4475         EmptyCast(s).
4476
4477         * expression.cs (Is.DoResolve): Handle null constant especially.
4478         (New.DoResolve): Check for new void().
4479         (MemberAccess.DoResolve): Cope with all kind of nulls.
4480
4481         * literal.cs (NullConstant): Uses EmptyConstantCast.
4482         (NullDefault): Based on EmptyConstantCast.
4483         (NullLiteral): Uses EmptyConstantCast.
4484
4485         * statement.cs (Block.ResolveMeta): Check for constant type.
4486
4487 2006-09-22  Martin Baulig  <martin@ximian.com>
4488
4489         * delegate.cs, attribute.cs: Merged with the gmcs versions.
4490
4491 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4492
4493         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4494         not the null type.
4495
4496         Fix part of #79451
4497         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4498         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
4499         code slightly.
4500
4501 2006-09-22  Martin Baulig  <martin@ximian.com>
4502
4503         * ecore.cs: Merged with the gmcs version.
4504
4505         * generic.cs (ConstructedType): New dummy class.
4506         (TypeArguments): Don't make this abstract.
4507
4508         * typemanager.cs
4509         (TypeManager.IsGenericTypeDefinition): New method.
4510         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4511
4512 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4513
4514         * expression.cs (ComposedCast): Check for arrays of TypedReference
4515         before creating the type, not after.
4516
4517 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4518
4519         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4520         after ToType change.
4521
4522         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4523         when constant must be implicitly convertible.
4524
4525         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4526
4527         * ecore.cs (NullCast): Derives from NullConstant.
4528
4529         * expression.cs (Is.DoResolve): Removed useless variables.
4530         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4531         (New.Constantify): Add enum support.
4532         (MemberAccess.DoResolve): Add warning when accessing null constant or
4533         variable.
4534
4535         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4536         property.
4537
4538         * literal.cs (NullConstant): New abstract class with common
4539         functionality for all null specializations.
4540         (NullDefault): Represents default(X) when result can be
4541         reduced to null.
4542         (NullLiteral): Updated.
4543
4544         * report.cs: Add new warning.
4545
4546 2006-09-21  Martin Baulig  <martin@ximian.com>
4547
4548         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4549
4550 2006-09-21  Martin Baulig  <martin@ximian.com>
4551
4552         * generic.cs (GenericConstraints): New dummy class.
4553         (Constraints): Likewise.
4554         (TypeParameter): Likewise.
4555         (TypeParameterName): Likewise.
4556         (GenericMethod): Likewise.
4557
4558         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4559
4560         * decl.cs: Merged with the gmcs version.
4561
4562 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4563
4564         * generic.cs (TypeParameter): Implement IMemberContainer.
4565         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4566
4567         * rootcontext.cs: Unify with gmcs version.
4568
4569         * report.cs: Unify with gmcs version.
4570         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4571         from gmcs/generics.cs.
4572         * generics.cs (TypeParameter): New dummy class.
4573
4574         * support.cs: Unify with gmcs version.
4575
4576 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4577
4578         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4579         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4580
4581         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4582         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4583         * mcs.exe.sources: Add generic.cs.
4584
4585         * codegen.cs: Unify with gmcs version.
4586
4587         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4588         (EmitContext): Add GenericDeclContainer implementation.
4589         * decl.cs (MemberCore, DeclSpace): Likewise.
4590         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4591
4592         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4593         MCS TypeManager has a corresponding dummy method.
4594
4595 2006-09-19  Martin Baulig  <martin@ximian.com>
4596
4597         * expression.cs: Completely merged with the gmcs version.
4598
4599 2006-09-19  Martin Baulig  <martin@ximian.com>
4600
4601         * expression.cs (Invocation): Merged with the gmcs version.
4602         (ArrayAccess.GetStoreOpcode): Likewise.
4603
4604 2006-09-19  Martin Baulig  <martin@ximian.com>
4605
4606         * typemanager.cs
4607         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4608         (TypeManager.IsGenericMethodDefinition): Likewise.
4609
4610 2006-09-19  Martin Baulig  <martin@ximian.com>
4611
4612         * typemanager.cs
4613         (TypeManager.IsEqual): Moved the gmcs implementation here.
4614         (TypeManager.DropGenericTypeArguments): Likewise.
4615         (TypeManager.DropGenericMethodArguments): Likewise.
4616         (TypeManager.GetTypeArguments): Moved here from gmcs.
4617         (TypeManager.HasGenericArguments): Likewise.
4618
4619 2006-09-19  Martin Baulig  <martin@ximian.com>
4620
4621         * expression.cs (Binary): Merged with the gmcs version.
4622
4623 2006-09-19  Martin Baulig  <martin@ximian.com>
4624
4625         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4626
4627 2006-09-19  Martin Baulig  <martin@ximian.com>
4628
4629         * typemanager.cs: Merged with the gmcs version.
4630
4631 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4632
4633         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4634         * driver.cs: Likewise.
4635
4636 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4637
4638         A fix for #79401
4639         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4640         only if parent type is class.
4641         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4642         update.
4643
4644 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * cs-parser.jay,
4647         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4648         keywords are used.
4649         * typemanager.cs(CSharpName): Converts NullType to null.
4650
4651 2006-09-15  Martin Baulig  <martin@ximian.com>
4652
4653         * typemanager.cs
4654         (TypeManager.GetMethodName): Added mcs implementation.
4655         (TypeManager.IsEqual): Likewise.
4656
4657         * ecore.cs
4658         (SimpleName.RemoveGenericArity): Added dummy implementation.
4659
4660         * pending.cs: Merged with the gmcs version.     
4661
4662 2006-09-15  Martin Baulig  <martin@ximian.com>
4663
4664         * statement.cs: Merge with the gmcs version.
4665
4666 2006-09-15  Martin Baulig  <martin@ximian.com>
4667
4668         * statement.cs (Switch): Merge with the gmcs implementation
4669         (without nullables), which is newer.
4670
4671 2006-09-15  Martin Baulig  <martin@ximian.com>
4672
4673         * statement.cs (Block.Variables): Make this public.
4674         (ToplevelBlock.Parameters): Make this a property.
4675         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4676
4677 2006-09-15  Martin Baulig  <martin@ximian.com>
4678
4679         * namespace.cs: Merge with the gmcs version.
4680
4681 2006-09-15  Martin Baulig  <martin@ximian.com>
4682
4683         * decl.cs (MemberName): Minor code cleanups.
4684
4685 2006-09-15  Martin Baulig  <martin@ximian.com>
4686
4687         * parameter.cs: Merge with the gmcs version.
4688
4689 2006-09-15  Martin Baulig  <martin@ximian.com>
4690
4691         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4692         and an error in mcs.
4693
4694 2006-09-15  Martin Baulig  <martin@ximian.com>
4695
4696         * flowanalysis.cs: Merged from GMCS; added the generics code into
4697         a `GMCS_SOURCE' conditional so we can share this file.
4698
4699 2006-09-08  Martin Baulig  <martin@ximian.com>
4700
4701         * typemanager.cs (TypeManager.interlocked_type): New public field.
4702         (TypeManager.int_interlocked_compare-exchange): New public field.
4703         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4704         enumerator types here and call InitGenericCoreTypes().
4705         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4706         after calling InitEnumUnderlyingTypes().
4707
4708         * rootcontext.cs
4709         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4710         `classes_second_stage'. 
4711
4712 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4713
4714         * assign.cs, ecore.cs, expression.cs: Share error message text.
4715         * class.cs (FieldMember.Define): Check for varible of static type.
4716         * driver.cs (LoadAssembly): Uses error output for errors.
4717         * statement.cs: Updated.
4718
4719 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4720
4721         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4722         type instance.
4723
4724 2006-09-07  Martin Baulig  <martin@ximian.com>
4725
4726         * driver.cs
4727         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4728
4729 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4730
4731         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4732         
4733 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4734
4735         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4736         #52019 and #79064, the use of the \uXXXX sequence in source code
4737         to represent unicode characters.
4738
4739 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4740
4741         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4742         support.
4743         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4744
4745 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4746
4747         * assign.cs: Catch attempts to assign to a method groups in += and
4748         report as 1656
4749
4750 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4751
4752         A fix for #79056
4753         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4754
4755 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * class.cs (Method.Define): Issue a warning when generic method looks like
4758         an entry point.
4759         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4760         as well.
4761
4762 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4763  
4764         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4765         looking for ctor.
4766         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4767         search all base interfaces as a member can be ambiguous.
4768         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4769         Constructor member type filter. 
4770         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4771         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4772         reporting for returned memberinfos.
4773         * report.cs: Updated.
4774         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4775         version to work on all runtimes.
4776         (TypeManager.RealMemberLookup): Removed members filtering.
4777
4778 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4779
4780         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4781         (PropertyExpr.EmitAssign): Likewise.
4782         * expression.cs (Indirection.EmitAssign): Likewise.
4783         (LocalVariableReference.EmitAssign): Likewise.
4784         (ParameterReference.EmitAssign): Likewise.
4785         (Invocation.EmitArguments): Likewise.
4786         (ArrayAccess.EmitAssign): Likewise.
4787         (IndexerAccess.EmitAssign): Likewise.
4788         (This.EmitAssign): Likewise.
4789         (ConditionalLogicalOperator.Emit): Likewise.
4790
4791         Fix #79026
4792         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4793         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4794         leave it in after returning it.
4795         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4796
4797 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4800         message.
4801
4802 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4803
4804         Fix cs0146-3.cs and cs0146-4.cs.
4805         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4806         enclosing types don't depend on the current type.
4807
4808 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4809
4810         Fix #77963
4811         * class.cs (TypeContainer.DoDefineMembers): Use
4812         FindBaseMemberWithSameName on Parent, since we're interested in
4813         whether we hide inherited members or not.
4814         (FindBaseMemberWithSameName): Make slightly more robust.
4815
4816         Fix the non-generic testcase from #77396
4817         * decl.cs (DeclSpace.DeclContainer): Remove override.
4818
4819         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4820         declspaces for doppelgangers too.
4821         (UsingEntry): Implement IResolveContext.
4822         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4823         'this' as the resolve context.
4824         (LocalAliasEntry): Likewise.
4825
4826         Implement parts of #77403
4827         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4828         toplevel declaration space.  Each namespace declaration introduces
4829         a "partial" root declaretion space.
4830         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4831         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4832         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4833         from 'current_namespace.SlaveDeclSpace'.
4834         (namespace_declaration): Likewise.
4835         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4836         check.  It can't happen now.
4837         * decl.cs (DeclSpace.LookupType): Likewise.
4838         * driver.cs (MainDriver): Sanity check.
4839
4840 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4841
4842         * decl.cs (DeclSpace.FindNestedType): Remove.
4843         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4844         LookupTypeContainer to get the container of the nested type.
4845         * class.cs (TypeContainer.FindNestedType): Make non-override.
4846
4847 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4848
4849         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4850         * class.cs (TypeContainer.PartialContainer): ... here.
4851         (TypeContainer.AddBasesForPart): New helper.
4852         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4853         instead.
4854         * cs-parser.jay (current_class): Convert to DeclSpace.
4855         (struct_declaration, interface_declaration, class_declaration):
4856         Use AddBasesForPart instead of .Bases directly.
4857         * const.cs, iterators.cs: Update to changes.
4858
4859 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4860
4861         * class.cs (TypeContainer.AddMemberType): Rename from
4862         AddToTypeContainer.
4863         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4864         (AddTypeContainer): New.  Combine AddClassOrStruct and
4865         AddInterface.
4866         (AddPartial): Update.  Add 'is_partial' argument.
4867         * roottypes.cs: Update to changes.
4868         * cs-parser.jay (push_current_class): New helper for handling
4869         current_container and current_class.
4870         (struct_declaration, interface_declaration, class_declaration):
4871         Use it.
4872
4873 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4874
4875         * roottypes.cs: Rename from tree.cs.
4876
4877         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4878         * tree.cs (Tree, ITreeDump): Remove types.
4879         * rootcontext.cs (tree, Tree): Remove fields.
4880         (root, ToplevelTypes): New.
4881         * *.cs: Update to rename.
4882
4883         * tree.cs (Tree.RecordDecl): Remove.
4884         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4885         namespace here.
4886         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4887
4888 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4889
4890         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4891         DoFlowAnalysis and OmitStructFlowAnalysis here.
4892         (ec.With): Rename from WithUnsafe and generalize.
4893         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4894         (ec.WithFlowAnalyis): New.
4895         * ecore.cs, expression.cs, statement.cs: Update.
4896
4897 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4898
4899         * statement.cs (Block.ResolveMeta): Simplify slightly.
4900
4901         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4902         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4903         check_state to flags.
4904         (CheckState, ConstantCheckState): Update.
4905         (InUnsafe): New read-only property.
4906         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4907         arbitrary flags.
4908         (WithUnsafe): New helper similar to WithCheckState.
4909         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4910         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4911
4912 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4913
4914         Make comparisons use the same IL irrespective of whether they're
4915         in a 'checked' or 'unchecked' context: one of the issues in #78899
4916         * codegen.cs (EmitContext.CheckState): Make read-only property.
4917         (EmitContext.ConstantCheckState): Likewise.
4918         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4919         helper that implement a save/restore stack for CheckState
4920         values.  This is the only way to change check-state.
4921         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4922         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4923         (CheckedExpr.EmitBranchable): New forwarding method.
4924         (UnCheckedExpr): Likewise.
4925         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4926         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4927         (Checked.Resolve, checked.DoEmit): Likewise.
4928
4929 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4930
4931         * anonymous.cs: Cache the resolved anonymous delegate, and return
4932         this so that the ResolveTopBlock is only triggered once, not
4933         twice.
4934
4935         Currently we trigger ResolvetopBlock twice due to a first pass of
4936         argument check compatibility, and a second pass that does the
4937         actual resolution.   
4938         
4939 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4940
4941         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4942         modifiers.
4943         * rootcontext.cs (Reset): Add helper_classes.
4944
4945 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4946
4947         A fix for #78860
4948         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4949         correctly.
4950
4951 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4952
4953         * statement.cs (Lock): Handle expressions of type
4954         TypeManager.null_type specially.  Fixes #78770
4955
4956 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4957
4958         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4959         to an event.
4960
4961 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4962
4963         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4964         for accessors as well.
4965         * ecore.cs (EventExpr): Add AccessorTable.
4966
4967 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4968
4969         A fix for #78738
4970         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4971         for CS0122 where appropriate.
4972         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4973         level attributes.
4974         (Filter): Assembly can be null in the case of top level attributes.
4975
4976 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4977
4978         A fix for #78690
4979
4980         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4981         is done at global level.
4982
4983 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4984
4985         A fix for #77002, Implemented TypeForwarder support.
4986
4987         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4988         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4989         * typemanager.cs (): Add type_forwarder_attr_type.
4990
4991 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4992
4993         * report.cs: Add CS0469 warning.
4994
4995 2006-06-21  Martin Baulig  <martin@ximian.com>
4996
4997         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4998         the `try'-block, so we also report CS0016 etc. there.
4999
5000 2006-06-21  Martin Baulig  <martin@ximian.com>
5001
5002         * delegate.cs
5003         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
5004
5005 2006-06-21  Martin Baulig  <martin@ximian.com>
5006
5007         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
5008         also report CS1686 for parameters.
5009
5010 2006-06-21  Martin Baulig  <martin@ximian.com>
5011
5012         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
5013         instead of an error if the value is not implicitly convertible to
5014         the switch types; fixes #77964.
5015
5016 2006-06-21  Raja R Harinath  <rharinath@novell.com>
5017
5018         Fix #78673
5019         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
5020         FieldBuilder is null.
5021
5022         Fix #78662
5023         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
5024         'left' and 'right' before error-checking.
5025
5026 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
5027
5028         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
5029         Fixed bug #78601.
5030         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
5031         (FieldExpr.DoResolve): likewise.
5032         (PropertyExpr.InstanceResolve): likewise.
5033         (EventExpr.InstanceResolve): likewise. 
5034
5035 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
5036
5037         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
5038         attribute applicable tests for attribute argument.
5039
5040 2006-06-02  Raja R Harinath  <rharinath@novell.com>
5041
5042         Fix #78079
5043         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
5044         (Binary.OverloadResolve_PredefinedIntegral): New.
5045         (Binary.OverloadResolve_PredefinedFloating): New.
5046         (Binary.OverloadResolve_PredefinedString): New.
5047         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
5048         Follow the standard more closely, and treat numeric promotions in
5049         terms of overload resolution.
5050         (Binary.CheckShiftArguments): Simplify.
5051
5052 2006-06-01  Raja R Harinath  <rharinath@novell.com>
5053
5054         * flowanalysis.cs (MyBitVector): Simplify representation.
5055         (MyBitVector.Clone): Avoid allocating BitArray.
5056         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
5057         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5058         (*): Update.  Change all references to MyBitVector.And and
5059         MyBitVector.Or to &= and |=.
5060
5061 2006-05-29  Raja R Harinath  <rharinath@novell.com>
5062
5063         Fix cs0231-[34].cs.
5064         * cs-parser.jay (formal_parameter_list): Extend the pattern below
5065         to param arguments too.
5066
5067 2006-05-26  Miguel de Icaza  <miguel@novell.com>
5068
5069         * cs-parser.jay: Catch another parsing form for arglist being
5070         followed by other arguments.  Fixes #78313.
5071
5072 2006-05-24  Raja R Harinath  <rharinath@novell.com>
5073
5074         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
5075         checking of out parameters to ...
5076         (FlowBranchingToplevel.Merge): ... here.
5077         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
5078         set, propagate the origin upward, and only complain if there was
5079         no other error.
5080         (FlowBranchingException.AddContinueOrigin): Likewise.
5081         (FlowBranchingException.AddReturnOrigin): Likewise.
5082         (FlowBranchingException.AddGotoOrigin): Likewise.       
5083
5084 2006-05-23  Raja R Harinath  <rharinath@novell.com>
5085
5086         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
5087         unreachable, skip it.
5088         (FlowBranchingException.Merge): Always propagate jumps, even if
5089         the finally block renders subsequent code unreachable.
5090
5091 2006-05-18  Raja R Harinath  <rharinath@novell.com>
5092
5093         Fix #77601
5094         * statement.cs (Goto.Resolve): Move responsibility for resolving
5095         'goto' to FlowBranching.AddGotoOrigin.
5096         (Goto.SetResolvedTarget): New.  Callback to set the
5097         LabeledStatement that's the target of the goto.
5098         (Goto.DoEmit): Use Leave instead of Br when crossing an
5099         unwind-protect boundary.
5100         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
5101         LookupLabel and adjust to new semantics.
5102         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
5103         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
5104         Goto.SetResolvedTarget to update target.
5105         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
5106         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
5107         AddBreakOrigin & co.  Delay propagation until ...
5108         (FlowBranchingException.Merge): ... this.
5109
5110         * statement.cs (Block.Resolve): Always depend on flow-branching to
5111         determine unreachability.  Kill workaround that originally emitted
5112         only one statement after an "unreachable" label (see infloop in
5113         test-515.cs).
5114
5115         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
5116         This is still "wrong", but anything better would probably need a
5117         multi-pass algorithm.
5118         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
5119         usage vector.  Force current usage vector to be reachable, to
5120         optimistically signify backward jumps.
5121         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
5122         detected.
5123         (FlowBranchingLabeled.Merge): New.  If no backward jump was
5124         detected, return the original salted-away usage vector instead,
5125         updated with appropriate changes.  Print unreachable warning if
5126         necessary.
5127         * statement.cs (Block.Resolve): Don't print unreachable warning on
5128         a labeled statement.
5129
5130 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
5131
5132         * driver.cs: Pass filename without path to AssemblyBuilder's 
5133         AddResourceFile. Fixes bug #78407.
5134
5135 2006-05-17  Raja R Harinath  <rharinath@novell.com>
5136
5137         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
5138         * flowanalysis.cs (FlowBranchingLabeled): ... here.
5139         (FlowBranching.MergeChild): Overwrite
5140         reachability information from Labeled branchings too.
5141
5142 2006-05-16  Raja R Harinath  <rharinath@novell.com>
5143
5144         * statement.cs (Goto.Resolve): Merge jump origins here ...
5145         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
5146
5147         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
5148         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
5149         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
5150         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
5151         here, ...
5152         * statement.cs (Goto.Resolve): ... not here.
5153         (Goto.Emit): Remove CS1632 check.
5154
5155 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
5156
5157         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
5158         error message.
5159
5160 2006-05-11  Raja R Harinath  <rharinath@novell.com>
5161
5162         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
5163         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5164         (FlowBranchingException.Label): Likewise.
5165
5166         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
5167         given value.
5168         (MyBitVector.Or): Use it to avoid losing information (Count).
5169         (FlowBranching.MergeOrigins): Likewise.
5170
5171         * flowanalysis.cs (UsageVector.IsDirty): Remove.
5172         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5173         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5174         (UsageVector.ToString): Simplify.
5175         (UsageVector.MergeSiblings): Move here from ...
5176         (FlowBranching.Merge): ... here.
5177         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5178         not a MyBitVector.
5179
5180 2006-05-10  Raja R Harinath  <rharinath@novell.com>
5181
5182         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5183         null bitvector is treated as all-true.
5184
5185         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5186         (MyBitVector): Rationalize invariants.  'vector != null' implies
5187         that we have our own copy of the bitvector.  Otherwise,
5188         'InheritsFrom == null' implies all inherited bits are true.
5189
5190 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
5191
5192         * statement.cs (LocalInfo): Add IsConstant.
5193         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5194         local variable for constants.
5195
5196 2006-05-09  Raja R Harinath  <rharinath@novell.com>
5197
5198         * flowanalysis.cs (MyBitVector.Empty): New.
5199         (MyBitVector): Don't allow InheritedFrom to be null.
5200         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5201         (UsageVector, FlowBranching): Update to changes.
5202
5203         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5204         recursion.  The 'Parent == null' condition isn't sufficient for
5205         anonymous methods.
5206         (FlowBranching.AddBreakOrigin): Likewise.
5207         (FlowBranching.AddContinueOrigin): Likewise.
5208         (FlowBranching.AddReturnOrigin): Likewise.
5209         (FlowBranching.StealFinallyClauses): Likewise.
5210         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5211         (FlowBranching.CheckOutParameters): Likewise.
5212         (FlowBranchingToplevel): Terminate all the above recursions here.
5213         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5214         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5215
5216         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
5217         toplevel block.
5218         (FlowBranchingToplevel): New.  Empty for now.
5219         (FlowBranching.MergeTopBlock): Update.
5220         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5221         branching for the anonymous delegate.
5222         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5223
5224         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5225         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5226         information at the start of the merge.  Reorganize.
5227
5228 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5229
5230         * class.cs (MethodData.Define): Method cannot implement interface accessor.
5231
5232 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5233
5234         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5235         to newly introduced ctor.
5236
5237         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5238         message to one place.
5239         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5240         global namespace.
5241
5242 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5243
5244         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5245
5246         * ecore.cs (Expression.ResolveAsConstant): Updated.
5247
5248         * statement.cs (ResolveMeta): Updated.
5249
5250 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5251
5252         * cs-parser.jay: __arglist cannot be used in initializer.
5253
5254 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5255
5256         A fix for #77879
5257         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5258         private types.
5259
5260 2006-05-05  Raja R Harinath  <rharinath@novell.com>
5261
5262         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5263         (LabeledStatement): Add 'name' parameter.
5264         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5265         (Block.AddLabel): Update to changes.
5266         * cs-parser.jay (labeled_statement): Likewise.
5267
5268         * flowanalysis.cs (BranchingType.Labeled): New.
5269         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5270         (FlowBranchingLabeled): New.  Does nothing for now, but will
5271         eventually handle 'goto' flows.
5272         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5273         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5274         that's terminated ...
5275         (Block.Resolve): ... here.
5276
5277         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5278         (UsageVector.MergeFinallyOrigins): Likewise.
5279         (FlowBranching.InTryOrCatch): Likewise.
5280         (FlowBranching.AddFinallyVector): Likewise.
5281         (FlowBranchingException): Update to changes.
5282
5283         Fix #78290
5284         * statement.cs (Return.Resolve): Move error checking to ...
5285         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5286         (FlowBranchingException): Handle return origins like break and
5287         continue origins.
5288         (FlowBranching.UsageVector.CheckOutParameters): Remove.
5289
5290 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5291
5292         A fix for #76122
5293         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5294         filter.
5295
5296 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5297
5298         A fix for #77543
5299         * class.cs (MethodData.Define): Do public accessor check only when method
5300         implements an interface.
5301
5302 2006-05-04  Raja R Harinath  <rharinath@novell.com>
5303
5304         Remove special handling of 'break'
5305         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5306         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
5307         (UsageVector.Break): Remove.
5308         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5309         reachability.
5310         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5311
5312         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5313         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
5314
5315 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5316
5317         A fix for #75726
5318         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5319         be the interface member.
5320
5321 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5322
5323         A fix for #60069
5324         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5325         for emitting small (int) values.
5326
5327 2006-05-03  Raja R Harinath  <rharinath@novell.com>
5328
5329         Fix #59427
5330         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5331         control-flow passes through the 'finally' after merging-in all the
5332         control-flows from 'try' and the 'catch' clauses.
5333
5334         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5335         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5336         always true at the only non-recursive entry point.
5337         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5338         FlowBranchingBreakable.
5339         (FlowBranchingLoop): Remove.
5340         * statement.cs (Return.DoResolve): Update to changes.
5341
5342         Fix #76471, #76665
5343         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5344         (FlowBranching.CreateBranching): Handle it: create a
5345         FlowBranchingContinuable.
5346         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5347         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5348         except that it handles the 'continue' command.
5349         (FlowBranching.UsageVector.MergeOrigins): Rename from
5350         MergeBreakOrigins.
5351         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5352         except that it overrides AddContinueOrigin.
5353         (FlowBranchingException): Override AddContinueOrigin, similar to
5354         AddBreakOrigin.
5355         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5356         Create a new branching around the embedded statement.
5357         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
5358         control flow after the embedded statement.
5359         (Continue.Resolve): Move all error checking to AddContinueOrigin.
5360
5361         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5362         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5363         FlowBranchingBreakable.
5364         (FlowBranchingSwitch): Remove.
5365
5366         Fix test-503.cs
5367         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
5368         error reporting to ...
5369         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5370         Rename from 'AddBreakVector'.  Add new location argument.  Return
5371         a bool indicating whether the 'break' crosses an unwind-protect.
5372         (FlowBranchingException.AddBreakOrigin): Add.
5373         (FlowBranchingException.Merge): Propagate 'break's to surrounding
5374         flowbranching after updating with the effects of the 'finally'
5375         clause.
5376         (FlowBranchingBreakable): New common base class for
5377         FlowBranchingLoop and FlowBranchingSwitch.
5378
5379         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5380         embedded statement.
5381         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5382
5383 2006-05-02  Raja R Harinath  <rharinath@novell.com>
5384
5385         * statement.cs (Do.Resolve): If the loop is infinite, set the
5386         barrier.
5387         (While.Resolve, For.Resolve): Set a barrier after the embedded
5388         statement.  There's no direct control flow that goes from the end
5389         of the embedded statement to the end of the loop.
5390         * flowanalysis.cs (FlowBranching.Infinite): Remove.
5391         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
5392         above ensure that the reachability is correctly computed.
5393
5394         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5395         (UsageVector.MergeBreakOrigins): If the current path is
5396         unreachable, treat it as if all parameters/locals are initialized.
5397         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
5398         infinite loops before merging-in break origins.
5399
5400         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5401         (Reachability.Reachable): Split part into ...
5402         (Reachability.Unreachable): ... this.  Simplify.
5403         (Reachability.IsUnreachable): Use 'Unreachable' instead.
5404
5405         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5406         (Reachability.SetThrowsSometimes): Likewise.
5407         (FlowBranchingBlock.MergeTopBlock): Don't compare against
5408         TriState.Always, use corresponding property.
5409         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5410         (Block.Resolve): Likewise.  Remove some redundant checks.
5411
5412 2006-05-02  Raja R Harinath  <harinath@gmail.com>
5413
5414         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5415         (Reachability.Meet): Don't bother checking AlwaysThrows --
5416         barrier is always set.
5417         (FlowBranchingBlock.Merge): Likewise.
5418
5419 2006-05-01  Raja R Harinath  <harinath@gmail.com>
5420
5421         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5422         checks for unreachable.
5423
5424 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
5425
5426         A fix for #77980
5427         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5428
5429         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5430         whether field is really assigned.
5431
5432 2006-04-30  Raja R Harinath  <harinath@gmail.com>
5433
5434         * flowanalysis.cs (Reachability): Make 4-argument constructor
5435         private.
5436         (Reachability.Meet): Rename from 'And'.  Remove static variant.
5437         (Reachability.Always): Rename from the highly misleading
5438         'Reachability.Never'.
5439         (FlowBranching.Merge): Update to changes.  Mark an impossible
5440         situation with a 'throw'.
5441         (*): Update to changes.
5442
5443 2006-04-29  Raja R Harinath  <harinath@gmail.com>
5444
5445         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5446         Remove 'Undefined'.
5447         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5448         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5449         (*): Update to changes.
5450         * statement.cs: Update to changes.
5451
5452 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
5453
5454         A fix for #78049
5455         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5456
5457 2006-04-28  Raja R Harinath  <harinath@gmail.com>
5458
5459         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5460         dummy UsageVector.
5461
5462         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5463         argument to two arguments: an usage-vector and a bool.  Move call
5464         to FlowBranching.Merge () ...
5465         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5466
5467         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5468         handling of loop and switch reachability to ...
5469         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5470
5471 2006-04-27  Raja R Harinath  <harinath@gmail.com>
5472
5473         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5474         handling to FlowBranchingLoop.InLoop.
5475         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5476
5477 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
5478
5479         A fix for #78115
5480         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5481         anonymous method is allowed from AnonymousContainer here.
5482
5483         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5484
5485 2006-04-24  Raja R Harinath  <rharinath@novell.com>
5486
5487         Fix #78156
5488         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5489
5490 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
5491
5492         A fix for #49011.
5493         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5494         (DoubleConstant.Reduce): Ditto.
5495
5496 2006-04-23  Raja R Harinath  <rharinath@novell.com>
5497
5498         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5499         Remove 'lvalue_right_side' argument.  Move parts to ...
5500         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5501         (LocalVariable.DoResolveLValue): ... these.
5502
5503 2006-04-21  Raja R Harinath  <rharinath@novell.com>
5504
5505         Fix cs1655.cs
5506         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5507         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5508         (LocalVariableReference.DoResolveBase): Use it to implement new
5509         CS1655 check.
5510         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5511         (Argument.Resolve): Simplify.  Move CS1510 check ...
5512         * ecore.cs (Expression.ResolveLValue): ... here.
5513         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5514         (PropertyExpr.DoResolveLValue): Likewise.
5515         (FieldExpr.Report_AssignToReadonly): Likewise.
5516         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5517         LValueMemberAccess or LValueMemberOutAccess on instance depending
5518         on it.
5519         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5520         DoResolve as appropriate.
5521
5522 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5523
5524         Fix #75800
5525         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5526         implicit conversions on 'out' and 'ref' arguments.
5527
5528         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5529         improve clarity.  Remove dead code.
5530
5531         Fix #66031
5532         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5533         (Catch.Resolve): Resolve VarBlock if it exists.
5534
5535 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5536
5537         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5538         twice, this was some residual code, the enumerator was emitted
5539         properly in the two branche of if later.
5540
5541 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5542
5543         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5544         cast is never an lvalue.
5545         (Cast.DoResolve, Cast.ResolveRest): Combine.
5546         (Argument.Emit): Simplify slightly.  Move 'Expr is
5547         IMemoryLocation' check ...
5548         (Argument.Resolve): ... here.
5549         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5550
5551         Simplifications.  Fix cs0191-2.cs
5552         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5553         CS1649 and CS1651 to ...
5554         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5555         the actual selection of the error code and message to a lookup
5556         table.  Add a dummy return value to simplify callsites.
5557         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5558         readonly fields of other instances of the same type.  Move CS0197
5559         warning from ...
5560         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5561         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5562         resolution of an out or ref argument.  The code simplification
5563         above uses this invariant.
5564
5565 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5566
5567         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5568         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5569         CheckMarshallByRefAccess.  Drop parameter.
5570         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5571         warning.
5572         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5573         InstanceExpression.
5574         * report.cs (AllWarnings): Add CS1690.
5575         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5576         for ref access too.
5577         (LocalVariableReference.DoResolveBase): Update.
5578
5579 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5580
5581         * class.cs (MethodOrOperator): Moved common parts from method class.
5582         detect obsolete attributes.
5583         (Method.Define): Simplified as it reuses code from base.
5584         (Constructor.ValidAttributeTargets): Fixed issue found during
5585         refactoring.
5586         (Destructor.ValidAttributeTargets): Fixed issue found during
5587         refactoring.
5588         (Operator): Finished refactoring set off by #78020. Operator class is now
5589         ordinary method class.
5590
5591         * anonymous.cs: Updated.
5592
5593         * decl.cs (DeclSpace): Add IsGeneric
5594
5595 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5596
5597         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5598
5599 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5600
5601         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5602         detect obsolete attributes.
5603         (Method.CreateEmitContext): Moved to MethodOrOperator.
5604
5605 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5606
5607         A fix for #78048.
5608         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5609         customized exception to make crash detection easier.
5610         (MethodOrOperator): Started to work on new base class for methods and
5611         operators.
5612         (Method): Derives from MethodOrOperator.
5613         (Constructor.Emit): Emits its own attributes.
5614         (AbstractPropertyEventMethod.Emit): Ditto.
5615         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5616         patch.
5617         (Operator.Emit): It's temporary more tricky than should be.
5618         
5619         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5620
5621         * report.cs (InternalErrorException): Add ctor with inner exception.
5622
5623 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5624
5625         A fix for #76744.
5626         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5627         only not visible.
5628
5629 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5630
5631         A fix for #77916.
5632         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5633         array.
5634
5635 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5636
5637         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5638         attribute is present and Guid not.
5639         (Interface.ApplyAttributeBuilder): Ditto.
5640
5641         * attribute.cs: Add error message.
5642
5643 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5644
5645         A fix for #78020.
5646
5647         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5648         sources (it's composite) so hold them in extra array as they are used in
5649         Emit phase only. It worked in the previous versions by mistake.
5650         (Attribute.Emit): Emit attribute for more owners when exist.
5651
5652         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5653         it has now different behaviour.
5654
5655 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5656
5657         * constant.cs (Constant.IsDefaultInitializer): New method.
5658
5659         * class.cs: Updated.
5660
5661         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5662         re-initialize default values. It saves KBs almost for every assembly.
5663         Thanks Zoltan for the idea.
5664         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5665         (ArrayCreation.DoResolve): Resolve only once.
5666         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5667         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5668
5669 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5670
5671         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5672         From #77961.
5673
5674 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5675
5676         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5677         in an embedded statement too.
5678
5679 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5680
5681         Fix #77958
5682         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5683
5684 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5685
5686         A fix for #77966.
5687
5688         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5689         was not specified.
5690
5691         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5692
5693 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5694
5695         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5696         phase.
5697
5698         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5699         LocalTemporary change.
5700
5701         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5702         TypeContainer.
5703         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5704         initializers optimization.
5705         (ClassOrStruct.TypeAttr): Moved from modifiers.
5706         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5707         (FieldBase.ResolveInitializer): Resolves initializer.
5708         (FieldBase.HasDefaultInitializer): New property.
5709
5710         * cs-parser.jay: Removed message.
5711
5712         * expression.cs (CompilerGeneratedThis): New specialization.
5713
5714         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5715
5716 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5719
5720 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5721
5722         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5723         be now EnumConstants only.
5724
5725 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5726
5727         * attribute.cs, driver.cs: Reset more caches.
5728
5729 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5730
5731         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5732
5733 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5734
5735         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5736         for easier reuse. Updated all overrides.
5737         (IntegralConstant): New base class for all integral constants.
5738         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5739         of the constant range, report custom error.
5740         (UIntConstant.Reduce): Fixed uint conversion.
5741
5742         * ecore.cs, literal.cs: Reduce updates.
5743
5744 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5745
5746         A fix for #75813.
5747
5748         * class.cs (Constructor.Define): Removed extra if for default ctors.
5749         A patch from Atsushi Enomoto.
5750
5751 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5752
5753         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5754         GetAttributableValue.
5755
5756         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5757         when required.
5758
5759         * convert.cs (ImplicitConversionRequired): Error message moved to
5760         DoubleLiteral.
5761
5762         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5763         automatic implicit conversion of an output value.
5764         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5765
5766         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5767         conversion.
5768         (TypeOf.GetAttributableValue): Add extra handling for object type.
5769
5770         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5771         special error message.
5772
5773 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5774
5775         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5776         InternalCall.
5777         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5778         compatible with MS runtime.
5779
5780 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5781
5782         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5783         attribute arguments here.
5784
5785         * class.cs (Indexer.Define): The check was moved to attribute class.
5786
5787 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5788
5789         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5790         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5791         easier.
5792
5793 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5794
5795         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5796         mcs to keep code differences small.
5797         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5798         * typemanager.cs (parameter_default_value_attribute_type): New.
5799         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5800         CS1908 check.
5801
5802 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5803
5804         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5805
5806 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5809
5810         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5811         the blocks too.
5812
5813 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5814
5815         * doc-bootstrap.cs : fix build.
5816
5817 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5818
5819         * expression.cs (StringConcat.Append): Issue a warning when empty string
5820         is going to append.
5821
5822 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5823
5824         * assign.cs (CompoundAssign.ResolveSource): Removed.
5825
5826         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5827         clean up.
5828
5829         * class.cs (TypeContainer.FindMethods): Removed.
5830         (TypeContainer.CheckMemberUsage): Made static.
5831
5832         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5833
5834         * constant.cs (CheckRange): Removed unused type argument.
5835         (CheckUnsigned): Removed unused type argument.
5836
5837         * cs-parser.jay: Updated after MemberAccess clean up.
5838         Uses Length for empty string test.
5839
5840         * cs-tokenizer.cs: Uses Length for empty string test.
5841         (IsCastToken): Made static.
5842         (is_hex): Made static.
5843         (real_type_suffix): Made static.
5844
5845         * decl.cs (SetupCache): Made static.
5846         (OnGenerateDocComment): Removed unused ds argument.
5847
5848         * delegate.cs (VerifyDelegate): Removed unused argument.
5849
5850         * doc.cs: Uses Length for empty string test.
5851
5852         * driver.cs: Uses Length for empty string test.
5853
5854         * enum.cs (IsValidEnumType): Made static
5855
5856         * expression.cs (EnumLiftUp): Removed unused argument.
5857         (ResolveMethodGroup): Ditto.
5858         (BetterConversion): Ditto.
5859         (GetVarargsTypes): Ditto.
5860         (UpdateIndices): Ditto.
5861         (ValidateInitializers): Ditto.
5862         (MemberAccess.ctor): Ditto.
5863         (GetIndexersForType): Ditto.
5864
5865         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5866
5867         * iterators.cs: Updated after MemberAccess clean up.
5868
5869         * location.cs: Uses Length for empty string test.
5870
5871         * namespace.cs: Uses Length for empty string test.
5872
5873          * report.cs (CheckWarningCode): Made static.
5874
5875         * statement.cs (LabeledStatement): Removed unused argument.
5876
5877         * typemanager.cs (FilterNone): Removed.
5878
5879 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5880
5881         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5882         obsolete.
5883
5884         * class.cs: Updated.
5885
5886 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5887
5888         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5889
5890 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5891
5892         A fix for #77822.
5893
5894         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5895         reporting, it's more tricky than I thought.
5896
5897 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5898
5899         A fix for #77816.
5900
5901         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5902         host container.
5903         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5904         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5905         Add more error reporting; Fixed issue with params.
5906
5907         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5908
5909         * cs-parser.jay: AnonymousMethod requires host container.
5910
5911         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5912
5913 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5914
5915         * class.cs: Change 'TypeContainer ds' constructor argument to
5916         'DeclSpace parent'.  Some classes were missed below due to
5917         different naming convention.
5918
5919         * class.cs (MemberCore.Parent): Delete.  This makes the
5920         ParentContainer changes below enforceable by the compiler.
5921
5922         Treat pointers to enclosing declaration space as 'DeclSpace', not
5923         'TypeContainer'.
5924         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5925         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5926
5927         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5928         of TypeContainer.
5929         (Block.AddThisVariable): Likewise.
5930         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5931         (AbstractPropertyEventMethod.Emit): Likewise.
5932         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5933         (GetMethod.Define, SetMethod.Define): Likewise.
5934         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5935         (DelegateMethod.EmitMethod): Likewise.
5936
5937         Fix regression test-partial-13.cs.
5938         Rationalize use of PartialContainer.  Ensure that the partial
5939         class semantics can be tied to type-correctness, i.e., any
5940         violation will cause a compile error.
5941         * class.cs, const.cs: Access all fields that belong to class
5942         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5943         Resolve()-like functions still use 'Parent'.
5944
5945         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5946         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5947         (PropertyMethod.CheckModifiers): Remove unused argument.
5948         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5949         DeclSpace.
5950
5951 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5952
5953         Make semantics of PartialContainer simpler.
5954         * decl.cs (DeclSpace.IsPartial): Remove.
5955         * class.cs (TypeContainer.IsPartial): Likewise.
5956         (TypeContainer..ctor): Set PartialContainer to point to self.
5957         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5958         (TypeContainer.FindNestedType): Likewise.
5959         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5960
5961 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5962
5963         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5964
5965 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5966
5967         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5968         classes.
5969
5970 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5971
5972         * class.cs (Operator.Define): An error for base conversion was not
5973         reported correctly.
5974
5975 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5976
5977         * iterator.cs : yield break is allowed in try statement which has
5978           catch clauses. Fixed bug #77767.
5979
5980 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5981
5982         A fix for #77593, #77574.
5983
5984         * class.cs (MethodCore.CheckBase): Another if for operator.
5985
5986 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5989         were not resolved
5990
5991         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5992         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5993         conversion test.
5994         
5995         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5996         not needed.
5997
5998         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5999         Updated after another emitcontext usage was clean up. It should help us to
6000         synchronize with gmcs easier.
6001
6002 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
6003
6004         A fix for #77353.
6005
6006         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
6007         (Event.Define): ditto
6008         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
6009
6010         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
6011         Removed redundant code and set NewSlot for Invoke method too.
6012
6013         * parameter.cs (Parameters.ctor): Add custom, type ctor.
6014         (Parameters.MergeGenerated): New method. Use this method when you merge
6015         compiler generated argument with user arguments.
6016
6017 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
6018
6019         * attribute.cs (ResolveAsTypeTerminal): Removed.
6020
6021         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
6022         specialization for predefined types; 30% speed up.
6023         Finally placed obsolete check to right place.
6024         (Expression.ResolveType): Removed.
6025
6026         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
6027         Updated after ResolveType was removed.
6028
6029         * expression.cs (Cast.ctor): Check void cast.
6030         (Binary.ResolveAsTypeTerminal): Is never type.
6031         (Conditional.ResolveAsTypeTerminal): Is never type.
6032
6033         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
6034
6035 2006-03-01  Raja R Harinath  <rharinath@novell.com>
6036
6037         Fix #77679.
6038         * expression.cs (ParameterReference.DoResolveBase): Change return
6039         type to bool.
6040         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
6041         Update.
6042
6043         Fix #77628.
6044         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
6045
6046         Fix #77642.
6047         * typemanager.cs (GetFullNameSignature): Don't nullref on
6048         protected accessors.
6049
6050 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
6051
6052         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
6053         these two separated members to simplify the code.
6054         (Attribute.Resolve): Refactored to use new fields and methods.
6055         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
6056         implemented obsolete attribute checking.
6057         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6058         implemented obsolete checking again. It look line never ending quest ;-)
6059         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6060
6061         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6062
6063         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6064
6065         *class.cs (Property.Define): Add RegisterProperty call.
6066
6067         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6068         argument groups (only 2).
6069
6070         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
6071         encoding expression to arguments.
6072         (Expression.ExprClassToResolveFlags): Just turned to property.
6073
6074         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
6075         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
6076         optimized as well as implemented support for zero-length attributes.
6077
6078         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
6079         Add caching of PropertyInfo's.
6080
6081 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
6082
6083         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
6084         error multiple times.
6085
6086 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
6087
6088         New partial class implementation.
6089         A fix for #77027, #77029, #77403
6090
6091         * attribute.cs (Attributable): Made attributes protected.
6092
6093         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
6094         the replacements of ClassPart and PartialContainer.
6095         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
6096         (TypeContainer.AddInterface): Ditto.
6097         (TypeContainer.AddPartial): The main method for partial classes. It checks
6098         for errors and merges ModFlags and attributes. At the end class is added to
6099         partial_parts list.
6100         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
6101         required here.
6102         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
6103         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
6104         from the rest of partial classes.
6105         (TypeContainer.GetClassBases): Simplified.
6106         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
6107         DefineType.
6108         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
6109         (TypeContainer.HasExplicitLayout): Uses Flags now.
6110         (PartialContainer): Removed.
6111         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
6112         (StaticClass): Was merged with Class.
6113         (Class.GetClassBases): class and static class bases are verified here.
6114         (Class.TypeAttr): Added static attributes when class is static.
6115         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
6116         (MemberBase): In some cases we need to call parent container for partial
6117         class. It should be eliminated but it's not easy now.
6118
6119         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
6120
6121         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
6122         partial classed to accumulate class comments.
6123         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
6124
6125         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
6126
6127         * driver.cs (MainDriver): Tree.GetDecl was removed.
6128
6129         * modifiers.cs (Modifiers): Add partial modifier.
6130
6131         * tree.cs (Tree.decl): Removed.
6132         (RootTypes): Started to use this class more often for root types
6133         specializations.
6134
6135 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
6136
6137         A fix for #77615
6138
6139         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
6140         external interface does not have an attribute.
6141
6142 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
6143
6144         Another prerequisites for new partial classs implementation.
6145         
6146         * attribute.cs (Attribute.Equal): Implemented.
6147         (Attribute.Emit): Changed as attributes can be applied more than twice.
6148         (Attributes.Emit): Check for duplicate attributes here.
6149
6150         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
6151         as a parameter, clean-up.
6152
6153 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
6154
6155         A fix for #77485
6156
6157         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
6158         contains obsolete attribute check which can in some cases look for base
6159         type of current class which is not initialized yet.
6160         (TypeContainer.BaseType): Replacement of ptype.
6161
6162         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
6163
6164 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
6165
6166         First of prerequisites for new partial classs implemention.
6167         
6168         * attribute.cs (Attributable): Extended by ResolveContext;
6169         Attributes finally have correct context for resolving in all cases.
6170         (AttachTo): Attribute owner is assigned here.
6171
6172         * codegen.cs (IResolveContext): Introduce new interface to hold
6173         all information needed in resolving phase.
6174         (EmitContext): Implements IResolveContext; more clean-up needed here.
6175         
6176         * decl.cs (MemberCore): Implemented IResolveContext.
6177
6178         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6179         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6180         parameter.cs, statement.cs, tree.cs, typemanager.cs:
6181         Refactored to use new IResolveContext instead of EmitContext; cleanup
6182
6183 2006-02-06  Miguel de Icaza  <miguel@novell.com>
6184
6185         * codegen.cs (EmitScopeInitFromBlock): check here the
6186         capture_context, there is no need to make two calls to the
6187         EmitContext. 
6188
6189         * anonymous.cs: Add some debugging messages that might help me
6190         track other instances of this problem in the future (the
6191         regression of test 467).
6192
6193         * cs-parser.jay: track the variable block, as we need to initalize
6194         any captured variables declared in this block for the "catch"
6195         portion of the "Try" statement.
6196
6197         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6198         scope initialization for captured variables. 
6199
6200         Also, move the emit for the variables after the block location has
6201         been marked.
6202
6203 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
6204
6205         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6206
6207 2006-02-02  Miguel de Icaza  <miguel@novell.com>
6208
6209         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6210         commit yesterday, the initialization for the roots is necessary.
6211         What is not necessary is the scope activation.
6212
6213 2006-02-02  Raja R Harinath  <rharinath@novell.com>
6214
6215         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6216         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6217         CS0206 checks.
6218         (Argument.Resolve): Remove CS0206 checks.
6219
6220 2006-02-01  Miguel de Icaza  <miguel@novell.com>
6221
6222         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6223         scopes for all the roots, the scopes will now be emitted when the
6224         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
6225
6226         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6227         code.  This reduces a lot of existing cruft.
6228         
6229         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6230         that the ScopeInfo is generated as we enter the scope, not at the
6231         time of use, which is what we used to do before.
6232
6233         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6234         every time a Block is about to be emitted if we have a
6235         CaptureContext. 
6236
6237 2006-02-01  Raja R Harinath  <rharinath@novell.com>
6238
6239         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6240         (Reset): Update.
6241         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6242
6243         * typemanager.cs (cons_param_array_attribute): Make private.
6244         (Reset): Set it to null.
6245         (InitCoreHelpers): Don't initialize it.
6246         (ConsParamArrayAttribute): New.  Initialize it as needed.
6247         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6248
6249 2006-01-31  Miguel de Icaza  <miguel@novell.com>
6250
6251         * expression.cs: There might be errors reported during the
6252         selection of applicable methods.  If there are errors, do not
6253         continue execution as it will lead the compiler to crash.
6254
6255 2006-01-30  Miguel de Icaza  <miguel@novell.com>
6256
6257         * expression.cs: Member access is not allowed on anonymous
6258         methods.  Fixes #77402.
6259
6260 2006-01-30  Raja R Harinath  <rharinath@novell.com>
6261
6262         Fix #77401
6263         * cs-parser.jay (VariableDeclaration): Don't set
6264         current_array_type to null.
6265         (field_declaration, event_declaration, declaration_statement):
6266         Set it to null here.
6267
6268 2006-01-28  Raja R Harinath  <harinath@gmail.com>
6269
6270         * typemanager.cs (GenericParameterPosition): New.
6271         * doc.cs: Use it.
6272
6273 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
6274
6275         * doc.cs : To process "include" elements, first we should create
6276           another list than XmlNodeList, because it could result in node
6277           removal, which could result in that the XmlNodeList gives up
6278           yielding next node.
6279
6280           (Also made code identical to gmcs again.)
6281
6282 2006-01-25  Miguel de Icaza  <miguel@novell.com>
6283
6284         * ecore.cs: Introduce an error report that we were not catching
6285         before, if not silent, we must report the error.  Gonzalo ran into
6286         it.
6287
6288 2006-01-23  Miguel de Icaza  <miguel@novell.com>
6289
6290         A fix for bug: #76957
6291         
6292         * iterators.cs (MoveNextMethod.CreateMethodHost): call
6293         ComputeMethodHost before creating the method, this is a new
6294         requirement. 
6295
6296         * anonymous.cs (AnonymousContainer): Now we track all the scopes
6297         that this method references (RegisterScope).  The actual scope
6298         where the method is hosted is computed with the ComputeMethodHost
6299         before we create the method.
6300
6301         Moved the Deepest routine here.
6302
6303         (AnonymousContainer.ComputeMethodHost): New routine used to
6304         compute the proper ScopeInfo that will host the anonymous method.
6305
6306         (ScopeInfo): Deal with multiple roots.  The problem was that we
6307         did not have a unique root where all ScopeInfos could be hanged
6308         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
6309         of roots.  
6310
6311         Remove AdjustMethodScope which is now computed at the end.  Remove
6312         LinkScope which did a partial link, instead link all ScopeInfos
6313         before code generation from the new "LinkScopes" routine. 
6314
6315         Simplify all the Add* routines as they no longer need to maintain
6316         the tree, they just need to record that they are using variables
6317         from a ScopeInfo.
6318
6319         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6320         routines to produce the forest of ScopeInfo trees.
6321
6322         * class.cs (TypeContainer.AppendMethod): This is just like
6323         AddMethod, but ensures that an interface implementation method
6324         (IEnumerable.XXX) is not inserted at the beginning of the queue of
6325         methods, but at the end.
6326
6327         We use this functionality to ensure that the generated MoveNext
6328         method in the iterator class is resolved/emitted before the
6329         enumerator methods created.   
6330
6331         This is required because the MoveNext method computes the right
6332         ScopeInfo for the method.  And the other methods will eventually
6333         need to resolve and fetch information computed from the anonymous
6334         method. 
6335
6336 2006-01-21  Raja R Harinath  <harinath@gmail.com>
6337             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
6338
6339         Fix rest of #76995.
6340         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6341         the 'aliases' hash.
6342         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6343         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6344
6345 2006-01-18  Raja R Harinath  <rharinath@novell.com>
6346
6347         Fix #76656, cs0231-2.cs.
6348         * cs-parser.jay (formal_parameter_list): Make error case catch
6349         more issues.
6350         (parenthesized_expression_0): Add CS1026 check.
6351         (invocation_expression): Remove unused { $$ = lexer.Location }.
6352
6353 2006-01-17  Raja R Harinath  <rharinath@novell.com>
6354
6355         Fix #76824.
6356         * cs-parser.jay (statement_expression): Don't list out the
6357         individual statement-expressions.  Convert syntax error into
6358         CS0201 check.
6359
6360 2006-01-16  Raja R Harinath  <rharinath@novell.com>
6361
6362         Fix #76874.
6363         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6364         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
6365         CheckIntermediateModification.
6366         (FieldExpr.DoResolve): Add new two-argument version that
6367         allows us to resolve the InstanceExpression as an lvalue.
6368         The one-argument variant is now just a wrapper.
6369         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6370         Resolve the lhs as an lvalue if the it has a value type.
6371         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6372         from Assign.DoResolve.
6373         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6374         resolved as an lvalue.
6375         (PropertyExpr.DoResolve): Update.
6376         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6377         has a value type.  Move CS1612 check here from
6378         CheckIntermediateModification.
6379         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6380         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
6381         'right_side' of a ResolveLValue on an 'out' argument.
6382         (EmptyExpression.LValueMemberAccess): New.  Used as the
6383         'right_side' of a propagated ResolveLValue on a value type.
6384         (LocalVariableReference.DoResolveBase): Recognize
6385         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6386         Add CS1654 check.
6387         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6388         EmptyExpression.Null.
6389
6390 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
6391
6392         * typemanager.cs : added IsGenericParameter(). In mcs it always
6393           return false.
6394         * doc.cs : for generic parameters, use GenericParameterPosition,
6395           not FullName.
6396
6397 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
6398
6399         * expression.cs: Fix Console.WriteLine ((this = x).foo);
6400
6401 2006-01-12  Miguel de Icaza  <miguel@novell.com>
6402
6403         This fixes the problem where we used ldfld instead of ldflda to
6404         load the "THIS" pointer on captured parameters, when THIS is a
6405         value type.  See bug #77205.
6406         
6407         * iterators.cs (CapturedThisReference.Emit): Pass false to
6408         EmitThis (we do not need the address).
6409
6410         * codegen.cs (EmitThis): it needs to know whether we need the
6411         address of `this' or not.  This is used by value types.  
6412
6413         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6414         every other call passes false.
6415
6416 2006-01-12  Raja R Harinath  <rharinath@novell.com>
6417
6418         Fix #77221.
6419         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6420         GetOverride.
6421         * expression.cs (Invocation.OverloadResolve): Update.
6422         (Invocation.DoResolve): Avoid double resolution of invocation.
6423
6424 2006-01-11  Raja R Harinath  <rharinath@novell.com>
6425
6426         Fix #77180.
6427         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6428         unary negation of floating point types as 0-expr; negation cannot
6429         overflow in floating point types.
6430
6431         Fix #77204.
6432         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6433         on operands of 'void' type.
6434
6435         Fix #77200.
6436         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6437         and ExclusiveOr for boolean constants too.
6438
6439 2006-01-09  Raja R Harinath  <rharinath@novell.com>
6440
6441         Fix #75636.
6442         * expression.cs (Invocation.OverloadResolve): Replace reflected
6443         override methods with their base virtual methods, rather than
6444         skipping over them.
6445         * typemanager.cs (TypeManager.GetOverride): New.
6446
6447 2006-01-05  Jb Evain  <jbevain@gmail.com>
6448
6449         * class.cs (Property.Define, Indexer.Define): do not tag the
6450         properties as SpecialName | RTSpecialName.
6451
6452 2006-01-04  Miguel de Icaza  <miguel@novell.com>
6453
6454         * class.cs (MethodCore.IsDuplicateImplementation): This method was
6455         doing a low-level comparission of parameter types.  It was lacking
6456         a check for __argslist. 
6457
6458 2005-12-30  Miguel de Icaza  <miguel@novell.com>
6459
6460         * expression.cs (ParameterReference.DoResolveBase): Allow
6461         reference parameters if they are local to this block. 
6462
6463         This allows the ref and out parameters of a delegate to be used in
6464         an anonymous method, for example:
6465
6466         delegate void set (out int x);
6467
6468         set s = delegate (out int x){
6469                 x = 0;
6470         };
6471
6472         This is used by functionality introduced late in the C# language.
6473         
6474         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6475         method that take ref and out parameters. 
6476
6477         Fixes #77119 which was a late change in the spec.
6478
6479 2005-12-23  Miguel de Icaza  <miguel@novell.com>
6480
6481         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6482         parent if its the same scope.  Fixes #77060.
6483
6484 2005-12-21  Miguel de Icaza  <miguel@novell.com>
6485
6486         * driver.cs: Report the case of no source files and no -out:
6487         argument provided.
6488
6489 2005-12-20  Raja R Harinath  <rharinath@novell.com>
6490
6491         Fix #77035.
6492         * expression.cs (ComposedCast.GetSignatureForError): Define.
6493
6494 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6495
6496         Fix #76995
6497
6498         * namespace.cs (NamespaceEntry): Add extern_aliases as a
6499         ListDictionary, to contain the ExternAliasEntry entries (in
6500         addition to the NamespaceEntry.aliases hashtable). This field is
6501         shared between the original entry and its doppelganger (bodyless 
6502         copy of it).
6503         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6504         extern_aliases field.
6505         (NamespaceEntry.Lookup): Move the IsImplicit check after the
6506         lookup in extern_aliases.
6507
6508 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6509
6510         Fix #77006.
6511         * class.cs (TypeContainer.Mark_HasEquals): New.
6512         (TypeContainer.Mark_HasGetHashCode): New.
6513         (ClassPart): Override them.
6514         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6515
6516         Fix #77008.
6517         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6518         'parent' argument to the base constructor.
6519
6520         Remove all mention of TypeContainer from decl.cs.
6521         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6522         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6523         (DeclSpace.DeclSpace): Likewise.
6524         (DeclSpace.DefineMembers): Remove unused argument.
6525         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6526         debugging check -- we don't care if the debug code throws an
6527         InvalidCastException instead of an InternalErrorException.
6528         * class.cs (TypeContainer.DefineMembers): Update to changes.
6529         (TypeContainer.DoDefineMembers): Likewise.
6530         (TypeContainer.GetMethods): Likewise.
6531         (PropertyMember.Define): Likewise.
6532         (MemberBase.Parent): New property that forwards to
6533         MemberCore.Parent, but ensures that we get a TypeContainer.
6534         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6535         (RootContext.PopulateTypes): Likewise.  Remove special case code
6536         for !RootContext.StdLib: DefineMembers is idempotent.
6537
6538 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6539
6540         * convert.cs (ExplicitConversionCore): Check the return value from
6541         ExplicitConversionCore which can return null on failure.  Fixes #76914
6542
6543 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6544
6545         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6546
6547 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6548
6549         * doc.cs : The search for referenced namespace was insufficient to
6550           get global one as it used to do. Fixed bug #76965.
6551
6552 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6553
6554         * doc.cs : check name in cref in the last phase that whether it is
6555           namespace or not.
6556
6557 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6558
6559         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6560           Mono.C5.
6561
6562 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6563
6564         * doc.cs : so it turned out that we cannot skip override check for 
6565           interface members. Fixed bug #76954.
6566
6567 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6568
6569         * cs-tokenizer.cs : fixed bug #75984:
6570           - #warning and #error should not be handled when the source line
6571             is disabled.
6572           - #line is not checked strictly when the source line is disabled.
6573           - #define and #undef is on the other hand checked strictly at any
6574             state.
6575
6576 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6577
6578         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6579           CS1027 report.
6580
6581 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6582
6583         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6584
6585         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6586         event initializers.
6587         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6588         (FieldBase.Initializer): Initializer is now optional.
6589         (EventField.Define): Only event field can have initializer.
6590
6591         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6592
6593         * const.cs (Const): Reuse initializer.
6594
6595         * cs-parser.jay: Updated after FieldBase changes.
6596         Added current_array_type to simplify array initializers.
6597
6598         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6599
6600         * expression.cs, iterators.cs: Updated.
6601
6602         * namespace.cs (NamespaceEntry): Made UsingFound private.
6603
6604 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6605
6606         * parameterCollection.cs: Obsolete, removed.
6607         * parser.cs: Obsolete, removed.
6608
6609 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6610
6611         Fix #76849.
6612         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6613
6614         * enum.cs (Enum.Define): Set obsolete context here.
6615
6616 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6617
6618         * doc.cs :
6619           - FindDocumentedMember() now expects 1) paramList as null
6620             when "we don't have to check the number of parameters" and
6621             2) Type.EmptyTypes when "there is no arguments".
6622           - Introduced FoundMember struct to hold the exact type which was
6623             used to find the documented member (the above change broke
6624             test-xml-044; it might be better just to use DeclaringType than
6625             what MS does, like this change does, but it depends on usage.)
6626
6627 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6628
6629         * doc.cs : documented member might be from DeclaringType for nested
6630           types. Fixed bug #76782.
6631
6632 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6633
6634         * anonymous.cs: Have the param code handle leaving copies on the
6635         stack etc. Allows anonymous params to take part in the assignment
6636         code (++, +=, etc). Fixes bug #76550
6637
6638         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6639         it down to the anon code.
6640
6641         * iterators.cs: Use dummy var here
6642
6643         * codegen.cs: Handle new vars
6644
6645 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6646
6647         Fix #76849.
6648         * class.cs (MethodData.Define): Set proper Obsolete context.
6649
6650         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6651         obsolete context.
6652         (FieldExpr.DoResolve): Ditto.
6653
6654 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6655
6656         Fix #76849.
6657         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6658         parent is not obsolete.
6659
6660 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6661
6662         * doc.cs : (FindDocumentedMember) find parameterless members first
6663           and get CS0419 in the early stage. Fixed first case of bug #76727.
6664
6665 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6666
6667         Fix #76859.
6668         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6669         no error was reported.
6670
6671         *expression.cs (Binary.DoResolve): left can be null.
6672
6673 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6674
6675         Fix #76783.
6676         * class.cs (MethodData.Emit): Parameters should be labeled first.
6677
6678 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6679
6680         Fix #76761.
6681         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6682
6683 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6684
6685         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6686
6687         * class.cs (MethodCore): Parameter clean up.
6688         (IMethodData): Added ParameterInfo.
6689         (MethodData): Parameter clean up.
6690         (Indexer.Define): Parameter clean up.
6691
6692         * anonymous.cs,
6693         * codegen.cs,
6694         * cs-parser.jay,
6695         * decl.cs,
6696         * doc.cs,
6697         * ecore.cs,
6698         * flowanalysis.cs,
6699         * iterators.cs,
6700         * pending.cs,
6701         * statement.cs,
6702         * typemanager.cs: Parameter clean up.
6703
6704         * delegate.cs (Define): Get rid of duplicated code.
6705
6706         * expression.cs (ParameterReference): Removed useless parameters
6707         and simplified.
6708         (Invocation): Ditto.
6709
6710         * parameter.cs (ParamsParameter): New class, params specialization.
6711         (ArglistParameter): Attemp to separate arglist.
6712         (Parameter): Refactored to be reusable and faster.
6713         (Parameter.Modifier): Made understandable.
6714         (Parameters): Changed to be used as a class for `this' assembly
6715         parameters. Refactored to use new specialized classes.
6716
6717         * support.cs (ParameterData): Added Types property.
6718         (InternalParameters): Deleted.
6719
6720 2005-08-20  Martin Baulig  <martin@ximian.com>
6721
6722         Merging this patch from GMCS to fix #75867.
6723
6724         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6725         scope if we don't already have it.
6726
6727 2005-11-17  Martin Baulig  <martin@ximian.com>
6728
6729         * anonymous.cs
6730         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6731         inherit the scope from our parent.  Fixes #76653.
6732
6733 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6734
6735         * doc.cs : the previous patch does not actually fix the bug.
6736           PropertyInfo override check is now implemented and really fixed it.
6737         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6738
6739 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6740
6741         * doc.cs : apply "override filter" also to properties.
6742           Fixed bug #76730.
6743
6744 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6745
6746         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6747           no need to check overrides. For classes, omit those results from 
6748           interfaces since they must exist in the class. Fixed bug #76726.
6749
6750 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6751
6752         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6753           with different parameters. Fixed the second problem in #76685.
6754
6755 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6756
6757         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6758           get expected 'protected' access in CheckValidFamilyAccess()).
6759           Fixed bug #76692.
6760
6761 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6762
6763         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6764           Fixed bug #76705.  CS1569 was incorrectly commented out.
6765
6766 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6767
6768         * doc.cs : use Invocation.IsOverride() to do real override check.
6769         * expression.cs : made Invocation.IsOverride() internal.
6770
6771 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6772
6773         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6774           TypeBuilder.FindMembers() and filter overriden base members out.
6775           Fixed bug #76990.
6776
6777 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6778
6779         * doc.cs : ref/out parameters are represented as '@' (instead of
6780           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6781
6782 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6783
6784         * doc.cs : when there was no '.' in cref to methods in doc comment,
6785           then parameters were missing in the output. Fixed bug #76691.
6786
6787 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6788
6789         * driver.cs : don't output docs when there is an error.
6790           Fixed bug #76693.
6791
6792 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6793
6794         * doc.cs :
6795           Now it should detect indexers. Fixed primary concern in bug #76685.
6796           Fixed CS0419 message to not show the identical member signature in
6797           the message.
6798
6799 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6800
6801         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6802           instead of Type.FindMembers() since it does not handle events.
6803           Fixed bug #71604.
6804
6805 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6806
6807         * codegen.cs: Fixed typo (speficied -> specified).
6808
6809 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6810
6811         Fix #76369.
6812         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6813
6814 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6815
6816         * attribute.cs: Changed error message.
6817
6818         * cs-tokenizer.cs: One more check.
6819
6820 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6821
6822         * statement.cs (Block.Resolve): Ignore empty statement.
6823
6824 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6825
6826         * report.cs: Made error/warning methods more strict to avoid
6827         their misuse.
6828
6829         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6830         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6831         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6832         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6833
6834 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6835
6836         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6837         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6838
6839         * class.cs (TypeContainer.IsComImport): New property.
6840         (Constructor.Define): Create proper ctor for ComImport types.
6841
6842         * expression.cs (New.CheckComImport): Fixed.
6843
6844 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6845
6846         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6847         that a parameter has been captured does not mean that we do not
6848         have to do the rest of the processing.  This fixes the second part
6849         of #76592.  If there was another anonymous method capturing
6850         values in the past, the Scope would never be set for the second
6851         method that captured the same parameter.
6852
6853         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6854         properly manipulate the stack.   Second part of fix for #76592.
6855
6856         * expression.cs (New): Add support for invoking "new" on
6857         interfaces that have been flagged with the ComImport attribute and
6858         the CoClass.  Fixes #76637 
6859
6860         * statement.cs (Try.DoEmit): When a variable is captured, do not
6861         try to emit the vi.LocalBuilder variable as it has been captured.
6862         Create a temporary variable and store the results on the
6863         FieldBuilder.  Fixes #76642
6864
6865 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6866
6867         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6868
6869         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6870
6871         * expression.cs (Binary.DoResolve): Added && optimalization.
6872     
6873         * typemanager.cs (AddUserType): Removed useless argument.
6874
6875 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6876
6877         * statement.cs (Block.variables): Uses ListDictionary.
6878
6879 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6880
6881         Fix #75969.
6882         * class.cs (PartialContainer.EmitType): Customized to emit
6883         security attributes.
6884         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6885         for partial classes.
6886
6887 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6888
6889         Fix #76599.
6890         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6891         access has to be fixed.
6892         
6893         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6894
6895 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6896
6897         Fix #76590.
6898         * ecore.cs (NullCast.Reduce): Implemented.
6899
6900         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6901         constant type.
6902         
6903         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6904         properly.
6905         (Foreach.Resolve): Catch null properly.
6906
6907 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6908  
6909         * cs-tokenizer.cs: Warning text fix.
6910
6911         * driver.cs: AllWarningNumbers exposed on public interface.
6912
6913         * report.cs (): Reviewed warning numbers.
6914         (IsValidWarning): Use binary search.
6915
6916 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6917  
6918         * driver.cs: Implemeted resource visibility.
6919         (Resources): New class for code sharing between /res: and
6920         /linkres:
6921  
6922 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6923
6924         Fix #76568.
6925         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6926         folding.
6927         
6928         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6929         contants only.
6930         
6931         * ecore.cs (NullCast): Child is contant only.
6932         
6933         * literal.cs (NullLiteral.Reduce): null can be converted to any
6934         reference type.
6935
6936 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6937
6938         * driver.cs: Use Encoding.Default as default code page instead
6939           of ISO-28591.
6940
6941 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6942
6943         Fix #76085.
6944         * expression.cs (Invocation.Error_InvalidArguments): Handle
6945         __arglist parameters.
6946         (Invocation.VerifyArgumentsCompat): Likewise.
6947         * support.cs (ReflectionParameters.GetSignatureForError): Print
6948         __arglist parameters.
6949         (InternalParamters.GetSignatureForError): Likewise.
6950         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6951
6952 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6953
6954         * attribute.cs (GetPropertyValue): Made public.
6955
6956         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6957         Resolve.
6958         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6959         attribute.
6960         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6961         is not defined.
6962         
6963         * driver.cs: Reflect method name change.
6964         
6965         * statement.cs (Try.Resolve): Warn when try has both general
6966         exception handlers.
6967         
6968         * typemanager.cs: runtime_compatibility_attr_type new predefined
6969         type.
6970
6971 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6972
6973         Fix #76419.
6974         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6975         treat it as an empty parameter list.
6976
6977 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6978
6979         Fix #76271.     
6980         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6981         ResolveAsTypeStep silent.
6982         * statement.cs (Block.AddConstant): Mark block as used.
6983         (Block.ResolveMeta): Avoid piling on error messages
6984         if a constant initializer resolution fails.
6985
6986 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6987
6988         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6989         Remove.
6990         (NamespaceEntry.VerifyAllUsing): New.
6991         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6992         behaviour.  Delegates actual resolution of alias to ...
6993         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6994         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6995         Update.
6996         * driver.cs (Driver.MainDriver): Update.
6997         
6998         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6999         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
7000         property.
7001         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
7002         Remove.
7003         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
7004         RootNamespace.DefineNamespacesForAll.
7005
7006 2005-10-24  Raja R Harinath  <harinath@gmail.com>
7007
7008         * typemanager.cs (assemblies, external_aliases, modules)
7009         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
7010         (ComputeNamespaces, GetRootNamespace): Remove extra staging
7011         overhead.  Move resposibility ...
7012         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
7013         * driver.cs, attribute.cs, codegen.cs: Update to changes.
7014
7015 2005-10-23  Raja R Harinath  <harinath@gmail.com>
7016
7017         * namespace.cs (RootNamespace.all_namespaces): Renamed from
7018         cached_namespaces.  Improve usage.
7019         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
7020         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
7021         Move from GlobalRootNamespace and simplify.
7022         (RootNamespace.Global): Make instance variable.
7023         (RootNamespace.RootNamespace): Add "alias name" parameter.
7024         (GlobalRootNamespace): Simplify drastically.
7025         (Namespace.Lookup): Don't use GetNamespace.
7026         * typemanager.cs (GetRootNamespace): Rename from
7027         ComputeNamespaceForAlias.
7028         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
7029
7030 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7031
7032         * anonymous.cs (AnonymousContainer): Don't crash when container
7033         doesn't exist.
7034
7035 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7036
7037         * expression.cs (Binary.DoResolve): Warn when comparing same
7038         values.
7039
7040 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7041
7042         Fix #76486.
7043         * expression.cs (Binary.DoResolve): It looks like there are no
7044         convetsion rules in enum context.
7045
7046 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7047
7048         Add support for extern alias qualifiers.
7049         * typemanager.cs: Move some LookupTypeReflection code
7050         to namespace.cs, to have cleaner code. Added some methods
7051         to help us keep track of the extern aliased references.
7052         * driver.cs: Add suport for extern alias assemblies on command
7053         line and check for their warnings/errors. Also keep track of the
7054         extern aliased assemblies.
7055         * namespace.cs: Move the global functionality of Namespace
7056         to GlobalRootNamespace/RootNamespace. Now the global namespace
7057         is GlobalRootNamespace.Globa. Also the code moved from 
7058         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
7059         Finally added LocalAliasEntry (AliasEntry before) and
7060         ExternAliasEntry, to handle alias statements.
7061         * cs-parser.jay: Add support in the grammar for extern alias
7062         statement.
7063         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
7064         Update callings to Namespace (now in GlobalRootNamespace).
7065
7066 2005-10-18  Raja R Harinath  <rharinath@novell.com>
7067
7068         Fix #76371.
7069         * class.cs (TypeContainer.DefineType): Move updating of
7070         topological sort earlier in the code.
7071         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
7072
7073 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
7074
7075         Fix #76273.
7076         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
7077         
7078         * constant.cs (Constant.TryReduce): Moved from Cast class.
7079         (Reduce): Made little bit more OO and fixed missing conversions.
7080         
7081         * ecore.cs (Reduce): Implemented.
7082         (Binary.EnumLiftUp): New method to upgrade values to enum values.
7083         
7084         * literal.cs (Reduce): Implemented.
7085         
7086         * class.cs: Reverted Miguel's wrong commit.
7087
7088 2005-10-14  Miguel de Icaza  <miguel@novell.com>
7089
7090         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
7091
7092 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
7093
7094         * cs-parser.jay, expression.cs : CS0214 was missing error location
7095           for constants. Fixed bug #76404.
7096
7097 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
7098
7099         Fix #76370.
7100         * convert.cs (ExplicitConversionCore): Fixed object->enum
7101         conversion.
7102
7103 2005-10-10  Raja R Harinath  <rharinath@novell.com>
7104
7105         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
7106         InstanceExpression.
7107         (PropertyExpr.EmitCall): Likewise.
7108         * expression.cs (Invocation.EmitArguments): Handle case where
7109         arguments == null.
7110         (Invocation.EmitCall): Avoid allocating temporary variable if
7111         there are no arguments.
7112
7113 2005-10-07  Raja R Harinath  <rharinath@novell.com>
7114
7115         Fix #76323.
7116         * convert.cs (ImplicitConversionStandard): Move conversion of
7117         void* to arbitrary pointer types ...
7118         (ExplicitConversionStandard): .. here.
7119         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
7120         error to always print typenames.
7121
7122 2005-10-07  Raja R Harinath  <rharinath@novell.com>
7123
7124         * convert.cs (GetConversionOperator): Rename from
7125         GetConversionOperators.  Move operator selection code from ...
7126         (UserDefinedConversion): ... here.
7127
7128 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
7129
7130         * convert.cs (ExplicitConversionCore): Removed duplicate enum
7131         conversion.
7132
7133 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
7134
7135         * assign.cs (Assign.DoResolve): Error method changed.
7136
7137         * cfold.cs (DoConstantNumericPromotions): Error method changed.
7138         
7139         * const.cs (ResolveValue): Reset in_transit immediately.
7140         
7141         * constant.cs: Error method changed.
7142         
7143         * convert.cs: Removed useless location parameter.
7144         (ExplicitNumericConversion): Don't do double enum check.
7145         (ExplicitConversionCore): Renamed from ExplicitConversion.
7146         (ExplicitUnsafe): Extracted from ExplicitConversion.
7147         (ExplicitConversion): Uses for error reporting.
7148         
7149         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
7150         error messages.
7151         (ResolveBoolean): Uses common error method.
7152         (CastToDecimal): Get rid of ec.
7153         (CastFromDecimal): Optimized.
7154         (ConvCast): Get rid of ec.
7155         
7156         * enum.cs (ResolveValue): Reset in_transit immediately.
7157         (Emit): Return after first error.
7158         
7159         * expression.cs: Convert changes.
7160         
7161         * literal.cs: Error method changed.
7162         
7163         * statement.cs: Error method changed.
7164
7165 2005-10-03  Raja R Harinath  <rharinath@novell.com>
7166
7167         * support.cs (SeekableStreamReader.Position): Don't error out when
7168         the requested position is just beyond the end of the current
7169         buffered data.
7170
7171 2005-09-28  Raja R Harinath  <rharinath@novell.com>
7172
7173         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
7174         try to keep in sync with the byte count of the underlying Stream.
7175         However, this limits us to a window size of 2048 characters: i.e.,
7176         the maximum lookahead of our lexer/parser can be 2048 characters.
7177
7178 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
7179
7180         Fix #76255.
7181         * driver.cs: Fix compilation files with full root path.
7182
7183 2005-09-25  Miguel de Icaza  <miguel@novell.com>
7184
7185         * report.cs (SymbolRelatedToPreviousError): Format the output so
7186         it does not use an open parenthesis that is never closed. 
7187
7188         * driver.cs: Follow coding guidelines
7189
7190 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7191
7192         Fix #72930.
7193         * const.cs (Const.ResolveValue): Check for assigning non-null
7194         value to reference type.
7195
7196 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7197
7198         * anonymous.cs: Implemented ExprClassName.
7199         
7200         * assign.cs (Assign.DoResolve): Don't chrash when type is not
7201         delegate.
7202         
7203         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7204         check.
7205         
7206         * class.cs (StaticClass.DefineContainerMembers): Report protected
7207         members as error.
7208         
7209         * codegen.cs: if(ed) PRODUCTION.
7210         
7211         * convert.cs (Error_CannotImplicitConversion): Better error
7212         distinction.
7213         
7214         * cs-parser.jay: More error checks.
7215         
7216         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7217         
7218         * driver.cs (CSCParseOption): Enabled wrong option check.
7219         
7220         * ecore.cs (Expression.ExprClassName): Turned to property.
7221         (MemberExpr.CheckIntermediateModification): For checking boxed
7222         value types     modification.
7223         
7224         * statement.cs (Fixed.Resolve): Expression type must be
7225         convertible to fixed type.
7226         (CollectionForeach.GetEnumeratorFilter,TryType):
7227         Small refactoring for easier error checking.
7228
7229 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
7230
7231         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7232         attributes.
7233         
7234         * class.cs (GeneratedBaseInitializer): New class for customization
7235         compiler generated initializers.
7236         (MemberBase.DoDefine): Check Obsolete attribute here.
7237         (FieldMember.DoDefine): Ditto.
7238         
7239         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7240         constants.
7241         
7242         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7243         (MemberCore.GetObsoleteAttribute): Removed argument.
7244         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7245         (MemberCore.CheckObsoleteType): New helper.
7246         
7247         * delegate.cs,
7248         * enum.cs,
7249         * statement.cs: Updates after MemberCore changes.
7250         
7251         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7252         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7253         
7254         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7255         obsolete attribute for compiler construct.
7256         (As.DoResolve): Cache result.
7257         
7258         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7259
7260 2005-09-26  Raja R Harinath  <rharinath@novell.com>
7261
7262         Fix #76133.
7263         * expression.cs (This.VerifyFixed): In a value type T, the type of
7264         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
7265         value type R, 'this' is treated as a value parameter.
7266
7267 2005-09-22  Miguel de Icaza  <miguel@novell.com>
7268
7269         * statement.cs (Lock): Use the TemporaryVariable class instead of
7270         manually using local variables as those do not work when variables
7271         are captured.
7272
7273         * ecore.cs: Moved the TemporaryVariable class from being a nested
7274         class inside Foreach to be a public class that can be employed in
7275         other places. 
7276
7277 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
7278
7279         * cs-parser.jay: interface_accessors replaced by
7280         accessor_declarations.
7281
7282         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7283         location.
7284         
7285         * statement.cs (GotoCase.Resolve): Convert null constant to
7286         null case.
7287         (SwitchLabel.ResolveAndReduce): Ditto.
7288         (SwitchLabel.NullStringCase): Custom null stamp.
7289         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7290         
7291         typemanager.cs (CSharpSignature): Don't skip first argument
7292         for full names.
7293
7294 2005-09-18  Miguel de Icaza  <miguel@novell.com>
7295
7296         * driver.cs: Set InEmacs based on the environment variable EMACS. 
7297
7298         * location.cs (InEmacs): in this mode, do not report column
7299         location as it confuses Emacs.
7300
7301 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
7302
7303         * cfold.cs, constant.cs, convert.cs, ecore.cs,
7304         expression.cs, iterators.cs, literal.cs: Store constants and
7305         literals location.
7306         
7307         * class.cs (MemberBase.ShortName): Pass location.
7308         
7309         * cs-parser.jay: Some location fixes.
7310         
7311         * ecore.cs (Expression.Location): Made virtual.
7312
7313 2005-09-05  Miguel de Icaza  <miguel@novell.com>
7314
7315         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7316         if the underlying types are the same, otherwise we need to produce
7317         code that will do the proper cast.
7318
7319         This was exposed by Marek's constant rewrite which produced
7320         invalid code for the call site:
7321
7322         enum X : long { a }
7323         void Method (X v) {}
7324
7325         Method ((X) 5)
7326
7327         This fixes test-49.cs
7328
7329 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7330
7331         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7332           Type/Object should be allowed as well. Fixed bug #75968.
7333
7334 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7335
7336         * expression.cs : (Binary.DoResolve): when one is enum constant and
7337           another is constant 0, then return enum one *as enum type*.
7338           Fixed bug 74846.
7339
7340 2005-09-02  Raja R Harinath  <rharinath@novell.com>
7341
7342         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7343         internal.
7344
7345         Fix #75941.
7346         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7347         flow-branching for LocalVariableReferences in case we were invoked
7348         from a MemberAccess.
7349         * expression.cs (LocalVariableReference.VerifyAssigned): New.
7350         Carved out of ...
7351         (LocalVariableReference.DoResolveBase): ... this.
7352         (MemberAccess.Resolve): Do the check that was disabled during
7353         SimpleNameResolve.
7354
7355 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7356
7357         * class.cs :
7358           (PartialContainer.Create): check abstract/sealed/static strictly
7359           but abstract/sealed can exist only at one side. Fixed bug #75883.
7360
7361 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
7362
7363         Fix #75945.
7364         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7365         specified, don't default to UnmanagedType.I4.
7366
7367 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7368
7369         * expression.cs : conditional operator should check possibly
7370           incorrect assign expression. Fixed bug #75946.
7371
7372 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7373
7374         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7375           Reverting the change. gmcs is much complex than mcs on this matter.
7376
7377 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7378
7379         * cs-tokenizer.cs : To read another token ahead of the actual 
7380           consumption, use new SavedToken and cache token instead of moving
7381           back the stream with SeekableStreamReader (it seemed problematic).
7382         * cs-parser.jay,
7383           driver.cs : Thus use StreamReader directly.
7384         * support.cs : Thus removed SeekableStreamReader.
7385
7386 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7387
7388         Fix #75934.
7389         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7390         (ScopeInfo.EmitScopeType): Use it to construct field names from
7391         names of captured locals.
7392
7393         Fix #75929.
7394         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7395         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7396         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7397         (ExplicitConversion): Remove enum cases already handled by
7398         implicit conversion.  Move implicit conversion check to the beginning.
7399         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7400         * expression.cs (ArrayCreation.EmitDynamicInitializers):
7401         Don't treat System.Enum as a struct.
7402
7403 2005-08-30  Jb Evain  <jbevain@gmail.com>
7404
7405         * attribute.cs: handles as expression in parameters.
7406
7407 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7408
7409         Fix #75802.
7410         * class.cs (TypeContainer.VerifyClsName): Don't use a
7411         PartialContainer when verifying CLS compliance.
7412         (AbstractPropertyEventMethod): Set Parent here, ...
7413         (PropertyMethod): ... not here.
7414
7415 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
7416
7417         * attribute.cs : escaped attribute name should not be allowed to be
7418           resolved (e.g. @class as classAttribute). Fixed bug #75930.
7419
7420 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7421
7422         Fix #75927.
7423         * convert.cs (ImplicitStandardConversionExists): Allow zero also
7424         when converting a long constant to unsigned long.
7425         * expression.cs (Invocation.OverloadResolve): Add sanity check to
7426         detect where IsApplicable and VerifyArgumentsCompat disagree.
7427
7428 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7429         and Carlos Alberto Cortez  <carlos@unixmexico.org>
7430
7431         Fix #75848.
7432         * class.cs (TypeContainer.CanElideInitializer): New helper.
7433         (TypeContainer.EmitFieldInitializers): Use it to determine if we
7434         can safely emitting the initializer of a field.
7435
7436 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7437
7438         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7439           allowed inside a switch (without loop). Fixed bug #75433.
7440
7441 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7442
7443         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7444         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7445
7446 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7447
7448         * driver.cs : kinda reverting the default encoding changes (not exact 
7449           revert since I noticed that "codepage:reset" might not work fine).
7450
7451 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7452
7453         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7454           Location. Now getter and setter store location correctly.
7455           (errors/cs0111-12.cs now reports the expected location.)
7456
7457 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7458
7459         * driver.cs : Use default encoding on the environment.
7460           Removed (now that) extra parameter for SeekableStreamReader.
7461         * support.cs : (SeekableStreamReader) third .ctor() argument for
7462           StreamReader is not required (always true). preamble size could
7463           be acquired in simpler and safe way.
7464
7465 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
7466
7467         * cs-parser.jay: report CS0642 at warning level 3
7468           and report CS0642 for an if else statement also
7469           fixes bug #74745. Patch by John Luke (and a bit
7470           modified by me).
7471           Removed extra CS0642 warning check for "while",
7472           "for" and "fixed".
7473         * statement.cs: In Block.Resolve(), CS0642 check
7474           is reimplemented to check a sequence of an empty
7475           statement and a block.
7476
7477           Both fix bug #66777.
7478
7479 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
7480
7481         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7482         detection until I fix it.
7483         
7484         * cs-tokenizer.cs: Changed error message.
7485         
7486         * cs-parser.jay: Fixed 2 error locations.
7487         
7488         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7489         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7490         properties.
7491         
7492         * enum.cs (GetSignatureForError): Fixed.
7493         
7494         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7495         method detection.
7496         
7497         * class.cs,
7498         * typemanager.cs (RegisterProperty): Removed.
7499         
7500         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7501
7502 2005-08-24  Raja R Harinath  <rharinath@novell.com>
7503
7504         Fix #75874.
7505         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7506         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7507
7508 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7509
7510         * expression.cs : tiny fix is required for not warning positive ulong.
7511           See test-441.cs.
7512
7513 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7514
7515         * expression.cs : add CS0652 check for constant and integral
7516           expression. Fixed bug #53974.
7517
7518 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7519
7520         * expression.cs : in DoNumericPromotions(), check if there is implicit
7521           conversion overload for string (to check CS0034). Fixed bug #52492.
7522
7523 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7524
7525         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7526
7527 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7528
7529         * ecore.cs : report location when it is *not* Null.
7530
7531 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7532
7533         * codegen.cs,
7534           ecore.cs,
7535           flowanalysis.cs,
7536           expression.cs:
7537           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7538           correctly. Fixed bug #75721.
7539
7540 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7541
7542         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7543         loop that performs 'min (pos, char_count)'.
7544
7545         Fix #75862.
7546         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7547         converted value in Operator.OnesComplement.
7548
7549 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7550
7551         * anonymous.cs: If the anon method is pulled into a helper class,
7552         it needs to be `internal' not `private'. Fixes runtime behavior on
7553         msft. bug #75704
7554
7555 2005-08-20  Martin Baulig  <martin@ximian.com>
7556
7557         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7558         scope if we don't already have it.
7559
7560         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7561         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7562         fixes #75867.
7563
7564 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7565
7566         Fix #75803
7567         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7568         is a partial class.
7569
7570 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7571
7572         The big constants rewrite
7573         Fix #75746, #75685 and more
7574         As a side effect saved 1MB for MWF ;-)
7575         
7576         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7577         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7578         enum based for corlib compilation.
7579         
7580         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7581         subtractions.
7582         
7583         * class.cs (FixedField.Define): Use ResolveAsConstant.
7584         
7585         * const.cs (IConstant): Interface constants and enums.
7586         (Const.ResolveValue): New method for constant resolvning.
7587         (ExternalConstant): Constants from imported assemblies.
7588         
7589         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7590         conversion; like enums.
7591         (Constant.ToType): Converts this constant to different type.
7592         (Constant.Increment): Adds 1.
7593         
7594         * convert.cs (ImplicitConversionRequired): Simplified.
7595         
7596         * cs-parser.jay: Create EnumMember directly.
7597         
7598         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7599         
7600         * doc.cs (GenerateEnumDocComment): Removed.
7601         
7602         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7603         (ConvertIntLiteral): Removed.
7604         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7605         
7606         * enum.cs (EnumMember): Implement IConstant.
7607         (Enum.IsValidEnumConstant): Removed.
7608         (Enum.GetNextDefaultValue): Removed.
7609         (Enum.FindMembers): Updated.
7610         (Enum.GenerateDocComment): Iterate enum members.
7611         
7612         * expression.cs (Cast.TryReduce): Handle enums correctly.
7613         (New.Constantify): Made public.
7614         (MemberAccess.DoResolve): Removed contant specific if(s).
7615         
7616         * literal.cs (NullLiteral): Implement new abstract methods.
7617         
7618         * statement.cs (GotoCase.Resolve): Use new constant methods.
7619         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7620         
7621         * typemanager.cs (LookupEnum): Removed.
7622         (IsEnumType): Fixed to work with corlib.
7623         (RegisterConstant): Removed.
7624         (LookupConstant): Removed.
7625         (GetConstant): Changed to work with IConstant.
7626
7627 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7628
7629         * location.cs : Fixed overflown (>255) column number.
7630
7631 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7632
7633         First cut of the qualified-alias-member feature.
7634         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7635         token.
7636         * cs-parser.jay (DOUBLE_COLON): New token.
7637         (namespace_or_type_name): Add rule for recognizing
7638         qualified-alias-members.
7639         (primary_expression): Likewise.
7640         (element_access): Allow QualifiedAliasMember as a possible
7641         type-bearing expression.
7642         (local_variable_type, local_variable_pointer_type): Likewise.
7643         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7644         aliases in the current and enclosing namespace declarations.
7645         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7646         * decl.cs (MemberName.is_double_colon): New.
7647         (MemberName.MemberName): Add new constructor for alias-member.
7648         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7649         * expression.cs (QualifiedAliasMember): New expression type.
7650
7651 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7652
7653         * location.cs : it borked when no argument was specified.
7654
7655 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7656
7657         * location.cs : tiny ToString() format fix.
7658
7659 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7660
7661         * statement.cs : oops, it was missing.
7662
7663 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7664
7665         A set of fixes for precise line/column location.
7666
7667         * location.cs :
7668           "token" field now holds a file/line "delta", a line number offset 
7669           from the segment, and a column number. See also:
7670           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7671           December/009508.html
7672           Removed static IsNull. Use instance IsNull property instead.
7673         * cs-tokenizer.cs :
7674           For some tokens it stores Location. For Identifier it stores
7675           LocatedToken which is a pair of string name and location.
7676           Column numbers are adjusted only at getChar().
7677         * report.cs :
7678           Use Location.ToString() for reporting (it now contains column).
7679         * cs-parser.jay :
7680           Largely modified to use LocatedToken instead of
7681           string (IDENTIFIER), and to acquire Location from some tokens.
7682         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7683           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7684           codegen.cs :
7685           Now MemberName holds Location. DeclSpace.ctor() receives Location
7686           as a parameter. Removed extra parameters to all derived classes.
7687           Replaced Location.IsNull() with instance property.
7688         * assign.cs, expression.cs :
7689           Added .ctor() overload that omits Location.
7690         * attribute.cs :
7691           Added "nameEscaped" flag that indicates the identifier was escaped
7692           in the source file. This fixes bug #57047.
7693
7694 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7695
7696         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7697         New method, looking for lo-case imported cls type.
7698
7699         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7700         here.
7701
7702         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7703
7704         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7705
7706         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7707         all_imported_types.
7708         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7709
7710         Optimized to save 3.5 MB for SWF compilation.
7711
7712 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7713
7714         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7715         (PartialContainer.Create): Moved logic AddToContainer.
7716         (PartialContainer.MarkForDuplicationCheck): Shares name.
7717         
7718         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7719         place.
7720         
7721         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7722         initialization.
7723         (Namespace.GetSignatureForError): New method.
7724         
7725         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7726         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7727
7728 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7729
7730         Fix #75669.
7731         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7732         member lookup rather than qualifier_type, since qualifier_type can
7733         be null.
7734
7735 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7738         enum member.
7739
7740 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7741
7742         * statement.cs: Copy the local exception into the exception
7743         captured local.  Fixes 75674
7744
7745 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7746
7747         Fix #75658.
7748         * expression.cs (Invocation.OverloadResolve): Don't report error
7749         CS1501 if error CS1502 has been reported.
7750         (New.DoResolve): Delegate CS1501 reporting to
7751         Invocation.OverloadResolve.
7752
7753         Fix #75656.
7754         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7755         invariant-meaning-in-block property in an enclosing block if
7756         necessary.
7757
7758 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7759
7760         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7761         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7762         (Switch.CheckSwitch): Just save 50kb for SWF.
7763
7764 2005-07-27  Martin Baulig  <martin@ximian.com>
7765
7766         * anonymous.cs (CaptureContext.AddField): Added
7767         `AnonymousContainer am' argument; compute its toplevel scope if
7768         it's not already computed.  Fixes #75649.
7769
7770 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7771
7772         Fix #75628.
7773         * class.cs (Constructor.Emit): Reset block to null if the block
7774         resolve fails.
7775
7776 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7777
7778         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7779
7780 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7781
7782         * class.cs (MethodData.Define): Check whether accessor implementing
7783         interface is public.
7784
7785         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7786
7787 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7788
7789         Fix #57245
7790         * namespace.cs (LookupType): Moved same type check to...
7791         
7792         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7793         with the same name.
7794
7795 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7796
7797         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7798         already found a typebuilder.
7799         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7800         MemberNames, not strings.
7801
7802         * const.cs (Error_ExpressionMustBeConst): 
7803         Rename from Error_EpressionMustBeConst.
7804         * const.cs, class.cs, statement.cd: Update.
7805
7806 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7807
7808         Fix #65573
7809
7810         * const.cs (Const.LookupConstantValue): Report missing contant expression
7811         everytime.
7812         (Error_EpressionMustBeConstant): Only one error method.
7813
7814         * class.cs, statement.c: Updated.
7815
7816 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7817
7818         * statement.cs (Block.Flags): Add back HasVarargs.
7819         (Block.flags): Make protected.
7820         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7821
7822         * typemanager.cs (types, typecontainers, user_types): Remove.
7823         (UserTypes, TypeContainers): Likewise.
7824         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7825         (CleanUp, Reset): Update.
7826         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7827         (GetNestedType): Use Type.GetNestedType.
7828         (CoreLookupType): Take two arguments, the namespace and the
7829         basename of the type.  Update to use the Namespace.Lookup
7830         mechanism.
7831         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7832         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7833         string concatenation and substring matches.
7834         * class.cs, enum.cs, delegate.cs: Update to changes.
7835
7836 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7837
7838         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7839         Expression and made virtual.
7840
7841         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7842         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7843
7844         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7845
7846         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7847         error message.
7848
7849         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7850         change.
7851
7852 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7853
7854         Fix #57707
7855         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7856         AssemblyCultureAttribute is not used on executable.
7857
7858         * rootcontext.cs,
7859         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7860
7861 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7862
7863         Fix #60638.
7864         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7865         New.  Reports CS0252/CS0253.
7866         Mostly taken from preliminary patch by Duncak Mak.
7867         (Binary.DoResolveOperator): Store results of operator lookup.
7868         Use them to detect if we need to warn about unintended reference
7869         comparisons.
7870
7871 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7872
7873         Fix #72969.
7874         * namespace.cs (Namespace.Lookup): Add back location parameter.
7875         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7876         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7877
7878         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7879         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7880         (Namespace.LookupType): ... this.
7881         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7882         of namespaces.
7883         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7884         purported to handle pointers.
7885         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7886         CoreLookupType.
7887
7888 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7889
7890         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7891         type as namespace.
7892
7893 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7894
7895         * namespace.cs (Namespace.Lookup): Drop location parameter.
7896         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7897         (NamespaceEntry.Lookup): ... this.
7898         (NamespaceEntry.Error_AmbiguousTypeReference):
7899         Move here from DeclSpace.
7900         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7901         names ...
7902         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7903         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7904         Move to NamespaceEntry.
7905         * delegate.cs, expression.cs: Update to changes.
7906
7907 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7908
7909         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7910         CheckAttributeType and refactored.
7911         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7912         ResolveAsTypeTerminal error handling.
7913         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7914         handling.
7915         (GetSignatureForError): Print errors in same way.
7916
7917         * class.cs,
7918         * codegen.cs: Reflect attribute GetSignatureForError change.
7919
7920         * ecore.cs,
7921         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7922
7923         * namespace.cs (UsingEntry): Refactored to make fields private.
7924
7925         * assign.cs,
7926         statement.cs: Error_UnexpectedKind has extra parameter.
7927
7928 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7929
7930         * ecore.cs (IAlias): Remove.
7931         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7932         that implement the interface.
7933         * namespace.cs (Namespace): Likewise.
7934         (Namespace.declspaces): Renamed from 'defined_names'.
7935         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7936         DeclSpace instead of an IAlias.
7937         * tree.cs (Tree.AddDecl): Update.
7938
7939 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7940
7941         * statement.cs (Block.Flags); Remove HasVarargs.
7942         (Block.HasVarargs): Move to ToplevelBlock.
7943         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7944         (Block.Variables): Make protected.  Initialize variable hashtable
7945         if necessary.
7946         (Block.AddVariable): Update.
7947         (Block.Resolve): Update to changes.
7948         (ToplevelBlock.HasVarargs): New boolean.
7949         (ToplevelBlock.ThisVariable): Move here from Block.
7950         (ToplevelBlock.AddThisVariable): Likewise.
7951         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7952         * expression.cs (This.ResolveBase): Update to changes.
7953         (ArglistAccess.DoResolve): Likewise.
7954
7955 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7956
7957         Fix #75321
7958         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7959
7960         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7961         not used and not used & assigned.
7962         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7963
7964 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7965
7966         Fix #75053
7967         * expression.cs (Is.DoResolve): null is never provided type.
7968
7969 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7970
7971         Fix #52496
7972         * cs-parser.jay: Less strict event error rule to catch more errors.
7973
7974 2005-07-08  Martin Baulig  <martin@ximian.com>
7975
7976         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7977         gettter (allowed) or setter (not allowed).
7978
7979         * class.cs (Accessor): Implement IIteratorContainer.
7980         (Accessor.Yields): New public field.
7981         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7982         per-accessor basis.
7983
7984         * cs-parser.jay
7985         (get_accessor_declaration, set_accessor_declaration): Set the
7986         `yields' flag on the accessor, not the property.
7987         (property_declaration): Do the iterators check on a per-accessor
7988         basis and not for the whole property.
7989
7990 2005-07-08  Martin Baulig  <martin@ximian.com>
7991
7992         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7993         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7994
7995 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7996
7997         Fix #74975
7998         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7999         (ExtractSecurityPermissionSet): Cope with self referencing security
8000         attributes properly.
8001
8002         * driver.cs (SetOutputFile): Made public property OutputFile.
8003
8004 2005-07-07  Raja R Harinath  <rharinath@novell.com>
8005
8006         Fix #75486.
8007         * class.cs (TypeContainer.first_nonstatic_field): Rename from
8008         has_nonstatic_fields.  Make into a FieldBase pointer.
8009         (TypeContainer.AddField): Add CS0282 check.
8010         (TypeContainer.EmitType): Update.
8011
8012 2005-07-06  Miguel de Icaza  <miguel@novell.com>
8013
8014         * cs-tokenizer.cs (consume_identifier): Do not create strings to
8015         compare if they start with __.
8016
8017 2005-07-06  Raja R Harinath  <rharinath@novell.com>
8018
8019         * statement.cs (Switch.SwitchGoverningType): Only look at
8020         UserCasts that don't need implicit standard conversions to one of
8021         the allowed switch types (Fixes test-322.cs).
8022         (LocalInfo.Resolve): Re-enable sanity-test.
8023
8024 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
8025
8026         * cs-tokenizer.cs (consume_identifier): Detect double undescores
8027         
8028         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
8029         
8030         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
8031
8032 2005-07-06  Raja R Harinath  <rharinath@novell.com>
8033
8034         Fix #75472.
8035         * ecore.cs (SimpleName.GetSignatureForError): Add.
8036         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
8037         (MemberAccess.GetSignatureForError): Add.
8038
8039 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
8040  
8041         The big error and warning messages review.
8042         
8043         * anonymous.cs,
8044         * assign.cs,
8045         * attribute.cs,
8046         * class.cs,
8047         * codegen.cs,
8048         * convert.cs,
8049         * cs-parser.jay,
8050         * cs-tokenizer.cs,
8051         * decl.cs,
8052         * delegate.cs,
8053         * doc.cs,
8054         * driver.cs,
8055         * ecore.cs,
8056         * enum.cs,
8057         * expression.cs,
8058         * flowanalysis.cs,
8059         * iterators.cs,
8060         * literal.cs,
8061         * location.cs,
8062         * modifiers.cs,
8063         * namespace.cs,
8064         * parameter.cs,
8065         * pending.cs,
8066         * report.cs,
8067         * rootcontext.cs,
8068         * statement.cs,
8069         * support.cs,
8070         * tree.cs,
8071         * typemanager.cs: Updated.
8072         
8073         * class.cs: (MethodCore.SetYields): Moved here to share.
8074         (PropertyMethod.Define): Moved iterator setup here.
8075         
8076         * iterators.cs: Add orig_method to have full access to parent
8077         container.
8078
8079 2005-07-05  Raja R Harinath  <rharinath@novell.com>
8080
8081         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
8082         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
8083         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
8084         variable of struct type.
8085         * expression.cs (Unary.ResolveOperator): Update to change.
8086         (Indirection.VerifyFixed): Likewise.
8087         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
8088         (ParameterReference.VerifyFixed): Value parameters are fixed.
8089         (This.VerifyFixed): Treat 'this' as a value parameter.
8090         * statement.cs (LocalInfo.IsFixed): Remove.
8091
8092 2005-07-01  Martin Baulig  <martin@ximian.com>
8093
8094         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
8095         `ec.EmitThis ()' to get the correct scope.
8096
8097 2005-07-01  Martin Baulig  <martin@ximian.com>
8098
8099         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
8100         instance is a ParameterReference; fixes #75299.
8101
8102 2005-07-01  Martin Baulig  <martin@ximian.com>
8103
8104         Reverted Marek's latest patch (r46725):
8105         - it contains structural changes which are neither mentioned in
8106           the ChangeLog nor explained anywhere; for example the additional
8107           argument of EmitContext's and Iterator's .ctor's and the
8108           TypeContainer.DefineMembers() change.
8109         - structural changes like this should go in in seperate patches
8110           and not be hidden in a huge patch which just seems to affect
8111           warnings and errors.
8112           a big and hard to understand patch.
8113         - it breaks iterators and causes regressions, for instance in
8114           test-iter-03.cs.      
8115
8116 2005-06-30  Raja R Harinath  <rharinath@novell.com>
8117
8118         Fix #75412.
8119         * expression.cs (Indexers.map): Remove.
8120         (Indexers.Append): Filter out inaccessible setters and getters.
8121         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
8122
8123         Fix #75283.
8124         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
8125         Refactored from ...
8126         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
8127         (FieldExpr.Emit, PropertyExpr.Emit): Update.
8128         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
8129         * expression.cs (Invocation.EmitCall): Add CS0120 check.
8130
8131 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
8132
8133         Fix #75322
8134         * class.cs (FieldBase.GetInitializerExpression): One more field
8135         for backup.
8136
8137 2005-06-28  Miguel de Icaza  <miguel@novell.com>
8138
8139         * pending.cs: Do not define a proxy if the base method is virtual,
8140         it will be picked up by the runtime (bug 75270).
8141
8142 2005-06-08  Martin Baulig  <martin@ximian.com>
8143
8144         The big Iterators rewrite :-)
8145
8146         * iterators.cs: Rewrite this to use the anonymous methods framework.
8147
8148         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
8149         before the TypeContainers; see 2test-21.cs.
8150
8151         * class.cs
8152         (TypeContainer.DefineType): Don't create a new EmitContext if we
8153         already have one (this only happens if we're an Iterator).
8154         (TypeContainer.Define): Also call Define() on all our iterators.
8155         (Method.CreateEmitContext): Added support for iterators.
8156
8157         * anonymous.cs
8158         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
8159         (AnonymousContainer.CreateMethodHost): Moved here from
8160         AnonymousMethod and made abstract.
8161         (AnonymousContainer.CreateScopeType): New abstract method.
8162         (AnonymousContainer.IsIterator): New public property.
8163         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
8164         get the ScopeTypeBuilder rather than manually defining it here. 
8165         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
8166         iterators here.
8167
8168         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
8169         before RootContext.DefineTypes().
8170
8171         * codegen.cs (EmitContext.RemapToProxy): Removed.
8172         (EmitContext.CurrentAnonymousMethod): Changed type from
8173         AnonymousMethod -> AnonymousContainer.
8174         (EmitContext.ResolveTopBlock): Protect from being called twice.
8175         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8176         (EmitContext.EmitThis): Removed the iterators hacks; use the
8177         anonymous methods framework for that.
8178
8179         * statement.cs
8180         (ToplevelBlock.Container): Make this a property, not a field.
8181         (ToplevelBlock.ReParent): New public method; move the
8182         ToplevelBlock into a new container.
8183         (Foreach.TemporaryVariable): Simplify.
8184
8185 2005-06-05  Martin Baulig  <martin@ximian.com>
8186
8187         * statement.cs (LocalInfo.CompilerGenerated): New flag.
8188         (Block.AddTemporaryVariable): New public method; creates a new
8189         `LocalInfo' for a temporary variable.
8190         (Block.EmitMeta): Create the LocalBuilders for all the temporary
8191         variables here.
8192         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8193         non-iterator variables.
8194
8195 2005-06-05  Martin Baulig  <martin@ximian.com>
8196
8197         * statement.cs (Foreach.TemporaryVariable): Create the
8198         LocalBuilder in the Emit phase and not in Resolve since in some
8199         situations, we don't have an ILGenerator during Resolve; see
8200         2test-19.cs for an example.
8201
8202 2005-06-04  Martin Baulig  <martin@ximian.com>
8203
8204         **** Merged r45395 from GCS ****
8205
8206         The big Foreach rewrite - Part II.
8207
8208         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8209         with `PropertyInfo ienumerator_getcurrent'.
8210
8211         * codegen.cs (VariableStorage): Removed.
8212
8213         * statement.cs
8214         (Foreach): Derive from Statement, not ExceptionStatement.
8215         (Foreach.CollectionForeach): New nested class.  Moved all the code
8216         dealing with collection foreach here.
8217         (Foreach.ForeachHelperMethods): Removed.
8218         (Foreach.TemporaryVariable): Implement IMemoryLocation.
8219
8220 2005-05-23  Martin Baulig  <martin@ximian.com>
8221
8222         * statement.cs (Try.DoResolve): Don't create a `finally' if we
8223         don't need to.  Fix #75014.
8224
8225 2005-05-20  Martin Baulig  <martin@ximian.com>
8226
8227         Merged r44808 from GMCS.
8228
8229         * class.cs (TypeContainer.CircularDepException): Removed.
8230         (TypeContainer.DefineType): Removed the `InTransit' stuff.
8231         (TypeContainer.CheckRecursiveDefinition): Check for circular class
8232         (CS0146) and interface (CS0529) dependencies here.
8233
8234 2005-06-21  Raja R Harinath  <rharinath@novell.com>
8235
8236         * expression.cs (Invocation.EmitCall): Fix initialization
8237         'this_call' to reflect current behaviour.  Fix indentation.
8238
8239         * convert.cs (FindMostEncompassedType): Add two trivial special
8240         cases (number_of_types == 0 || number_of_types == 1).
8241         (FindMostEncompasingType): Likewise.
8242
8243 2005-06-17  Raja R Harinath  <rharinath@novell.com>
8244
8245         Some cleanups preparing for the fix of #75283.
8246         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8247         error testing.
8248         (EventExpr.InstanceResolve): Likewise.
8249         (EventExpr.DoResolve): Remove redundant checks.
8250
8251 2005-06-10  Duncan Mak  <duncan@novell.com>
8252
8253         * cs-tokenizer.cs (process_directives): New flag for controlling
8254         the processing of preprocessor directives.
8255         (x_token): After seeing a '#', return Token.NONE instead of going
8256         to handle_preprocessing_directive() when not processing
8257         directives. This avoids unnecessary processing during the token peek in
8258         is_punct().
8259
8260         This fixes #74939.
8261
8262         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8263         the existing error reporting methods instead of Report.Error.
8264
8265         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8266         after Raja's rewrite.
8267
8268 2005-06-08  Miguel de Icaza  <miguel@novell.com>
8269
8270         * class.cs: Small fix.
8271
8272 2005-06-08  Raja R Harinath  <rharinath@novell.com>
8273
8274         Fix #75160.
8275         * class.cs (GetPartialBases): Fix return value check of
8276         part.GetClassBases.
8277
8278 2005-06-07  Raja R Harinath  <rharinath@novell.com>
8279
8280         Ensure that partial classes are registered in their enclosing
8281         namespace.  Initial part of fix of #75160.
8282         * tree.cs (Tree.RecordDecl): Add new namespace argument.
8283         Register declspace with namespace here, not in
8284         DeclSpace.RecordDecl.
8285         * cs-parser.jay: Pass namespace to RecordDecl.
8286         * class.cs (PartialContainer.Create): Likewise.
8287         (ClassPart.DefineType): New sanity-check.  Throws an exception if
8288         called.
8289         * decl.cs (Declspace.RecordDecl): Remove.
8290         * namespace.cs (NamespaceEntry.DefineName): Remove.
8291
8292 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
8293
8294         * rootcontext.cs: Reset TargetExt as well.
8295
8296 2005-06-03  Raja R Harinath  <rharinath@novell.com>
8297
8298         * ecore.cs (Expression.Resolve): Emit CS0654 error when
8299         -langversion:ISO-1.
8300
8301 2005-06-02  Raja R Harinath  <rharinath@novell.com>
8302
8303         Fix #75080, cs0119.cs.
8304         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
8305         of ...
8306         (Expression.Resolve): ... this.  Use it.  Remove bogus code
8307         allowing ExprClass.Type and ExprClass.Namespace for
8308         ResolveFlags.VariableOrValue.
8309         (Expression.Resolve) [1-argument variant]: Change default resolve
8310         flags based on language version.
8311         (Expression.Error_UnexpectedKind): Use a simple string array
8312         rather than an ArrayList.
8313         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8314         not ExprClass.Type.
8315         (TypeOfVoid.DoResolve): Likewise.
8316         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
8317         flags argument -- it always has the same value.
8318
8319 2005-05-31  Raja R Harinath  <rharinath@novell.com>
8320
8321         Fix #75081.
8322         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8323         Use it in the error message.
8324         * assign.cs, expression.cs, statement.cs: Update.
8325
8326 2005-05-30  Raja R Harinath  <rharinath@novell.com>
8327
8328         Fix #75088.
8329         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8330         the "almostMatchedMember" case too.
8331         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8332         that failed the accessibility checks to 'almost_match'.
8333
8334 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
8335
8336         * attribute.cs: Use internal MethodBuilder methods to set
8337         ExactSpelling and SetLastError on PInvoke methods, instead
8338         of passing them via charset.  Fixes #75060.
8339
8340 2005-05-27  Raja R Harinath  <rharinath@novell.com>
8341
8342         * parameter.cs (Parameter): Remove TODO comment.
8343         (Parameter.DefineParameter): Remove Location parameter.
8344         (Parameters.LabelParameters): Likewise.
8345         * class.cs (Constructor.Emit): Update to change.
8346         (MethodData.Emit): Likewise.
8347         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
8348         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8349
8350 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
8351
8352         * parameter.cs,
8353           Removed Parameters.Location and added Parameter.Location instead.
8354           Removed Location parameter from Emit() and GetSignature().
8355         * anonymous.cs,
8356           class.cs,
8357           cs-parser.jay,
8358           delegate.cs,
8359           iterators.cs,
8360           statement.cs :
8361           Modified all related calls.
8362
8363 2005-05-26  Raja R Harinath  <rharinath@novell.com>
8364
8365         Improve user-defined conversion handling.
8366         * convert.cs (GetConversionOperators): Rewrite.  Return only the
8367         applicable operators.
8368         (AddConversionOperators): New.  Helper for GetConversionOperators.
8369         (FindMostEncompassedType, FindMostEncompassingType): Verify that
8370         there is only one most encompassed/encompassing type.
8371         (FindMostSpecificSource, FindMostSpecificTarget): Remove
8372         "applicable operator" handling.
8373         (UserConversion): Move cache here from GetConversionOperators.
8374         Directly cache the chosen operator, rather than the whole
8375         MethodGroup.
8376         (ExplicitNumericConversion): Fix buggy implementation of Decimal
8377         case.  Allow conversion of decimal to sbyte and byte too.
8378         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8379         New static methods.  Used to avoid allocating EmptyExpressions in
8380         convert.cs.
8381
8382 2005-05-24  Duncan Mak  <duncan@novell.com>
8383
8384         * ecore.cs (CastFromDecimal): New class for casting a decimal to
8385         another class, used in Convert.ExplicitNumericConversion.
8386         (CastToDecimal): New class, similar to above, but casts to
8387         System.Decimal, used in Convert.ImplicitNumericConversion and also
8388         in explicit convesion from double/float to decimal.
8389
8390         * convert.cs (ImplicitNumericConversion): Handle implicit
8391         conversions to System.Decimal.
8392         (ExplicitNumericConversion): handle explicit conversions to
8393         System.Decimal.
8394
8395         This fixes #68711.
8396         
8397 2005-05-20  Miguel de Icaza  <miguel@novell.com>
8398
8399         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8400         know the type at this stage, just break through.   Fixes #75008 
8401
8402 2005-05-19  Martin Baulig  <martin@ximian.com>
8403
8404         * delegate.cs
8405         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8406         to disable error reporting.
8407
8408         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8409         here since we don't want to report an error; see the new test-336.cs.
8410
8411 2005-05-19  Raja R Harinath  <rharinath@novell.com>
8412
8413         * statement.cs (ToplevelBlock.GetParameterReference)
8414         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8415         Move here from class Block.
8416         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8417         * expression.cs (ParameterReference.DoResolveBase): Likewise.
8418
8419 2005-05-18  Martin Baulig  <martin@ximian.com>
8420
8421         Fix #74978.
8422
8423         * flowanalysis.cs
8424         (FlowBranching.Reachability): Add non-static public And() and Or()
8425         methods.
8426         (FlowBranchingSwitch): New class; do the `break_origins' thing
8427         like in FlowBranchingLoop.
8428         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8429         reachability, not just locals and parameters.
8430         (FlowBranching.MergeChild): Remove some of the hacks for loop and
8431         switch; MergeBreakOrigins() now takes care of that.
8432
8433 2005-05-18  Martin Baulig  <martin@ximian.com>
8434
8435         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8436         a loop and may leave it, reset the barrier; fixes #74974.
8437
8438 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
8439         
8440         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8441         is back.
8442         
8443         * cs-parser.jay: Catch more lexical errors.
8444         
8445         * report.cs: Add one more Error method.
8446         
8447         * rootcontext.cs,
8448         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8449
8450 2005-05-17  Martin Baulig  <martin@ximian.com>
8451
8452         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8453         #70970. 
8454
8455 2005-05-16  Raja R Harinath  <rharinath@novell.com>
8456
8457         Fix test-382.cs.  Emit values of decimal constants.
8458         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8459         Carved out of ...
8460         (TypeContainer.AddField): ... this.
8461         (TypeContainer.EmitFieldInitializers): Allow the list of fields
8462         with initializers to include 'Const's.
8463         (ClassPart.RegisterFieldForInitialization): Forward to
8464         PartialContainer.
8465         * const.cs (Const.Const): Pass initializer to base class.
8466         (Const.Define): In case of decimal constants, register them for
8467         initialization in a static constructor.
8468
8469 2005-05-14  Martin Baulig  <martin@ximian.com>
8470
8471         * statement.cs (Block.Resolve): Correctly handle unreachable code;
8472         do not call ResolveUnreachable() on unreachable statements in
8473         here, see the comment in the source code.
8474
8475 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8476
8477         Fix #74934.
8478         * expression.cs (BinaryResolveOperator): If one of the operands of
8479         an equality comparison is 'null' and the other is a pointer type,
8480         convert the null to a NullPointer.
8481         * convert.cs (ImplicitReferenceConversion): If the expression is a
8482         NullLiteral and the target type is a pointer type, return a
8483         NullPointer instead.
8484         (ImplicitConversionStandard): Likewise.
8485
8486 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
8487         
8488         * cs-parser.jay: Set readonly context based on special constructs.
8489         
8490         * expression.cs (LocalVariableReference.DoResolveBase): Improved
8491         readonly variable error handling.
8492         
8493         * rootcontext.cs (EmitCode): Don't verify members when error
8494         occurred.
8495         
8496         * statement.cs (LocalInfo): Add reaodnly context information.
8497         (SetReadOnlyContext, GetReadOnlyContext): New methods.
8498
8499 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8500
8501         * statement.cs (Block.Resolve): Revert change below.  Modify fix
8502         for #74041 to initialize 'resolved' to false only for explicit
8503         blocks.  Fixes #74873.
8504
8505 2005-05-12  Raja R Harinath  <harinath@gmail.com>
8506
8507         Fix #74920.
8508         * typemanager.cs (unmanaged_enclosing_types): New.
8509         (IsUnmanagedType): Avoid infloops by using
8510         'unmanaged_enclosing_types' to talk with recursive invocations.
8511
8512 2005-05-13  Martin Baulig  <martin@ximian.com>
8513
8514         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8515         instance variable, not a local.  Fix #74873.
8516         (Block.ResolveUnreachable): Set it to true here.
8517
8518 2005-05-11  Duncan Mak  <duncan@novell.com>
8519
8520         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8521         continuing to process for 'arg'.
8522         (handle_preprocessing_directive): Check the argument of the #endif
8523         directive and report error CS1025 if there are any trailing
8524         characters.
8525
8526         According to the C# spec, having even whitespace after the #endif
8527         directive is illegal; however, because we call arg.TrimEnd ()
8528         beforehand, we have the same behavior as csc, allowing whitespace
8529         after the directive.
8530
8531         Fixes #74892.
8532
8533 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8534
8535         Fix #74863.
8536         
8537         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8538         (Constructor.GetObsoleteAttribute): Implemented correctly.
8539
8540 2005-05-10  Martin Baulig  <martin@ximian.com>
8541
8542         * support.cs (ReflectionParameters.ParameterModifier): Use
8543         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8544         and `ParameterAttributes.In'.  Fixes #74884.
8545
8546 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8547
8548         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8549         
8550         * expression.cs (Argument.GetParameterModifier): Turned to property.
8551         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8552         
8553         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8554         its C# equivalent.
8555         
8556 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8557
8558         Fix #74852.
8559         * decl.cs (MemberCache.AddMethods): Register override methods,
8560         rather than non-override methods.
8561         * typemanager.cs (RegisterOverride): New.
8562         (IsOverride): Update.
8563
8564 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8565
8566         Fix #73105.
8567         
8568         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8569         recursive declaration.
8570         
8571         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8572         
8573 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8574
8575         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8576         
8577         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8578
8579 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8580
8581         Fix #74797.
8582         * decl.cs (DeclSpace.FamilyAccessible): 
8583         Use TypeManager.IsNestedFamilyAccessible.
8584
8585         Fix reopened #64812.
8586         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8587         internal'.
8588
8589 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8590             Abin Thomas  <projectmonokochi@rediffmail.com>
8591             Anoob V E  <projectmonokochi@rediffmail.com>
8592             Harilal P R  <projectmonokochi@rediffmail.com>
8593
8594         Fix #64812.
8595         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8596         allow access to all static members.
8597
8598 2005-05-04  Martin Baulig  <martin@ximian.com>
8599
8600         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8601
8602 2005-05-04  Martin Baulig  <martin@ximian.com>
8603
8604         Fix #74655.
8605
8606         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8607         section at the end; make things work if `default' is not the last
8608         section.        
8609
8610 2005-05-04  Martin Baulig  <martin@ximian.com>
8611
8612         Fix #70400.
8613
8614         * statement.cs (Switch): Replaced the `got_default' field with a
8615         `default_section' one.
8616         (Switch.CheckSwitch): Set `default_section' here.
8617         (Switch.Resolve): If we're a constant switch and the constant is
8618         not found, use the default section.
8619
8620 2005-05-03  Martin Baulig  <martin@ximian.com>
8621
8622         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8623
8624         * statement.cs (Foreach.ArrayForeach): New nested class.
8625         (Foreach.TemporaryVariable): New nested class.
8626         (Foreach.EmitArrayForeach): Removed; this is now in the new
8627         ArrayForeach class.
8628
8629 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8630
8631         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8632         more conservative.
8633         (VerifyPendingMethods): Revert change below.
8634
8635         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8636         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8637         that used to trigger warning -28.  Remove warning -28.
8638         * expression.cs (Invocation.OverloadResolve): Use
8639         TypeManager.IsOverride to distinguish override methods.
8640
8641         Fix #74773.
8642         * pending.cs (VerifyPendingMethods): If a base type implements the
8643         requested interface, don't bother checking individual methods of
8644         the base type.  As a side-effect, this prevents the creation of
8645         unnecessary proxies.
8646
8647 2005-05-02  Martin Baulig  <martin@ximian.com>
8648
8649         Fix #70182.
8650
8651         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8652         Also `And' the locals if the old vector is null.
8653         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8654         null; in this case we basically reset all the variables.        
8655
8656 2005-05-02  Martin Baulig  <martin@ximian.com>
8657
8658         Fix #74529.
8659
8660         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8661         Added `FlowBranching branching' argument; always `and' the
8662         variables instead of `or'ing them unless we're an infinite loop.
8663
8664         * statement.cs (While.Resolve): Create a new sibling unless we're
8665         infinite.       
8666
8667 2005-05-02  Martin Baulig  <martin@ximian.com>
8668
8669         Fix #70140.
8670
8671         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8672         arguments; use it instead of creating a new TopLevelBlock.
8673         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8674         our ConstructorInitializer.
8675
8676         * statement.cs
8677         (TopLevelBlock.TopLevelBranching): New public property.
8678         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8679         and create our `TopLevelBranching'.
8680
8681         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8682         anonymous method host, use `block.TopLevelBranching' rather than
8683         creating a new branching.
8684
8685 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8686
8687         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8688         a ScopeInfo, if any of the current children is a child of the new
8689         entry, move those children there.
8690
8691 2005-04-30  Martin Baulig  <martin@ximian.com>
8692
8693         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8694         at the beginning of a SwitchSection.  Fix #73335.
8695
8696 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8697
8698         Fix #74378
8699         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8700         
8701         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8702         (FieldExpr.DoResolve): Obsolete members are ignored for field
8703         initializers.
8704         
8705 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8706
8707         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8708         of arrays detection.
8709
8710         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8711         verification.
8712         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8713
8714         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8715         arrays report.
8716
8717 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8718
8719         * cs-parser.jay: Use the prefered version of -unsafe in error
8720         message.
8721
8722 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8723
8724         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8725         circumstances.
8726
8727 2005-04-20  John Luke  <john.luke@gmail.com>
8728
8729         * driver.cs: fix typo in error message, --outout to --output
8730
8731 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * codegen.cs (InRefOutArgumentResolving): New field.
8734         
8735         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8736         fields outside contructor.
8737         
8738         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8739         
8740 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8741
8742         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8743         parameter code was not completed ever, so it was not as up-to-date
8744         as local variables.  Must finish it.
8745
8746         The bug fix was to compare the Toplevel of the block, not the
8747         current block.  Thanks for Ben for pointing this out. 
8748
8749 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8750
8751         * decl.cs (AddMethods): Use the declaring type of the problem
8752         method to determine if we want to squash a warning.
8753
8754 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8755
8756         * attribute.cs: Removed debug output.
8757
8758         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8759         
8760         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8761         Report.Stderr.
8762         
8763 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8764
8765         Fix #74481.
8766         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8767         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8768         all null comparisons against reference types.
8769
8770 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8771
8772         Fix# 74565
8773         * class.cs (TypeContainer.CircularDepException) New nested
8774         exception class.
8775         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8776         (TypeContainer.DefineType): Removed error, reset InTransit before
8777         exit.
8778         (Class.DefineType): Throw exception when is in Transit.
8779         Catch exception and report error.
8780         (Struct.DefineType): Throw exception when is in Transit.
8781         Catch exception and report error.
8782         (Interface.DefineType): Throw exception when is in Transit.
8783         Catch exception and report error.
8784
8785         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8786         handle nested exception handlers.
8787
8788         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8789         a catch.
8790
8791         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8792         InFinally and InCatch storage.
8793
8794         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8795         (Catch.Resolve): Set and Restore ec.InCatch.
8796         (Try.Resolve): Set and Restore ec.InFinally.
8797         (Try.HasCatch): True when try has catch.
8798
8799 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8800
8801         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8802           for the same event member, so exclude such cases from warning 419.
8803           Fixed bug #74633.
8804
8805 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8806
8807         * expression.cs (Binary.ResolveOperator): Apply patch from John
8808         Luke to fix bug 59864: operators &, | and ^ on enumerations
8809         require that the same enum type on both sides.
8810
8811         * driver.cs: Add warnings to old flag usage, this is to assist
8812         people who produce Makefiles and hope that the Makefiles will be
8813         used on Windows.
8814
8815         * class.cs (TypeContainer.EmitType): Moved the definition of the
8816         special $PRIVATE$ field from the resolve phase to the Emit phase.
8817         During resolve we do not know if we are a struct with
8818         HasExplicitLayout, we know this only after the attributes for the
8819         type are emitted.
8820
8821         Set the FieldOffset to zero on the dummy field that we create for
8822         the class.   Fixes 74590.
8823
8824 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8825
8826         Fix #73834.
8827         * ecore.cs (PropertyExpr.resolved): New.
8828         (DoResolve): Use it to handle a case of double resolution here.
8829         Handle a case of identical-name-and-type-name.
8830         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8831         resolution by storing the results of expression resolution back
8832         into the "probes" array.
8833
8834 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8835
8836         Fix cs0208-7.cs and cs0208-8.cs.
8837         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8838         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8839         error reporting to point out the reason a struct is not unmanaged.
8840
8841 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8842
8843         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8844           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8845
8846 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8847
8848         Fix #74528.
8849         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8850         IdenticalNameAndTypeName here.
8851         (EventExpr.InstanceResolve): Likewise.
8852
8853 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8854
8855         C# 2.0 DefaultCharSetAttribute implementation
8856         
8857         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8858         which allows us to set GlobalNamespace for every resolve.
8859         (Attribute.ResolveArguments): Cut from Resolve.
8860         (Attribute.GetCharSetValue): Returns CharSet named argument.
8861         (Attribute.DefinePInvokeMethod): Gets default charset from
8862         module settings.
8863         (GlobalAttribute.ResolveAsTypeStep): Override.
8864         (GlobalAttribute.ResolveArguments): Override.
8865         
8866         * class.cs (TypeAttr): Is protected.
8867         
8868         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8869         (ModuleClass.DefaultCharSetType): New memeber.
8870         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8871         
8872         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8873         charset from module.
8874         
8875         * delegate.cs (TypeAttr): Override.
8876         (Delegate.DefineType): Use this TypeAttr.
8877         
8878         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8879         at very early stage (before types are defined) to resolve model
8880         module attributes. It will probably not work with corlib but it
8881         should be ok.
8882         
8883         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8884         charset from module.
8885         
8886         * typemanager.cs (default_charset_type): New type.
8887
8888 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8889
8890         * decl.cs (MemberCache.AddMethods): Don't warn if
8891         System.Object.Finalize has buggy MethodAttributes.
8892
8893         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8894         removed below.
8895
8896 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8897
8898         * doc.cs : detect ambiguous reference to overloaded members.
8899           Fixed bug #71603. MS 1.1 csc does not detect it.
8900
8901 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8902
8903         * doc.cs : delegates must not be referenced with parameters.
8904           Fixed bug #71605.
8905
8906 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8907
8908         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8909
8910 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8911
8912         * driver.cs (MainDriver): Stop processing if the CLS stage found
8913         errors. 
8914
8915         (CompilerCallableEntryPoint.InvokeCompiler): Always
8916         reset after execution;   Take a TextWriter argument for the
8917         output.
8918
8919         * report.cs: Use the error stream instead of hardcoding stderr. 
8920
8921 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8922
8923         * class.cs: Reduce code paths to test, too small of an
8924         optimization to make it worth the extra testing.  Always perform
8925         it. 
8926
8927 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8928
8929         Fix #74510.
8930         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8931         operators that had errors reported on them.
8932
8933 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8934
8935         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8936         argument types.
8937         (Attribute.Resolve): Add named argument type checking.
8938         
8939         * class.cs (FixedField.Define): Use IsPrimitiveType
8940         
8941         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8942         
8943         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8944         unsafe parameter types.
8945         
8946         * statement.cs (Using.ResolveExpression): Add better error description.
8947         
8948         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8949         
8950 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8951
8952         Fix #74484.
8953         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8954         AttributeUsageAttribute in the emitcontext of the attribute class,
8955         not in the emitcontext of the attributable entity it was attached to.
8956         * cs-parser.jay: Use 'current_class', not 'current_container',
8957         when creating a GlobalAttribute.
8958
8959 2005-04-08  Alp Toker  <alp@atoker.com>
8960
8961         * pending.cs: The fix to #58413 failed to compile methods implementing
8962         interfaces with/without params modifiers and vice versa, even though
8963         params modifiers aren't part of the signature. Make the modifier check
8964         less strict as in csc.
8965
8966 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8967             Anoob V E  <projectmonokochi@rediffmail.com>
8968             Harilal P R  <projectmonokochi@rediffmail.com>
8969
8970         Fix #58413.
8971         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8972         modifiers of pending methods.
8973         (PendingImplementation.PendingImplementation): Initialize it.
8974         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8975         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8976         with ParameterData.  Add check for modifiers.
8977         * class.cs (MethodData.Define): Update to changes.
8978
8979 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8980
8981         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8982
8983 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8984
8985         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8986         property.
8987         
8988         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8989         
8990         * rootcontext.cs,
8991         * typemanager.cs: Registered RequiredAttributeAttribute.
8992         
8993 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8994
8995         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8996         Warning CS0169 is back at level 3.
8997         (IMethodData.SetMemberIsUsed): New method.
8998         
8999         * decl.cs (IsUsed): New value; moved from FieldBase.Status
9000         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
9001         
9002         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
9003
9004         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
9005         contants.
9006         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
9007         is used.
9008         
9009         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
9010         is used.
9011         
9012         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
9013         to avoid the problems with nested types.
9014
9015 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
9016             Anoob V.E  <projectmonokochi@rediffmail.com>
9017             Harilal P.R  <projectmonokochi@rediffmail.com>
9018             Raja R Harinath  <rharinath@novell.com>
9019
9020         Fix #73820.
9021         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
9022         attribute.
9023         * typemanager (GetConstructor): Make public.
9024
9025 2005-04-05  John Luke  <john.luke@gmail.com>
9026             Raja R Harinath  <rharinath@novell.com>
9027
9028         Fix #62232.
9029         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
9030         struct too.  Return false quicker in a few cases.
9031         (VerifyUnManaged): Use it.
9032
9033 2005-04-05  Raja R Harinath  <rharinath@novell.com>
9034
9035         Fix #74041.
9036         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
9037         not 'unreachable_seen'.
9038
9039 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
9040
9041         * attribute.cs (Attribute.GetValue): Removed unused.
9042         
9043         * codegen.cs (CodeGen.TrimExt): Removed unused.
9044         
9045         * cs-parser.jay (output): Removed unused.
9046         
9047         * cs-tokenizer.cs (hex_digits): Removed unused.
9048         
9049         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
9050         
9051         * expression.cs (Indirection.LoadExprValue): Removed unused.
9052         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
9053         
9054         * iterators.cs (Iterator.param_types): Removed unused.
9055         
9056         * statement.cs (Goto.block): Removed unused.
9057         (ToplevelBlock.did): Removed unused.
9058         (Switch.ResolveConstantSwitch): Removed unused.
9059
9060 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
9061
9062         * rootcontext.cs: Allow mcs to bootstrap with the compilation
9063         resetting thingy.
9064
9065 2005-04-01  Raja R Harinath  <rharinath@novell.com>
9066
9067         Fix #74232 and cs0208-3.cs.
9068         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
9069         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
9070         unmanaged type.  Don't use FieldBuilders when 't' is a
9071         TypeBuilder.  Use ModFlags and MemberType fields.
9072         * class.cs (MemberBase.member_type): Rename from MemberType.
9073         (MemberBase.MemberType): New property.  Determines member_type on
9074         demand.
9075         (MemberBase.DoDefine): Don't initialize MemberType here.
9076         (FieldMember.Define): Likewise.
9077
9078 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
9079
9080         Fix #74241
9081         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
9082         Attributes are emitted there.
9083         
9084 2005-04-01  Raja R Harinath  <rharinath@novell.com>
9085
9086         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
9087         keyword in 'partial enum' too.
9088         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
9089         is not allowed).
9090         Report from Kamil Skalski <nazgul@omega.pl>.
9091
9092         Fix #74309.
9093         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
9094         have partial containers too.
9095
9096         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
9097         in block' checks to Block.CheckInvariantMeaningInBlock.
9098         * statement.cs (Block.GetKnownVariableInfo): Make private.
9099         (Block.IsVariableUsedInChildBlock): Remove.
9100         (Block.IsVariableUsedInBlock): Likewise.
9101         (Block.CheckInvariantMeaningInBlock): New.  Show location of
9102         conflicting declaration.
9103         (Block.AddVariable): Make error messages less long-winded and more
9104         specific.  Show location of conflicting declaration.
9105         * parameter.cs (Parameters.Location): New readonly property.
9106
9107 2005-03-31  Raja R Harinath  <rharinath@novell.com>
9108
9109         Clean up semantics of invoking ResolveMemberAccess.
9110         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
9111         can have an instance, ensure that we pass in a non-TypeExpression
9112         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
9113         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
9114         argument.  Update to changes and simplify.
9115         (FieldExpr.Emitinstance): Remove CS0120 check.
9116         (PropertyExpr.EmitInstance): Likewise.
9117         * expression.cs (Argument.Resolve): Likewise.
9118         (Invocation.DoResolve): Update to changes in semantics of
9119         InstanceExpression.
9120
9121 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
9122
9123         Fix #74241
9124         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
9125         customization.
9126         
9127         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
9128
9129 2005-03-31  Raja R Harinath  <rharinath@novell.com>
9130
9131         Fix difference in behaviour with commandline invocation.
9132         * driver.cs (Driver.Reset): New.
9133         (CompilerCallableEntryPoint): Call it.
9134
9135         * statement.cs (If.Resolve): Avoid spurious "uninitialized
9136         variable" warnings if the boolean expression failed to resolve.
9137
9138 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
9139
9140         * attribute.cs: Fix the union of several permissions when some of them
9141         are unrestricted (so the result isn't an unrestricted permission set).
9142         Fix #74036.
9143
9144 2005-03-30  Raja R Harinath  <rharinath@novell.com>
9145
9146         * ecore.cs (MemberExpr): New class.  Convert from interface
9147         IMemberExpr.
9148         (MemberExpr.ResolveMemberAccess): Refactor and move here from
9149         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
9150         error checks.
9151         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
9152         (MethodGroupExpr.IsExplicitImpl): Remove.
9153         (Expression.GetFieldFromEvent): Remove.
9154         (SimpleName.MemberStaticCheck): Remove.
9155         (SimpleName.DoSimpleNameResolve): Update to changes.
9156         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
9157         (MemberAccess.IdenticalNameAndTypeName): Remove.
9158         (MemberAccess.error176): Move to MemberExpr.
9159         (MemberAccess.DoResolve): Update to changes.
9160         (BaseAccess.DoResolve): Likewise.
9161
9162 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
9163
9164         C# 2.0 Conditional attribute class implementation
9165         
9166         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
9167         Analyzes class whether it has attribute which has ConditionalAttribute
9168         and its condition is not defined.
9169         
9170         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
9171         (Class.IsExcluded): New method. Search for at least one defined
9172         condition in ConditionalAttribute of attribute class.
9173
9174 2005-03-30  Raja R Harinath  <rharinath@novell.com>
9175
9176         * ecore.cs (PropertyExpr): Derive from Expression, not
9177         ExpressionStatement.
9178         (PropertyExpr.EmitStatement): Remove.
9179
9180 2005-03-29  Raja R Harinath  <rharinath@novell.com>
9181
9182         Fix #74060.
9183         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9184         internal field "value__" of an enum be private.  The examples for
9185         "value__" that I found on MSDN all used FieldAttributes.Private.
9186
9187         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9188         Don't mention IL method attribute names.
9189
9190         Fix #47991.  Remove a TODO.
9191         * statement.cs (Block.Toplevel): Make into a field.
9192         (Block.Parameters): Move into ToplevelBlock.
9193         (Block.known_variables): Rename from child_variable_names.
9194         (Block.Block): Remove variants that take Parameters.  Initialize
9195         'Toplevel' with the immediately surrounding toplevel block.
9196         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
9197         LocalInfo parameter.
9198         (Block.GetKnownVariableInfo): New.
9199         (Block.IsVariableNameUsedInChildBlock): Update.
9200         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
9201         the block, even though it may not be in scope.
9202         (Block.AddVariable): Remove Parameters parameter.  Use
9203         Toplevel.Parameters instead.
9204         (Block.AddConstant): Remove Parameters parameter.
9205         (Block.GetParameterReference): Update to use Toplevel.Parameters.
9206         (Block.IsParamaterReference): Likewise.
9207         (Block.IsLocalParameter): Likewise.  Simplify a lot.
9208         (ToplevelBlock.Parameters): New.  Moved from Block.
9209         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
9210         initialize Parameters to a non-null value.
9211         * cs-parser.jay: Update to changes.
9212         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9213         simple names that mean different things in the same block.  Use
9214         Block.IsVariableNameUsedInBlock.
9215
9216 2005-03-28  Raja R Harinath  <rharinath@novell.com>
9217
9218         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9219         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9220         GetTypeHandle.  It is possible for a reflected type to derive from
9221         a TypeBuilder (e.g., int[] derives from the TypeBuilder
9222         System.Array during mscorlib compilation).
9223         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9224         contain a method_hash, don't create one either.  Don't create a
9225         deep copy of the base cache's method_hash.
9226         (MemberCache.SetupCache): Rename back from DeepCopy.
9227         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9228         already initialized.  If we see an override function, add its
9229         underlying base virtual function to the member_hash too.
9230
9231         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9232
9233 2005-03-26  Raja R Harinath  <harinath@acm.org>
9234
9235         Fix #73038.
9236         * assign.cs (Assign.DoResolve): When the RHS of an assignment
9237         fails to resolve, ensure that the LHS is still resolved as an
9238         lvalue.
9239
9240 2005-03-25  Raja R Harinath  <harinath@acm.org>
9241
9242         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9243         ec.ContainerType.
9244         (Enum.current_ec): Remove.
9245         (Enum.LookupEnumValue): Remove EmitContext argument.
9246         Just uses the one created during DefineType.
9247         (Enum.FindMembers): Update.
9248         * expression.cs (MemberAccess.DoResolve): Update.
9249
9250 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
9251
9252         * assign.cs (Assign.DoResolve): Check for CS1717 when
9253         source and target are same (uses Equals).
9254
9255         * expression.cs (LocalVariableReference, ParameterReference,
9256         This): Implemented Equals, GetHashCode.
9257
9258         * statement.cs (Block.GetParameterReference): Removed useless
9259         local variable.
9260
9261 2005-03-22  Raja R Harinath  <rharinath@novell.com>
9262
9263         Fix cs0128.cs
9264         * statement.cs (Block.AddVariable): Ensure that we skip implicit
9265         blocks before deciding whether the error is cs0136 or cs0128.
9266
9267         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9268         (using_alias_directive, using_namespace_directive): Pass
9269         MemberName, not an expression to Namespace.UsingAlias and
9270         Namespace.Using.
9271         (MakeName): Use the MemberName of the namespace.
9272         * namespace.cs (Namespace.MemberName): New.
9273         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9274         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9275         Likewise.
9276         * decl.cs (MemberName.Name): Make readonly.
9277         (MemberName.FromDotted): New "constructor".
9278         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9279         (MemberCore.Name): Compute from MemberName on demand.
9280         (MemberCore.SetMemberName): Provide a way to change the
9281         MemberName.
9282         (MemberCore.AddToContainer): Don't take a fullname parameter.
9283         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9284         fully qualified name of the container to the member name.
9285         (TypeContainer.AddToTypeContainer): Use a fully qualified name
9286         only if the type is a member of the root container.
9287         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9288         MemberName.Left rather than searching for an embedded ".".
9289         (PartialContainer.CreatePart): Update to changes in RootContext.
9290         (MemberBase.ShortName): Turn into a property.  Use
9291         MemberCore.SetMemberName.
9292         (MemberBase.ExplicitInterfaceName): Remove.
9293         (MemberBase.UpdateMemberName): Remove.
9294         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9295         (PropertyBase.SetMemberName): New override.
9296         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9297         (Tree.GetDecl): New.
9298         (Tree.AllDecls): Rename from Decls.
9299         * attribute.cs, enum.cs, report.cs: Update to changes.
9300         * driver.cs (MainDriver): Use MemberName.FromDotted on
9301         RootContext.MainClass.
9302
9303 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
9304
9305         * class.cs (FixedField.Define): Check for CS1664 and more sanity
9306         checks.
9307
9308         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9309
9310 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
9311
9312         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9313         property accessor modifiers.
9314
9315         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9316         fixed buffer attribute (CS1716).
9317         (PropertyMethod.HasCustomAccessModifier): When property accessor
9318         has custom modifier.
9319
9320         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9321         modifiers.
9322         (PropertyExpr.DoResolveLValue): Add CS0272.
9323
9324 2005-03-17  Miguel de Icaza  <miguel@novell.com>
9325
9326         * convert.cs: When converting to a pointer, use the proper Conv.U
9327         or Conv.I depending on the source data type.
9328
9329         * cs-tokenizer.cs: Make the size for large decimal constants,
9330         fixes #72957.
9331
9332 2005-03-17  Martin Baulig  <martin@ximian.com>
9333
9334         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9335         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
9336
9337 2005-03-17  Martin Baulig  <martin@ximian.com>
9338
9339         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9340         to bool so we can return an error condition.
9341         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9342         returned an error.
9343
9344 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
9345
9346         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9347         attributes.
9348
9349 2005-03-16  Raja R Harinath  <rharinath@novell.com>
9350
9351         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9352         Refactor to avoid traversing the list of assemblies, and to avoid
9353         string concatenation.
9354         * typemanager.cs (guid_attr_type): Remove.
9355         (negative_hits, pointers, references): Remove hashes.
9356         (type_hash): New.
9357         (GetConstructedType): New.  Uses type_hash to handle constructed
9358         types (arrays, references, pointers).
9359         (GetReferenceType, GetPointerType): Use it.
9360         (GetNestedType): New.  Uses type_hash to handle nested types of
9361         reflected types.
9362         (LookupType, LookupTypeDirect): Remove.
9363         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
9364         'types' hash and LookupTypeReflection directly.
9365         (params_string, params_object): Use GetConstructedType.
9366         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
9367         top-level types.
9368         (Namespace.Lookup): Use cached_types.
9369         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9370         provided by old TypeManager.LookupType.
9371         * rootcontext.cs (MakeFQN): Remove.
9372         * decl.cs (DeclSpace.MakeFQN): Likewise.
9373         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9374         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9375         TypeManager.GetConstructedType.
9376         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9377
9378 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9381         indexers.
9382
9383         * cs-parser.jay: Reports CS1527 for any namespace element.
9384
9385         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9386         Added CS0407.
9387
9388         * expression.cs (ParameterReference.IsAssigned): Changed error to
9389         CS0269.
9390         (Error_WrongNumArguments): Moved CS0245 detection here.
9391
9392         * statement.cs (Return.Resolve): Add CS1622 report.
9393
9394 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
9395
9396         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9397
9398 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
9399
9400         * attribute.cs expression.cs: Get rid of some allocations.
9401
9402 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
9403
9404         * doc.cs : just eliminate the latest change.
9405
9406 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9407
9408         * doc.cs : commented out the latest change. It breaks xml-030.cs
9409
9410 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9411
9412         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9413           fail. So invoke CreateType() in FindDocumentedType().
9414
9415 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9416
9417         * cs-tokenizer.cs : added IsKeyword().
9418         * doc.cs : Detect keyword incorrectly used as identifier.
9419           Allow identifiers prefixed by @.
9420
9421 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
9422
9423         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9424         It caused exception in namespace resolving (again!).
9425         
9426         * class.cs (Class.ctor): Removed exit.
9427         (PropertyMethod.ctor): ditto.
9428         
9429         * codegen.cs (Codegen.Reset): Reset static data.
9430         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9431         
9432         * cs-tokenizer.cs (Cleanup): Removed.
9433         
9434         * driver.cs (GetSystemDir): Rewrote to one line command.
9435         It caused problem with unloaded dynamic modules.
9436         (UnixParseOption): Removed Exit.
9437         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9438         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9439         Now can be mcs used as library.
9440         
9441         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9442         empty location.
9443         
9444         * location.cs (Reset): Reset static data.
9445         
9446         * namespace.cs (Reset): Reset static data.
9447         
9448         * report.cs (Report.Reset): Reset static data.
9449         
9450         * rootcontext.cs (RootContext.Reset): Reset static data.
9451         
9452         * tree.cs (RootTypes.ctor): Use Location.Null
9453         
9454         * typemanager.cs (TypeManager.Reset): Reset static data.
9455         (CoreLookupType): Removed Exit.
9456         (TypeHandle.Reset): Reset static data.
9457         
9458 2005-03-10  Raja R Harinath  <rharinath@novell.com>
9459
9460         Fix #73516.
9461         * typemanager.cs (ComputeNamespaces): Import namespaces from
9462         referenced modules too.
9463
9464 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9465
9466         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9467         than '.'.
9468
9469 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9470
9471         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9472         enclosing DeclSpace.  This ensures that a name-lookup populates
9473         more caches and there are fewer 'TypeExpression's.  Carve out
9474         nested type lookup into ...
9475         (LookupNestedTypeInHierarchy): ... this.
9476
9477 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9478
9479         Clean up a few partial-class semantics.  
9480         Fixes test-357.cs and cs1618-2.cs.
9481         * cs-parser.jay (struct_declaration): Use 'current_class' as
9482         parent of newly-created struct.  Remove call to Register ().
9483         Use 'pop_current_class' to complete handing the current struct.
9484         (interface_declaration): Likewise.
9485         (class_declaration): Likewise.
9486         (enum_declaration): Use 'current_class' as parent of newly created
9487         enum.
9488         (delegate_declaration): Likewise.
9489         (pop_current_class): New function.  This is used to handle closing
9490         up the 'current_class' and 'current_container', and pointing them
9491         to the enclosing class/container.
9492         (CSharpParser): Initialize 'current_class' too.
9493         * decl.cs (MemberCore): Add check for invariant: a partial
9494         container is not a parsed entity, and thus does not enclose any
9495         parsed members.
9496         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9497         (DeclSpace.BaseTypeExpr): Use it.
9498         (DeclSpace.LookupType): Add check for invariant.
9499         * class.cs (TypeContainer): Add check for invariant: a nested
9500         class should have the same NamespaceEntry as its enclosing class.
9501         (TypeContainer.EmitFieldInitializers): Make virtual.
9502         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9503         MemberCore.
9504         (TypeContainer.Register): Remove.
9505         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9506         null.  Use TypeResolveEmitContext for resolving base types and
9507         interfaces.  Move initialization of Parts.TypeBuilder here from
9508         ...
9509         (TypeContainer.DefineNestedTypes): ... here.
9510         (PartialContainer): Take a Namespace not a NamespaceEntry.
9511         (PartialContainer.Create): Don't use Register.  Call the
9512         appropriate Add... function directly.
9513         (ClassPart): Take both the PartialContainer and the enclosing
9514         class as constructor arguments.
9515         (ClassPart.EmitFieldInitializers): Override.
9516         (ClassPart.PartFindNestedTypes): Remove.
9517         (FieldBase.GetInitializerExpression): Resolve the initializer
9518         expression in the emit context of the enclosing class.
9519         * tree.cs (RootTypes): Remove Register ().
9520         
9521 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9522
9523         * cs-parser.jay: Removed CS0134.
9524         
9525         * driver.cs: Removed CS1901.
9526         
9527         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9528         for predefined types.
9529
9530 2005-03-07  Duncan Mak  <duncan@novell.com>
9531
9532         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9533         well. Fixes bug #73454.
9534
9535 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9536
9537         * cs-tokenizer.cs (xtoken): Add CS1035.
9538         
9539         * class.cs (MethodData.Define): Add CS0683.
9540         (FieldMember.ctor): Add CS0681.
9541
9542 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9543
9544         * ecore.cs (SimpleName.DoResolve): Rename from
9545         SimpleName.DoResolveAllowStatic.
9546         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9547         Pass 'intermediate' flag to MemberStaticCheck.
9548         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9549         of "intermediate" lookups via MemberAccess.
9550         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9551         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9552
9553 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9554
9555         Fix #73394.
9556         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9557         slipped in because of variable names that are identical to a
9558         builtin type's BCL equivalent ('string String;', 'int Int32;').
9559         (PropertyExpr.EmitInstance): Likewise.
9560
9561 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9562
9563         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9564         
9565         * report.cs (warning_ignore_table): Made public.
9566
9567 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9568
9569         Fix #73282.
9570         * class.cs (MethodData.Emit): Pass 'container' to
9571         container.GetObsoleteAttribute instead of 'container.Parent'.
9572
9573 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9574
9575         * cs-parser.jay: Add 1534 error test.
9576
9577         * iterators.cs (Yield.CheckContext): Add error 1629.
9578         (Iterator.ctor): Save unsafe modifier.
9579         (MoveNextMethod.DoEmit): Restore unsafe context.
9580
9581         * namespace.cs (UsingAlias): Better error message.
9582
9583 2005-03-03  Dan Winship  <danw@novell.com>
9584
9585         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9586         the warning message [#73219]
9587
9588 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9589
9590         Fix compile with MCS 1.0.0.0.
9591         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9592         w_restore to not depend on string constant folding.
9593
9594 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9595
9596         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9597         CS0246 check to users who passed 'silent = false'.
9598         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9599         check.
9600         (SimpleName.SimpleNameResolve): Update.
9601         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9602         (MemberAccess.IdenticalNameAndTypeName): Update.
9603         * doc.cs (FindDocumentedTypeNonArray): Update.
9604
9605 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9606
9607         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9608         * parameters.cs (ComputeAndDefineParameters): Remove.
9609         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9610         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9611         Use GetParameterInfo.
9612
9613 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9614
9615         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9616
9617 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9618
9619         Unify DeclSpace.LookupType and DeclSpace.FindType.
9620         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9621         is in charge of defining nested types on demand.
9622         (DeclSpace.LookupType): Use it when the current_type is a
9623         TypeBuilder.  Use LookupTypeDirect for reflected types.
9624         (DeclSpace.FindType): Remove.
9625         (DeclSpace.LookupInterfaceOrClass): Likewise.
9626         (DeclSpace.DefineTypeAndParents): Likewise.
9627         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9628         DeclSpace.LookupType.
9629         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9630         * typemanager.cs (LookupType): Simplify.
9631         (AddUserType): Remove type from negative_hits.
9632         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9633         * class.cs (TypeContainer.FindMembers): Move handling of nested
9634         types ...
9635         (TypeContainer.FindMembers_NestedTypes): ... here.
9636         (TypeContainer.FindNestedType): Implement override.
9637         (ClassPart.FindNestedType): Delegate to PartialContainer.
9638         (ClassPart.PartFindNestedType): Looks up the nested types of the
9639         part alone.
9640
9641 2005-03-02  Martin Baulig  <martin@ximian.com>
9642
9643         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9644         static constructor in static classes.
9645
9646 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9647
9648         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9649         sizeParamIndex is not specified.
9650
9651 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9652
9653         Fix #73117
9654         * report.cs (WarningMessage.IsEnabled): Missing null check.
9655
9656 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9657
9658         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9659         in the fields and not in the properties.
9660
9661 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9662
9663         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9664         fields as well.
9665
9666 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9667
9668         * attribute.cs: Small refactoring (improved robustness).
9669         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9670         (ValidateGuid): Removed.
9671         (Resolve): Removed referenced to above mentioned.
9672         (GetAttributeUsage): Made private and changed to work without
9673         class assistance.
9674         (GetIndexerAttributeValue): Don't crash.
9675         (GetConditionalAttributeValue): Ditto.
9676         (GetClsCompliantAttributeValue): Ditto.
9677         (ExtractSecurityPermissionSet): All attributes exceptions are
9678         error 648.
9679         (GetPropertyValue): New helper.
9680         (GetMethodImplOptions): New method.
9681         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9682         some missing properties.
9683         
9684         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9685         (Method.ApplyAttributeBuilder): Updated.
9686         
9687         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9688         exception.
9689
9690 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9691
9692         Fix #73052.
9693         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9694         non-simple types (array, pointer, reference).
9695
9696 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9697
9698         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9699
9700         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9701         for operators.
9702         (Method.CheckBase): Catch wrong destructor here.
9703         (MethodData.Define): Add errors 550, 668.
9704
9705         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9706
9707         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9708
9709         * pending.cs (VerifyPendingMethods): Add error 551.
9710
9711         * typemanager.cs (CSharpName): Next error report helper.
9712
9713 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9714
9715         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9716         attributes. Removed useless attribute double check.
9717         It saves almost 2MBs for corlib.
9718
9719 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9720
9721         Fix #72924.
9722         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9723         called twice in case of error.
9724
9725 2005-02-23  Chris Toshok  <toshok@ximian.com>
9726
9727         Fix compiler portions of #72827.
9728         * statement.cs (Block.Emit): call Begin/EndScope on the
9729         EmitContext instead of the ILGenerator.
9730
9731         * codegen.cs (EmitContext.BeginScope): new method, call
9732         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9733         we have one.)
9734         (EmitContext.BeginScope): same, but EndScope and CloseScope
9735
9736         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9737         offset and call the superclass's OpenScope(int) with it.
9738         (SymbolWriter.CloseScope): get the current il
9739         offset and call superclass's CloseScope(int) with it.
9740
9741 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9742
9743         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9744         CS1677 for out and ref as well.
9745
9746         * class.cs (Method.Define): Add error CS1599 detection.
9747         
9748         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9749         
9750         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9751         
9752         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9753         
9754         * support.cs.cs (ModifierDesc): New helper method.
9755
9756 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9757             Abin Thomas  <projectmonokochi@rediffmail.com>
9758             Anoob V E  <projectmonokochi@rediffmail.com>
9759             Harilal P R  <projectmonokochi@rediffmail.com>
9760
9761         Fix #57851, #72718.
9762         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9763         MemberLookup (used for error reporting) actually returns a result.
9764         Fix error report number (122, not 112).
9765
9766 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9767             Anoob V E  <projectmonokochi@rediffmail.com>
9768             Harilal P R  <projectmonokochi@rediffmail.com>
9769
9770         Fix #71134.
9771         * pending.cs (PendingImplementation.GetAbstractMethods):
9772         Find NonPublic members too.
9773
9774 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9775
9776         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9777         Fixed error 217.
9778         
9779         * class.cs (MethodCore.CheckMethodAgainstBase):
9780         Add error 239 report.
9781
9782 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9783
9784         Fix #68955.
9785         * expression.cs (Invocation.IsApplicable): Make public.
9786         (Invocation.IsParamsMethodApplicable): Likewise.
9787         * delegate.cs (Delegate.VerifyApplicability): Don't use
9788         Invocation.VerifyArgumentCompat for parameter applicability
9789         testing.  Use Invocation.IsApplicable and
9790         Invocation.IsParamsMethodApplicable.
9791
9792 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9793
9794         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9795         
9796         * class.cs (Operator.Define): Add error 217 report.
9797         
9798 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9799
9800         * namespace.cs (UsingEntry.Resolve): Undo change below.
9801
9802 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9803
9804         Fix #72756.
9805         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9806         disable the error message when the extended MemberLookup also
9807         fails.
9808         (Expression.MemberLookupFinal): Update.
9809         (SimpleName.DoSimpleNameResolve): Update.
9810         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9811         Don't use MemberLookupFinal.
9812         (New.DoResolve): Update.
9813         (BaseAccess.CommonResolve): Update.
9814
9815 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9816
9817         Fix #72732.
9818         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9819         occured previously, don't resolve again.
9820
9821 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9822
9823         Fix #69949
9824         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9825         argument. Call ResolveAttributeUsage for unresolved.
9826         when types doesn't match ctor arguments.
9827         
9828         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9829         for nested attribute classes.
9830         (Class.attribute_usage): Removed.
9831         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9832         for attribute class.
9833         
9834         * ecore.cs (IsAttribute): Removed.
9835         
9836         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9837         
9838         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9839         now normal types.
9840         (attribute_types): Removed.
9841         (EmitCode): Global attributes are emited as the latest.
9842
9843 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9844
9845         * class.cs (EmitFieldInitializers): Don't emit field initializer
9846         for default values when optimilization is on.
9847         
9848         * constant.cs (Constant.IsDefaultValue): New property.
9849         
9850         * driver.cs: Add /optimize handling.
9851         
9852         * constant.cs,
9853         * ecore.cs,
9854         * literal.cs: Implement new IsDefaultValue property.
9855         
9856         * rootcontext.cs (Optimize): New field, holds /optimize option.
9857
9858 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9859
9860         Fix crasher in re-opened #72347.
9861         * namespace.cs (Namespace.Lookup): Return null if
9862         DeclSpace.DefineType returns null.
9863
9864         Fix #72678.
9865         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9866
9867 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9868
9869         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9870         now returns null if it cannot resolve to an lvalue.
9871         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9872         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9873         returned null.  Remove check for SimpleName.
9874         (EventExpr.DoResolveLValue): New.
9875         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9876         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9877         error from ...
9878         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9879         avoid CS0131 error.
9880         (Unary.ResolveOperator): Move CS0211 check ...
9881         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9882         CS0131 error.
9883         (Unary.DoResolveLValue): Simplify.
9884         (AddressOf.DoResolveLValue): New.
9885         (ArrayAccess.DoResolveLValue): New.
9886
9887 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9888
9889         * attribute.cs (Attribute.Resolve): Add arguments casting for
9890         when types doesn't match ctor arguments.
9891
9892 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9893
9894         Fix parts of #63202.
9895         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9896         lookup of operator in base type.  Ensure that all checks happen
9897         when the operator resolves to an "op_..." method.
9898
9899 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9900
9901         Fix #71992.
9902         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9903         'ignore_cs0104' parameter.  Pass it to ...
9904         (NamespaceEntry.Lookup): ... this.
9905         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9906         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9907         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9908         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9909         Update.  Request that cs0104 errors be ignored.
9910         (ComposedCast.ResolveAsTypeStep): Update.
9911
9912 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9913
9914         Fix #59209.
9915         * expression.cs (Invocation.BetterFunction): Remove support for
9916         comparing virtual functions and their overrides.
9917         (Invocation.IsOverride): New.
9918         (Invocation.OverloadResolve): Don't consider 'override' functions
9919         during candidate selection.  Store them in a lookaside list.
9920         If the selected method is a 'virtual' function, use the list to
9921         find any overrides that are closer to the LHS type.
9922
9923 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9924
9925         * expression.cs (New.DoResolve): Add complex core type reduction.
9926         (New.Constantify): Converts complex core type syntax like 'new int ()'
9927         to simple constant.
9928         
9929 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9930
9931         * decl.cs (EntryType.EntryType): New constructor to create an
9932         updated copy of a cache entry.
9933         (MemberCache.AddMethods): Use it.
9934         (MemberCache.ClearDeclaredOnly): Remove.
9935         (MemberCache.MemberCache): Update.
9936
9937 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9938
9939         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9940         variable.  This one is represents the actual low-level declaration
9941         of the method, as opposed to the semantic level `IsStatic'.   
9942
9943         An anonymous method which is hosted into a static method might be
9944         actually an instance method.  IsStatic would reflect the
9945         container, while MethodIsStatic represents the actual code
9946         generated.
9947
9948         * expression.cs (ParameterReference): Use the new MethodIsStatic
9949         instead of IsStatic.
9950
9951         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9952         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9953         set on the current EmitContext. 
9954
9955         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9956         resolve our casted expression as an LValue.  This triggers the
9957         proper LValue processing that is later required by Assign.
9958
9959         This fixes 72347.
9960
9961         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9962
9963 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9964
9965         C# 2.0 Fixed buffer implementation
9966
9967         * anonymous.cs: Update after RegisterHelperClass renaming.
9968
9969         * attribute.cs (AttributeTester.fixed_buffer_cache):
9970         Cache of external fixed buffers.
9971         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9972         implementation if field is fixed buffer else null.
9973
9974         * class.cs
9975         (TypeContainer.AddField): Accept FieldMember instead of Field.
9976         (FieldBase.IsFieldClsCompliant): Extracted code from
9977         VerifyClsCompliance descendant customization.
9978         (FixedField): New class handles fixed buffer fields.
9979         (FixedFieldExternal): Keeps information about imported fixed
9980         buffer.
9981         (IFixedField): Make access to internal or external fixed buffer
9982         same.
9983
9984         * cs-parser.jay: Add fixed buffer parsing.
9985
9986         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9987         buffer.
9988
9989         * expression.cs (Indirection): Extended implementation to accept
9990         fixed buffer field.
9991         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9992         (ElementAccess.MakePointerAccess): Get type as parameter.
9993         (DoResolve): Add fixed buffer field expression conversion.
9994         (DoResolveLValue): Ditto.
9995         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9996         (ArrayPtr): Derives from FixedBufferPtr.
9997         (ArrayPtr.Emit): Add extra emit for array elements.
9998
9999         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
10000
10001         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
10002         for compiler generated types.
10003         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
10004
10005         * statement.cs (Fixed): Refactored to be easier add fixed buffer
10006         and consume less memory.
10007         (Fixed.Resolve): Add fixed buffer case.
10008
10009         * typemanager.cs (compiler_generated_attr_ctor,
10010         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
10011         (HasElementType): Add our own implementation to work on every
10012         runtime.
10013
10014 2005-02-11  Miguel de Icaza  <miguel@novell.com>
10015
10016         * anonymous.cs (CaptureContext): Track whether `this' has been
10017         referenced.   
10018
10019         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
10020         only captured `this' if it was implicitly done (instance
10021         methods/variables were used). 
10022
10023         * codegen.cs (EmitContext.CaptureThis): New method to flag that
10024         `this' must be captured.
10025
10026 2005-01-30  Miguel de Icaza  <miguel@novell.com>
10027  
10028         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
10029         is null it means that there has been no need to capture anything,
10030         so we just create a sibling.
10031
10032         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
10033
10034         Just a partial fix.  The other half is fairly elusive.
10035         
10036 2005-02-10  Raja R Harinath  <rharinath@novell.com>
10037
10038         Fix #52586, cs0121-4.cs.
10039         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
10040         and return a hashtable.
10041         (MemberCache.ClearDeclaredOnly): New.
10042         (MemberCache.MemberCache): Update to change.  Make a deep copy of
10043         the method_hash of a base type too.
10044         (MemberCache.AddMethods): Adapt to having a deep copy of the base
10045         type methods.  Overwrite entries with the same MethodHandle so
10046         that the ReflectedType is correct.  The process leaves in base
10047         virtual functions and their overrides as distinct entries.
10048         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
10049         matters since it was boxed in a ArrayList before.
10050         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
10051         modifier.
10052         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
10053         case of a virtual function and its override (choose the overload
10054         as better).
10055         (Invocation.OverloadResolve): Avoid 'override' members during
10056         'applicable_type' calculation.
10057
10058 2005-02-09  Raja R Harinath  <rharinath@novell.com>
10059
10060         Combine two near-redundant caches.
10061         * typemanager.cs (method_params): Rename from method_internal_params.
10062         (TypeManager.GetParameterData): New.  Replace
10063         Invocation.GetParameterData.
10064         (TypeManager.LookupParametersByBuilder): Remove.
10065         * expression.cs (Invocation.method_parameter_cache): Remove.
10066         (Invocation.GetParameterData): Remove.
10067         Update to changes.
10068         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
10069         Update to changes.
10070
10071 2005-02-08  Raja R Harinath  <rharinath@novell.com>
10072
10073         Fix #72015.
10074         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
10075         TypeManager.multicast_delegate_type is null, resolve it by looking
10076         up "System.MulticastDelegate".
10077         * rootcontext.cs (RootContext.ResolveCore): Simplify.
10078
10079 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
10080             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
10081             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
10082
10083         Fix cs0164.cs.
10084         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
10085         (LabeledStatement.AddReference): New.  Set 'referenced'.
10086         (Goto.Resolve): Use it.
10087
10088 2005-02-05  John Luke  <john.luke@gmail.com>
10089
10090         * driver.cs: remove duplicate -doc line in Usage ()
10091
10092 2005-02-04  Raja R Harinath  <rharinath@novell.com>
10093
10094         * location.cs (Location.AddFile): Fix CS2002 error report.
10095
10096 2005-02-02  Martin Baulig  <martin@ximian.com>
10097
10098         * delegate.cs (Delegate.DefineType): Report an internal error if
10099         TypeManager.multicast_delegate_type is null.  See bug #72015 for
10100         details.        
10101
10102 2005-02-02  Raja R Harinath  <rharinath@novell.com>
10103
10104         Fix a crasher in a variant of #31984.
10105         * const.cs (Constant.CheckBase): New override that defers the
10106         new-or-override check in case the base type hasn't been populated
10107         yet.
10108         (Constant.Define): Ensure the new-or-override check is performed.
10109
10110 2005-02-01  Duncan Mak  <duncan@ximian.com>
10111
10112         * const.cs (LookupConstantValue): Check that `ce' is not null
10113         before calling GetValue ().
10114
10115 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10116
10117         Fix test-334.cs (#69519).
10118         * cs-parser.jay (using_alias_directive): Pass in an expression to
10119         NamespaceEntry.UsingAlias.
10120         (using_namespace_directive): Pass in an expression to
10121         NamespaceEntry.Using.
10122         (namespace_name): Don't flatten to a string.
10123         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
10124         (NamespaceEntry.AliasEntry.Resolve): Lookup using
10125         ResolveAsTypeStep.
10126         (NamespaceEntry.UsingEntry): Likewise.
10127         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
10128         changes.
10129         (NamespaceEntry.LookupForUsing): Remove.
10130         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
10131         names.
10132         (NamespaceEntry.Lookup): Remove support for dotted names.
10133
10134 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10135
10136         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
10137         split into two.
10138         (NamespaceEntry.ImplicitParent): Compute on demand.
10139         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
10140         parallels the current.
10141         (NamespaceEntry.LookupForUsing): Use it.
10142         (NamespaceEntry.Lookup): If the current namespace-entry is
10143         implicit, don't search aliases and using tables.
10144
10145 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10146
10147         Fix #31984.
10148         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
10149         BaseCache here.
10150         (TypeContainer.BaseCache): Compute on demand.
10151         (TypeContainer.FindMembers): Define constants and types if they're
10152         not already created.
10153         (FieldMember.Define): Move resetting of ec.InUnsafe before error
10154         check.
10155         * const.cs (Constant.Define): Make idempotent.
10156
10157 2005-01-29  Miguel de Icaza  <miguel@novell.com>
10158
10159         * pending.cs: Produce better code (no nops produced by using Ldarg
10160         + value).
10161         
10162         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
10163         i - 1' it should be arg + 1.
10164
10165         Fixes bug #71819.
10166
10167 2005-01-28  Raja R Harinath  <rharinath@novell.com>
10168
10169         * attribute.cs (Attribute.CheckAttributeType): Make private
10170         non-virtual.
10171         (Attribute.ResolveType): Make virtual.
10172         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10173         handling of RootContext.Tree.Types.
10174
10175 2005-01-27  Raja R Harinath  <rharinath@novell.com>
10176
10177         Update attribute-handling to use the SimpleName/MemberAccess
10178         mechanisms.
10179         * cs-parser.jay (attribute): Pass in an expression to the
10180         constructors of Attribute and GlobalAttribute.
10181         * attribute.cs (Attribute): Take an expression for the name.
10182         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
10183         passed in attribute name expression.
10184         (Attribute.CheckAttributeType): Use it.
10185         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10186         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10187         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
10188         argument to prevent error messages if the lookup fails.
10189
10190 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
10191
10192         * expression.cs (Indirection): Implemented IVariable interface
10193         to support indirection in AddressOf operator.
10194         (PointerArithmetic.Emit): Add optimalization for case where
10195         result can be precomputed.
10196
10197 2005-01-26  Martin Baulig  <martin@ximian.com>
10198
10199         * class.cs (TypeContainer.AttributeTargets): Return the correct
10200         AttributeTargets depending on our `Kind' instead of throwing an
10201         exception; fixes #71632.
10202
10203 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
10204
10205         Fix #71257
10206         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10207         constant members.
10208
10209 2005-01-25  Raja R Harinath  <rharinath@novell.com>
10210
10211         Fix #71602.
10212         * expression.cs (MemberAccess.DoResolve): Don't complain with
10213         cs0572 when the LHS of a member access has identical name and type
10214         name.
10215
10216 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
10217
10218         Fix #71651, #71675
10219         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10220         CreatePermission.
10221         Create custom PermissionSet only for PermissionSetAttribute.
10222
10223 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
10224
10225         Fix #71649
10226         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10227         delegates in static class.
10228
10229 2005-01-24  Martin Baulig  <martin@ximian.com>
10230
10231         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10232         merging an implicit block, just use its reachability.
10233
10234         * statement.cs (Block.Resolve): Make the unreachable code check
10235         work wrt. implicit blocks; see test-337 from #63842.
10236
10237 2005-01-21  Alp Toker  <alp@atoker.com>
10238  
10239         * cs-parser.jay: destructor_declaration's container is PartialContainer
10240         not Class when partial types are used, so use Kind prop instead of
10241         'is'.
10242         
10243 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
10244
10245         * cs-parser.jay: Improve error reporting when an interface
10246         declares new types.
10247
10248 2005-01-20  Dick Porter  <dick@ximian.com>
10249
10250         * support.cs: SeekableStreamReader fix from Sandor Dobos
10251         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10252         chars are read.  Fixes bug 70369.
10253
10254 2005-01-20  Raja R Harinath  <rharinath@novell.com>
10255
10256         * cs-parser.jay (catch_clause): Simplify current_block handling
10257         somewhat.
10258
10259 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
10260
10261         * convert.cs (ImplicitStandardConversionExists): Synchronize the
10262         code with ImplicitStandardConversion to handle the implicit
10263         conversion of method groups into valid delegate invocations. 
10264
10265         The problem is that in parameter handling we were using this code
10266         path.  Fixes bug #64698
10267
10268 2005-01-19  Raja R Harinath  <rharinath@novell.com>
10269
10270         * cs-parser.jay: Fix several infelicities.
10271         - Avoid assigning to the parser value stack.  Code like 
10272           '$3 = null' is unclean.  Synthesize a value for the code block
10273           instead. 
10274         - Avoid using oob_stack for storing location information.  Use ...
10275         (_mark_): ... this.  New (empty) rule.  Saves the current location
10276         in $$.
10277         (foreach_statement): Avoid using oob_stack for current_block
10278         handling.  Use technique used in for_statement and
10279         using_statement.  Synthesize a value for the code block to store
10280         additional intermediate information.
10281
10282 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10285         of a different type is only allowed to private fields of a
10286         containing type, not on fields of a base class.
10287
10288         See test-174.cs and error cs0122-9.cs
10289
10290 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10291
10292         Fix test-335.cs (bug #58126).
10293         * cs-parser.jay (argument): Split out non-expression parts of the
10294         rule into 'non_simple_argument'.
10295         (invocation_expression): Support parenthesized invocations with
10296         multiple arguments, and with single non-simple arguments.
10297
10298 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10299
10300         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10301         places.
10302
10303 2005-01-12  Raja R Harinath  <rharinath@novell.com>
10304
10305         Fix cs0038-1.cs, cs1640-6.cs.
10306         * ecore.cs (Expression.Resolve): Remove special-case for
10307         SimpleName in error-handling.
10308         (Expression.almostMatchedMembers): Relax access permission to
10309         protected.
10310         (Expression.MemberLookupFailed): Handle duplicates in
10311         almostMatchedMembers list.
10312         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10313         * expression.cs (New.DoResolve): Report CS1540 for more cases.
10314         * typemanager.cs (GetFullNameSignature): Use the MethodBase
10315         overload if the passed in MemberInfo is a MethodBase.
10316
10317 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
10318
10319         Fix #70749
10320         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10321         for non-CAS & merge permission sets properly.
10322
10323 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10324
10325         Improve standard-compliance of simple name and member access 
10326         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
10327         * ecore.cs (FullNamedExpression): New abstract base class 
10328         for Namespaces and TypeExpressions.
10329         (ResolveFlags.SimpleName): Remove.
10330         (SimpleName): Remove support for dotted names.
10331         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
10332         DeclSpace.FindType and DeclSpace.LookupType.
10333         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10334         (Expression.ExprClassName): Make member function.
10335         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10336         a namespace.  Remove creation of dotted "SimpleName"s.
10337         (MemberAccess.DoResolve): Likewise.
10338         * decl.cs (DeclSpace.Cache): Make private.
10339         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10340         (DeclSpace.FindType): Update.
10341         (DeclSpace.LookupType): Move here from RootContext.  Return a 
10342         FullNamedExpression.
10343         * namespace.cs (Namespace): Derive from FullNamedExpression
10344         so that it can be part of expression resolution.
10345         (Namespace.Lookup): Return an FullNamedExpression.
10346         (NamespaceEntry.LookupAlias): Lookup aliases only in current
10347         namespace.
10348         * rootcontext.cs (NamespaceLookup): Remove.
10349         (LookupType): Move to DeclSpace.
10350         * attribute.cs (CheckAttributeType): Update.
10351         * doc.cs (FindDocumentedType): Remove allowAlias argument.
10352         (FindDocumentedTypeNonArray): Likewise.
10353
10354 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10355
10356         Fix cs0509.cs, cs1632.cs.
10357         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10358         is the same as IsInterface.
10359         (TypeContainer.GetClassBases): Likewise.
10360         * statement.cs (LabeledStatement.ig): New field.
10361         (LabeledStatement.LabelTarget): Save ILGenerator which created the
10362         label.
10363         (LabeledStatement.DoEmit): Check that the label was created with
10364         the same ILGenerator.
10365
10366 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10367
10368         Fix #71058
10369         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10370         accessors to its properties.
10371
10372         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10373         from accessors to property.
10374         
10375 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10376
10377         Fix #70722
10378         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10379         only for overrides.
10380         
10381 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
10382
10383         * attribute.cs: Check for null and empty strings.  
10384
10385         I have lost another battle to Paolo.
10386
10387 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
10388
10389         Fix #70942
10390         * class.cs (PropertyMethod): Set Parent field in ctors.
10391         (SetMethod.InternalParameters): Add unsafe switch hack.
10392         Override MarkForDuplicationCheck where it is appropriate.
10393
10394         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10395         It says whether container allows members with the same name.
10396         Base default is no.
10397         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10398         Removed is_method parameter.
10399
10400 2005-01-06  Duncan Mak  <duncan@ximian.com>
10401
10402         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10403         because the previous change led to incorrect reporting of CS1032
10404         ("Cannot define/undefine preprocessor symbols after first token in
10405         file"). Instead of using `tokens_seen' as the only flag that
10406         triggers CS1040, introduce `comments_seen'. This new flag is used
10407         to signify having seen comments on the current line, so it is
10408         unset after a newline.
10409
10410 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10411
10412         * doc.cs : When searching for a type, find nested type too.
10413           This fixes bug #71040.
10414
10415 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10416
10417         * doc.cs :
10418           - Warn missing member comment on those classes which also does not
10419             have doc comments. Fixed bug #71041.
10420           - Don't warn missing doc comment on default constructor.
10421             Fixed bug #71042.
10422
10423 2005-01-06  Duncan Mak  <duncan@ximian.com>
10424
10425         * cs-tokenizer.cs (xtoken): After handling traditional C-style
10426         comments, set `tokens_seen' to true. This allows us to detect
10427         misplaced preprocessor directives (i.e. not at the beginning of
10428         the a line, nor after whitespaces). In that case, report error
10429         CS1040. This fixes bug #56460.
10430
10431         * cs-parser.jay (interface_member_declaration): Add checks for
10432         IsExplicitImpl, and report CS0541 error if an interface member is
10433         defined as an explicit interface declaration.
10434
10435 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
10436
10437         Fix #70817
10438         * class.cs (PropertyMethod): Set Parent field in ctors.
10439         (SetMethod.InternalParameters): Add unsafe switch hack.
10440         
10441         * decl.cs (MemberCore.Parent): Cannot be readonly.
10442
10443 2005-01-06  Raja R Harinath  <rharinath@novell.com>
10444
10445         * decl.cs (DeclSpace.ResolveType): Remove.
10446         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10447         Merge in code from ...
10448         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
10449         * class.cs, enum.cs: Update to changes.
10450
10451 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * anonymous.cs: Ensure that we init the scope of our parent if it
10454         has not been initialized yet.
10455
10456 2004-12-30  Duncan Mak  <duncan@ximian.com>
10457
10458         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10459         if field.FieldBuilder is null. Fixes #70758.
10460
10461         * convert.cs: Fixed some typos and updated some of the comments.
10462         (ImplicitStandardConversionExists):
10463         (TryImplicitIntConversion): If `target_type' is an interface and
10464         the type of `ic' implements this interface, return true or a new
10465         BoxedCast instead of null. This fixes #70468.
10466
10467 2004-12-29  Duncan Mak  <duncan@ximian.com>
10468
10469         * expression.cs (Argument.Emit): Check that Expr is
10470         IMemoryLocation before casting to it, and report CS1510 otherwise.
10471
10472         This fixes #70402.
10473
10474 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
10475
10476         * statement.cs (Block.ThisVariable): remove the recursion here, to
10477         make the --profile more sane.
10478
10479 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
10480
10481         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10482         assembly, by JB Evain.
10483
10484 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10485
10486         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
10487           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10488         "parent" refers to enclosing type/class.  "base" refers to superclass.
10489
10490 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10491
10492         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10493         Ensure that we only have GlobalAttributes.
10494         * attribute.cs (Attribute.Emit): Make non-virtual.
10495         (GlobalAttribute.Emit): Remove.
10496         (Attribute.Resolve): Make virtual.
10497         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
10498         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10499         the argument. Don't create one.
10500         (Attribute.GetObsoleteAttribute): Likewise.
10501         (Attribute.GetClsCompliantAttributeValue): Likewise.
10502         * class.cs, decl.cs: Update to changes.
10503
10504 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
10505
10506         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10507         
10508         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10509         
10510         * statement.cs (Foreach.Resolve): Add error 186 report.
10511
10512 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10513
10514         * expression.cs (Conditional.DoResolve): Add warning 429.
10515         
10516         * statement.cs (If.Resolve): Add warning 665.
10517
10518 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10519
10520         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10521         except when in the parser, and in GlobalAttribute.
10522         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10523         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10524         RootContext.Tree.Types.NamespaceEntry once work is done.
10525         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10526         and resets RootContext.Tree.Types.NamespaceEntry.
10527
10528 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10529
10530         * cs-parser.jay: Don't create a block for every variable.
10531
10532 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * location.cs: Provide extra information.
10535
10536         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10537         variables from the captured environment, it is the ldarg_0.
10538
10539 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10540
10541         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10542         find a conclusion.
10543         
10544         * class.cs: Changed warning level for 169 to avoid developer
10545         displeasure from warning flooding. It will be changed back when they
10546         fix most of current BCL warnings.
10547         
10548         * RootContext.cs: Pushed default WarningLevel to 3.
10549         
10550         * statement.cs: Removed unused variable.
10551
10552 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10553
10554         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10555         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10556         Add error 502 report.
10557         (StaticClass.DefineType): Add error 441 report.
10558         (Class.AllowedModifiersProp): New virtual property as temporary
10559         extension to AllowedModifiers.
10560         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10561         to share implementation with StaticClass and don't call virtual
10562         methods from ctor.
10563         
10564         * driver.cs (MainDriver): Add error 1558 test.
10565
10566         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10567         report. Moved error 36 test here.
10568
10569         * statement.cs (Throw.Resolve): Add error 724 report.
10570
10571         * typemanager.cs: Add out_attribute_type core type.
10572         
10573 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10574
10575         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10576         3018 report.
10577         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10578
10579         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10580         3017 report.
10581         
10582         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10583
10584         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10585         Add error 3023 report.
10586         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10587
10588         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10589         implementation.
10590
10591 2004-12-12  John Luke  <john.luke@gmail.com>
10592
10593         * driver.cs (AddArgs): take -- into account when
10594         adding arguments, fixes bug 65710 
10595
10596 2004-12-12  Martin Baulig  <martin@ximian.com>
10597
10598         * expression.cs (Unary.TryReduceNegative): Added support for
10599         SByteConstant and ByteConstant.
10600         (Unary.Reduce): Check error values from TryReduceNegative().
10601
10602 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10603
10604         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10605         and report exception as error 182.
10606
10607 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10608
10609         * driver.cs (Main): Fix message when there are warnings.
10610
10611 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10614
10615 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10616
10617         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10618         Reduced number of warnings.
10619         
10620         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10621
10622 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10623
10624         * driver.cs: Removed message.
10625
10626         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10627
10628 2004-12-08    <vargaz@freemail.hu>
10629
10630         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10631
10632 2004-12-08  Martin Baulig  <martin@ximian.com>
10633
10634         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10635         instead of a CS3002 for properties and indexer.
10636
10637 2004-12-08  Martin Baulig  <martin@ximian.com>
10638
10639         * decl.cs (MemberName.ToString): Make this work again.
10640
10641 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10642
10643         * attribute.cs (Resolve): Add error 591 detection.
10644
10645         * class.cs (FieldMember.Define): Add error 1547 detection.
10646         (Indexer.Define): Add error 620 detection.
10647         (Operator.Define): Add error 590 detection.
10648
10649         * ecore.cs: Missing argument for error 79.
10650
10651         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10652         detection.
10653
10654 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10655
10656         Fix #70106
10657         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10658         only.
10659
10660 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10661
10662         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10663           Some operator comments were suppressed.
10664         * doc.cs : Implicit/explicit operator name in doc comments are like
10665           "op_Explicit(type)~returnType", so added suffix handling.
10666
10667 2004-12-07  Martin Baulig  <martin@ximian.com>
10668
10669         * decl.cs
10670         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10671         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10672         (DeclSpace.ec): New protected field; store the EmitContext here.
10673         (DeclSpace.EmitContext): New public property; moved here from
10674         `TypeContainer'.
10675         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10676         EmitContext.
10677
10678         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10679         (Enum.Emit): Don't create a new EmitContext.
10680
10681         * delegate.cs (Delegate.DefineType): Always create the
10682         EmitContext.
10683
10684         * iterators.cs (Iterators.DefineIterator): Create a new
10685         EmitContext and store it in `ec'.
10686
10687 2004-08-24  Martin Baulig  <martin@ximian.com>
10688
10689         * typemanager.cs
10690         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10691         this for accessibility checks.
10692         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10693         IsNestedFamilyAccessible.
10694         (TypeManager.IsSubclassOf): New method, do what the name actually
10695         says.   
10696
10697 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10698
10699         Fix crash on cs0657-17.cs.
10700         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10701         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10702         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10703         the case where the NamespaceEntry gets overwritten.
10704
10705 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10706
10707         Fixed #69195, #56821
10708         * ecore.cs (ResolveBoolean): Tiny refactoring.
10709
10710         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10711         of right expression resolving when left is false constant and
10712         operator is LogicalAnd OR true constant and operator is LogicalOr.
10713
10714         * statement.cs (ResolveUnreachable): Always reports warning.
10715
10716 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10717
10718         * class.cs: Distinguish between 1721 and 1722 (just a little help
10719         for the programmer).
10720
10721 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * delegate.cs: Only allow this on new versions of the language. 
10724
10725 2004-12-02  Duncan Mak  <duncan@ximian.com>
10726
10727         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10728         Expression class.
10729         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10730         here as a static method. Take an additional bool out parameter
10731         `must_do_cs1540_check' for signaling to InstanceResolve.
10732         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10733         member field from PropertyExpr class and made it an argument of
10734         the method instead.
10735         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10736         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10737         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10738         and `remove_accessor' as well as InstanceResolve: report CS0122
10739         where applicable.
10740
10741         Fixes #70129.
10742
10743 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10744
10745         Fix test-327.cs, test-328.cs, and put in early infrastructure
10746         for eventually fixing #52697.
10747         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10748         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10749         from other methods.
10750         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10751         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10752         (VerifyUsing, error246): Update.
10753         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10754         'NamespaceEntry.LookupNamespaceOrType'.
10755
10756 2004-12-03  Martin Baulig  <martin@ximian.com>
10757
10758         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10759         method as our child, call AnonymousMethod.Compatible() on it.
10760
10761 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10762
10763         Disable XML documentation support in 'basic' profile.
10764         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10765         Redirect XmlElement to System.Object.
10766         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10767         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10768         * mcs.exe.sources: Add doc-bootstrap.cs.
10769         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10770         of doc.cs.
10771
10772 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10773
10774         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10775           comments are allowed.
10776
10777 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10778
10779         * delegate.cs: Add checks for subtypes in paramaters and return values
10780         in VerifyMethod () to add support for Covariance/Contravariance
10781         in delegates.
10782         
10783 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10784
10785         * report.cs: Remove extra closing parenthesis.
10786
10787         * convert.cs (Error_CannotImplicitConversion): If the name of the
10788         types are the same, provide some extra information.
10789
10790         * class.cs (FieldBase): Use an unused bit field from the field to
10791         encode the `has_offset' property from the FieldMember.  This saves
10792         a couple of Ks on bootstrap compilation.
10793
10794         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10795         method as our child, return the AnonymousMethod resolved
10796         expression.
10797
10798         * expression.cs (New.DoResolve): Allow return values from
10799         NewDelegate to also include AnonymousMethods.
10800
10801         Fixes #70150.
10802
10803 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10804
10805         Fix bug #70102
10806         * attribute.cs (Resolve): Improved implementation of params
10807         attribute arguments.
10808
10809         * support.cs (ParameterData): Add HasParams to be faster.
10810
10811 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10812
10813         all things are for /doc support:
10814
10815         * doc.cs: new file that supports XML documentation generation.
10816         * mcs.exe.sources: added doc.cs.
10817         * driver.cs:
10818           Handle /doc command line option.
10819           Report error 2006 instead of 5 for missing file name for /doc.
10820           Generate XML documentation when required, after type resolution.
10821         * cs-tokenizer.cs:
10822           Added support for picking up documentation (/// and /** ... */),
10823           including a new XmlCommentState enumeration.
10824         * cs-parser.jay:
10825           Added lines to fill Documentation element for field, constant,
10826           property, indexer, method, constructor, destructor, operator, event
10827           and class, struct, interface, delegate, enum.
10828           Added lines to warn incorrect comment.
10829         * rootcontext.cs :
10830           Added Documentation field (passed only when /doc was specified).
10831         * decl.cs:
10832           Added DocComment, DocCommentHeader, GenerateDocComment() and
10833           OnGenerateDocComment() and some supporting private members for
10834           /doc feature to MemberCore.
10835         * class.cs:
10836           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10837         * delegate.cs:
10838           Added overriden DocCommentHeader.
10839         * enum.cs:
10840           Added overriden DocCommentHeader and GenerateDocComment().
10841
10842 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10845         unwrapping the enumeration values, chain to
10846         DoConstantNumericPromotions again, so we can promote things to the
10847         fundamental types (takes care of enums that are bytes, sbytes).
10848
10849         Fixes bug #62054.
10850
10851 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10852
10853         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10854         Fix long-standing bug in type-lookup.  Use FindType instead of
10855         LookupType when ec.ResolvingTypeTree.
10856         (Attribute.ResolveType, Attribute.Resolve)
10857         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10858         Update to changes.
10859         (Attributes.Search): Remove internal version.  Update.
10860         (Attributes.SearchMulti): Update.
10861         (Attributes.GetClsCompliantAttribute): Remove.
10862         (Attributes.GetIndexerNameAttribute): Remove.
10863         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10864         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10865         * class.cs (Indexer.Define): Likewise.
10866
10867 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10868
10869         Fix bug #68790
10870         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10871         MarshallByReference members access.
10872
10873         * expression.cs: Use CheckMarshallByRefAccess;
10874         Better error CS0197 message.
10875
10876         * report.cs: Print whole related error message.
10877
10878 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10879
10880         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10881         the current directory to help debugging.
10882
10883 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10884
10885         * class (GetClassBases): Better error 60 report.
10886         (EventProperty): Disabled warning 67 detection.
10887
10888 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10889
10890         Fix bug #60324
10891         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10892
10893         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10894         precise values.
10895
10896 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10897
10898         Fix bug #49488
10899         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10900
10901         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10902
10903 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10904
10905         * attribute.cs (Attribute.Resolve): Refine error reporting and
10906         report a cs0117 if the identifier does not exist, to distinguish
10907         from 0617 which is a miss-use of the actual identifier.
10908
10909         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10910         between cs0070 and cs0079.
10911
10912         * class.cs (MemberBase.DoDefine): When reporting a wrong
10913         accessibility level, we use MethodCore to compare instead of
10914         Method (this was a regression in some refactoring effort).
10915
10916         So now we correctly report cs0056 again.
10917
10918         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10919         testing the target_type (which was known to be object_type) and
10920         not the source type (which is anonymous_method).
10921
10922         Fixed reporting of error cs1660.
10923
10924         * expression.cs (UserCast.Source): Expose the underlying cast.
10925
10926         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10927         allowed types to find a match to int32 first (most common).
10928
10929         In addition, it ignores any ImplicitUserConversions that did an
10930         internal implicit conversion (as the switch statement allows only
10931         one integral conversion to exist).
10932
10933         * class.cs (PartialContainer.Create): rename `name' to
10934         `member_name' for clarity.  Then replace the string calls with a
10935         call to MemberName.GetPartialName, as now using
10936         MemberName.ToString is an error (this is due to the side effects
10937         it had, that were fixed in the past).
10938
10939         This will restore the error reporting on a number of partial class
10940         errors that were missusing this (and getting an exception as a
10941         results, which is now just a plain textual warning, because
10942         yyparse debug output would crash otherwise).
10943
10944 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10945
10946         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10947
10948 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10949
10950         * rootcontext.cs (LookupType): Make sure to cache lookups that
10951         don't give us a negative result. This saves about 5% of corlib
10952         compilation time.
10953
10954 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10955
10956         * report.cs (AbstractMessage.Print): messages are sent to stderr
10957
10958         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10959         non-interface in the list of interfaces (at this point, either
10960         parent was properly set, or a base class is being listed in the
10961         interfaces section).
10962
10963         This flags error 1722, and resolves the crash from bug 69259.
10964
10965 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10966
10967         * statement.cs (Using.EmitExpressionFinally): make this work right
10968         for valuetypes. Fixes 69926.
10969
10970 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10971
10972         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10973         converted to an enum" here, before we try to change the underlying
10974         type.  This code exists, but it is a different code path than the
10975         one used while encoding constants.
10976
10977         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10978         old bug: when converting from the null literal to a pointer,
10979         return an EmptyCast, not the NullLiteral.
10980
10981         This fixes #69921, the recent null_type changes probably made this
10982         bug more prominent.
10983
10984         (ImplicitReferenceConversionExists): In addition, resynchronized
10985         the code here, so it matches the same code in
10986         ImplicitReferenceConversionExists for the `from any class-type S
10987         to any interface-type T'.
10988         
10989
10990 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10991
10992         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10993
10994 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10995
10996         * cs-parser.jay: Use verbosity accordingly. 
10997
10998 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10999
11000         * expression.cs (Unary.ResolveOperator): Do not report warning;
11001         AddressOf reads from variable.
11002         
11003         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
11004
11005 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
11006
11007         Fix bug #69462
11008
11009         * attribute.cs (Attributable): Removed CheckTargets.
11010         (Attributes.Emit): Explicit attribute targets are tested here.
11011
11012         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
11013         not enabled for interfaces.
11014
11015         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
11016         (GetAssemblyName): Ouch next bug there.
11017
11018 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11019
11020         * expression.cs: Error 275 added.
11021         
11022 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
11023
11024         Fix bug #69177 (Implemented decimal constant support)
11025
11026         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
11027         (BinaryFold): Add DecimalConstant.
11028
11029         * const.cs (Define): Decimal constant 
11030         (is not constant.
11031         (ChangeType): Add decimal type handling.
11032         (LookupConstantValue): Don't set value for decimal type but
11033         emit DecimalConstantAttribute. Needed for constant optimization.
11034
11035         * constant.cs (ToDecimal): New method.
11036         (ConvertToDecimal): New method.
11037         (IntConstant): Implemented ConvertToDecimal.
11038         (DecimalConstant.Emit): Emit optimized version for decimals in
11039         int range.
11040
11041         * expression.cs (ResolveOperator): Changed order of constant
11042         reduction to work correctly with native types which have
11043         overloaded operators.
11044         (ResolveMemberAccess): Extract constant value from attribute
11045         for decimal type.
11046
11047         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
11048
11049         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
11050         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
11051         (ChangeType): Decimal is special.
11052         (TypeToCoreType): Add decimal type.
11053
11054 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
11055
11056         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
11057         decimal types.
11058
11059 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
11060
11061         * class.cs (EventField.ApplyAttributeBuilder): Fix error
11062         test cs1667-5.cs.
11063
11064 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
11065
11066         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11067
11068         * pending.cs (PendingImplementation): Grab only interfaces.
11069
11070 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
11071
11072         * statement.cs (ForeachHelperMethods): Add location member and
11073         error 202 detection.
11074
11075 2004-11-19  Raja R Harinath  <rharinath@novell.com>
11076
11077         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
11078         automatically handled by executable.make.
11079         (PROGRAM): Make profile-specific.
11080
11081 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
11082
11083         * expression.cs (DoResolveBase): Fixed wrong warning for out
11084         variables.
11085
11086 2004-11-18  Martin Baulig  <martin@ximian.com>
11087
11088         Merged latest changes into gmcs.  Please keep this comment in
11089         here, it makes it easier for me to see what changed in MCS since
11090         the last time I merged.
11091
11092 2004-11-17  Raja R Harinath  <rharinath@novell.com>
11093
11094         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
11095         (TypeHandle.GetMemberCache): New.
11096         (TypeHandle.TypeHandle): Update.
11097         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
11098         (TypeManager.LookupParentInterfacesCache):
11099         Rename from LookupInterfaceCache.  Optimize slightly.
11100         (TypeManager.MemberLookup_FindMembers): Update.
11101         * decl.cs (MemberCache.MemberCache): Set Container to null in the
11102         multi-type variant.
11103         (AddCacheContents): Rename from AddHashtable.
11104         * class.cs (TypeContainer.parent_container): Remove.
11105         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
11106         (TypeContainer.DoDefineMembers): Don't initialize it.
11107         Update to name changes.
11108         
11109 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
11110
11111         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
11112         that factors the code to check access modifiers on override.  
11113
11114         (PropertyBase): Use the code here.
11115
11116         Patch from Lluis S'anchez, fixes bug #69361.
11117
11118 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
11119
11120         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
11121         routine that is used to report the use of a captured variable
11122         whose address has been taken.
11123
11124         There are two checks: one when variables are being captured and
11125         the other check is when the address of a variable is taken. 
11126         
11127         (because an anonymous methods might be resolved before *or* after
11128         the address has been taken) and 
11129
11130         * expression.cs (Conditional.DoResolve): Remove the special
11131         casing that Martin added to trueExpr and falseExpr being both
11132         NullLiteral.  We get the right behavior now just by introducing
11133         the null_type into the compiler. 
11134
11135         * convert.cs (ExplicitConversion): Change the code to use
11136         null_type instead of testing `expr is NullLiteral'.
11137         (ImplicitConversionStandard): use null_type too.
11138         (ImplicitReferenceConversionExists): use null_type too.
11139         (ImplicitReferenceConversion): use null_type too.
11140
11141         * literal.cs: The type of `NullLiteral' is now null_type instead
11142         of object_type. 
11143         (Resolve): Set the type here.
11144
11145         * typemanager.cs: Introduce null_type.
11146
11147 2004-11-17  Martin Baulig  <martin@ximian.com>
11148
11149         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
11150         direction, like FindMembers() does.  Fixes #69546, testcase is in
11151         test-315.cs.    
11152
11153 2004-11-16  Martin Baulig  <martin@ximian.com>
11154
11155         This is based on a patch from Marek Safar, see bug #69082.
11156         Fixes bugs #63705 and #67130.
11157
11158         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
11159         method; create a MemberCache for an interface type and cache the
11160         result.
11161
11162         * decl.cs (IMemberContainer.ParentContainer): Removed.
11163         (IMemberContainer.ParentCache): New property.
11164         (MemberCache.SetupCacheForInterface): Removed.
11165         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
11166         to create a cache for an interface's "parent".
11167
11168         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
11169         interfaces too.
11170
11171 2004-11-16  Martin Baulig  <martin@ximian.com>
11172
11173         Merged back from gmcs; these changes already went into gmcs a
11174         couple of weeks ago.
11175
11176         * typemanager.cs
11177         (TypeManager.AddUserType): Removed the `ifaces' argument.
11178         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11179         `TypeExpr []'.
11180         (TypeManager.AddUserInterface): Removed.
11181         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11182         `TypeExpr []'.
11183         (TypeManager.GetInterfaces): Likewise.
11184         (TypeManager.GetExplicitInterfaces): Likewise.
11185
11186         * ecore.cs (TypeExpr.GetInterfaces): Removed.
11187
11188         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11189         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11190
11191 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
11192
11193         * statement.cs: Avoid adding bools to a hashtable.
11194
11195 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * expression.cs (Invocation.OverloadResolve): Flag error if we are
11198         calling an unsafe method from a safe location.
11199
11200 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
11201
11202         Fix #69167
11203         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11204
11205 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
11206
11207         * namespace.cs (VerifyUsing): use GetPartialName instead of
11208         ToString. 
11209
11210 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * statement.cs (Return.Resolve): Fix regression in typo: if
11213         `in_exc', we have to request a NeedReturnLabel, this was a typo
11214         introduced in the anonymous method check-in.  Fixes #69131.
11215
11216         * Indexers were using the ShortName when defining themselves,
11217         causing a regression in the compiler bootstrap when applying the
11218         patch from 2004-11-02 (first part), now they use their full name
11219         and the bug is gone.
11220
11221 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
11222
11223         * driver.cs: Strip the path from the names of embedded resources. Fixes
11224         #68519.
11225
11226 2004-11-04  Raja R Harinath  <rharinath@novell.com>
11227
11228         Fix error message regression: cs0104-2.cs.
11229         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11230         (AliasEntry.Resolve): Update.
11231         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
11232         'silent' flag.
11233         (RootContext.LookupType): Update.
11234
11235 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
11236
11237         * cs-parser.jay: Add support for handling accessor modifiers
11238         * class: Add support port accessor modifiers and error checking,
11239         define PropertyMethod.Define as virtual (not abstract anymore)
11240         * ecore.cs: Add checking for proeprties access with access modifiers
11241         * iterators.cs: Modify Accessor constructor call based in the modified
11242         constructor
11243 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
11244
11245         * expression.cs (StringConcat): Handle being called twice,
11246         as when we have a concat in a field init with more than two
11247         ctors in the class
11248
11249 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
11250
11251         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11252         special case explicit implementations, we should always produce
11253         the .property or .event declaration.
11254         
11255         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11256         since it will not return correct data if people use this
11257         unresolved in the presence of using statements (see test-313).
11258
11259         * class.cs (MethodData.Define): If we are an explicit interface
11260         implementation, set the method name to the full name of the
11261         interface plus the name of the method.  
11262
11263         Notice that using the method.MethodName.GetFullName() does not
11264         work, as it will only contain the name as declared on the source
11265         file (it can be a shorthand in the presence of using statements)
11266         and not the fully qualifed type name, for example:
11267
11268         using System;
11269
11270         class D : ICloneable {
11271                 object ICloneable.Clone ()  {
11272                 }
11273         }
11274
11275         Would produce a method called `ICloneable.Clone' instead of
11276         `System.ICloneable.Clone'.
11277
11278         * namespace.cs (Alias.Resolve): Use GetPartialName.
11279         
11280 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11281
11282         * cs-parser.jay: Add error 1055 report.
11283
11284 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
11285
11286         * assign.cs (Assign.DoResolve): Only do the transform of
11287         assignment into a New if the types are compatible, if not, fall
11288         through and let the implicit code deal with the errors and with
11289         the necessary conversions. 
11290
11291 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11292
11293         * cs-parser.jay: Add error 1031 report.
11294
11295         * cs-tokenizer.cs: Add location for error 1038.
11296
11297 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11298
11299         * cs-parser.jay: Add error 1016 report.
11300
11301 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11302
11303         * cs-parser.jay: Add errors 1575,1611 report.
11304
11305 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11306
11307         * cs-parser.jay: Add error 1001 report.
11308
11309 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11310
11311         Fix #68850
11312         * attribute.cs (GetMarshal): Add method argument for
11313         caller identification.
11314
11315         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11316         agument for GetMarshal and RuntimeMissingSupport.
11317
11318 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11319
11320         * attribute.cs (ExtractSecurityPermissionSet): Removed
11321         TypeManager.code_access_permission_type.
11322
11323         * typemanager.cs: Removed TypeManager.code_access_permission_type.
11324
11325 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * expression.cs (LocalVariableReference.DoResolveLValue): Check
11328         for obsolete use of a variable here.   Fixes regression on errors
11329         cs0619-25 and cs0619-26.
11330
11331 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
11332
11333         Fix #62358, implemented security attribute encoding.
11334
11335         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11336         Tests permitted SecurityAction for assembly or other types.
11337         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11338         data from SecurityPermissionAttribute to PermisionSet class.
11339
11340         * class.cs (ApplyAttributeBuilder): Added special handling
11341         for System.Security.Permissions.SecurityAttribute based types.
11342
11343         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11344         special handling for System.Security.Permissions.SecurityAttribute
11345         based types.
11346
11347         * enum.cs (ApplyAttributeBuilder): Added special handling
11348         for System.Security.Permissions.SecurityAttribute based types.
11349
11350         * parameter.cs (ApplyAttributeBuilder): Added special handling
11351         for System.Security.Permissions.SecurityAttribute based types.
11352
11353         * rootcontext.cs: Next 2 core types.
11354
11355         * typemanager.cs (TypeManager.security_permission_attr_type):
11356         Built in type for the SecurityPermission Attribute.
11357         (code_access_permission_type): Build in type.
11358
11359 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11362         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11363         all of this information into
11364         EmitContext.EmitCapturedVariableInstance.
11365         
11366         * codegen.cs (EmitCapturedVariableInstance): move here the
11367         funcionality of emitting an ldarg.0 in the presence of a
11368         remapping.   This centralizes the instance emit code.
11369
11370         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11371         then emit a load of this: it means that we have reached the
11372         topmost ScopeInfo: the one that contains the pointer to the
11373         instance of the class hosting the anonymous method.
11374
11375         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11376         captures to the topmost CaptureContext.
11377
11378 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * expression.cs (LocalVariableReference): Move the knowledge about
11381         the iterators into codegen's EmitCapturedVariableInstance.
11382
11383 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
11384
11385         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11386         all code paths return a value from an anonymous method (it is the
11387         same as the 161 error, but for anonymous methods).
11388
11389 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
11390
11391         The introduction of anonymous methods in the compiler changed
11392         various ways of doing things in the compiler.  The most
11393         significant one is the hard split between the resolution phase
11394         and the emission phases of the compiler.
11395
11396         For instance, routines that referenced local variables no
11397         longer can safely create temporary variables during the
11398         resolution phase: they must do so from the emission phase,
11399         since the variable might have been "captured", hence access to
11400         it can not be done with the local-variable operations from the runtime.
11401         
11402         * statement.cs 
11403
11404         (Block.Flags): New flag `IsTopLevel' to indicate that this block
11405         is a toplevel block.
11406
11407         (ToplevelBlock): A new kind of Block, these are the blocks that
11408         are created by the parser for all toplevel method bodies.  These
11409         include methods, accessors and anonymous methods.
11410
11411         These contain some extra information not found in regular blocks:
11412         A pointer to an optional CaptureContext (for tracking captured
11413         local variables and parameters).  A pointer to the parent
11414         ToplevelBlock.
11415         
11416         (Return.Resolve): Catch missmatches when returning a value from an
11417         anonymous method (error 1662).
11418         Invoke NeedReturnLabel from the Resolve phase instead of the emit
11419         phase.
11420
11421         (Break.Resolve): ditto.
11422
11423         (SwitchLabel): instead of defining the labels during the
11424         resolution phase, we now turned the public ILLabel and ILLabelCode
11425         labels into methods called GetILLabelCode() and GetILLabel() that
11426         only define the label during the Emit phase.
11427
11428         (GotoCase): Track the SwitchLabel instead of the computed label
11429         (its contained therein).  Emit the code by using
11430         SwitchLabel.GetILLabelCode ().
11431
11432         (LocalInfo.Flags.Captured): A new flag has been introduce to track
11433         whether the Local has been captured or not.
11434
11435         (LocalInfo.IsCaptured): New property, used to tell whether the
11436         local has been captured.
11437         
11438         * anonymous.cs: Vastly updated to contain the anonymous method
11439         support.
11440
11441         The main classes here are: CaptureContext which tracks any
11442         captured information for a toplevel block and ScopeInfo used to
11443         track the activation frames for various local variables.   
11444
11445         Each toplevel block has an optional capture context associated
11446         with it.  When a method contains an anonymous method both the
11447         toplevel method and the anonymous method will create a capture
11448         context.   When variables or parameters are captured, they are
11449         recorded on the CaptureContext that owns them, for example:
11450
11451         void Demo () {
11452              int a;
11453              MyDelegate d = delegate {
11454                  a = 1;
11455              }
11456         }
11457
11458         Here `a' will be recorded as captured on the toplevel
11459         CapturedContext, the inner captured context will not have anything
11460         (it will only have data if local variables or parameters from it
11461         are captured in a nested anonymous method.
11462
11463         The ScopeInfo is used to track the activation frames for local
11464         variables, for example:
11465
11466         for (int i = 0; i < 10; i++)
11467                 for (int j = 0; j < 10; j++){
11468                    MyDelegate d = delegate {
11469                         call (i, j);
11470                    }
11471                 }
11472
11473         At runtime this captures a single captured variable `i', but it
11474         captures 10 different versions of the variable `j'.  The variable
11475         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11476         recorded on a child.  
11477
11478         The toplevel ScopeInfo will also track information like the `this'
11479         pointer if instance variables were referenced (this is necessary
11480         as the anonymous method lives inside a nested class in the host
11481         type of the method). 
11482
11483         (AnonymousMethod): Expanded to track the Toplevel, implement
11484         `AnonymousMethod.Compatible' to tell whether an anonymous method
11485         can be converted to a target delegate type. 
11486
11487         The routine now also produces the anonymous method content
11488
11489         (AnonymousDelegate): A helper class that derives from
11490         DelegateCreation, this is used to generate the code necessary to
11491         produce the delegate for the anonymous method that was created. 
11492
11493         * assign.cs: API adjustments for new changes in
11494         Convert.ImplicitStandardConversionExists.
11495
11496         * class.cs: Adjustments to cope with the fact that now toplevel
11497         blocks are of type `ToplevelBlock'. 
11498
11499         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11500         insteda of standard blocks.
11501
11502         Flag errors if params arguments are passed to anonymous methods.
11503
11504         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11505         `CurrentAnonymousMethod' which points to the current Anonymous
11506         Method.  The variable points to the AnonymousMethod class that
11507         holds the code being compiled.  It is set in the new EmitContext
11508         created for the anonymous method.
11509
11510         (EmitContext.Phase): Introduce a variable and an enumeration to
11511         assist in enforcing some rules about when and where we are allowed
11512         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11513         only one that enfonces this right now).
11514
11515         (EmitContext.HaveCaptureInfo): new helper method that returns
11516         whether we have a CapturedContext initialized.
11517
11518         (EmitContext.CaptureVariable): New method used to register that a
11519         LocalInfo must be flagged for capturing. 
11520
11521         (EmitContext.CapturedParameter): New method used to register that a
11522         parameters must be flagged for capturing. 
11523         
11524         (EmitContext.CapturedField): New method used to register that a
11525         field must be flagged for capturing. 
11526
11527         (EmitContext.HaveCapturedVariables,
11528         EmitContext.HaveCapturedFields): Return whether there are captured
11529         variables or fields. 
11530
11531         (EmitContext.EmitMethodHostInstance): This is used to emit the
11532         instance for the anonymous method.  The instance might be null
11533         (static methods), this (for anonymous methods that capture nothing
11534         and happen to live side-by-side with the current method body) or a
11535         more complicated expression if the method has a CaptureContext.
11536
11537         (EmitContext.EmitTopBlock): Routine that drives the emission of
11538         code: it will first resolve the top block, then emit any metadata
11539         and then emit the code.  The split is done so that we can extract
11540         any anonymous methods and flag any captured variables/parameters.
11541         
11542         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11543         during this phase, the ILGenerator should not be used as labels
11544         and local variables declared here might not be accessible to any
11545         code that is part of an anonymous method.  
11546
11547         Exceptions to this include the temporary variables that are
11548         created by some statements internally for holding temporary
11549         variables. 
11550         
11551         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11552         metadata for a cb
11553
11554         (EmitContext.TemporaryReturn): This method is typically called
11555         from the Emit phase, and its the only place where we allow the
11556         ReturnLabel to be defined other than the EmitMeta.  The reason is
11557         that otherwise we would have to duplicate a lot of logic in the
11558         Resolve phases of various methods that today is on the Emit
11559         phase. 
11560
11561         (EmitContext.NeedReturnLabel): This no longer creates the label,
11562         as the ILGenerator is not valid during the resolve phase.
11563
11564         (EmitContext.EmitThis): Extended the knowledge in this class to
11565         work in anonymous methods in addition to iterators. 
11566
11567         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11568         code is necessary on the stack to access the instance to a local
11569         variable (the variable will be accessed as a field).
11570
11571         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11572         EmitContext.EmitAddressOfParameter): Routines to support
11573         parameters (not completed at this point). 
11574         
11575         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11576         will also remove the parameters.
11577
11578         * convert.cs (Convert): Define a `ConstantEC' which points to a
11579         null.  This is just to prefity some code that uses
11580         ImplicitStandardConversion code and do not have an EmitContext
11581         handy.
11582
11583         The idea is to flag explicitly that at that point in time, it is
11584         known that the conversion will not trigger the delegate checking
11585         code in implicit conversions (which requires a valid
11586         EmitContext). 
11587
11588         Everywhere: pass new EmitContext parameter since
11589         ImplicitStandardConversionExists now requires it to check for
11590         anonymous method conversions. 
11591
11592         (Convert.ImplicitStandardConversionExists): If the type of an
11593         expression is the anonymous_method_type, and the type is a
11594         delegate, we invoke the AnonymousMethod.Compatible method to check
11595         whether an implicit conversion is possible. 
11596
11597         (Convert.ImplicitConversionStandard): Only do implicit method
11598         group conversions if the language level is not ISO_1.
11599
11600         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11601         MethodInfo for the Invoke method.  used by Delegate and
11602         AnonymousDelegate.
11603
11604         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11605         method conversions if the target type is a delegate.
11606
11607         Removed extra debugging nops.
11608
11609         (LocalVariableReference): Turn the `local_info' into a public
11610         field. 
11611
11612         Add `prepared' field, the same hack used for FieldExprs to cope
11613         with composed assignments, as Local variables do not necessarily
11614         operate purely on the stack as they used to: they can be captured
11615         fields. 
11616
11617         Add `temp' for a temporary result, like fields.
11618
11619         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11620
11621         It now copes with Local variables that are captured and emits the
11622         proper instance variable to load it from a field in the captured
11623         case. 
11624
11625         (ParameterReference.DoResolveBase): During the resolve phase,
11626         capture parameters if we are in an anonymous method.
11627
11628         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11629         anonymous method, use the EmitContext helper routines to emit the
11630         parameter reference.
11631
11632         * iterators.cs: Set RemapToProxy to true/false during the
11633         EmitDispose class.
11634
11635         * parameters.cs (GetParameterByName): New helper method. 
11636
11637         * typemanager.cs (anonymous_method_type) a new type that
11638         represents an anonyous method.  This is always an internal type,
11639         used as a fencepost to test against the anonymous-methodness of an
11640         expression. 
11641         
11642 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11643
11644         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11645         561 report.
11646         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11647
11648 2004-10-18  Martin Baulig  <martin@ximian.com>
11649
11650         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11651         `Type' directly, but call ResolveType() on it.
11652         (Catch.Resolve): Likewise.
11653         (Foreach.Resolve): Likewise.
11654
11655 2004-10-18  Martin Baulig  <martin@ximian.com>
11656
11657         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11658         `Type' directly, but call ResolveType() on it.
11659         (Probe.DoResolve): Likewise.
11660         (ArrayCreation.LookupType): Likewise.
11661         (TypeOf.DoResolve): Likewise.
11662         (SizeOf.DoResolve): Likewise.
11663
11664 2004-10-18  Martin Baulig  <martin@ximian.com>
11665
11666         * expression.cs (Invocation.BetterFunction): Put back
11667         TypeManager.TypeToCoreType().
11668
11669 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11670
11671         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11672         the ResolveType.
11673
11674 2004-10-18  Martin Baulig  <martin@ximian.com>
11675
11676         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11677         `Type' directly, but call ResolveType() on it.
11678
11679 2004-10-18  Martin Baulig  <martin@ximian.com>
11680
11681         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11682         `Type' directly, but call ResolveType() on it.
11683         (MemberBase.DoDefine): Likewise.
11684
11685         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11686         `Type' directly, but call ResolveType() on it.
11687         (ComposedCast.DoResolveAsTypeStep): Likewise.
11688
11689         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11690         `Type' directly, but call ResolveType() on it.
11691
11692 2004-10-17  John Luke  <john.luke@gmail.com>
11693
11694         * class.cs (Operator.GetSignatureForError): use CSharpName
11695
11696         * parameter.cs (Parameter.GetSignatureForError): Returns
11697         correct name even if was not defined.
11698
11699 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11700
11701         Fix #65816.
11702         * class.cs (TypeContainer.EmitContext): New property.
11703         (DefineNestedTypes): Create an emitcontext for each part.
11704         (MethodCore.DoDefineParameters): Use container's emitcontext.
11705         Pass type array to InternalParameters.
11706         (MemberBase.DoDefine): Use container's emitcontext.
11707         (FieldMember.Define): Likewise.
11708         (Event.Define): Likewise.
11709         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11710         Pass type array to InternalParameters.
11711         (SetIndexerMethod.GetParameterInfo): Likewise.
11712         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11713         * delegate.cs (Define): Pass emitcontext to
11714         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11715         array to InternalParameters.
11716         * expression.cs (ParameterReference.DoResolveBase): Pass
11717         emitcontext to GetParameterInfo.
11718         (ComposedCast.DoResolveAsTypeStep): Remove check on
11719         ec.ResolvingTypeTree.
11720         * parameter.cs (Parameter.Resolve): Change argument to
11721         EmitContext.  Use ResolveAsTypeTerminal.
11722         (Parameter.GetSignature): Change argument to EmitContext.
11723         (Parameters.ComputeSignature): Likewise.
11724         (Parameters.ComputeParameterTypes): Likewise.
11725         (Parameters.GetParameterInfo): Likewise.
11726         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11727         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11728         * support.cs (InternalParameters..ctor): Remove variant that takes
11729         a DeclSpace.
11730         * typemanager.cs (system_intptr_expr): New.
11731         (InitExpressionTypes): Initialize it.
11732
11733 2004-10-12  Chris Toshok  <toshok@ximian.com>
11734
11735         * cs-parser.jay: fix location for try_statement and catch_clause.
11736
11737 2004-10-11  Martin Baulig  <martin@ximian.com>
11738
11739         * report.cs: Don't make --fatal abort on warnings, we have
11740         -warnaserror for that.
11741
11742 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11743
11744         More DeclSpace.ResolveType avoidance.
11745         * decl.cs (MemberCore.InUnsafe): New property.
11746         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11747         with newly created EmitContext.
11748         (FieldMember.Define): Likewise.
11749         * delegate.cs (Delegate.Define): Likewise.
11750         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11751         only if normal name-lookup fails.
11752         (TypeExpr.DoResolve): Enable error-checking.
11753         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11754         (SizeOf.DoResolve): Likewise.
11755         (ComposedCast.DoResolveAsTypeStep): Likewise.
11756         (StackAlloc.DoResolve): Likewise.
11757         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11758         (Block.Unsafe): New property.
11759         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11760         (Unsafe): Set 'unsafe' flag of contained block.
11761         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11762         (Fixed.Resolve): Likewise.
11763         (Catch.Resolve): Likewise.
11764         (Using.ResolveLocalVariableDecls): Likewise.
11765         (Foreach.Resolve): Likewise.
11766
11767 2004-10-05  John Luke <john.luke@gmail.com>
11768
11769         * cs-parser.jay: add location to error CS0175
11770
11771 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * ecore.cs (Expression.Constantity): Add support for turning null
11774         into a constant.
11775
11776         * const.cs (Const.Define): Allow constants to be reference types
11777         as long as the value is Null.
11778
11779 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11780
11781         * namespace.cs (NamespaceEntry.Using): No matter which warning
11782         level is set, check if this namespace name has already been added.
11783
11784 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11785
11786         * expression.cs: reftype [!=]= null should always use br[true,false].
11787         # 67410
11788
11789 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11790
11791         Fix #67108
11792         * attribute.cs: Enum conversion moved to 
11793         GetAttributeArgumentExpression to be applied to the all
11794         expressions.
11795
11796 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11797
11798         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11799         * class.c (TypeContainer.DefineType): Flag error if
11800         base types aren't accessible due to access permissions.
11801         * decl.cs (DeclSpace.ResolveType): Move logic to
11802         Expression.ResolveAsTypeTerminal.
11803         (DeclSpace.ResolveTypeExpr): Thin layer over
11804         Expression.ResolveAsTypeTerminal.
11805         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11806         Refactor code into NestedAccess.  Use it.
11807         (DeclSpace.NestedAccess): New.
11808         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11809         argument to silence errors.  Check access permissions.
11810         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11811         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11812         (Cast.DoResolve): Likewise.
11813         (New.DoResolve): Likewise.
11814         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11815         (TypeOf.DoResolve): Likewise.
11816
11817         * expression.cs (Invocation.BetterConversion): Return the Type of
11818         the better conversion.  Implement section 14.4.2.3 more faithfully.
11819         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11820         section 14.4.2.2 explicit.
11821         (Invocation.OverloadResolve): Update.
11822         (Invocation): Remove is_base field.
11823         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11824         (Invocation.Emit): Likewise.
11825
11826 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11827
11828         * README: Update to changes.
11829
11830 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11831
11832         * cs-parser.jay: Reverted 642 warning fix.
11833
11834 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11835
11836         Fix bug #66615
11837         * decl.cs (FindMemberWithSameName): Indexer can have more than
11838         1 argument.
11839
11840 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11841
11842         * expression.cs (LocalVariableReference.DoResolveLValue):
11843         Do not report warning 219 for out values.
11844         (EmptyExpression.Null): New member to avoid extra allocations.
11845
11846 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11847
11848         * cs-parser.jay: Fix wrong warning 642 report.
11849
11850         * cs-tokenizer.cs (CheckNextToken): New helper;
11851         Inspect next character if is same as expected.
11852
11853 2004-09-23  Martin Baulig  <martin@ximian.com>
11854
11855         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11856         (Convert.ImplicitReferenceConversionExists): Likewise.
11857
11858 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11859
11860         * class.cs (Operator.Define): Add error 448 and 559 report.
11861
11862 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11863
11864         * class.cs (MemberBase.IsTypePermitted): New protected
11865         method for checking error CS0610.
11866
11867 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11868
11869         * class.cs (TypeContainer.HasExplicitLayout): New property
11870         Returns whether container has StructLayout attribute set Explicit.
11871         (FieldMember): New abstract class for consts and fields.
11872         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11873         (Field): Reuse FieldMember.
11874
11875         * const.cs (Const): Reuse FieldMember.
11876
11877         * rootcontext.cs: EmitConstants call moved to class.
11878
11879 2004-09-22  Martin Baulig  <martin@ximian.com>
11880
11881         Thanks to Peter Sestoft for this bug report.
11882
11883         * expression.cs (Conditional): If both the `trueExpr' and the
11884         `falseExpr' is a NullLiteral, return a NullLiteral.
11885
11886 2004-09-22  Martin Baulig  <martin@ximian.com>
11887
11888         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11889         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11890         for the "get_Current" call.
11891
11892 2004-09-22  Martin Baulig  <martin@ximian.com>
11893
11894         Marek and me just fixed one of our oldest bugs: #28562 :-)
11895
11896         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11897
11898         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11899         we're an EnumConstant, just return that.
11900         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11901         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11902         to get the value which'll actually be written into the attribute.
11903         However, we have to use GetValue() to access the attribute's value
11904         in the compiler.        
11905
11906 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11907
11908         * constant.cs (Constant.IsNegative): New abstract property
11909         IsNegative.
11910
11911         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11912         (StackAlloc.DoResolve): Reused IsNegative.
11913
11914 2004-09-21  Martin Baulig  <martin@ximian.com>
11915
11916         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11917         if we're used in an iterator, we may be called from different
11918         methods.
11919
11920         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11921         we actually have an exception block.
11922
11923 2004-09-20  John Luke <jluke@cfl.rr.com>
11924
11925         * class.cs, cs-parser.jay: Improve the error report for 1520:
11926         report the actual line where the error happens, not where the
11927         class was declared.
11928
11929         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11930         Pass location information that was available elsewhere.
11931
11932 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11933
11934         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11935         runtime to delay sign assemblies.
11936
11937 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11938
11939         * cs-parser.jay: Do not report the stack trace, this is barely
11940         used nowadays.
11941
11942 2004-08-22  John Luke  <john.luke@gmail.com>
11943  
11944         * driver.cs : check that a resource id is not already used
11945         before adding it, report CS1508 if it is, bug #63637
11946
11947 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11948
11949         * ecore.cs: Removed dead code.
11950
11951 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11952
11953         * class.cs: Do not report warning CS0067 on the interfaces.
11954
11955 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11956
11957         * cs-parser.jay: Add error 504 report.
11958
11959 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11960
11961         * rootcontext.cs: WarningLevel is 4 by default now.
11962
11963         * statement.cs (Fixed.Resolve): Do not null
11964         VariableInfo.
11965
11966 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11967
11968         Fixed bug #55780
11969         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11970         deep search when property is not virtual.
11971         (PropertyExpr.ResolveAccessors): Make one call for both
11972         accessors.
11973
11974 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11975
11976         Fixed bug #65766
11977         * statement.cs: Error 152 report constains also location.
11978
11979 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11980
11981         Fixed bug #65766
11982         * const.cs: Explicitly set constant as static.
11983
11984 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11985
11986         Fixed bug #64226
11987         * cs-parser.jay: Add error 1017 report.
11988
11989 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11990
11991         Fixed bug #59980, #64224
11992         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11993
11994         * typemanager.cs (IsSpecialMethod): Simplified
11995
11996 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11997
11998         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11999         condition with better params.
12000
12001 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
12002
12003         Fixed bug #65238
12004         * attribute.cs (Resolve): Property has to have both
12005         accessors.
12006
12007 2004-09-14  Martin Baulig  <martin@ximian.com>
12008
12009         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
12010
12011 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
12012
12013         Fixed bug #61902
12014         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
12015         called and is obsolete then this member suppress message
12016         when call is inside next [Obsolete] method or type.
12017
12018         * expression.cs: Use TestObsoleteMethodUsage member.
12019
12020 2004-09-14  Martin Baulig  <martin@ximian.com>
12021
12022         * cs-parser.jay: Sync a bit with the GMCS version.
12023
12024 2004-09-14  Martin Baulig  <martin@ximian.com>
12025
12026         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
12027         (CSharpParser.yacc_verbose_flag): New public field.
12028
12029         * genericparser.cs: Removed.
12030
12031 2004-09-14  Raja R Harinath  <rharinath@novell.com>
12032
12033         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
12034
12035 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
12036
12037         * class.cs (MethodCore.CheckBase): Fix bug #65757.
12038
12039 2004-09-10  Martin Baulig  <martin@ximian.com>
12040
12041         Backported my MemberName changes from GMCS into MCS.
12042
12043         - we are now using a special `MemberName' class instead of using
12044         strings; in GMCS, the `MemberName' also contains the type
12045         arguments.
12046
12047         - changed the grammar rules a bit:
12048           * the old `member_name' is now a `namespace_or_type_name':
12049             The rule is that we use `namespace_or_type_name' everywhere
12050             where we expect either a "member name" (GetEnumerator) or a
12051             "member name" with an explicit interface name
12052             (IEnumerable.GetEnumerator).
12053             In GMCS, the explicit interface name may include type arguments
12054             (IEnumerable<T>.GetEnumerator).
12055           * we use `member_name' instead of just `IDENTIFIER' for
12056             "member names":
12057             The rule is that we use `member_name' wherever a member may
12058             have type parameters in GMCS.       
12059
12060         * decl.cs (MemberName): New public class.
12061         (MemberCore.MemberName): New public readonly field.
12062         (MemberCore.ctor): Take a `MemberName' argument, not a string.
12063         (DeclSpace): Likewise.
12064
12065         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12066         * enum.cs (Enum.ctor): Likewise.
12067
12068         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
12069         MemberName.     
12070         (AliasEntry.ctor): Take a MemberName, not an Expression.
12071         (AliasEntry.UsingAlias): Likewise.
12072
12073         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
12074         (IMethodData.MemberName): Changed type from string to MemberName.
12075         (MemberBase.ExplicitInterfaceName): Likewise.
12076         (AbstractPropertyEventMethod.SetupName): Make this private.
12077         (AbstractPropertyEventMethod.ctor): Added `string prefix'
12078         argument; compute the member name here.
12079         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
12080         on the `member.MemberName' and the `prefix'.
12081
12082         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
12083         not `type_name'.
12084         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
12085         thus, we get a `MemberName' instead of a `string'.  These
12086         declarations may have type parameters in GMCS.
12087         (interface_method_declaration, delegate_declaration): Likewise.
12088         (class_declaration, interface_declaration): Likewise.
12089         (method_header): Use `namespace_or_type_name' instead of
12090         `member_name'.  We may be an explicit interface implementation.
12091         (property_declaration, event_declaration): Likewise.
12092         (member_name): This is now just an `IDENTIFIER', not a
12093         `namespace_or_type_name'.
12094         (type_name, interface_type): Removed.
12095         (namespace_or_type_name): Return a MemberName, not an Expression.
12096         (primary_expression): Use `member_name' instead of `IDENTIFIER';
12097         call GetTypeExpression() on the MemberName to get an expression.
12098         (IndexerDeclaration.interface_type): Changed type from string to
12099         MemberName.
12100         (MakeName): Operate on MemberName's instead of string's.
12101
12102 2004-09-13  Raja R Harinath  <rharinath@novell.com>
12103
12104         Fix bug #55770.
12105         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
12106         (NamespaceEntry.Lookup): Add new argument to flag if we want the
12107         lookup to avoid symbols introduced by 'using'.
12108         * rootcontext.cs (NamespaceLookup): Update.
12109
12110 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
12111
12112         * class.cs (TypeContainer.DoDefineMembers): Do not call
12113         DefineDefaultConstructor for static classes.
12114
12115 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
12116
12117         * attribute.cs (Attribute.Resolve): Add error 653 report.
12118
12119         * class.cs (Class.ApplyAttributeBuilder): Add error 641
12120         report.
12121         (Method.ApplyAttributeBuilder): Add error 685 report.
12122         (Operator.Define): Add error 564 report.
12123
12124         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
12125
12126         * expression.cs (Invocation.DoResolve): Add error
12127         245 and 250 report.
12128
12129         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
12130         error 674 report.
12131
12132 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12133
12134         * class.cs (ConstructorInitializer.Resolve):
12135         Wrong error number (515->516).
12136
12137 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12138
12139         * class.cs (Indexer.Define): Add error 631 report.
12140
12141 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12142
12143         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
12144
12145 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12146
12147         * expression.cs (Probe.DoResolve): Add error CS0241 report.
12148
12149 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
12150
12151         * cs-parser.jay: Added error CS0241 report.
12152
12153 2004-09-10  Raja R Harinath  <rharinath@novell.com>
12154
12155         * cs-parser.jay (fixed_statement): Introduce a scope for the
12156         declaration in the 'fixed' statement.
12157
12158 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12159
12160         * cs-parser.jay: Added CS0230 error report.
12161
12162 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12163
12164         * cs-parser.jay: Added errors CS0231 and CS0257 report.
12165
12166 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12167
12168         * expression.cs (Argument.Resolve): Added error CS0192 and
12169         CS0199 report.
12170
12171 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12172
12173         C# 2.0 #pragma warning feature
12174
12175         * cs-tokenizer.cs (PreProcessPragma): New method; 
12176         Handles #pragma directive.
12177
12178         * report.cs (WarningRegions): New class; Support
12179         class for #pragma warning directive. It tests whether
12180         warning is enabled for a given line.
12181
12182 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * const.cs: Add more descriptive error report, tahnks to
12185         Sebastien. 
12186
12187 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
12188
12189         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12190
12191 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
12192
12193         * expression.cs: Apply patch from Ben: Remove dead code from
12194         ArrayCreation, and remove the TurnintoConstant call in const.cs,
12195         as that code just threw an exception anwyays.
12196
12197         * const.cs: Remove the call to the turnintoconstant, for details
12198         see bug: #63144
12199         
12200         * literal.cs: The type of the null-literal is the null type;  So
12201         we use a placeholder type (literal.cs:System.Null, defined here)
12202         for it.
12203
12204         * expression.cs (Conditional.DoResolve): Remove some old code that
12205         is no longer needed, conversions have been fixed.
12206
12207         (ArrayCreationExpression.DoResolve): Return false if we fail to
12208         resolve the inner expression.
12209
12210 2004-09-07  Raja R Harinath  <rharinath@novell.com>
12211
12212         Fix test-290.cs.
12213         * cs-parser.jay (delegate_declaration): Record a delegate
12214         declaration as a type declaration.
12215         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12216
12217 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
12218
12219         * parameter.cs: Do not crash if the type can not be resolved. 
12220
12221         * expression.cs: Report errors with unsafe pointers, fixes #64896
12222
12223 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12224
12225         * expression.cs: Pointer arith always needs to do a conv.i
12226         if the operand is a long. fix 65320
12227
12228 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12229
12230         Fixed cs0619-37.cs, cs0619-38.cs
12231
12232         * enum.cs (GetObsoleteAttribute): Removed.
12233
12234         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12235         on Enum member is double staged. The first is tested member
12236         and then enum.
12237
12238 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12239
12240         Fixed #56986, #63631, #65231
12241
12242         * class.cs: (TypeContainer.AddToMemberContainer): New method,
12243         adds member to name container.
12244         (TypeContainer.AddToTypeContainer): New method, adds type to
12245         name container.
12246         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12247         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12248         AddOperator): Simplified by reusing AddToMemberContainer.
12249         (TypeContainer.UserDefinedStaticConstructor): Changed to property
12250         instead of field.
12251         (Method.CheckForDuplications): Fixed implementation to test all
12252         possibilities.
12253         (MemberBase): Detection whether member is explicit interface
12254         implementation is now in constructor.
12255         (MemberBase.UpdateMemberName): Handles IndexerName.
12256         (Accessor): Changed to keep also location information.
12257         (AbstractPropertyEventMethod): Is derived from MemberCore.
12258         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12259         will be emited or not.
12260         (PropertyBase.AreAccessorsDuplicateImplementation):
12261         Tests whether accessors are not in collision with some method.
12262         (Operator): Is derived from MethodCore to simplify common
12263         operations.
12264
12265         * decl.cs (Flags.TestMethodDuplication): Test for duplication
12266         must be performed.
12267         (DeclSpace.AddToContainer): Adds the member to defined_names
12268         table. It tests for duplications and enclosing name conflicts.
12269
12270         * enum.cs (EnumMember): Clean up to reuse the base structures
12271
12272 2004-09-03  Martin Baulig  <martin@ximian.com>
12273
12274         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12275         into TypeContainer, to make partial classes work again.
12276
12277 2004-09-03  Martin Baulig  <martin@ximian.com>
12278
12279         * rootcontext.cs (RootContext.V2): Removed.
12280
12281 2004-03-23  Martin Baulig  <martin@ximian.com>
12282
12283         * expression.cs (Invocation.OverloadResolve): Added `bool
12284         may_fail' argument and use it instead of the Location.IsNull() hack.
12285
12286 2004-09-03  Martin Baulig  <martin@ximian.com>
12287
12288         Merged latest changes into gmcs.  Please keep this comment in
12289         here, it makes it easier for me to see what changed in MCS since
12290         the last time I merged.
12291
12292 2004-09-03  Raja R Harinath  <rharinath@novell.com>
12293
12294         Fix #61128.
12295         * expression.cs (BetterConversion): Don't allow either conversion 
12296         to be null.  Remove redundant implicit conversion test when 'q ==
12297         null' -- when this function is invoked, we already know that the
12298         implicit conversion exists.
12299         (BetterFunction): Assume that 'best' is non-null.  Remove
12300         redundant reimplementation of IsApplicable when 'best' is null.
12301         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12302         number of arguments.
12303         (IsAncestralType): Extract from OverloadResolve.
12304         (OverloadResolve): Make robust to the MethodGroupExpr being
12305         unsorted.  Implement all the logic of Section 14.5.5.1, and
12306         support overloading of methods from multiple applicable types.
12307         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
12308
12309         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12310         (RealError, Warning): Append type of report to related symbol.
12311
12312 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
12313
12314         * enum.cs: Fixed CLS-Compliance checks for enum members.
12315         Error tests cs3008-8.cs, cs3014-8.cs
12316
12317 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12318
12319         Fixed bug #62342, #63102
12320         * class.cs: ImplementIndexer uses member.IsExplicitImpl
12321         like ImplementMethod.
12322
12323 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12324
12325         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12326         Fixed bug #65170.
12327
12328 2004-09-02  Martin Baulig  <martin@ximian.com>
12329
12330         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12331         TypeManager.GetArgumentTypes() rather than calling GetParameters()
12332         on the MethodBase.
12333
12334 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
12335
12336         C# 2.0 Static classes implemented
12337
12338         * class.cs (TypeContainer): instance_constructors,
12339         initialized_fields, initialized_static_fields,
12340         default_constructor, base_inteface_types are protected to be
12341         accessible from StaticClass.
12342         (TypeContainer.DefineDefaultConstructor): New virtual method
12343         for custom default constructor generating
12344         (StaticClass): New class to handle "Static classes" feature.
12345
12346         * cs-parser.jay: Handle static keyword on class like instance
12347         of StaticClass.
12348
12349         * driver.cs: Added "/langversion" command line switch with two
12350         options (iso-1, default).
12351
12352 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
12353
12354         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12355
12356 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * delegate.cs: Style.
12359
12360 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12361
12362         * delegate.cs: Add seperate instance expr field for miguel.
12363
12364 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12365
12366         * PointerArithmetic (Resolve): make sure we are not doing
12367         pointer arith on void*. Also, make sure we are resolved
12368         by not setting eclass until resolve.
12369
12370         All callers: Make sure that PointerArithmetic gets resolved.
12371
12372 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12373
12374         * ArrayCreation (LookupType): If the type does not resolve 
12375         to an array, give an error.
12376
12377 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
12378
12379         * statement.cs (Try.Resolve): Fixed bug #64222
12380
12381 2004-08-27  Martin Baulig  <martin@ximian.com>
12382
12383         * class.cs
12384         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12385         crash here.     
12386
12387 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12388
12389         * ecore.cs (Constantify): Get underlying type via
12390         System.Enum.GetUnderlyingType to avoid StackOverflow on the
12391         Windows in special cases.
12392
12393 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12394
12395         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12396         for obtaining also private methods.
12397         (GetRemoveMethod): Used GetRemoveMethod (true)
12398         for obtaining also private methods.
12399
12400 2004-08-24  Martin Baulig  <martin@ximian.com>
12401
12402         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12403         MethodAttributes.HideBySig for operators.
12404
12405 2004-08-23  Martin Baulig  <martin@ximian.com>
12406
12407         Back to the old error reporting system :-)
12408
12409         * report.cs (Message): Removed.
12410         (Report.MessageData, ErrorData, WarningData): Removed.
12411         (Report.Error, Warning): Back to the old system.
12412
12413 2004-08-23  Martin Baulig  <martin@ximian.com>
12414
12415         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12416
12417         * class.cs (TypeContainer.ParentContainer): New public virtual
12418         method; replaces the explicit interface implementation.
12419         (ClassPart.ParentContainer): Override.
12420
12421 2004-08-23  Martin Baulig  <martin@ximian.com>
12422
12423         * statement.cs (Switch): Added support for constant switches; see
12424         #59428 or test-285.cs.
12425
12426 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12427
12428         Fixed bug #62740.
12429         * statement.cs (GetEnumeratorFilter): Removed useless
12430         logic because C# specs is strict. GetEnumerator must be
12431         public.
12432
12433 2004-08-22  Martin Baulig  <martin@ximian.com>
12434
12435         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12436         a switch and may break, reset the barrier.  Fixes #59867.
12437
12438 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12439
12440         CLS-Compliance speed up (~5% for corlib)
12441
12442         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12443         New method. Tests container for CLS-Compliant names
12444
12445         * class.cs (TypeContainer.VerifyClsName): New method.
12446         Checks whether container name is CLS Compliant.
12447         (Constructor): Implements IMethodData.
12448
12449         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12450         low-case table for CLS Compliance test.
12451         (MemberCache.VerifyClsParameterConflict): New method.
12452         Checks method parameters for CS3006 error.
12453
12454         * enum.cs (EnumMember): Is derived from MemberCore.
12455         (Enum.VerifyClsName): Optimized for better performance.
12456
12457 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12458
12459         * report.cs: Renamed Error_T to Error and changed all
12460         references.
12461
12462 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12463
12464         * class.cs (TypeContainer.IndexerArrayList): New inner class
12465         container for indexers.
12466         (TypeContainer.DefaultIndexerName): New constant for default
12467         indexer name. Replaced all "Item" with this constant.
12468         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12469
12470         * typemanager.cs (TypeManager.default_member_ctor): Cache here
12471         DefaultMemberAttribute constructor.
12472
12473 2004-08-05  Martin Baulig  <martin@ximian.com>
12474
12475         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12476         Fix bug #59429.
12477
12478 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
12479
12480         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12481         multi platforms problem.
12482
12483         * compiler.csproj: Included shared files.
12484
12485 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12486
12487         Fix bug 60333, 55971 in the more general way
12488         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12489         Added arg_type argument for constant conversion.
12490         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12491
12492 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12493
12494         Fix bug #59760
12495         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
12496         OperatorArrayList, MethodCoreArrayList for typecontainer
12497         containers. Changed class member types to these new types.
12498         (MethodArrayList.DefineMembers): Added test for CS0659.
12499
12500 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
12501
12502         * cfold.cs: Synchronize the folding with the code in expression.cs
12503         Binary.DoNumericPromotions for uint operands.
12504
12505         * attribute.cs: Revert patch from Raja, it introduced a regression
12506         while building Blam-1.2.1 (hard to isolate a test case).
12507
12508 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12509
12510         Fix for #55382
12511         * class.cs:
12512         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12513         name collision.
12514         (MethodCore.parent_method): New member. The method we're overriding
12515         if this is an override method.
12516         (MethodCore.CheckBase): Moved from Method class and made common.
12517         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12518         private.
12519         (MethodCore.CheckForDuplications): New abstract method. For custom
12520         member duplication search in a container
12521         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12522         method and its return type.
12523         (Event.conflict_symbol): New member. Symbol with same name in the
12524         parent class.
12525
12526         * decl.cs:
12527         (MemberCache.FindMemberWithSameName): New method. The method
12528         is looking for conflict with inherited symbols.
12529
12530 2004-08-04  Martin Baulig  <martin@ximian.com>
12531
12532         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12533
12534         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12535
12536 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12537
12538         * report.cs (Message): New enum for better error, warning reference in
12539         the code.
12540         (MessageData): New inner abstract class. It generally handles printing of
12541         error and warning messages.
12542         Removed unused Error, Warning, Message methods.
12543
12544 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12545
12546         Fix for cs0592-8.cs test
12547         * attribute.cs
12548         (Attributable.ValidAttributeTargets): Made public.
12549         (Attribute.ExplicitTarget): New member for explicit target value.
12550         (Attribute.CheckTargets): Now we translate explicit attribute
12551         target to Target here.
12552
12553 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12554
12555         * ecore.cs (MethodGroupExpr): new IsBase property.
12556
12557         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12558
12559         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12560         rather than an instance expr.
12561
12562         (DelegateCreation.Emit): Use the method group rather than
12563         the instance expression. Also, if you have base.Foo as the
12564         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12565
12566         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12567
12568         (NewDelegate.DoResolve): Only check for the existance of Invoke
12569         if the method is going to be needed. Use MethodGroupExpr.
12570
12571         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12572
12573         * expression.cs: For pointer arith., make sure to use
12574         the size of the type, not the size of the pointer to
12575         the type.
12576
12577 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12578
12579         Fix for #60722
12580         * class.cs (Class): Added error CS0502 test.
12581
12582 2004-08-03  John Luke  <jluke@cfl.rr.com>
12583             Raja R Harinath  <rharinath@novell.com>
12584
12585         Fix for #60997.
12586         * attribute.cs (Attribute.complained_before): New flag.
12587         (Attribute.ResolveType, Attribute.Resolve),
12588         (Attribute.DefinePInvokeMethod): Set it.
12589         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12590         
12591 2004-08-03  Martin Baulig  <martin@ximian.com>
12592
12593         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12594         use a user-defined operator; we still need to do numeric
12595         promotions in case one argument is a builtin type and the other
12596         one has an implicit conversion to that type.  Fixes #62322.
12597
12598 2004-08-02  Martin Baulig  <martin@ximian.com>
12599
12600         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12601         (LocalInfo.IsThis): New public property.
12602         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12603
12604 2004-08-01  Martin Baulig  <martin@ximian.com>
12605
12606         * class.cs (TypeContainer.GetClassBases): Don't set the default
12607         here since we may get called from GetPartialBases().
12608         (TypeContainer.DefineType): If GetClassBases() didn't return a
12609         parent, use the default one.
12610
12611 2004-07-30  Duncan Mak  <duncan@ximian.com>
12612
12613         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12614
12615 2004-07-30  Martin Baulig  <martin@ximian.com>
12616
12617         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12618
12619         * class.cs (SourceMethod): New public class, derive from the
12620         symbol writer's ISourceMethod.
12621         (Method): Use the new symbol writer API.
12622
12623         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12624         as argument and use the new symbol writer.
12625
12626         * location.cs
12627         (SourceFile): Implement the symbol writer's ISourceFile.
12628         (Location.SymbolDocument): Removed.
12629         (Location.SourceFile): New public property.
12630
12631         * symbolwriter.cs: Use the new symbol writer API.
12632
12633 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12634
12635         * Makefile (install-local): Remove.  Functionality moved to
12636         executable.make.
12637
12638 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12639
12640         * Makefile: Install mcs.exe.config file together with mcs.exe.
12641         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12642         correct runtime version.
12643         
12644 2004-07-25  Martin Baulig  <martin@ximian.com>
12645
12646         * class.cs
12647         (TypeContainer.RegisterOrder): Removed, this was unused.
12648         (TypeContainer, interface_order): Removed.
12649         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12650         TypeContainer as argument since we can also be called with a
12651         `PartialContainer' for a partial class/struct/interface.
12652         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12653         of checking whether we're an `Interface' - we could be a
12654         `PartialContainer'.
12655         (PartialContainer.Register): Override; call
12656         AddClass()/AddStruct()/AddInterface() on our parent.
12657
12658         * cs-parser.jay (interface_member_declaration): Add things to the
12659         `current_container', not the `current_class'.
12660
12661         * rootcontext.cs (RegisterOrder): The overloaded version which
12662         takes an `Interface' was unused, removed.
12663
12664         * typemanager.cs (TypeManager.LookupInterface): Return a
12665         `TypeContainer', not an `Interface'.
12666         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12667         contain a `PartialContainer' for an interface, so check it's
12668         `Kind' to figure out what it is.
12669
12670 2004-07-25  Martin Baulig  <martin@ximian.com>
12671
12672         * class.cs (Class.DefaultTypeAttributes): New public constant.
12673         (Struct.DefaultTypeAttributes): Likewise.
12674         (Interface.DefaultTypeAttributes): Likewise.
12675         (PartialContainer.TypeAttr): Override this and add the
12676         DefaultTypeAttributes.
12677
12678 2004-07-25  Martin Baulig  <martin@ximian.com>
12679
12680         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12681         we can just use the `Parent' field instead.
12682
12683 2004-07-25  Martin Baulig  <martin@ximian.com>
12684
12685         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12686
12687 2004-07-25  Martin Baulig  <martin@ximian.com>
12688
12689         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12690         our parts before defining any methods.
12691         (TypeContainer.VerifyImplements): Make this virtual.
12692         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12693         on our PartialContainer.
12694
12695 2004-07-25  Martin Baulig  <martin@ximian.com>
12696
12697         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12698
12699         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12700         argument, we can just use the `Parent' field instead.
12701
12702         * class.cs
12703         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12704         (MemberBase.DoDefine): Likewise.
12705
12706 2004-07-24  Martin Baulig  <martin@ximian.com>
12707
12708         * decl.cs (MemberCore.Parent): New public field.
12709         (DeclSpace.Parent): Moved to MemberCore.
12710
12711         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12712         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12713         parent's .ctor.
12714         (FieldBase, Field, Operator): Likewise.
12715         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12716         (EventField, Event): Likewise.
12717
12718 2004-07-23  Martin Baulig  <martin@ximian.com>
12719
12720         * class.cs (PartialContainer): New public class.
12721         (ClassPart): New public class.
12722         (TypeContainer): Added support for partial classes.
12723         (TypeContainer.GetClassBases): Splitted some of the functionality
12724         out into GetNormalBases() and GetPartialBases().
12725
12726         * cs-tokenizer.cs (Token.PARTIAL): New token.
12727         (Tokenizer.consume_identifier): Added some hacks to recognize
12728         `partial', but only if it's immediately followed by `class',
12729         `struct' or `interface'.
12730
12731         * cs-parser.jay: Added support for partial clases.
12732
12733 2004-07-23  Martin Baulig  <martin@ximian.com>
12734
12735         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12736         a `DeclSpace' and also made it readonly.
12737         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12738         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12739         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12740
12741         * cs-parser.jay: Pass the `current_class', not the
12742         `current_container' (at the moment, this is still the same thing)
12743         to a new Method, Property, Event, Indexer or Constructor.
12744
12745 2004-07-23  Martin Baulig  <martin@ximian.com>
12746
12747         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12748         and removed the `current_interface' one.
12749         (struct_declaration, class_declaration, interface_declaration):
12750         Set `current_class' to the newly created class/struct/interface;
12751         set their `Bases' and call Register() before parsing their body.
12752
12753 2004-07-23  Martin Baulig  <martin@ximian.com>
12754
12755         * class.cs (Kind): New public enum.
12756         (TypeContainer): Made this class abstract.
12757         (TypeContainer.Kind): New public readonly field.
12758         (TypeContainer.CheckDef): New public method; moved here from
12759         cs-parser.jay.
12760         (TypeContainer.Register): New public abstract method.
12761         (TypeContainer.GetPendingImplementations): New public abstract
12762         method.
12763         (TypeContainer.GetClassBases): Removed the `is_class' and
12764         `is_iface' parameters.
12765         (TypeContainer.DefineNestedTypes): Formerly known as
12766         DoDefineType().
12767         (ClassOrStruct): Made this class abstract.
12768
12769         * tree.cs (RootTypes): New public type. 
12770
12771 2004-07-20  Martin Baulig  <martin@ximian.com>
12772
12773         * tree.cs (Tree.RecordNamespace): Removed.
12774         (Tree.Namespaces): Removed.
12775
12776         * rootcontext.cs (RootContext.IsNamespace): Removed.
12777
12778         * cs-parser.jay (namespace_declaration): Just create a new
12779         NamespaceEntry here.
12780
12781 2004-07-20  Martin Baulig  <martin@ximian.com>
12782
12783         * statement.cs (ExceptionStatement): New abstract class.  This is
12784         now used as a base class for everyone who's using `finally'.
12785         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12786         our local variables before using them.
12787
12788         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12789         virtual method.  This is used by Yield.Resolve() to "steal" an
12790         outer block's `finally' clauses.
12791         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12792         argument.
12793
12794         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12795         version which takes an ExceptionStatement.  This version must be
12796         used to create exception branchings.
12797
12798         * iterator.cs
12799         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12800         (Iterator.EmitMoveNext): Added exception support; protect the
12801         block with a `fault' clause, properly handle 'finally' clauses.
12802         (Iterator.EmitDispose): Run all the `finally' clauses here.
12803
12804 2004-07-20  Martin Baulig  <martin@ximian.com>
12805
12806         * iterator.cs: This is the first of a set of changes in the
12807         iterator code.  Match the spec more closely: if we're an
12808         IEnumerable, then GetEnumerator() must be called.  The first time
12809         GetEnumerator() is called, it returns the current instance; all
12810         subsequent invocations (if any) must create a copy.
12811
12812 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12813
12814         * expression.cs: Resolve the constant expression before returning
12815         it. 
12816
12817 2004-07-19  Martin Baulig  <martin@ximian.com>
12818
12819         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12820         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12821         the return type of the new EmitContext.
12822
12823 2004-07-18  Martin Baulig  <martin@ximian.com>
12824
12825         * class.cs (Property.Define): Fix iterators.
12826
12827         * iterators.cs (Iterator.Define): Moved the
12828         `container.AddInterator (this)' call here from the .ctor; only do
12829         it if we resolved successfully.
12830
12831 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12832
12833         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12834         `true' for preprocessing directives that we parse.  The return
12835         value indicates whether we should return to regular tokenizing or
12836         not, not whether it was parsed successfully.
12837
12838         In the past if we were in: #if false ... #line #endif, we would
12839         resume parsing after `#line'.  See bug 61604.
12840
12841         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12842         building: IsEnumType should return true only for enums, not for
12843         enums or System.Enum itself.  This fixes #61593.
12844
12845         Likely what happened is that corlib was wrong: mcs depended on
12846         this bug in some places.  The bug got fixed, we had to add the
12847         hack, which caused bug 61593.
12848
12849         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12850         that was a workaround for the older conditions.
12851
12852 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12853
12854         * assign.cs: IAssignMethod has a new interface, as documented
12855         inline. All assignment code now uses this new api.
12856
12857         * ecore.cs, expression.cs: All classes which implement
12858         IAssignMethod now use the new interface.
12859
12860         * expression.cs (Invocation): add a hack to EmitCall so that
12861         IndexerAccess can be the target of a compound assignment without
12862         evaluating its arguments twice.
12863
12864         * statement.cs: Handle changes in Invocation api.
12865
12866 2004-07-16  Martin Baulig  <martin@ximian.com>
12867
12868         * iterators.cs: Rewrote this.  We're now using one single Proxy
12869         class for both the IEnumerable and the IEnumerator interface and
12870         `Iterator' derives from Class so we can use the high-level API.
12871
12872         * class.cs (TypeContainer.AddIterator): New method.
12873         (TypeContainer.DoDefineType): New protected virtual method, which
12874         is called from DefineType().
12875         (TypeContainer.DoDefineMembers): Call DefineType() and
12876         DefineMembers() on all our iterators.
12877         (TypeContainer.Emit): Call Emit() on all our iterators.
12878         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12879
12880         * codegen.cs (EmitContext.CurrentIterator): New public field.
12881
12882 2004-07-15  Martin Baulig  <martin@ximian.com>
12883
12884         * typemanager.cs
12885         (TypeManager.not_supported_exception_type): New type.   
12886
12887 2004-07-14  Martin Baulig  <martin@ximian.com>
12888
12889         * iterators.cs: Use real error numbers.
12890
12891 2004-07-14  Martin Baulig  <martin@ximian.com>
12892
12893         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12894         requires this to be a System.Collection.IEnumerable and not a
12895         class implementing that interface.
12896         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12897
12898 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12899
12900         * class.cs: Fixed previous fix, it broke some error tests.
12901
12902 2004-07-12  Martin Baulig  <martin@ximian.com>
12903
12904         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12905         Fixes #61293.
12906
12907 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12908
12909         * assign.cs (LocalTemporary): Add new argument: is_address,If
12910         `is_address' is true, then the value that we store is the address
12911         to the real value, and not the value itself.
12912         
12913         * ecore.cs (PropertyExpr): use the new local temporary
12914         stuff to allow us to handle X.Y += z (where X is a struct)
12915
12916 2004-07-08  Martin Baulig  <martin@ximian.com>
12917
12918         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12919         not always return, just like we're doing in Using.Resolve().
12920
12921 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12922
12923         * cs-parser.jay (fixed_statement): flag this as Pinned.
12924
12925 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12926
12927         * typemanager.cs (TypeManager): Removed MakePinned method, this
12928         mechanism is replaced with the .NET 2.x compatible mechanism of
12929         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12930
12931         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12932         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12933         `IsFixed' property which has a different meaning.
12934
12935 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12936
12937         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12938         visible from inside a nested class, not just the names of the
12939         immediately enclosing class.
12940         Fix for bug #60730.
12941
12942 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12943
12944         * expression.cs (BetterConversion): Remove buggy special-case
12945         handling of "implicit constant expression conversions".  At this
12946         point, we already know that the conversion is possible -- we're
12947         only checking to see which is better.
12948
12949 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12950
12951         * cs-parser.jay: Added error CS0210 test.
12952
12953 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12954
12955         * cs-parser.jay: Added error CS0134 test.
12956
12957 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12958
12959         Fix bug #52507
12960         * cs-parser.jay: Added error CS0145 test.
12961
12962 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12963
12964         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12965
12966 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12967         
12968         * expression.cs (StackAlloc.Resolve): The argument may not
12969         be a constant; deal with this case.
12970         
12971 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12972
12973         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12974         GetIndexerAttributeValue.
12975         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12976
12977         * class.cs (Indexer.Define): Added error tests for CS0415,
12978         CS0609.
12979
12980 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12981
12982         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12983         property code.
12984
12985 2004-06-23  Martin Baulig  <martin@ximian.com>
12986
12987         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12988         neither return nor throw, reset the barrier as well.  Fixes #60457.
12989
12990 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12991
12992         * class.cs : EventAttributes is now set to None by default.
12993           This fixes bug #60459.
12994
12995 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12996
12997         Fix bug #60219
12998         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12999         Don't throw exception but return null (it's sufficient now).
13000
13001 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
13002
13003         * typemanager.cs (GetArgumentTypes): Faster implementation.
13004
13005 2004-06-18  Martin Baulig  <martin@ximian.com>
13006
13007         * attribute.cs (Attribute.Resolve): Check whether we're an
13008         EmptyCast which a Constant child.  Fixes #60333.
13009
13010 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
13011
13012         * statement.cs (EmitCollectionForeach): Account for the fact that
13013         not all valuetypes are in areas which we can take the address of.
13014         For these variables, we store to a temporary variable. Also, make
13015         sure that we dont emit a `callvirt' on a valuetype method.
13016
13017 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13018
13019         * expression.cs (StackAlloc.DoReSolve): Added test for
13020         negative parameter (CS0247).
13021
13022 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13023
13024         Fix bug #59792
13025         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
13026
13027 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13028
13029         Fix bug #59781
13030         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
13031         ulong.
13032
13033 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
13034
13035         Fix bug #58254 & cs1555.cs, cs1556.cs
13036         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
13037
13038 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
13039
13040         * cs-parser.jay: Added error CS1669 test for indexers.
13041
13042 2004-06-11  Martin Baulig  <martin@ximian.com>
13043
13044         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
13045         call this twice: for params and varargs methods.
13046
13047 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13048
13049         * class.cs:
13050         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
13051
13052 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13053
13054         * attribute.cs (Attribute.GetValidTargets): Made public.
13055
13056         * class.cs: 
13057         (AbstractPropertyEventMethod): New class for better code sharing.
13058         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13059         CS1667 report.
13060         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13061
13062 2004-06-11  Raja R Harinath  <rharinath@novell.com>
13063
13064         Fix bug #59477.
13065         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13066         that the call to Resolve is part of a MemberAccess.
13067         (Expression.Resolve): Use it for SimpleName resolution.
13068         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
13069         Add 'intermediate' boolean argument.
13070         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
13071         error message when the SimpleName can be resolved ambiguously
13072         between an expression and a type.
13073         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
13074         public.
13075         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
13076         call on the left-side.
13077
13078 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13079
13080         * class.cs:
13081         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
13082
13083 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13084
13085         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
13086
13087 2004-06-11  Martin Baulig  <martin@ximian.com>
13088
13089         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
13090         varargs methods if applicable.
13091
13092 2004-06-11  Martin Baulig  <martin@ximian.com>
13093
13094         * expression.cs (Invocation.EmitCall): Don't use
13095         `method.CallingConvention == CallingConventions.VarArgs' since the
13096         method could also have `CallingConventions.HasThis'.
13097
13098 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13099
13100         * class.cs (Event.GetSignatureForError): Implemented.
13101         Fixed crash in error test cs3010.cs
13102
13103 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * cs-tokenizer.cs: Change the way we track __arglist to be
13106         consistent with the other keywords.
13107
13108 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
13109
13110         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
13111         tomorrow.
13112
13113 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
13114
13115         * codegen.cs: Check that all referenced assemblies have a strongname
13116         before strongnaming the compiled assembly. If not report error CS1577.
13117         Fix bug #56563. Patch by Jackson Harper.
13118         * typemanager.cs: Added a method to return all referenced assemblies.
13119         Fix bug #56563. Patch by Jackson Harper.
13120
13121 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
13122
13123         * class.cs:
13124         (Method.ApplyAttributeBuilder): Moved and added conditional
13125         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
13126
13127         * delegate.cs:
13128         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
13129
13130 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
13131
13132         Fixed #59640
13133         * class.cs: (EventField.attribute_targets): Changed default target.
13134
13135 2004-06-08  Martin Baulig  <martin@ximian.com>
13136
13137         * expression.cs (Invocation.EmitCall): Enable varargs methods.
13138
13139 2004-06-08  Martin Baulig  <martin@ximian.com>
13140
13141         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
13142
13143 2004-06-07  Martin Baulig  <martin@ximian.com>
13144
13145         Added support for varargs methods.
13146
13147         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
13148         keyword.
13149
13150         * cs-parser.jay: Added support for `__arglist'.
13151
13152         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
13153
13154         * expression.cs (Argument.AType): Added `ArgList'.
13155         (Invocation): Added support for varargs methods.
13156         (ArglistAccess): New public class.
13157         (Arglist): New public class.
13158
13159         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
13160
13161         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
13162         a method's top-level block if the method has varargs.
13163
13164         * support.cs (ReflectionParameters, InternalParameters): Added
13165         support for varargs methods.    
13166
13167 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * class.cs: Provide location in indexer error report.
13170
13171         * driver.cs: Use standard names.
13172
13173         * namespace.cs: Catch the use of using after a namespace has been
13174         declared also on using aliases.
13175
13176 2004-06-03  Raja R Harinath  <rharinath@novell.com>
13177
13178         Bug #50820.
13179         * typemanager.cs (closure_private_ok, closure_invocation_type)
13180         (closure_qualifier_type, closure_invocation_assembly)
13181         (FilterWithClosure): Move to ...
13182         (Closure): New internal nested class.
13183         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13184         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13185         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13186         (MemberLookup, MemberLookupFailed): Use it.
13187         * expression.cs (New.DoResolve): Treat the lookup for the
13188         constructor as being qualified by the 'new'ed type.
13189         (Indexers.GetIndexersForTypeOrInterface): Update.
13190
13191 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
13192
13193         * attribute.cs
13194         (GetConditionalAttributeValue): New method. Returns
13195         condition of ConditionalAttribute.
13196         (SearchMulti): New method.  Returns all attributes of type 't'.
13197         Use it when attribute is AllowMultiple = true.
13198         (IsConditionalMethodExcluded): New method.
13199
13200         * class.cs
13201         (Method.IsExcluded): Implemented. Returns true if method has conditional
13202         attribute and the conditions is not defined (method is excluded).
13203         (IMethodData): Extended interface for ConditionalAttribute support.
13204         (PropertyMethod.IsExcluded): Implemented.
13205
13206         * decl.cs
13207         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13208
13209         * expression.cs
13210         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13211         on the method.
13212
13213 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13214
13215         * expression.cs (ArrayCreationExpression): Make this just an
13216         `expression'. It can't be a statement, so the code here was
13217         dead.
13218
13219 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13220
13221         Fixed #59072
13222         * typemanager.cs (GetFullNameSignature): New method for
13223         MethodBase types.
13224
13225 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13226
13227         Fixed #56452
13228         * class.cs (MemberBase.GetSignatureForError): New virtual method.
13229         Use this method when MethodBuilder is null.
13230         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13231         Added test for error CS0626 (MONO reports error for this situation).
13232         (IMethodData.GetSignatureForError): Extended interface.
13233
13234 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13235
13236         * attribute.cs
13237         (AttributeTester.GetObsoleteAttribute): Returns instance of
13238         ObsoleteAttribute when type is obsolete.
13239
13240         * class.cs
13241         (TypeContainer.VerifyObsoleteAttribute): Override.
13242         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13243         (MethodCode.VerifyObsoleteAttribute): Override.
13244         (MemberBase.VerifyObsoleteAttribute): Override.
13245
13246         * decl.cs
13247         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13248         and report proper error.
13249
13250         *delegate.cs
13251         Delegate.VerifyObsoleteAttribute): Override.
13252
13253         * ecore.cs
13254         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13255         and report proper error.
13256         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13257
13258         * enum.cs
13259         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13260         and enum member.
13261
13262         * expression.cs
13263         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13264         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13265         Added test for ObsoleteAttribute.
13266
13267         * statement.cs
13268         (Catch): Derived from Statement.
13269
13270 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13271  
13272         Fixed bug #59071 & cs0160.cs
13273  
13274         * statement.cs (Try.Resolve): Check here whether order of catch
13275         clauses matches their dependencies.
13276
13277 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
13278
13279         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
13280         caused a regression: #59343.  Referencing nested classes from an
13281         assembly stopped working.
13282
13283 2004-05-31  Martin Baulig  <martin@ximian.com>
13284
13285         MCS is now frozen for beta 2.
13286
13287 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13288
13289         * convert.cs: add a trivial cache for overload operator resolution.
13290
13291 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13292
13293         * decl.cs: If possible, use lookuptypedirect here. We can only do
13294         this if there is no `.' after the namespace. Avoids using
13295         LookupType, which does lots of slow processing.
13296         (FindNestedType) New method, does what it says :-).
13297         * namespace.cs: use LookupTypeDirect.
13298         * rootcontext.cs: use membercache, if possible.
13299         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13300
13301 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13302
13303         * expression.cs:
13304         According to the spec, 
13305
13306         In a member access of the form E.I, if E is a single identifier,
13307         and if the meaning of E as a simple-name (§7.5.2) is a constant,
13308         field, property, localvariable, or parameter with the same type as
13309         the meaning of E as a type-name (§3.8), then both possible
13310         meanings of E are permitted.
13311
13312         We did not check that E as a simple-name had the same type as E as
13313         a type name.
13314
13315         This trivial check gives us 5-7% on bootstrap time.
13316
13317 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13318
13319         * expression.cs (Invocation.OverloadResolve): Avoid the
13320         use of hashtables and boxing here by allocating on demand.
13321
13322 2004-05-30  Martin Baulig  <martin@ximian.com>
13323
13324         * rootcontext.cs (RootContext.LookupType): Don't cache things if
13325         we're doing a silent lookup.  Don't try to lookup nested types in
13326         TypeManager.object_type (thanks to Ben Maurer).
13327
13328 2004-05-30  Martin Baulig  <martin@ximian.com>
13329
13330         Committing a patch from Ben Maurer.
13331
13332         * rootcontext.cs (RootContext.LookupType): Cache negative results.
13333
13334 2004-05-29  Martin Baulig  <martin@ximian.com>
13335
13336         * class.cs (IMethodData.ShouldIgnore): New method.
13337
13338         * typemanager.cs (TypeManager.MethodFlags): Don't take a
13339         `Location' argument, we don't need it anywhere.  Use
13340         `IMethodData.ShouldIgnore ()' instead of
13341         `MethodData.GetMethodFlags ()'.
13342         (TypeManager.AddMethod): Removed.
13343         (TypeManager.AddMethod2): Renamed to AddMethod.
13344
13345 2004-05-29  Martin Baulig  <martin@ximian.com>
13346
13347         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13348
13349         * convert.cs (Convert.ImplicitReferenceConversion): If we're
13350         converting from a class type S to an interface type and we already
13351         have an object on the stack, don't box it again.  Fixes #52578.
13352
13353 2004-05-29  Martin Baulig  <martin@ximian.com>
13354
13355         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13356         Added support for `params' parameters.  Fixes #59267.
13357
13358 2004-05-29  Martin Baulig  <martin@ximian.com>
13359
13360         * literal.cs (NullPointer): Provide a private .ctor which sets
13361         `type' to TypeManager.object_type.  Fixes #59048.
13362
13363 2004-05-29  Martin Baulig  <martin@ximian.com>
13364
13365         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13366         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
13367
13368         * ecore.cs (EventExpr.instance_expr): Make the field private.
13369
13370 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
13371
13372         Fixed bug #50080 & cs0214-2.cs
13373         * expression.cs (Cast.DoResolve): Check unsafe context here.
13374         
13375         * statement.cs (Resolve.DoResolve): Likewise.
13376
13377 2004-05-26  Martin Baulig  <martin@ximian.com>
13378
13379         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13380
13381         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13382         (RootContext.LookupType): Pass down the `silent' flag.
13383
13384 2004-05-25  Martin Baulig  <martin@ximian.com>
13385
13386         * expression.cs
13387         (MethodGroupExpr.IdenticalTypeName): New public property.
13388         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13389         expression actually refers to a type.
13390
13391 2004-05-25  Martin Baulig  <martin@ximian.com>
13392
13393         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13394         for #56176 and made it actually work.
13395
13396 2004-05-25  Martin Baulig  <martin@ximian.com>
13397
13398         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13399         (FieldExpr, PropertyExpr): Override and implement
13400         CacheTemporaries.  Fixes #52279.
13401
13402 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * location.cs: In the new compiler listing a file twice is a
13405         warning, not an error.
13406
13407 2004-05-24  Martin Baulig  <martin@ximian.com>
13408
13409         * enum.cs (Enum.DefineType): For the `BaseType' to be a
13410         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
13411
13412 2004-05-24  Martin Baulig  <martin@ximian.com>
13413
13414         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13415         walking the `using' list.  Fixes #53921.
13416
13417 2004-05-24  Martin Baulig  <martin@ximian.com>
13418
13419         * const.cs (Const.LookupConstantValue): Added support for
13420         EmptyCast's; fixes #55251.
13421
13422 2004-05-24  Martin Baulig  <martin@ximian.com>
13423
13424         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13425         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13426         which does the CS0135 check.  The reason is that we first need to
13427         check whether the variable actually exists.
13428
13429 2004-05-24  Martin Baulig  <martin@ximian.com>
13430
13431         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13432         than RootContext.LookupType() to find the explicit interface
13433         type.  Fixes #58584.
13434
13435 2004-05-24  Raja R Harinath  <rharinath@novell.com>
13436
13437         * Makefile: Simplify.  Use executable.make.
13438         * mcs.exe.sources: New file.  List of sources of mcs.exe.
13439
13440 2004-05-24  Anders Carlsson  <andersca@gnome.org>
13441
13442         * decl.cs:
13443         * enum.cs:
13444         Use the invariant culture when doing String.Compare for CLS case
13445         sensitivity.
13446         
13447 2004-05-23  Martin Baulig  <martin@ximian.com>
13448
13449         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13450         don't have any dots.  Fixes #52622, added cs0246-8.cs.
13451
13452         * namespace.cs (NamespaceEntry.Lookup): Likewise.
13453         
13454 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13455
13456         * class.cs (MemberBase.Define): Reuse MemberType member for 
13457         resolved type. Other methods can use it too.
13458
13459 2004-05-23  Martin Baulig  <martin@ximian.com>
13460
13461         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13462         the variable also exists in the current block (otherwise, we need
13463         to report a CS0103).  Fixes #58670.
13464
13465 2004-05-23  Martin Baulig  <martin@ximian.com>
13466
13467         * flowanalysis.cs (Reachability.Reachable): Compute this
13468         on-the-fly rather than storing it as a field.
13469
13470 2004-05-23  Martin Baulig  <martin@ximian.com>
13471
13472         * flowanalysis.cs (Reachability.And): Manually compute the
13473         resulting `barrier' from the reachability.      
13474        
13475 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13476
13477         Fix bug #57835
13478         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13479         instance of ObsoleteAttribute when symbol is obsolete.
13480
13481         * class.cs
13482         (IMethodData): Extended interface for ObsoleteAttribute support.
13483
13484 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13485
13486         * attribute.cs: Fix bug #55970
13487
13488 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13489
13490         Fix bug #52705
13491         * attribute.cs
13492         (GetObsoleteAttribute): New method. Creates the instance of
13493         ObsoleteAttribute.
13494         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13495         ObsoleteAttribute when member is obsolete.
13496         (AttributeTester.Report_ObsoleteMessage): Common method for
13497         Obsolete error/warning reporting.
13498
13499         * class.cs
13500         (TypeContainer.base_classs_type): New member for storing parent type.
13501
13502         * decl.cs
13503         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13504         for this MemberCore.
13505
13506 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13507
13508         * attribute.cs, const.cs: Fix bug #58590
13509
13510 2004-05-21  Martin Baulig  <martin@ximian.com>
13511
13512         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13513         out parameters if the end of the method is unreachable.  Fixes
13514         #58098. 
13515
13516 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13517
13518         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13519         Hari was right, why extra method.
13520
13521 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13522
13523         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13524
13525 2004-05-20  Martin Baulig  <martin@ximian.com>
13526
13527         Merged this back from gmcs to keep the differences to a minumum.
13528
13529         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13530         instead of a Declspace.
13531         (Attribute.ResolveType): Likewise.
13532         (Attributes.Search): Likewise.
13533         (Attributes.Contains): Likewise.
13534         (Attributes.GetClsCompliantAttribute): Likewise.
13535
13536         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13537         argument.
13538         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13539         DeclSpace.
13540
13541 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13542
13543         Fix bug #58688 (MCS does not report error when the same attribute
13544         is assigned twice)
13545
13546         * attribute.cs (Attribute.Emit): Distinction between null and default.
13547
13548 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13549
13550         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13551         of a top-level attribute without an attribute target.
13552         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13553         Make non-static.
13554         (Attribute.Conditional_GetConditionName), 
13555         (Attribute.Obsolete_GetObsoleteMessage): Update.
13556         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13557         part of ScanForIndexerName.
13558         (Attribute.CanIgnoreInvalidAttribute): New function.
13559         (Attribute.ScanForIndexerName): Move to ...
13560         (Attributes.ScanForIndexerName): ... here.
13561         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13562         (Attributes.Search): New internal variant that can choose not to
13563         complain if types aren't resolved.  The original signature now
13564         complains.
13565         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13566         complaints suppressed.
13567         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13568         only if it not useful.
13569         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13570         top-level for attributes that are shared between the assembly
13571         and a top-level class.
13572         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13573         * class.cs: Update to reflect changes.
13574         (DefineIndexers): Fuse loops.
13575         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13576         a couple more variants of attribute names.
13577
13578 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13579
13580         Fix bug #52585 (Implemented explicit attribute declaration)
13581
13582         * attribute.cs:
13583         (Attributable.ValidAttributeTargets): New abstract method. It gets
13584         list of valid attribute targets for explicit target declaration.
13585         (Attribute.Target): It holds target itself.
13586         (AttributeSection): Removed.
13587         (Attribute.CheckTargets): New method. It checks whether attribute
13588         target is valid for the current element.
13589
13590         * class.cs:
13591         (EventProperty): New class. For events that are declared like
13592         property (with add and remove accessors).
13593         (EventField): New class. For events that are declared like field.
13594         class.cs
13595
13596         * cs-parser.jay: Implemented explicit attribute target declaration.
13597
13598         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13599         Override ValidAttributeTargets.
13600
13601         * parameter.cs:
13602         (ReturnParameter): Class for applying custom attributes on 
13603         the return type.
13604         (ParameterAtribute): New class. Class for applying custom
13605         attributes on the parameter type.
13606
13607 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13608
13609         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13610         definitions. 
13611
13612         (Method): Allow UNSAFE here.
13613
13614         * modifiers.cs: Support unsafe reporting.
13615
13616 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13617
13618         * decl.cs: Fix bug #58478.
13619
13620 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13621
13622         * statement.cs: When checking for unreachable code on an EmptyStatement,
13623         set the location. Fixes bug #58488.
13624
13625 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * driver.cs: Add -pkg handling.
13628
13629         From Gonzalo: UseShelLExecute=false
13630
13631 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13632
13633         * attribute.cs:
13634         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13635         for attribute.
13636         (Attribute.IsClsCompliaceRequired): Moved to base for better
13637         accesibility.
13638         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13639         when attribute is AttributeUsageAttribute.
13640         (Attribute.GetValidTargets): Simplified.
13641         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13642         attribute for this type.
13643         (Attribute.ApplyAttributes): Method renamed to Emit and make
13644         non-static.
13645         (GlobalAttributeSection): New class for special handling of global
13646         attributes (assembly, module).
13647         (AttributeSection.Emit): New method.
13648
13649         * class.cs: Implemented Attributable abstract methods.
13650         (MethodCore.LabelParameters): Moved to Parameter class.
13651         (Accessor): Is back simple class.
13652         (PropertyMethod): Implemented Attributable abstract class.
13653         (DelegateMethod): Implemented Attributable abstract class.
13654         (Event): New constructor for disctintion between normal Event
13655         and Event with accessors.
13656
13657         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13658
13659         * codegen.cs, const.cs, decl.cs, delegate.cs:
13660         (CommonAssemblyModulClass): Implemented Attributable abstract class
13661         and simplified.
13662
13663         * enum.cs: Implement IAttributeSupport interface.
13664         (EnumMember): New class for emum members. Implemented Attributable
13665         abstract class
13666
13667         * parameter.cs:
13668         (ParameterBase): Is abstract.
13669         (ReturnParameter): New class for easier [return:] attribute handling.
13670
13671         * typemanager.cs: Removed builder_to_attr.
13672
13673 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13674
13675         Fix bug #57151.
13676         * attribute.cs (Attribute.GetPositionalValue): New function.
13677         * class.cs (TypeContainer.VerifyMembers): New function.
13678         (TypeContainer.Emit): Use it.
13679         (ClassOrStruct): New base class for Class and Struct.
13680         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13681         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13682         class.
13683         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13684         then each non-static field should have a FieldOffset attribute.
13685         Otherwise, none of the fields should have a FieldOffset attribute.
13686         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13687         and FieldOffset attributes.
13688         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13689         (TypeManager.field_offset_attribute_type): New core types.
13690         (TypeManager.InitCoreTypes): Initialize them.
13691
13692 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13693
13694         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13695         Return correct type.
13696         From bug #58270.
13697
13698 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13699
13700         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13701         be implicitly converted to ulong.
13702         
13703         * expression.cs: The logic for allowing operator &, | and ^ worked
13704         was wrong, it worked before because we did not report an error in
13705         an else branch.  Fixes 57895.
13706
13707         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13708         allow volatile fields to be reference types.
13709
13710 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13711
13712         * driver.cs: Add support for /debug-
13713
13714 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13715
13716         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13717         Add a 'complain' parameter to silence errors.
13718         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13719         silently overlooked type-resolutions.
13720         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13721         to reflect changes.
13722         (Attributes.Search): New function.
13723         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13724         (Attributes.GetAttributeFullName): Remove hack.
13725         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13726         Update to reflect changes.
13727         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13728         Use Attributes.Search instead of nested loops.
13729
13730 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13731
13732         * decl.cs:
13733         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13734         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13735         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13736
13737         * report.cs: (Report.Warning): Renamed to Warning_T because of
13738         parameter collision.
13739
13740 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13741
13742         * expression.cs (MemberAccess.ResolveMemberAccess):
13743         Exit with non-zero status after Report.Error.
13744         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13745         Likewise.
13746         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13747
13748 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13749
13750         * support.cs: Don't hang when the file is empty.
13751
13752 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13753
13754         * support.cs: In SeekableStreamReader, compute the preamble size of the
13755           underlying stream. Position changes should take into account that initial
13756           count of bytes.
13757
13758 2004-05-03  Todd Berman  <tberman@sevenl.net>
13759
13760         * driver.cs: remove unused GetSysVersion function.
13761
13762 2004-05-03  Todd Berman  <tberman@sevenl.net>
13763
13764         * driver.cs: Remove the hack from saturday, as well as the hack
13765         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13766         link_paths to get that bit proper.
13767
13768 2004-05-01  Todd Berman  <tberman@sevenl.net>
13769
13770         * driver.cs: Try a LoadFrom before a Load, this checks the current
13771         path. This is currently a bug in mono that is be fixed, however, this
13772         provides a workaround for now. This will be removed when the bug
13773         is fixed.
13774
13775 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13776
13777         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13778         incomplete key pairs (#57941).
13779
13780 2004-05-01  Todd Berman  <tberman@sevenl.net>
13781
13782         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13783         from the GAC
13784
13785 2004-04-30  Jackson Harper  <jackson@ximian.com>
13786
13787         * codegen.cs: Open keys readonly.
13788         
13789 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13790
13791         * typemanager.cs: don't report cyclic struct layout when a struct
13792         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13793         which has 2 Pango.Rectangle fields.
13794
13795 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13796
13797         * expression.cs: Handle IntPtr comparisons with IL code
13798         rather than a method call.
13799
13800 2004-04-29  Martin Baulig  <martin@ximian.com>
13801
13802         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13803         the list of PropertyInfo's in class hierarchy and find the
13804         accessor.  Fixes #56013.
13805
13806 2004-04-29  Martin Baulig  <martin@ximian.com>
13807
13808         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13809
13810 2004-04-29  Martin Baulig  <martin@ximian.com>
13811
13812         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13813
13814         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13815
13816 2004-04-29  Martin Baulig  <martin@ximian.com>
13817
13818         * class.cs (ConstructorInitializer.Resolve): Check whether the
13819         parent .ctor is accessible.  Fixes #52146.
13820
13821 2004-04-29  Martin Baulig  <martin@ximian.com>
13822
13823         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13824
13825         * statement.cs (Using.EmitLocalVariableDecls): Use
13826         TypeManager.idisposable_type, not typeof (IDisposable).
13827         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13828
13829 2004-04-29  Martin Baulig  <martin@ximian.com>
13830
13831         * class.cs (Event.Define): Don't emit the field and don't set
13832         RTSpecialName and SpecialName for events on interfaces.  Fixes
13833         #57703. 
13834
13835 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13836
13837         Refactor Attribute.ApplyAttributes.
13838         * attribute.cs (Attributable): New base class for objects that can
13839         have Attributes applied on them.
13840         (Attribute): Make AttributeUsage fields public.
13841         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13842         (Attribute.IsInternalCall): New property.
13843         (Attribute.UsageAttr): Convert to a public read-only property.
13844         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13845         (Attribute.ResolveType, Attribute.Resolve)
13846         (Attribute.ScanForIndexerName): Update to reflect changes.
13847         (Attribute.CheckAttributeTarget): Re-format.
13848         (Attribute.ApplyAttributes): Refactor, to various
13849         Attributable.ApplyAttributeBuilder methods.
13850         * decl.cs (MemberCore): Make Attributable.
13851         * class.cs (Accessor): Make Attributable.
13852         (MethodData.ApplyAttributes): Use proper attribute types, not
13853         attribute names.
13854         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13855         (TypeContainer.ApplyAttributeBuilder)
13856         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13857         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13858         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13859         (Operator.ApplyAttributeBuilder): New factored-out methods.
13860         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13861         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13862         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13863         * parameter.cs (ParameterBase): New Attributable base class
13864         that can also represent Return types.
13865         (Parameter): Update to the changes.
13866
13867 2004-04-29  Jackson Harper  <jackson@ximian.com>
13868
13869         * driver.cs: Prefer the corlib system version when looking for
13870         assemblies in the GAC. This is still a hack, but its a better hack
13871         now.
13872         
13873 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13874
13875         * decl.cs, enum.cs: Improved error 3005 reporting.
13876   
13877         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13878         (related_symbols): New private member for list of symbols
13879         related to reported error/warning.
13880         
13881         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13882
13883 2004-04-29  Martin Baulig  <martin@ximian.com>
13884
13885         * ecore.cs (Expression.Constantify): If we're an enum and
13886         TypeManager.TypeToCoreType() doesn't give us another type, use
13887         t.UnderlyingSystemType.  Fixes #56178.  
13888
13889 2004-04-29  Martin Baulig  <martin@ximian.com>
13890
13891         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13892         interfaces and for each interface, only add members directly
13893         declared in that interface.  Fixes #53255.
13894
13895 2004-04-28  Martin Baulig  <martin@ximian.com>
13896
13897         * expression.cs (ConditionalLogicalOperator): Use a temporary
13898         variable for `left' to avoid that we evaluate it more than once;
13899         bug #52588.
13900
13901 2004-04-28  Martin Baulig  <martin@ximian.com>
13902
13903         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13904         `void[]' (CS1547).
13905
13906 2004-04-28  Martin Baulig  <martin@ximian.com>
13907
13908         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13909         void (CS1547).
13910
13911         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13912         whether the type is not void (CS1547).
13913
13914 2004-04-28  Martin Baulig  <martin@ximian.com>
13915
13916         * expression.cs (Unary.DoResolveLValue): Override this and report
13917         CS0131 for anything but Operator.Indirection.
13918
13919 2004-04-28  Martin Baulig  <martin@ximian.com>
13920
13921         Committing a patch from Ben Maurer; see bug #50820.
13922
13923         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13924         check for classes.
13925
13926         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13927         classes.        
13928
13929 2004-04-28  Martin Baulig  <martin@ximian.com>
13930
13931         Committing a patch from Ben Maurer; see bug #50820.
13932
13933         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13934         check for classes.
13935
13936         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13937         classes.        
13938
13939 2004-04-28  Martin Baulig  <martin@ximian.com>
13940
13941         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13942         (Block.AddLabel): Call DoLookupLabel() to only search in the
13943         current block.
13944
13945 2004-04-28  Martin Baulig  <martin@ximian.com>
13946
13947         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13948         comparing StringConstants and NullLiterals in Equality and Inequality.
13949
13950 2004-04-28  Jackson Harper  <jackson@ximian.com>
13951
13952         * driver.cs: Attempt to load referenced assemblies from the
13953         GAC. This is the quick and dirty version of this method that
13954         doesnt take into account versions and just takes the first
13955         canidate found. Will be good enough for now as we will not have more
13956         then one version installed into the GAC until I update this method.
13957
13958 2004-04-28  Martin Baulig  <martin@ximian.com>
13959
13960         * typemanager.cs (TypeManager.CheckStructCycles): New public
13961         static method to check for cycles in the struct layout.
13962
13963         * rootcontext.cs (RootContext.PopulateTypes): Call
13964         TypeManager.CheckStructCycles() for each TypeContainer.
13965         [Note: We only need to visit each type once.]
13966
13967 2004-04-28  Martin Baulig  <martin@ximian.com>
13968
13969         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13970
13971         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13972         success and added `out object value'.  Use a `bool resolved' field
13973         to check whether we've already been called rather than
13974         `ConstantValue != null' since this breaks for NullLiterals.
13975
13976 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13977
13978         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13979         setting of this flag, since the 'set' method may be non-public.
13980
13981 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13982
13983         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13984         check on current_vector.Block.
13985
13986 2004-04-27  Martin Baulig  <martin@ximian.com>
13987
13988         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13989         a field initializer.  Fixes #56459.
13990
13991 2004-04-27  Martin Baulig  <martin@ximian.com>
13992
13993         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13994         we're not attempting to use an indexer.  Fixes #52154.
13995
13996 2004-04-27  Martin Baulig  <martin@ximian.com>
13997
13998         * statement.cs (Return): Don't create a return label if we don't
13999         need it; reverts my change from January 20th.  Thanks to Ben
14000         Maurer for this.
14001
14002 2004-04-27  Martin Baulig  <martin@ximian.com>
14003
14004         According to the spec, `goto' can only leave a nested scope, but
14005         never enter it.
14006
14007         * statement.cs (Block.LookupLabel): Only lookup in the current
14008         block, don't recurse into parent or child blocks.
14009         (Block.AddLabel): Check in parent and child blocks, report
14010         CS0140/CS0158 if we find a duplicate.
14011         (Block): Removed this indexer for label lookups.
14012         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
14013         this already does the error reporting for us.
14014
14015         * flowanalysis.cs
14016         (FlowBranching.UsageVector.Block): New public variable; may be null.
14017         (FlowBranching.CreateSibling): Added `Block' argument.
14018         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
14019         label for the target of a `goto' and check whether we're not
14020         leaving a `finally'.
14021
14022 2004-04-27  Martin Baulig  <martin@ximian.com>
14023
14024         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14025         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
14026         just for returns).
14027
14028 2004-04-27  Martin Baulig  <martin@ximian.com>
14029
14030         * statement.cs (Block.AddLabel): Also check for implicit blocks
14031         and added a CS0158 check.
14032
14033 2004-04-27  Martin Baulig  <martin@ximian.com>
14034
14035         * flowanalysis.cs (FlowBranchingLoop): New class.
14036         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
14037         UsageVector's instead of an ArrayList.
14038         (FlowBranching.Label): Likewise.
14039         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
14040         (FlowBranching.AddBreakVector): New method.
14041
14042 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
14043
14044         * attribute.cs: Small regression fix: only convert the type if we
14045         the type is different, fixes System.Drawing build.
14046
14047 2004-04-27  Martin Baulig  <martin@ximian.com>
14048
14049         * attribute.cs (Attribute.Resolve): If we have a constant value
14050         for a named field or property, implicity convert it to the correct
14051         type.
14052
14053 2004-04-27  Raja R Harinath  <rharinath@novell.com>
14054
14055         * statement.cs (Block.Block): Implicit blocks share
14056         'child_variable_names' fields with parent blocks.
14057         (Block.AddChildVariableNames): Remove.
14058         (Block.AddVariable): Mark variable as "used by a child block" in
14059         every surrounding block.
14060         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14061         been used in a child block, complain about violation of "Invariant
14062         meaning in blocks" rule.
14063         * cs-parser.jay (declare_local_variables): Don't use
14064         AddChildVariableNames.
14065         (foreach_statement): Don't create an implicit block: 'foreach'
14066         introduces a scope.
14067
14068 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
14069
14070         * convert.cs (ImplicitNumericConversion): 0 is also positive when
14071         converting from 0L to ulong.  Fixes 57522.
14072
14073 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
14074
14075         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
14076         derived class hides via 'new' keyword field from base class (test-242.cs).
14077         TODO: Handle this in the more general way.
14078         
14079         * class.cs (CheckBase): Ditto.
14080
14081 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
14082
14083         * decl.cs (caching_flags): New member for storing cached values
14084         as bit flags.
14085         (MemberCore.Flags): New enum where bit flags for caching_flags
14086         are defined.
14087         (MemberCore.cls_compliance): Moved to caching_flags.
14088         (DeclSpace.Created): Moved to caching_flags.
14089
14090         * class.cs: Use caching_flags instead of DeclSpace.Created
14091         
14092 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
14095         if we are only a derived class, not a nested class.
14096
14097         * typemanager.cs: Same as above, but do this at the MemberLookup
14098         level (used by field and methods, properties are handled in
14099         PropertyExpr).   Allow for the qualified access if we are a nested
14100         method. 
14101
14102 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
14103
14104         * class.cs: Refactoring.
14105         (IMethodData): New inteface; Holds links to parent members
14106         to avoid member duplication (reduced memory allocation).
14107         (Method): Implemented IMethodData interface.
14108         (PropertyBase): New inner classes for get/set methods.
14109         (PropertyBase.PropertyMethod): Implemented IMethodData interface
14110         (Event): New inner classes for add/remove methods.
14111         (Event.DelegateMethod): Implemented IMethodData interface.
14112
14113         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
14114         EmitContext (related to class.cs refactoring).
14115
14116 2004-04-21  Raja R Harinath  <rharinath@novell.com>
14117
14118         * delegate.cs (Delegate.VerifyApplicability): If the number of
14119         arguments are the same as the number of parameters, first try to
14120         verify applicability ignoring  any 'params' modifier on the last
14121         parameter.
14122         Fixes #56442.
14123
14124 2004-04-16  Raja R Harinath  <rharinath@novell.com>
14125
14126         * class.cs (TypeContainer.AddIndexer): Use
14127         'ExplicitInterfaceName' to determine if interface name was
14128         explicitly specified.  'InterfaceType' is not initialized at this time.
14129         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
14130         Indexers array is already in the required order.  Initialize
14131         'IndexerName' only if there are normal indexers.
14132         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
14133         (TypeContainer.Emit): Emit DefaultMember attribute only if
14134         IndexerName is initialized.
14135         Fixes #56300.
14136
14137 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
14138
14139         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
14140         Fixes #57007
14141
14142 2004-04-15  Raja R Harinath  <rharinath@novell.com>
14143
14144         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
14145         attributes.
14146         Fix for #56456.
14147
14148         * attribute.cs (Attribute.Resolve): Check for duplicate named
14149         attributes.
14150         Fix for #56463.
14151
14152 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
14153
14154         * iterators.cs (MarkYield): track whether we are in an exception,
14155         and generate code accordingly.  Use a temporary value to store the
14156         result for our state.
14157
14158         I had ignored a bit the interaction of try/catch with iterators
14159         since their behavior was not entirely obvious, but now it is
14160         possible to verify that our behavior is the same as MS .NET 2.0
14161
14162         Fixes 54814
14163
14164 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * iterators.cs: Avoid creating temporaries if there is no work to
14167         do. 
14168
14169         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
14170         Enumerations, use TypeManager.EnumToUnderlying and call
14171         recursively. 
14172
14173         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14174         bug #57013
14175
14176         (This.Emit): Use EmitContext.EmitThis to emit our
14177         instance variable.
14178
14179         (This.EmitAssign): Ditto.
14180
14181         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14182         codepaths, we will move all the functionality into
14183         Mono.CSharp.This 
14184
14185         (FieldExpr.EmitAssign): Ditto.
14186
14187         This fixes several hidden bugs that I uncovered while doing a code
14188         review of this today.
14189
14190         * codegen.cs (EmitThis): reworked so the semantics are more clear
14191         and also support value types "this" instances.
14192
14193         * iterators.cs: Changed so that for iterators in value types, we
14194         do not pass the value type as a parameter.  
14195
14196         Initialization of the enumerator helpers is now done in the caller
14197         instead of passing the parameters to the constructors and having
14198         the constructor set the fields.
14199
14200         The fields have now `assembly' visibility instead of private.
14201
14202 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * expression.cs (Argument.Resolve): Check if fields passed as ref
14205         or out are contained in a MarshalByRefObject.
14206
14207         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14208         another compiler type.
14209
14210 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14211
14212         * class.cs (Indexer.Define): use the new name checking method.
14213         Also, return false on an error.
14214         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14215         (is_identifier_[start/part]_character): make static.
14216
14217 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
14218
14219         * expression.cs (Binary.ResolveOperator): Do no append strings
14220         twice: since we can be invoked more than once (array evaluation)
14221         on the same concatenation, take care of this here.  Based on a fix
14222         from Ben (bug #56454)
14223
14224 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
14225
14226         * codegen.cs: Fix another case where CS1548 must be reported (when 
14227         delay-sign isn't specified and no private is available #56564). Fix
14228         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
14229         error when MCS is used on the MS runtime and we need to delay-sign 
14230         (which seems unsupported by AssemblyBuilder - see #56621).
14231
14232 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
14233
14234         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14235         (TypeManager.ComputeNamespaces): Faster implementation for
14236         Microsoft runtime.
14237
14238         * compiler.csproj: Updated AssemblyName to mcs.
14239
14240 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
14241
14242         * rootcontext.cs: Add new types to the boot resolution.
14243
14244         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14245         MulticastDelegate is not allowed.
14246
14247         * typemanager.cs: Add new types to lookup: System.TypedReference
14248         and ArgIterator.
14249
14250         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14251         check for TypedReference or ArgIterator, they are not allowed. 
14252
14253         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14254         makes us properly catch 1510 in some conditions (see bug 56016 for
14255         details). 
14256
14257 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
14258
14259         * CryptoConvert.cs: update from corlib version
14260         with endian fixes.
14261
14262 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
14263
14264         * class.cs (Indexer.Define): Check indexername declaration
14265
14266 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
14267
14268         * attribute.cs (IsClsCompliant): Fixed problem with handling
14269         all three states (compliant, not-compliant, undetected).
14270
14271 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
14272
14273         * attribute.cs (Attribute): Location is now public.
14274         (Resolve): Store resolved arguments (pos_values) in attribute class.
14275         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14276         (GetClsCompliantAttributeValue): New method that gets
14277         CLSCompliantAttribute value.
14278         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14279         if exists else null.
14280         (AttributeTester): New class for CLS-Compliant verification routines.
14281
14282         * class.cs (Emit): Add CLS-Compliant verification.
14283         (Method.GetSignatureForError): Implemented.
14284         (Constructor.GetSignatureForError): Implemented
14285         (Constructor.HasCompliantArgs): Returns if constructor has
14286         CLS-Compliant arguments.
14287         (Constructor.Emit): Override.
14288         (Construcor.IsIdentifierClsCompliant): New method; For constructors
14289         is needed to test only parameters.
14290         (FieldBase.GetSignatureForError): Implemented.
14291         (TypeContainer): New member for storing base interfaces.
14292         (TypeContainer.FindMembers): Search in base interfaces too.
14293
14294         * codegen.cs (GetClsComplianceAttribute): New method that gets
14295         assembly or module CLSCompliantAttribute value.
14296         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14297         for assembly.
14298         (ModuleClass.Emit): Add error 3012 test.
14299
14300         * const.cs (Emit): Override and call base for CLS-Compliant tests.
14301
14302         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14303         state for all decl types.
14304         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14305         if CLS-Compliant tests are required.
14306         (IsClsCompliaceRequired): New method. Analyze whether code
14307         must be CLS-Compliant.
14308         (IsExposedFromAssembly): New method. Returns true when MemberCore
14309         is exposed from assembly.
14310         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14311         value or gets cached value.
14312         (HasClsCompliantAttribute): New method. Returns true if MemberCore
14313         is explicitly marked with CLSCompliantAttribute.
14314         (IsIdentifierClsCompliant): New abstract method. This method is
14315         used to testing error 3005.
14316         (IsIdentifierAndParamClsCompliant): New method. Common helper method
14317         for identifier and parameters CLS-Compliant testing.
14318         (VerifyClsCompliance): New method. The main virtual method for
14319         CLS-Compliant verifications.
14320         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14321         null. I don't know why is null (too many public members !).
14322         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14323         and get value of first CLSCompliantAttribute that found.
14324
14325         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14326         (VerifyClsCompliance): Override and add extra tests.
14327
14328         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14329         clscheck- disable CLS-Compliant verification event if assembly is has
14330         CLSCompliantAttribute(true).
14331
14332         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14333         ApllyAttribute is now called in emit section as in the other cases.
14334         Possible future Emit integration.
14335         (IsIdentifierClsCompliant): New override.
14336         (VerifyClsCompliance): New override.
14337         (GetEnumeratorName): Returns full enum name.
14338
14339         * parameter.cs (GetSignatureForError): Implemented.
14340
14341         * report.cs (WarningData): New struct for Warning message information.
14342         (LocationOfPreviousError): New method.
14343         (Warning): New method. Reports warning based on the warning table.
14344         (Error_T): New method. Reports error based on the error table.
14345
14346         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14347         verifications are done here.
14348
14349         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14350
14351         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14352         CLSCompliantAttribute.
14353         (all_imported_types): New member holds all imported types from other
14354         assemblies.
14355         (LoadAllImportedTypes): New method fills static table with exported types
14356         from all referenced assemblies.
14357         (Modules): New property returns all assembly modules.
14358
14359 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
14360
14361         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14362         throwing a parser error.
14363
14364         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14365         which removes the hardcoded get_/set_ prefixes for properties, as
14366         IL allows for the properties to be named something else.  
14367
14368         Bug #56013
14369
14370         * expression.cs: Do not override operand before we know if it is
14371         non-null.  Fix 56207
14372
14373 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14374
14375         * typemanager.cs: support for pinned variables.
14376
14377 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14378
14379         * decl.cs, typemanager.cs: Avoid using an arraylist
14380         as a buffer if there is only one result set.
14381
14382 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14383
14384         * expression.cs: Make sure you cant call a static method
14385         with an instance expression, bug #56174.
14386
14387 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * class.cs (IsDuplicateImplementation): Improve error reporting to
14390         flag 663 (method only differs in parameter modifier).
14391
14392         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14393         in preprocessor directives.
14394
14395         * location.cs (LookupFile): Allow for the empty path.
14396
14397         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
14398         better approach for some of that patch, but its failing with the
14399         CharSet enumeration.  For now try/catch will do.
14400
14401         * typemanager.cs: Do not crash if a struct does not have fields.
14402         Fixes 56150.
14403
14404 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14405
14406         * expression.cs: cs0213, cant fix a fixed expression.
14407         fixes 50231.
14408
14409 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14410
14411         * cs-parser.jay: detect invalid embeded statements gracefully.
14412         bug #51113.
14413
14414 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14415
14416         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14417         As a regex:
14418         s/
14419         the invocation type may not be a subclass of the tye of the item/
14420         The type of the item must be a subclass of the invocation item.
14421         /g
14422
14423         Fixes bug #50820.
14424
14425 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
14426
14427         * attribute.cs: Added methods to get a string and a bool from an
14428         attribute. Required to information from AssemblyKeyFileAttribute,
14429         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14430         * codegen.cs: Modified AssemblyName creation to include support for
14431         strongnames. Catch additional exceptions to report them as CS1548.
14432         * compiler.csproj: Updated include CryptoConvert.cs.
14433         * compiler.csproj.user: Removed file - user specific configuration.
14434         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
14435         Mono.Security assembly. The original class is maintained and tested in
14436         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14437         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14438         like CSC 8.0 (C# v2) supports.
14439         * Makefile: Added CryptoConvert.cs to mcs sources.
14440         * rootcontext.cs: Added new options for strongnames.
14441
14442 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
14443
14444         * driver.cs: For --expect-error, report error code `2'
14445         if the program compiled with no errors, error code `1' if
14446         it compiled with an error other than the one expected.
14447
14448 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
14449
14450         * compiler.csproj: Updated for Visual Studio .NET 2003.
14451         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14452         * compiler.sln: Updated for Visual Studio .NET 2003.
14453
14454 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
14455
14456         * expression.cs: Fix bug #47234. We basically need to apply the
14457         rule that we prefer the conversion of null to a reference type
14458         when faced with a conversion to 'object' (csc behaviour).
14459
14460 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14461
14462         * statement.cs: Shorter form for foreach, eliminates
14463         a local variable. r=Martin.
14464
14465 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14466
14467         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14468         checks if we can use brtrue/brfalse to test for 0.
14469         * expression.cs: use the above in the test for using brtrue/brfalse.
14470         cleanup code a bit.
14471
14472 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14473
14474         * expression.cs: Rewrite string concat stuff. Benefits:
14475
14476         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14477         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14478         rather than a concat chain.
14479
14480         * typemanager.cs: Add lookups for more concat overloads.
14481
14482 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14483
14484         * expression.cs: Emit shorter il code for array init.
14485
14486         newarr
14487         dup
14488         // set 1
14489
14490         // set 2
14491
14492         newarr
14493         stloc.x
14494
14495         ldloc.x
14496         // set 1
14497
14498         ldloc.x
14499         // set 2
14500
14501 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
14502
14503         * statement.cs: Before, two switch blocks would be merged if the
14504         total size of the blocks (end_item - begin_item + 1) was less than
14505         two times the combined sizes of the blocks.
14506
14507         Now, it will only merge if after the merge at least half of the
14508         slots are filled.
14509
14510         fixes 55885.
14511
14512 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14513
14514         * class.cs : csc build fix for GetMethods(). See bug #52503.
14515
14516 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14517
14518         * expression.cs: Make sure fp comparisons work with NaN.
14519         This fixes bug #54303. Mig approved this patch a long
14520         time ago, but we were not able to test b/c the runtime
14521         had a related bug.
14522
14523 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14524
14525         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14526
14527 2004-03-19  Martin Baulig  <martin@ximian.com>
14528
14529         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14530         error here and not in our caller.
14531
14532 2004-03-19  Martin Baulig  <martin@ximian.com>
14533
14534         * interface.cs: Completely killed this file.
14535         (Interface): We're now a TypeContainer and live in class.cs.
14536
14537         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14538         argument; we're now also called for interfaces.
14539         (TypeContainer.DefineMembers): Allow this method being called
14540         multiple times.
14541         (TypeContainer.GetMethods): New public method; formerly known as
14542         Interface.GetMethod().  This is used by PendingImplementation.
14543         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14544         it's now private and non-static.
14545         (Interface): Moved this here; it's now implemented similar to
14546         Class and Struct.
14547         (Method, Property, Event, Indexer): Added `bool is_interface'
14548         argument to their .ctor's.
14549         (MemberBase.IsInterface): New public field.
14550
14551         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14552         instances instead of InterfaceMethod, InterfaceProperty, etc.
14553         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14554         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14555
14556 2004-03-19  Martin Baulig  <martin@ximian.com>
14557
14558         * class.cs (MethodCore.IsDuplicateImplementation): New private
14559         method which does the CS0111 checking.
14560         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14561         Use IsDuplicateImplementation().
14562
14563 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14564
14565         * decl.cs (FindMemberToOverride): New method to find the correct
14566         method or property to override in the base class.
14567         * class.cs
14568             - Make Method/Property use the above method to find the
14569               version in the base class.
14570             - Remove the InheritableMemberSignatureCompare as it is now
14571               dead code.
14572
14573         This patch makes large code bases much faster to compile, as it is
14574         O(n) rather than O(n^2) to do this validation.
14575
14576         Also, it fixes bug 52458 which is that nested classes are not
14577         taken into account when finding the base class member.
14578
14579         Reviewed/Approved by Martin.
14580
14581 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14582
14583         * interface.cs: In all interface classes removed redundant
14584         member initialization.
14585
14586 2004-03-16  Martin Baulig  <martin@ximian.com>
14587
14588         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14589
14590 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * decl.cs (DefineTypeAndParents): New helper method to define a
14593         type's containers before the type itself is defined;  This is a
14594         bug exposed by the recent changes to Windows.Forms when an
14595         implemented interface was defined inside a class that had not been
14596         built yet.   
14597
14598         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14599
14600         (Check): Loop correctly to report errors modifiers
14601         (UNSAFE was not in the loop, since it was the same as TOP).
14602
14603         * interface.cs: Every interface member now takes a ModFlags,
14604         instead of a "is_new" bool, which we set on the base MemberCore. 
14605
14606         Every place where we called "UnsafeOk" in the interface, now we
14607         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14608         the unsafe settings from the member declaration instead of the
14609         container interface. 
14610
14611         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14612
14613         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14614         `set_indexer_name' to the pending bits (one per type).
14615
14616         We fixed a bug today that was picking the wrong method to
14617         override, since for properties the existing InterfaceMethod code
14618         basically ignored the method name.  Now we make sure that the
14619         method name is one of the valid indexer names.
14620
14621 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14622  
14623         * support.cs (SeekableStreamReader): Keep track of stream byte
14624         positions and don't mix them with character offsets to the buffer.
14625
14626         Patch from Gustavo Giráldez
14627
14628 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14629
14630         * interface.cs (InterfaceSetGetBase): Removed double member
14631         initialization, base class does it as well.
14632
14633 2004-03-13  Martin Baulig  <martin@ximian.com>
14634
14635         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14636         when compiling corlib.
14637
14638 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * convert.cs (ExplicitConversion): We were reporting an error on
14641         certain conversions (object_type source to a value type, when the
14642         expression was `null') before we had a chance to pass it through
14643         the user defined conversions.
14644
14645         * driver.cs: Replace / and \ in resource specifications to dots.
14646         Fixes 50752
14647
14648         * class.cs: Add check for duplicate operators.  Fixes 52477
14649
14650 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14651
14652         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14653         that are in the middle of the statements, not only at the end.
14654         Fixes #54987
14655
14656         * class.cs (TypeContainer.AddField): No longer set the
14657         `HaveStaticConstructor' flag, now we call it
14658         `UserDefineStaticConstructor' to diferentiate the slightly
14659         semantic difference.
14660
14661         The situation is that we were not adding BeforeFieldInit (from
14662         Modifiers.TypeAttr) to classes that could have it.
14663         BeforeFieldInit should be set to classes that have no static
14664         constructor. 
14665
14666         See:
14667
14668         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14669
14670         And most importantly Zoltan's comment:
14671
14672         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14673
14674         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14675          before its static fields are used', i.e. initialization does not need
14676          to be triggered by the first access to the type. Setting this flag
14677          helps the JIT to compile better code, since it can run the static
14678          constructor at JIT time, and does not need to generate code to call it
14679          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14680          this flag for lots of classes like String. 
14681          
14682          csc sets this flag if the type does not have an explicit static 
14683          constructor. The reasoning seems to be that if there are only static
14684          initalizers for a type, and no static constructor, then the programmer
14685          does not care when this initialization happens, so beforefieldinit
14686          can be used.
14687          
14688          This bug prevents the AOT compiler from being usable, since it 
14689          generates so many calls to mono_runtime_class_init that the AOT code
14690          is much slower than the JITted code. The JITted code is faster, 
14691          because it does not generate these calls if the vtable is type is
14692          already initialized, which is true in the majority of cases. But the
14693          AOT compiler can't do this."
14694
14695 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * class.cs (MethodData.Emit): Refactor the code so symbolic
14698         information is generated for destructors;  For some reasons we
14699         were taking a code path that did not generate symbolic information
14700         before. 
14701
14702 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14703
14704         * class.cs: Create a Constructor.CheckBase method that
14705         takes care of all validation type code. The method
14706         contains some code that was moved from Define.
14707
14708         It also includes new code that checks for duplicate ctors.
14709         This fixes bug #55148.
14710
14711 2004-03-09  Joshua Tauberer <tauberer@for.net>
14712
14713         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14714         a { ... }-style array creation invokes EmitStaticInitializers
14715         which is not good for reference-type arrays.  String, decimal
14716         and now null constants (NullCast) are not counted toward
14717         static initializers.
14718
14719 2004-03-05  Martin Baulig  <martin@ximian.com>
14720
14721         * location.cs (SourceFile.HasLineDirective): New public field;
14722         specifies whether the file contains or is referenced by a "#line"
14723         directive.
14724         (Location.DefineSymbolDocuments): Ignore source files which
14725         either contain or are referenced by a "#line" directive.        
14726
14727 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14728
14729         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14730         direct access to our parent, so check the method inline there.
14731
14732 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14733
14734         * expression.cs (Invocation.EmitCall): Miguel's last commit
14735         caused a regression. If you had:
14736
14737             T t = null;
14738             t.Foo ();
14739
14740         In Foo the implict this would be null.
14741
14742 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14743
14744         * expression.cs (Invocation.EmitCall): If the method is not
14745         virtual, do not emit a CallVirt to it, use Call.
14746
14747         * typemanager.cs (GetFullNameSignature): Improve the method to
14748         cope with ".ctor" and replace it with the type name.
14749
14750         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14751         as an argument the ConstructorBuilder where it is being defined,
14752         to catch the recursive constructor invocations.
14753
14754 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14755
14756         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14757         routines to check if a type is an enumerable/enumerator allow
14758         classes that implement the IEnumerable or IEnumerator interfaces.
14759
14760         * class.cs (Property, Operator): Implement IIteratorContainer, and
14761         implement SetYields.
14762
14763         (Property.Define): Do the block swapping for get_methods in the
14764         context of iterators.   We need to check if Properties also
14765         include indexers or not.
14766
14767         (Operator): Assign the Block before invoking the
14768         OperatorMethod.Define, so we can trigger the Iterator code
14769         replacement. 
14770
14771         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14772         Property and Operator classes are not created when we parse the
14773         declarator but until we have the block completed, so we use a
14774         singleton SimpleIteratorContainer.Simple to flag whether the
14775         SetYields has been invoked.
14776
14777         We propagate this setting then to the Property or the Operator to
14778         allow the `yield' to function.
14779
14780 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14781
14782         * codegen.cs: Implemented attribute support for modules.
14783         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14784         Assembly/Module functionality.
14785
14786         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14787         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14788         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14789
14790 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14791
14792         * interface.cs (FindMembers): The operation is performed on all base
14793         interfaces and not only on the first. It is required for future CLS Compliance patch.
14794
14795 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14796
14797         * statement.cs, codegen.cs:
14798         This patch deals with patterns such as:
14799
14800         public class List : IEnumerable {
14801
14802                 public MyEnumerator GetEnumerator () {
14803                         return new MyEnumerator(this);
14804                 }
14805
14806                 IEnumerator IEnumerable.GetEnumerator () {
14807                         ...
14808                 }
14809                 
14810                 public struct MyEnumerator : IEnumerator {
14811                         ...
14812                 }
14813         }
14814
14815         Before, there were a few things we did wrong:
14816         1) we would emit callvirt on a struct, which is illegal
14817         2) we emited ldarg when we needed to emit ldarga
14818         3) we would mistakenly call the interface methods on an enumerator
14819         type that derived from IEnumerator and was in another assembly. For example:
14820
14821         public class MyEnumerator : IEnumerator
14822
14823         Would have the interface methods called, even if there were public impls of the
14824         method. In a struct, this lead to invalid IL code.
14825
14826 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14827
14828         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14829           renamed to Emit.
14830
14831         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14832
14833 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14834
14835         * cs-parser.jay: Fix small regression: we were not testing V2
14836         compiler features correctly.
14837
14838         * interface.cs: If the emit context is null, then create one
14839
14840 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14841
14842         * decl.cs (GetSignatureForError): New virtual method to get full name
14843           for error messages.
14844
14845         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14846           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14847
14848         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14849           Duplicated members and code in these classes has been removed.
14850           Better encapsulation in these classes.
14851
14852 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * assign.cs (Assign.DoResolve): When dealing with compound
14855         assignments, there is a new rule in ECMA C# 2.4 (might have been
14856         there before, but it is documented here) that states that in:
14857
14858         a op= b;
14859
14860         If b is of type int, and the `op' is a shift-operator, then the
14861         above is evaluated as:
14862
14863         a = (int) a op b 
14864
14865         * expression.cs (Binary.ResolveOperator): Instead of testing for
14866         int/uint/long/ulong, try to implicitly convert to any of those
14867         types and use that in pointer arithmetic.
14868
14869         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14870         method to print information for from the type, not from the
14871         null-method we were given.
14872
14873 2004-02-01  Duncan Mak  <duncan@ximian.com>
14874
14875         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14876         parsing for cmd, fixes bug #53694.
14877
14878 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14879
14880         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14881         in the member name duplication tests. Property and operator name duplication
14882         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14883
14884 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14885
14886         * interface.cs (PopulateMethod): Fixed crash when interface method
14887         returns not existing type (error test cs0246-3.cs).
14888
14889 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14890
14891         * cs-parser.jay (interface_accessors): Re-write actions to also
14892         store attributes attached to get and set methods. Fix spelling
14893         while at it.
14894
14895         (inteface_property_declaration): Modify accordingly.
14896
14897         (InterfaceAccessorInfo): New helper class to store information to pass
14898         around between rules that use interface_accessors.
14899
14900         * interface.cs (Emit): Apply attributes on the get and set
14901         accessors of properties and indexers too.
14902
14903         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14904         right MethodBuilder when applying attributes to the get and set accessors.
14905
14906 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14909
14910 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14911
14912         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14913
14914 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14915
14916         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14917         changes that treat `yield' specially when present before `break'
14918         or `return' tokens.
14919
14920         * cs-tokenizer.cs: yield is no longer a keyword.
14921
14922 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14923
14924         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14925         setting for default constructors.
14926         For default constructors are almost every time set wrong Modifier. The
14927         generated IL code has been alright. But inside mcs this values was
14928         wrong and this was reason why several of my CLS Compliance tests
14929         failed.
14930
14931 2004-01-22  Martin Baulig  <martin@ximian.com>
14932
14933         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14934         not a QualifiedIdentifier.  This is what `type_name_expression'
14935         was previously doing.
14936         (type_name_expression): Removed; the code is now in
14937         `namespace_or_type_name'.
14938         (qualified_identifier): Removed, use `namespace_or_type_name'
14939         instead.
14940         (QualifiedIdentifier): Removed this class.      
14941
14942 2004-01-22  Martin Baulig  <martin@ximian.com>
14943
14944         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14945         not a string as alias name.
14946
14947 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14950         #52730 bug, and instead compute correctly the need to use a
14951         temporary variable when requesting an address based on the
14952         static/instace modified of the field and the constructor.
14953  
14954 2004-01-21  Martin Baulig  <martin@ximian.com>
14955
14956         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14957         class and namespace before looking up aliases.  Fixes #52517.
14958
14959 2004-01-21  Martin Baulig  <martin@ximian.com>
14960
14961         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14962         assinged in a 'try'; fixes exception4.cs.
14963
14964 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14965         * class.cs : Implemented parameter-less constructor for TypeContainer
14966
14967         * decl.cs: Attributes are now stored here. New property OptAttributes
14968
14969         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14970
14971         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14972
14973 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14974
14975         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14976           (CSharpSignature): New method for indexer and property signature.
14977
14978 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14979
14980         * pending.cs (IsVirtualFilter): Faster implementation.
14981
14982 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14983
14984         * typemanager.cs: Avoid inclusion of same assembly more than once.
14985
14986 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14987
14988         * cs-parser.jay: Fixed problem where the last assembly attribute
14989           has been applied also to following declaration (class, struct, etc.)
14990           
14991 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14992
14993         * class.cs: Added error CS0538, CS0539 reporting.
14994         Fixed crash on Microsoft runtime when field type is void.
14995
14996         * cs-parser.jay: Added error CS0537 reporting.
14997
14998         * pending.cs: Added error CS0535 reporting.
14999         Improved error report for errors CS0536, CS0534.
15000
15001 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
15002
15003         Merge a few bits from the Anonymous Method MCS tree.
15004
15005         * statement.cs (ToplevelBlock): New class for toplevel methods,
15006         will hold anonymous methods, lifted variables.
15007
15008         * cs-parser.jay: Create toplevel blocks for delegates and for
15009         regular blocks of code. 
15010
15011 2004-01-20  Martin Baulig  <martin@ximian.com>
15012
15013         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
15014         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
15015         and `NeedExplicitReturn'; added `IsLastStatement'.
15016         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
15017         have a `ReturnLabel' or we're not unreachable.
15018
15019         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
15020         child's reachability; don't just override ours with it.  Fixes
15021         #58058 (lluis's example).
15022         (FlowBranching): Added public InTryOrCatch(), InCatch(),
15023         InFinally(), InLoop(), InSwitch() and
15024         BreakCrossesTryCatchBoundary() methods.
15025
15026         * statement.cs (Return): Do all error checking in Resolve().
15027         Unless we are the last statement in a top-level block, always
15028         create a return label and jump to it.
15029         (Break, Continue): Do all error checking in Resolve(); also make
15030         sure we aren't leaving a `finally'.
15031         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
15032         statement in a top-level block.
15033         (Block.Flags): Added `IsDestructor'.
15034         (Block.IsDestructor): New public property.
15035
15036 2004-01-20  Martin Baulig  <martin@ximian.com>
15037
15038         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
15039
15040 2004-01-20  Martin Baulig  <martin@ximian.com>
15041
15042         * statement.cs (Statement.ResolveUnreachable): New public method.
15043         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
15044         (Block.Resolve): Resolve unreachable statements.
15045
15046 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
15047
15048         * expression.cs: We need to fix the case where we do
15049         not have a temp variable here.
15050
15051         * assign.cs: Only expression compound assignments need
15052         temporary variables.
15053
15054 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
15055
15056         * flowanalysis.cs: Reduce memory allocation in a few ways:
15057           - A block with no variables should not allocate a bit
15058             vector for itself.
15059           - A method with no out parameters does not need any tracking
15060             for assignment of the parameters, so we need not allocate
15061             any data for it.
15062           - The arrays:
15063                 public readonly Type[] VariableTypes;
15064                 public readonly string[] VariableNames;
15065             Are redundant. The data is already stored in the variable
15066             map, so we need not allocate another array for it.
15067           - We need to add alot of checks for if (params | locals) == null
15068             due to the first two changes.
15069
15070 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
15071
15072         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
15073         implement IMemoryLocation, we store a copy on a local variable and
15074         take the address of it.  Patch from Benjamin Jemlich
15075
15076         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
15077         to use a special "type_name_expression" rule which reduces the
15078         number of "QualifiedIdentifier" classes created, and instead
15079         directly creates MemberAccess expressions.
15080
15081 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
15082
15083         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
15084         that fixes #52853.  Null literal assignment to ValueType
15085
15086         * class.cs (MethodData.Emit): Instead of checking the name of the
15087         method to determine if its a destructor, create a new derived
15088         class from Method called Destructor, and test for that.  
15089
15090         * cs-parser.jay: Create a Destructor object instead of a Method.  
15091
15092         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
15093
15094         Fixes: 52933
15095
15096 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * expression.cs (Binary.ResolveOperator): Perform an implicit
15099         conversion from MethodGroups to their delegate types on the
15100         Addition operation.
15101
15102         * delegate.cs: Introduce a new class DelegateCreation that is the
15103         base class for `NewDelegate' and `ImplicitDelegateCreation',
15104         factor some code in here.
15105
15106         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
15107         conversion from MethodGroups to compatible delegate types. 
15108
15109         * ecore.cs (Expression.Resolve): Do not flag error 654
15110         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
15111         we allow conversions from MethodGroups to delegate types now.
15112
15113         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
15114         assignments in v2 either.
15115
15116 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
15119         static read-only fields in ctors.
15120
15121         Applied patch from Benjamin Jemlich 
15122
15123         * expression.cs (UnaryMutator): Avoid leaking local variables. 
15124
15125 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
15126
15127         * cs-tokenizer.cs (IsCastToken): Allow the various native types
15128         here to return true, as they can be used like this:
15129
15130                 (XXX) int.MEMBER ()
15131
15132         Fixed 49836 and all the other dups
15133
15134 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
15135
15136         * driver.cs: Implement /win32res and /win32icon.
15137
15138 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * cs-parser.jay: Add a rule to improve error handling for the
15141         common mistake of placing modifiers after the type.
15142
15143 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * cs-parser.jay (interface_event_declaration): Catch
15146         initialization of events on interfaces, and report cs0068
15147
15148         * cs-parser.jay (interface_event_declaration): Catch
15149         initialization of events. 
15150
15151         * ecore.cs: Better report missing constructors.
15152
15153         * expression.cs (Binary.ResolveOperator): My previous bug fix had
15154         the error reporting done in the wrong place.  Fix.
15155
15156         * expression.cs (Binary.ResolveOperator): Catch the 
15157         operator + (E x, E y) error earlier, and later allow for implicit
15158         conversions in operator +/- (E e, U x) from U to the underlying
15159         type of E.
15160
15161         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
15162         52596, if the container class is abstract, the default constructor
15163         is protected otherwise its public (before, we were always public).
15164
15165         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
15166         fixed statement.
15167
15168         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
15169         Jemlich that fixes bug #52597, MCS was generating invalid code for
15170         idisposable structs.   Thanks to Ben for following up with this
15171         bug as well.
15172
15173 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * driver.cs: Allow assemblies without code to be generated, fixes
15176         52230.
15177
15178 2004-01-07  Nick Drochak <ndrochak@gol.com>
15179
15180         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15181
15182 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
15183
15184         * cs-parser.jay: Add rules to improve error reporting if fields or
15185         methods are declared at the namespace level (error 116)
15186
15187         * Add rules to catch event add/remove
15188
15189 2004-01-04  David Sheldon <dave-mono@earth.li>
15190
15191   * expression.cs: Added matching ")" to error message for 
15192   CS0077
15193
15194 2004-01-03 Todd Berman <tberman@gentoo.org>
15195
15196         * ecore.cs, attribute.cs:
15197         Applying fix from #52429.
15198
15199 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15200
15201         * ecore.cs, expression.cs, statement.cs:
15202         Total rewrite of how we handle branching. We
15203         now handle complex boolean expressions with fewer
15204         jumps. As well if (x == 0) no longer emits a ceq.
15205
15206         if (x is Foo) is much faster now, because we generate
15207         better code.
15208
15209         Overall, we get a pretty big improvement on our benchmark
15210         tests. The code we generate is smaller and more readable.
15211
15212         I did a full two-stage bootstrap. The patch was reviewed
15213         by Martin and Miguel.
15214
15215 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15216
15217         * cs-parser.jay: Make primary_expression not take a QI.
15218         we dont need this because the member_access rule covers
15219         us here. So we replace the rule with just IDENTIFIER.
15220
15221         This has two good effects. First, we remove a s/r conflict.
15222         Second, we allocate many fewer QualifiedIdentifier objects.
15223
15224 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15225
15226         * attribute.cs: Handle MarshalAs attributes as pseudo, and
15227         set the correct information via SRE. This prevents
15228         hanging on the MS runtime. Fixes #29374.
15229
15230 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15231
15232         * convert.cs: correctly handle conversions to value types
15233         from Enum and ValueType as unboxing conversions.
15234
15235         Fixes bug #52569. Patch by Benjamin Jemlich.
15236
15237 2004-01-02  Ravi Pratap  <ravi@ximian.com>
15238
15239         * expression.cs (BetterConversion): Prefer int -> uint
15240         over int -> ulong (csc's behaviour). This fixed bug #52046.
15241
15242 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15243
15244         * decl.cs (MemberCache.FindMembers): now returns a
15245         MemberInfo [].
15246
15247         * typemanager.cs: In general, go with with ^^.
15248         (CopyNewMethods): take an IList.
15249         (RealMemberLookup): Only allocate an arraylist
15250         if we copy from two sets of methods.
15251
15252         This change basically does two things:
15253         1) Fewer array lists allocated due to CopyNewMethods.
15254         2) the explicit cast in MemberList costed ALOT.
15255
15256 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
15257
15258         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15259         a hashtable to avoid needless string allocations when an identifier is
15260         used more than once (the common case).
15261
15262 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15263
15264         * pending.cs: MS's TypeBuilder.GetInterfaces ()
15265         is broken, it will not return anything. So, we
15266         have to use the information we have in mcs to
15267         do the task.
15268
15269         * typemanager.cs: Add a cache for GetInterfaces,
15270         since this will now be used more often (due to ^^)
15271
15272         (GetExplicitInterfaces) New method that gets the
15273         declared, not effective, interfaces on a type
15274         builder (eg, if you have interface IFoo, interface
15275         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15276         { IBar }.
15277
15278         This patch makes MCS able to bootstrap itself on
15279         Windows again.
15280
15281 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15282
15283         * expression.cs: Remove the Nop's that Miguel put
15284         in by mistake.
15285
15286 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15287
15288         * report.cs, codegen.cs: Give the real stack trace to
15289         the error when an exception is thrown.
15290
15291 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15292
15293         * decl.cs: only allocate hashtables for ifaces if 
15294         it is an iface!
15295
15296 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15297
15298         * expression.cs: fix the error from cs0121-2.cs
15299         (a parent interface has two child interfaces that
15300         have a function with the same name and 0 params
15301         and the function is called through the parent).
15302
15303 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15304
15305         * class.cs, rootcontext.cs, typmanager.cs: do not
15306         leak pointers.
15307
15308 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15309
15310         * codegen.cs: remove stack for the ec flow branching.
15311         It is already a linked list, so no need.
15312
15313 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15314
15315         * Makefile: Allow custom profiler here.
15316
15317 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15318
15319         * typemanager.cs (LookupType):
15320           - Use a static char [], because split takes
15321             a param array for args, so it was allocating
15322             every time.
15323           - Do not store true in a hashtable, it boxes.
15324
15325 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15326
15327         * flowanalysis.cs: bytify common enums.
15328
15329 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15330
15331         * modifiers.cs: Add a new set of flags for the
15332         flags allowed on explicit interface impls.
15333         * cs-parser.jay: catch the use of modifiers in
15334         interfaces correctly.
15335         * class.cs: catch private void IFoo.Blah ().
15336
15337         All related to bug #50572.
15338
15339 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15340
15341         * decl.cs: Rewrite the consistant accessability checking.
15342         Accessability is not linear, it must be implemented in
15343         a tableish way. Fixes #49704.
15344
15345 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15346
15347         * expression.cs: Handle negation in a checked context.
15348         We must use subtraction from zero. Fixes #38674.
15349
15350 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15351
15352         * class.cs: Ignore static void main in DLLs.
15353         * rootcontext.cs: Handle the target type here,
15354         since we are have to access it from class.cs
15355         * driver.cs: account for the above.
15356
15357 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15358
15359         * report.cs: Give line numbers and files if available.
15360
15361 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
15362
15363         * driver.cs: Implement /addmodule.
15364
15365         * typemanager.cs:  Change 'modules' field so it now contains Modules not
15366         ModuleBuilders.
15367
15368 2003-12-20  Martin Baulig  <martin@ximian.com>
15369
15370         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15371         (FieldBase.IsAssigned): Removed this field.
15372         (FieldBase.SetAssigned): New public method.
15373         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15374
15375 2003-12-20  Martin Baulig  <martin@ximian.com>
15376
15377         * expression.cs (LocalVariableReference.DoResolve): Don't set
15378         `vi.Used' if we're called from DoResolveLValue().
15379
15380         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15381         returns the usage vector it just merged into the current one -
15382         pass this one to UsageWarning().
15383         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15384         of the `EmitContext', don't call this recursively on our children.
15385
15386 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
15387
15388         * driver.cs: Implement /target:module.
15389
15390 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
15391
15392         * support.cs (CharArrayHashtable): New helper class.
15393
15394         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
15395         char arrays, not strings, so we can avoid creating a string in
15396         consume_identifier if the identifier is a keyword.
15397
15398 2003-12-16  Martin Baulig  <martin@ximian.com>
15399
15400         * statement.cs (LocalInfo.Assigned): Removed this property.
15401         (LocalInfo.Flags): Removed `Assigned'.
15402         (LocalInfo.IsAssigned): New public method; takes the EmitContext
15403         and uses flow analysis.
15404         (Block.UsageWarning): Made this method private.
15405         (Block.Resolve): Call UsageWarning() if appropriate.
15406
15407         * expression.cs (LocalVariableReference.DoResolve): Always set
15408         LocalInfo.Used here.
15409
15410 2003-12-13  Martin Baulig  <martin@ximian.com>
15411
15412         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15413         any value here; we're now using flow analysis to figure out
15414         whether a statement/block returns a value.
15415
15416 2003-12-13  Martin Baulig  <martin@ximian.com>
15417
15418         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15419         working again.
15420         (FlowBranching.MergeFinally): Don't call
15421         `branching.CheckOutParameters()' here, this is called in
15422         MergeTopBlock().
15423         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15424         when adding the `finally' vector.       
15425
15426 2003-12-13  Martin Baulig  <martin@ximian.com>
15427
15428         * flowanalysis.cs
15429         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15430         actually work and also fix #48962.
15431
15432 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15433
15434         * decl.cs: Do not check System.Object for nested types,
15435         since we know it does not have any. Big bang for buck:
15436
15437         BEFORE:
15438            Run 1:   8.35 seconds
15439            Run 2:   8.32 seconds
15440            corlib:  17.99 seconds
15441         AFTER:
15442            Run 1:   8.17 seconds
15443            Run 2:   8.17 seconds
15444            corlib:  17.39 seconds
15445
15446 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15447
15448         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15449         time we are returning 0 members, so we save alot here.
15450
15451 2003-12-11  Martin Baulig  <martin@ximian.com>
15452
15453         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15454         `MergeChild()', also just take the `FlowBranching' as argument;
15455         call Merge() on it and return the result.
15456         (FlowBranching.Merge): We don't need to do anything if we just
15457         have one sibling.
15458
15459 2003-12-11  Martin Baulig  <martin@ximian.com>
15460
15461         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15462         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
15463         Maurer for this idea.
15464
15465 2003-12-11  Martin Baulig  <martin@ximian.com>
15466
15467         * flowanalysis.cs (MergeResult): This class is now gone; we now
15468         use the `UsageVector' for this.  The reason for this is that if a
15469         branching just has one sibling, we don't need to "merge" them at
15470         all - that's the next step to do.
15471         (FlowBranching.Merge): We now return a `UsageVector' instead of a
15472         `MergeResult'.
15473
15474 2003-12-11  Martin Baulig  <martin@ximian.com>
15475
15476         Reworked flow analyis and made it more precise and bug-free.  The
15477         most important change is that we're now using a special `Reachability'
15478         class instead of having "magic" meanings of `FlowReturns'.  I'll
15479         do some more cleanups and optimizations and also add some more
15480         documentation this week.
15481
15482         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15483         largely reworked this class.
15484         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15485         the new `Reachability' class instead of having "magic" values here.
15486         (FlowBranching): We're now using an instance of `Reachability'
15487         instead of having separate `Returns', `Breaks' etc. fields.
15488
15489         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15490         based on flow analysis; ignore the return value of block.Emit ().
15491
15492 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
15493
15494         * driver.cs typemanager.cs: Find the mono extensions to corlib even
15495         if they are private.
15496
15497 2003-12-09  Martin Baulig  <martin@ximian.com>
15498
15499         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15500         call them directly on the UsageVector.
15501
15502 2003-12-09  Martin Baulig  <martin@ximian.com>
15503
15504         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15505         Changed return type from `FlowReturns' to `Reachability'.
15506
15507 2003-12-09  Martin Baulig  <martin@ximian.com>
15508
15509         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15510         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15511         `Reachable' fields with a single `Reachability' one.
15512
15513 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15514
15515         * class.cs (FindMembers): Remove foreach's.
15516
15517         Bootstrap times:
15518
15519         BEFORE
15520                 Run 1:   8.74 seconds
15521                 Run 2:   8.71 seconds
15522
15523         AFTER
15524                 Run 1:   8.64 seconds
15525                 Run 2:   8.58 seconds
15526
15527
15528 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15529
15530         * cs-parser.jay:
15531         * gen-treedump.cs:
15532         * statement.cs:
15533         This patch does a few things:
15534                 1. EmptyStatement is now a singleton, so it is never reallocated.
15535                 2. All blah is EmptyStatement constructs have been changed to
15536                    blah == EmptyStatement.Value, which is much faster and valid
15537                    now that EmptyStatement is a singleton.
15538                 3. When resolving a block, rather than allocating a new array for
15539                    the non-empty statements, empty statements are replaced with
15540                    EmptyStatement.Value
15541                 4. Some recursive functions have been made non-recursive.
15542         Mainly the performance impact is from (3), however (1) and (2) are needed for
15543         this to work. (4) does not make a big difference in normal situations, however
15544         it makes the profile look saner.
15545
15546         Bootstrap times:
15547
15548         BEFORE
15549         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15550         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15551         Total memory allocated: 56397 KB
15552
15553         AFTER
15554         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15555         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15556         Total memory allocated: 55666 KB
15557
15558 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15559
15560         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15561         than the hashtable in a hashtable version
15562
15563         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15564         we always end up concating a string. This results in a huge perf
15565         loss, because many strings have to be tracked by the GC. In this
15566         patch, we first use a hashtable that works with two keys, so that
15567         the strings do not need to be concat'ed.
15568
15569         Bootstrap times:
15570         BEFORE
15571                 Run 1:   8.74 seconds
15572                 Run 2:   8.71 seconds
15573
15574         AFTER
15575                 Run 1:   8.65 seconds
15576                 Run 2:   8.56 seconds
15577
15578 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15579
15580         * Makefile: Add a new target `do-time' that does a quick and simple
15581         profile, leaving easy to parse output.
15582
15583 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15584
15585         * codegen.cs (Init): Create the dynamic assembly with 
15586         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15587
15588 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15589
15590         * support.cs: Make the PtrHashtable use only one
15591         instance of its comparer.
15592
15593 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15594
15595         * typemanager.cs: Fix lookup of GetNamespaces.
15596
15597 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15598
15599         * expression.cs: Removed redundant line.
15600
15601         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15602         ArrayLists, use for loops with bounds.  
15603
15604         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15605         arraylist.
15606
15607         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15608         arraylists, use for loop with bounds.
15609
15610         The above three changes give us a 0.071 second performance
15611         improvement out of 3.294 seconds down to 3.223.  On my machine
15612         the above changes reduced the memory usage by 1,387 KB during
15613         compiler bootstrap.
15614
15615         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15616         QualifiedIdentifiers.  Before we created a new string through
15617         concatenation, and mostly later on, the result would be
15618         manipulated by DecomposeQI through string manipulation.
15619
15620         This reduced the compiler memory usage for bootstrapping from
15621         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15622         compile times in 0.05 seconds.
15623
15624 2003-11-28  Dick Porter  <dick@ximian.com>
15625
15626         * support.cs: Do string compares with the Invariant culture.
15627
15628         * rootcontext.cs: 
15629         * gen-treedump.cs: 
15630         * expression.cs: 
15631         * driver.cs: 
15632         * decl.cs: 
15633         * codegen.cs: 
15634         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15635         the comparison is done with the Invariant culture.
15636
15637 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15638
15639         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15640         GetEnumerator method.
15641
15642         (ProbeCollectionType): Iterate starting at the most specific type
15643         upwards looking for a GetEnumerator
15644
15645         * expression.cs: Shift count can be up to 31 for int/uint and 63
15646         for long/ulong.
15647
15648 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * statement.cs (Block.LookupLabel): Also look for the label on the
15651         children blocks.  Use a hash table to keep track of visited
15652         nodes. 
15653
15654         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15655         we actually did transform the other operand, otherwise fall back
15656         to the common codepath that casts to long.
15657
15658         * cs-tokenizer.cs: Use the same code pattern as the int case.
15659         Maybe I should do the parsing myself, and avoid depending on the
15660         Parse routines to get this done.
15661
15662 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15663
15664         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15665         which fixes bug 51347.  This time test it.
15666
15667         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15668         attributes for example can not tell the difference between these.
15669         The difference was only a syntax feature of the language. 
15670
15671         * attribute.cs: Apply attributes to delegates.
15672
15673         * delegate.cs: Call the apply attributes method.
15674
15675 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15676
15677         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15678         comparing 0 vs Byte.MinValue, not the value
15679
15680         (ImplicitConversionRequired): When reporting a conversion error,
15681         use error 31 to print out the constant error instead of the
15682         simpler 29.
15683
15684         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15685         which fixes bug 51347.
15686
15687 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15690         which fixes the -warnaserror command line option.
15691
15692 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15693
15694         * cfold.cs (DoNumericPromotions): During constant folding of
15695         additions on UIntConstant, special case intconstants with
15696         IntConstants like we do on the expression binary operator. 
15697
15698 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15699
15700         * convert.cs (ImplicitReferenceConversion): We were missing a case
15701         (System.Enum are not value types or class types, so we need to
15702         classify them separatedly).
15703
15704         * driver.cs: We do not support error 2007.
15705
15706 2003-11-12 Jackson Harper <jackson@ximian.com>
15707
15708         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15709         system directory. Also use the full file name so users can
15710         libraries names mscorlib-o-tron.dll in a non system dir.
15711
15712 2003-11-10  Martin Baulig  <martin@ximian.com>
15713
15714         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15715         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15716         calling `ResolveType()' on them, directly assign their `Type'.
15717
15718 2003-11-08  Martin Baulig  <martin@ximian.com>
15719
15720         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15721         return value and the `out parent' parameter.
15722         (TypeContainer.DefineType): Moved the CS0644 check into
15723         GetClassBases().  Don't pass the interface types to the
15724         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15725         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15726
15727         * ecore.cs (TypeExpr.IsAttribute): New property.
15728         (TypeExpr.GetInterfaces): New method.
15729
15730         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15731         TypeExpr instead of a Type.
15732         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15733         (Interface.DefineType): Don't pass the interface types to the
15734         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15735         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15736
15737         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15738         instead of a `Type[]'.
15739         (TypeManager.RegisterBuilder): Likewise.
15740         (TypeManager.AddUserInterface): Likewise.
15741         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15742         `Type[]' and also return a `TypeExpr[]'.
15743         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15744
15745 2003-11-08  Martin Baulig  <martin@ximian.com>
15746
15747         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15748         Expression.     
15749
15750 2003-11-08  Martin Baulig  <martin@ximian.com>
15751
15752         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15753         TypeManager.ResolveExpressionTypes().
15754
15755         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15756         instead of an Expression.
15757         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15758         (TypeExpression): New public class; formerly known as `TypeExpr'.
15759
15760         * expression.cs (ComposedCast): Derive from TypeExpr.
15761
15762         * typemanager.cs (TypeManager.system_*_expr): These are now
15763         TypExpr's instead of Expression's.
15764         (TypeManager.ResolveExpressionTypes): New public static function;
15765         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15766         of them.        
15767
15768 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15769
15770         * expression.cs (New.DoResolve): Do not dereference value that
15771         might be a null return.
15772
15773         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15774         sure that the constant value has the right type.  Fixes an
15775         unreported bug, similar to 50425.
15776
15777         * const.cs (Const.LookupConstantValue): Call
15778         ImplicitStandardConversionExists before doing a conversion to
15779         avoid havng the TypeManager.ChangeType do conversions.
15780
15781         Reduced the number of casts used
15782
15783         (Const.ChangeType): New routine to enable reuse of the constant
15784         type changing code from statement.
15785
15786         * typemanager.cs (ChangeType): Move common initialization to
15787         static global variables.
15788
15789         Fixes #50425.
15790
15791         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15792         every value type to go through, even if it was void.  Fix that. 
15793
15794         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15795         character of the define, and the is_identifier_part_character for
15796         the rest of the string.
15797
15798 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * expression.cs (UnaryMutator.EmitCode): When I updated
15801         LocalVariableReference.DoResolve, I overdid it, and dropped an
15802         optimization done on local variable references.
15803
15804 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * ecore.cs: Convert the return from Ldlen into an int.
15807
15808 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15811         the accessibility, this is a special case for toplevel non-public
15812         classes (internal for instance).
15813
15814 2003-10-20  Nick Drochak <ndrochak@gol.com>
15815
15816         * ecore.cs: Fix typo and build.  Needed another right paren.
15817
15818 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15819
15820         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15821         `internal' case regular and protected, but not allowing protected
15822         to be evaluated later.  Bug 49840
15823
15824 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15825
15826         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15827         to kb.Nlast, and not the kb.nFirst to isolate the switch
15828         statement.
15829
15830         Extract the underlying type, so enumerations of long/ulong are
15831         treated like long/ulong.
15832
15833 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15834
15835         * expression.cs (New): Overload the meaning of RequestedType to
15836         track the possible creation of the NewDelegate type, since
15837         DoResolve is invoked more than once for new constructors on field
15838         initialization.
15839
15840         See bugs: #48800 and #37014
15841
15842         * cs-parser.jay (declare_local_constants): Take an arraylist
15843         instead of a single constant.
15844
15845         (local_constant_declaration): It should take a
15846         constant_declarators, not a constant_declarator.  Fixes 49487
15847
15848         * convert.cs: Fix error report.
15849
15850 2003-10-13 Jackson Harper <jackson@ximian.com>
15851
15852         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15853         bug #49611
15854
15855 2003-10-09  Martin Baulig  <martin@ximian.com>
15856
15857         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15858         to the .ctor.
15859         (MethodCore.DoDefineParameters): Removed the TypeContainer
15860         argument; use the DeclSpace which was passed to the .ctor instead.
15861         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15862         TypeContainer; we only need a DeclSpace here.
15863
15864 2003-10-09  Martin Baulig  <martin@ximian.com>
15865
15866         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15867         to the .ctor.
15868         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15869         EmitContext's .ctor.    
15870
15871 2003-10-09  Martin Baulig  <martin@ximian.com>
15872
15873         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15874         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15875         AsAccessible(), moved them as well.
15876
15877         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15878
15879 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15880
15881         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15882
15883 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15884
15885         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15886         generation for >=, as spotted by Paolo, bug 48679.  
15887         Patch from David Waite.
15888
15889         * cs-tokenizer.cs: Add handling for #pragma.
15890
15891         * cs-parser.jay: Allow for both yield and yield return in the
15892         syntax.  The anti-cobolization of C# fight will go on!
15893
15894         * class.cs (TypeBuilder.DefineType): Catch error condition here
15895         (Parent.DefineType erroring out and returning null).
15896
15897         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15898         coping with enumerations variables, we were mistakenly processing
15899         them as a regular value type instead of built-in types.  Fixes the
15900         bug #48063
15901
15902         * typemanager.cs (IsBuiltinOrEnum): New method.
15903
15904 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15905
15906         * cs-parser.jay: Upgrade: yield now needs the return clause.
15907
15908 2003-09-19  Martin Baulig  <martin@ximian.com>
15909
15910         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15911         `MemberCache parent' argument.  Normally, an interface doesn't
15912         have a parent type except System.Object, but we use this in gmcs
15913         for generic type parameters.
15914
15915 2003-09-18  Martin Baulig  <martin@ximian.com>
15916
15917         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15918         on `type.IsInterface'; don't check whether the type has a parent
15919         to determine whether it's an interface.
15920
15921 2003-09-15  Martin Baulig  <martin@ximian.com>
15922
15923         * class.cs (TypeContainer.DefineType): Added an error flag to
15924         avoid reporting duplicate CS0146's ("class definition is
15925         circular.").
15926
15927         * driver.cs (Driver.MainDriver): Abort if
15928         RootContext.ResolveTree() reported any errors.
15929
15930 2003-09-07  Martin Baulig  <martin@ximian.com>
15931
15932         * report.cs (Error, Warning): Added overloaded versions which take
15933         a `params object[] args' and call String.Format().
15934
15935 2003-09-07  Martin Baulig  <martin@ximian.com>
15936
15937         * decl.cs (DeclSpace..ctor): Don't call
15938         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15939         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15940         (DeclSpace.RecordDecl): New method.
15941
15942         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15943
15944 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15945
15946         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15947         value attributes to be applied to ParameterBuilders.
15948
15949         * class.cs (MethodCore.LabelParameters): Make static and more
15950         generic so that it can be used from other places - like interface
15951         methods, for instance.
15952
15953         * interface.cs (Interface.Emit): Call LabelParameters before
15954         emitting attributes on the InterfaceMethod.
15955
15956 2003-08-26  Martin Baulig  <martin@ximian.com>
15957
15958         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15959         resolving aliases; fixes #47927.
15960
15961 2003-08-26  Martin Baulig  <martin@ximian.com>
15962
15963         * statement.cs (Using.DoResolve): This is internally emitting a
15964         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15965         do not always return.  Fixes #47681.
15966
15967 2003-08-26  Martin Baulig  <martin@ximian.com>
15968
15969         * decl.cs (MemberCore): Moved WarningNotHiding(),
15970         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15971         into MemberBase.
15972         (AdditionResult): Make this nested in DeclSpace.
15973         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15974         argument; call NamespaceEntry.Define() unless we're nested in a
15975         class or struct.
15976
15977         * namespace.cs (Namespace.DefineName): New public function.  This
15978         is called from DeclSpace's .ctor to add 
15979         (Namespace.Lookup): Include DeclSpaces in the lookup.
15980
15981         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15982
15983         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15984
15985 2003-08-25  Martin Baulig  <martin@ximian.com>
15986
15987         * convert.cs (Convert.ExplicitReferenceConversion): When
15988         converting from an interface type to a class, unbox if the target
15989         type is a struct type.  Fixes #47822.
15990
15991 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15992
15993         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15994         #47854.
15995
15996 2003-08-22  Martin Baulig  <martin@ximian.com>
15997
15998         * class.cs (TypeManager.DefineType): When defining a nested type,
15999         call DefineType() on our parent; fixes #47801.
16000
16001 2003-08-22  Martin Baulig  <martin@ximian.com>
16002
16003         * class.cs (MethodData.Define): While checking if a method is an
16004         interface implementation, improve the test a bit more to fix #47654.
16005
16006 2003-08-22  Martin Baulig  <martin@ximian.com>
16007
16008         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
16009         correctly; fixes #47722.
16010
16011 2003-08-22  Martin Baulig  <martin@ximian.com>
16012
16013         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
16014         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
16015
16016         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
16017
16018 2003-08-22  Martin Baulig  <martin@ximian.com>
16019
16020         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
16021         can only be assigned in static constructors.  Fixes #47161.
16022
16023 2003-08-22  Martin Baulig  <martin@ximian.com>
16024
16025         Rewrote and improved the flow analysis code.
16026
16027         * flowbranching.cs (FlowBranching): Make this class abstract.
16028         (FlowBranching.CreateBranching): New static function to create a
16029         new flow branching.
16030         (FlowBranchingBlock, FlowBranchingException): New classes.
16031         (FlowBranching.UsageVector.Type): New public readonly field.
16032         (FlowBranching.UsageVector.Breaks): Removed the setter.
16033         (FlowBranching.UsageVector.Returns): Removed the setter.
16034         (FlowBranching.UsageVector): Added Break(), Return(),
16035         NeverReachable() and Throw() methods to modify the reachability.
16036         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
16037         done by FlowBranching.Merge().
16038         (FlowBranching.UsageVector.MergeChild): New method; merges the
16039         merge result into the current vector.
16040         (FlowBranching.Merge): New abstract method to merge a branching.
16041
16042 2003-08-12  Martin Baulig  <martin@ximian.com>
16043
16044         * expression.cs (Indirection.CacheTemporaries): Create the
16045         LocalTemporary with the pointer type, not its element type.
16046
16047 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
16050         token was a keyword or not.
16051
16052         Add `error' options where an IDENTIFIER was expected;  Provide
16053         CheckToken and CheckIdentifierToken convenience error reporting
16054         functions. 
16055
16056         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
16057
16058         * decl.cs: Rename `NamespaceEntry Namespace' public field into
16059         NameSpaceEntry NameSpaceEntry.
16060
16061         (LookupInterfaceOrClass): Avoid creating a full qualified name
16062         from namespace and name: avoid doing lookups when we know the
16063         namespace is non-existant.   Use new Tree.LookupByNamespace which
16064         looks up DeclSpaces based on their namespace, name pair.
16065
16066         * driver.cs: Provide a new `parser verbose' to display the
16067         exception thrown during parsing.  This is turned off by default
16068         now, so the output of a failure from mcs is more graceful.
16069
16070         * namespace.cs: Track all the namespaces defined in a hashtable
16071         for quick lookup.
16072
16073         (IsNamespace): New method
16074
16075 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
16076
16077         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
16078         we know that we need to concatenate (full typename can never be
16079         null). 
16080
16081         * class.cs: ditto.
16082
16083         * statement.cs: Use a bitfield;  Do not initialize to null things
16084         which are done by the constructor by default.
16085
16086         * cs-parser.jay: bug fix, parameter was 4, not 3.
16087
16088         * expression.cs: Just use the property;
16089
16090         * statement.cs: No need for GetVariableInfo method.
16091
16092 2003-08-08  Martin Baulig  <martin@ximian.com>
16093
16094         * flowanalysis.cs (FlowReturns): This is now nested in the
16095         `FlowBranching' class.
16096         (MyBitVector): Moved this here from statement.cs.
16097         (FlowBranching.SiblingType): New enum type.
16098         (FlowBranching.CreateSibling): Added `SiblingType' argument.
16099
16100 2003-08-07  Martin Baulig  <martin@ximian.com>
16101
16102         * flowanalysis.cs (FlowBranchingType): This is now nested in the
16103         `FlowBranching' class and called `BranchingType'.
16104
16105 2003-08-07  Martin Baulig  <martin@ximian.com>
16106
16107         * flowanalysis.cs: Moved all the control flow analysis code into
16108         its own file.
16109
16110 2003-08-07  Martin Baulig  <martin@ximian.com>
16111
16112         * assign.cs (Assign.DoResolve): `target' must either be an
16113         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
16114         #37319.
16115
16116 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
16117
16118         * expression.cs (BinaryMethod): This kind of expression is created by the
16119         Binary class if it determines that the operator has to be handled
16120         by a method.
16121
16122         (BinaryDelegate): This kind of expression is created if we are
16123         dealing with a + or - operator on delegates.
16124
16125         (Binary): remove method, argumetns, and DelegateOperator: when
16126         dealing with methods, 
16127
16128         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
16129
16130         * statement.cs (Block): use bitfields for the three extra booleans
16131         we had in use.   Remove unused topblock parameter.
16132
16133         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
16134
16135         * assign.cs: Drop extra unneeded tests.
16136
16137 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
16138
16139         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
16140
16141         * statement.cs (Foreach): Use VariableStorage instead of
16142         LocalBuilders.   
16143
16144         * codegen.cs (VariableStorage): New class used by clients that
16145         require a variable stored: locals or fields for variables that
16146         need to live across yield.
16147
16148         Maybe provide a convenience api for EmitThis+EmitLoad?
16149
16150         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
16151         these bad boys.
16152
16153 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
16156         RemapParameterLValue): New methods that are used to turn a
16157         precomputed FieldInfo into an expression like this:
16158
16159                 instance.FieldInfo
16160
16161         The idea is to use this instead of making LocalVariableReference
16162         have more than one meaning.
16163
16164         * cs-parser.jay: Add error production to BASE.
16165
16166         * ecore.cs: Deal with TypeManager.GetField returning null, which
16167         is now a valid return value.
16168
16169         (FieldExprNoAddress): New expression for Fields whose address can
16170         not be taken.
16171
16172         * expression.cs (LocalVariableReference): During the resolve
16173         phases, create new expressions if we are in a remapping context.
16174         Remove code that dealt with remapping here.
16175
16176         (ParameterReference): same.
16177
16178         (ProxyInstance): New expression, like the `This' expression, but
16179         it is born fully resolved.  We know what we are doing, so remove
16180         the errors that are targeted to user-provided uses of `this'.
16181
16182         * statement.cs (Foreach): our variable is now stored as an
16183         Expression;  During resolution, follow the protocol, dont just
16184         assume it will return this.
16185
16186 2003-08-06  Martin Baulig  <martin@ximian.com>
16187
16188         * support.cs (SeekableStreamReader.cs): New public class.
16189
16190         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16191         SeekableStreamReader instead of the normal StreamReader.
16192
16193 2003-08-04  Martin Baulig  <martin@ximian.com>
16194
16195         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16196         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16197         deambiguate casts and delegate invocations.
16198         (parenthesized_expression): Use the new tokens to ensure this is
16199         not a cast of method invocation.
16200
16201         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16202         when reading a `)' and Deambiguate_CloseParens () was previously
16203         called.
16204
16205         * expression.cs (ParenthesizedExpression): New class.  This is
16206         just used for the CS0075 test.
16207         (Binary.DoResolve): Check for CS0075.   
16208
16209 2003-07-29  Ravi Pratap  <ravi@ximian.com>
16210
16211         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16212         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16213         reference comparison.
16214
16215         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16216         examine the ReturnType for equality - this is necessary in the
16217         cases of implicit and explicit operators whose signature also
16218         includes the return type.
16219
16220 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
16221
16222         * namespace.cs: Cache the result of the namespace computation,
16223         instead of computing it every time.
16224
16225 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * decl.cs: Use a global arraylist that we reuse over invocations
16228         to avoid excesive memory consumption.  Reduces memory usage on an
16229         mcs compile by one meg (45 average).
16230
16231         * typemanager.cs (LookupTypeReflection): In .NET pointers are
16232         private, work around that.
16233
16234 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
16235
16236         * literal.cs (IntLiteral): Define Zero and One static literals. 
16237
16238         * cs-parser.jay (integer_literal): use static literals to reduce
16239         memory usage for the most used literals (0, 1 and -1).  211kb
16240         reduced in memory usage.
16241
16242         Replace all calls to `new ArrayList' with `new
16243         ArrayList(4)' which is a good average number for most allocations,
16244         and also requires only 16 bytes of memory for its buffer by
16245         default. 
16246
16247         This reduced MCS memory usage in seven megabytes for the RSS after
16248         bootstrapping.
16249
16250 2003-07-28  Ravi Pratap  <ravi@ximian.com>
16251
16252         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16253         handle params methods the correct way by forming only one
16254         applicable set with params and normal methods in them. Earlier we
16255         were looking at params methods only if we found no normal methods
16256         which was not the correct thing to do.
16257
16258         (Invocation.BetterFunction): Take separate arguments indicating
16259         when candidate and the best method are params methods in their
16260         expanded form.
16261
16262         This fixes bugs #43367 and #46199.
16263
16264         * attribute.cs: Documentation updates.
16265
16266         (CheckAttribute): Rename to CheckAttributeTarget.
16267         (GetValidPlaces): Rename to GetValidTargets.
16268
16269         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16270         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16271
16272         Fixes bug #44468.
16273
16274 2003-07-28  Martin Baulig  <martin@ximian.com>
16275
16276         * class.cs (TypeContainer.DefineMembers): Use the base type's full
16277         name when looking up the base class of a nested class.  Fixes #46977.
16278
16279 2003-07-26  Martin Baulig  <martin@ximian.com>
16280
16281         * expression.cs (Indexers.Indexer): New nested struct; contains
16282         getter, setter and the indexer's type.
16283         (Indexers.Properties): This is now an ArrayList of
16284         Indexers.Indexer's.
16285         (IndexerAccess.DoResolveLValue): Correctly set the type if the
16286         indexer doesn't have any getters.
16287
16288         * assign.cs (Assign.DoResolve): Also do the implicit conversions
16289         for embedded property and indexer assignments.
16290
16291 2003-07-26  Martin Baulig  <martin@ximian.com>
16292
16293         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16294         preprocessor directive is not the first non-whitespace character
16295         on a line.
16296
16297 2003-07-26  Martin Baulig  <martin@ximian.com>
16298
16299         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16300         namespace parsing, follow the spec more closely.
16301
16302         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16303         NamespaceEntry.Lookup().
16304
16305 2003-07-25  Martin Baulig  <martin@ximian.com>
16306
16307         * MethodCore.cs (OverridesSomething): New public field; it's set
16308         from TypeContainer.DefineMembers if this method overrides
16309         something (which doesn't need to be a method).  Fix #39462.
16310
16311 2003-07-25  Ravi Pratap  <ravi@ximian.com>
16312
16313         * typemanager.cs (GetMembers): Ensure that the list of members is
16314         reversed. This keeps things in sync.
16315
16316         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16317         find an AttributeUsage attribute.
16318
16319         * expression.cs (Invocation.OverloadResolve): Perform the check
16320         which disallows Invoke to be directly called on a Delegate.
16321
16322         (Error_InvokeOnDelegate): Report error cs1533.
16323
16324 2003-07-25  Martin Baulig  <martin@ximian.com>
16325
16326         * expression.cs (Indexers.GetIndexersForType): Only look in the
16327         interface hierarchy if the requested type is already an
16328         interface.  Fixes #46788 while keeping #46502 fixed.
16329
16330 2003-07-25  Martin Baulig  <martin@ximian.com>
16331
16332         * class.cs (TypeContainer.DefineMembers): Check whether all
16333         readonly fields have been assigned and report warning CS0649 if
16334         not.
16335
16336         * statement.cs (LocalInfo.IsFixed): Always return true if this is
16337         a valuetype.
16338
16339 2003-07-24  Ravi Pratap  <ravi@ximian.com>
16340
16341         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16342         returned from GetMethods to make things consistent with the
16343         assumptions MCS makes about ordering of methods.
16344
16345         This should comprehensively fix bug #45127 and it does :-)
16346
16347         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16348         ordering is actually reverse.
16349
16350         * Clean up some debug messages I left lying around.
16351
16352         * interface.cs (Populate*): Get rid of code which emits attributes
16353         since the stage in which we emit attributes is the 'Emit' stage,
16354         not the define stage.
16355
16356         (Emit): Move attribute emission for interface members here.
16357
16358 2003-07-22  Ravi Pratap  <ravi@ximian.com>
16359
16360         * expression.cs (Invocation.OverloadResolve): Follow the spec more
16361         closely: we eliminate methods in base types when we have an
16362         applicable method in a top-level type.
16363
16364         Please see section 14.5.5.1 for an exact description of what goes
16365         on. 
16366
16367         This fixes bug #45127 and a host of other related to corlib compilation.
16368
16369         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16370         array is the method corresponding to the top-level type (this is
16371         because of the changes made to icall.c) so we change this
16372         accordingly.
16373
16374         (MethodGroupExpr.Name): This too.
16375
16376         * typemanager.cs (GetElementType): New method which does the right
16377         thing when compiling corlib. 
16378
16379         * everywhere: Make use of the above in the relevant places.
16380
16381 2003-07-22  Martin Baulig  <martin@ximian.com>
16382
16383         * cs-parser.jay (invocation_expression): Moved
16384         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16385         `cast_expression', but create a InvocationOrCast which later
16386         resolves to either an Invocation or a Cast.
16387
16388         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16389         method; call this before EmitStatement() to make sure that this
16390         expression can be used as a statement.
16391
16392         * expression.cs (InvocationOrCast): New class; resolves to either
16393         an Invocation or a Cast.
16394
16395         * statement.cs (StatementExpression): Call ResolveStatement() on
16396         the ExpressionStatement before emitting it.
16397
16398 2003-07-21  Martin Baulig  <martin@ximian.com>
16399
16400         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16401         `ref' and `out' attributes match; fixes #46220.
16402         (MemberAccess.ResolveMemberAccess): You can't reference a type
16403         through an expression; fixes #33180.
16404         (Indexers.GetIndexersForType): Don't return the indexers from
16405         interfaces the class implements; fixes #46502.
16406
16407 2003-07-21  Martin Baulig  <martin@ximian.com>
16408
16409         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16410         CS0661 checks; fixes bug #30442.
16411
16412 2003-07-21  Martin Baulig  <martin@ximian.com>
16413
16414         * decl.cs (AdditionResult): Added `Error'.
16415
16416         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16417
16418         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16419         makes cs0031.cs actually work.
16420
16421 2003-07-20  Martin Baulig  <martin@ximian.com>
16422
16423         * namespace.cs: Fixed that bug which caused a crash when compiling
16424         the debugger's GUI.
16425
16426 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * typemanager.cs (LookupTypeReflection): Never expose types which
16429         are NotPublic, NestedPrivate, NestedAssembly, or
16430         NestedFamANDAssem.  We used to return these, and later do a check
16431         that would report a meaningful error, but the problem is that we
16432         would not get the real match, if there was a name override.
16433
16434 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * namespace.cs (Namespace, Name): Do not compute the namespace
16437         name dynamically, compute it in the constructor.  This reduced
16438         memory usage by 1697 KB.
16439
16440         * driver.cs: Use --pause to pause at the end.
16441
16442 2003-07-17  Peter Williams  <peter@newton.cx>
16443
16444         * Makefile: Change the name of the test target so that it doesn't
16445         conflict with the recursive test target.
16446
16447 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * expression.cs (LocalVariableReference.Emit, EmitAssign,
16450         AddressOf): Do not use EmitThis, that was wrong, use the actual
16451         this pointer.
16452
16453 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * class.cs (MethodData.Define): While checking if a method is an
16456         interface implementation, improve the test: If we are not public
16457         (use new test here: use the computed MethodAttributes directly,
16458         instead of the parsed modifier flags) check if the `implementing'
16459         method comes from an interface or not.
16460
16461         * pending.cs (VerifyPendingMethods): Slightly better error
16462         message.
16463
16464         * makefile: add test target that does the mcs bootstrap.
16465
16466 2003-07-16  Ravi Pratap  <ravi@ximian.com>
16467
16468         * interface.cs (Define): Do nothing here since there are no
16469         members to populate etc. Move the attribute emission out of here
16470         since this was just totally the wrong place to put it. Attribute
16471         application happens during the 'Emit' phase, not in the 'Define'
16472         phase.
16473
16474         (Emit): Add this method and move the attribute emission here
16475
16476         * rootcontext.cs (EmitCode): Call the Emit method on interface
16477         types too.
16478
16479 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16480
16481         * expression.cs (OverloadResolve): Report error only if Location
16482         is not 'Null' which means that there was a probe going on.
16483
16484 2003-07-14  Martin Baulig  <martin@ximian.com>
16485
16486         * expression.cs (ConditionalLogicalOperator): New public class to
16487         implement user defined conditional logical operators.
16488         This is section 14.11.2 in the spec and bug #40505.
16489
16490 2003-07-14  Martin Baulig  <martin@ximian.com>
16491
16492         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16493
16494 2003-07-14  Martin Baulig  <martin@ximian.com>
16495
16496         * codegen.cs (EmitContext.InFixedInitializer): New public field.
16497
16498         * ecore.cs (IVariable.VerifyFixed): New interface method.
16499
16500         * expression.cs (Unary.ResolveOperator): When resolving the `&'
16501         operator, check whether the variable is actually fixed.  Fixes bug
16502         #36055.  Set a variable definitely assigned when taking its
16503         address as required by the spec.
16504
16505         * statement.cs (LocalInfo.IsFixed): New field.
16506         (LocalInfo.MakePinned): Set `IsFixed' to true.
16507
16508 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16509
16510         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16511         for .ctors, ensure that we only ask for members declared in the
16512         attribute type (BindingFlags.DeclaredOnly).
16513
16514         Fixes bug #43632.
16515
16516         * expression.cs (Error_WrongNumArguments): Report error 1501
16517         correctly the way CSC does.
16518
16519 2003-07-13  Martin Baulig  <martin@ximian.com>
16520
16521         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16522         lookup on the fully qualified name, to make things like "X.X" work
16523         where "X.X" is a fully qualified type name, but we also have a
16524         namespace "X" in the using list.  Fixes #41975.
16525
16526 2003-07-13  Martin Baulig  <martin@ximian.com>
16527
16528         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16529         function. If we're a CompoundAssign, we need to create an embedded
16530         CompoundAssign, not an embedded Assign.
16531         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16532         Fixes #45854.
16533
16534 2003-07-13  Martin Baulig  <martin@ximian.com>
16535
16536         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16537         work to fix bug #46088.
16538
16539 2003-07-13  Ravi Pratap <ravi@ximian.com>
16540
16541         * class.cs (Operator.Emit): Do not emit attributes here - it is
16542         taken care of by the Method class that we delegate too. This takes
16543         care of bug #45876.
16544
16545 2003-07-10  Martin Baulig  <martin@ximian.com>
16546
16547         * expression.cs (TypeOfVoid): New class.
16548         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16549
16550 2003-07-10  Martin Baulig  <martin@ximian.com>
16551
16552         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16553         bug #35957.
16554
16555 2003-07-10  Martin Baulig  <martin@ximian.com>
16556
16557         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16558         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16559
16560         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16561
16562         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16563
16564 2003-07-10  Martin Baulig  <martin@ximian.com>
16565
16566         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16567         of decimal.  Fixes #42850.
16568
16569         NOTE: I also fixed the created byte blob, but this doesn't work on
16570         the MS runtime and csc never produces any byte blobs for decimal
16571         arrays.
16572
16573 2003-07-10  Martin Baulig  <martin@ximian.com>
16574
16575         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16576         structs; fixes #32068.
16577         (Block.AddChildVariableNames): Fixed #44302.
16578
16579 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16580
16581         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16582
16583 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * attribute.cs: And this test is onger needed.
16586
16587 2003-07-08  Martin Baulig  <martin@ximian.com>
16588
16589         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16590         inaccessible types.  Fixes #36313.
16591
16592         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16593
16594         * namespace.cs (NamespaceEntry): Create implicit entries for all
16595         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16596         implicit entries for N1.N2 and N1.
16597
16598 2003-07-08  Martin Baulig  <martin@ximian.com>
16599
16600         Rewrote the handling of namespaces to fix a lot of the issues
16601         wrt. `using' aliases etc.
16602
16603         * namespace.cs (Namespace): Splitted this class into a
16604         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16605
16606         * typemanager.cs (TypeManager.IsNamespace): Removed.
16607         (TypeManager.ComputeNamespaces): Only compute namespaces from
16608         loaded assemblies here, not the namespaces from the assembly we're
16609         currently compiling.
16610
16611 2003-07-08  Martin Baulig  <martin@ximian.com>
16612
16613         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16614
16615 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16616
16617         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16618         already fixed it.  
16619
16620         I thought about the memory savings here, but LookupTypeReflection
16621         is used under already very constrained scenarios.  Compiling
16622         corlib or mcs only exposes one hit, so it would not really reduce
16623         any memory consumption.
16624
16625 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16626
16627         * typemanager.cs: fixes bug #45889 by only adding public types from
16628         other assemblies to the list of known types.
16629
16630 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16633         on the type we resolved.
16634
16635 2003-07-05  Martin Baulig  <martin@ximian.com>
16636
16637         * pending.cs (PendingImplementation.ParentImplements): Don't
16638         create the proxy if the parent is abstract.
16639
16640         * class.cs (TypeContainer.DefineIndexers): Process explicit
16641         interface implementations first.  Fixes #37714.
16642
16643 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16644
16645         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16646         defined recursively;  but since we modify the input parameters
16647         (left is set to `this' temporarily), we reset this value if the
16648         left_is_explicit is false, which gives the original semantics to
16649         the code.  
16650
16651         * literal.cs (NullPointer): new class used to represent a null
16652         literal in a pointer context.
16653
16654         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16655         type is a pointer, use a NullPointer object instead of a
16656         NullLiteral.   Closes 43687
16657
16658         (ExplicitConversion): Convert pointer values using
16659         the conv opcode to the proper type.
16660
16661         * ecore.cs (New): change ValueTypeVariable property into a method,
16662         that returns whether the valuetype is suitable for being used.
16663
16664         * expression.cs (Binary.DoNumericPromotions): Only return if we
16665         the int constant was a valid uint, and we can return both left and
16666         right as uints.  If not, we continue processing, to trigger the
16667         type conversion.  This fixes 39018.
16668
16669         * statement.cs (Block.EmitMeta): During constant resolution, set
16670         the CurrentBlock property on the emitcontext, so that we resolve
16671         constants propertly.
16672
16673 2003-07-02  Martin Baulig  <martin@ximian.com>
16674
16675         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16676         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16677
16678         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16679         than emitting it here.
16680
16681         * statement.cs: Fixed some more flow analysis bugs.
16682
16683 2003-07-02  Martin Baulig  <martin@ximian.com>
16684
16685         * class.cs (MethodData.Define): When implementing interface
16686         methods, set Final unless we're Virtual.
16687
16688         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16689         check work for interface methods.
16690
16691 2003-07-01  Martin Baulig  <martin@ximian.com>
16692
16693         * ecore.cs (EmitContext.This): Replaced this property with a
16694         GetThis() method which takes a Location argument.  This ensures
16695         that we get the correct error location for a CS0188.
16696
16697 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16698
16699         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16700         ImplicitStandardConversion.
16701
16702         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16703
16704 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16705
16706         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16707         optimization.
16708
16709 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16712         constructors.
16713
16714         (MethodData.Define): Turn off initlocals for unsafe methods.
16715
16716 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16719         complete;  Fixes #37521.
16720
16721         * delegate.cs: Use Modifiers.TypeAttr to compute the
16722         TypeAttributes, instead of rolling our own.  This makes the flags
16723         correct for the delegates.
16724
16725 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16726
16727         * class.cs (Constructor.Define): Set the private flag for static
16728         constructors as well.
16729
16730         * cs-parser.jay (statement_expression): Set the return value to
16731         null, to avoid a crash when we catch an error.
16732
16733 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16734
16735         * cs-parser.jay: Applied patch from Jackson that adds support for
16736         extern and unsafe modifiers to destructor declarations.
16737
16738         * expression.cs: Report error 21 if the user is trying to index a
16739         System.Array.
16740
16741         * driver.cs: Add an error message, suggested by the bug report.
16742
16743         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16744         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16745
16746 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * namespace.cs: Add some information to reduce FAQs.
16749
16750 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16753         underlying enumeration types.  Fixes #43915.
16754
16755         * expression.cs: Treat ushort/short as legal values to be used in
16756         bitwise operations.
16757
16758 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16759
16760         * delegate.cs: transfer custom attributes for paramenters from
16761         the delegate declaration to Invoke and BeginInvoke.
16762
16763 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16764
16765         * attribute.cs: handle custom marshalers and emit marshal info
16766         for fields, too.
16767
16768 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16769
16770         * makefile.gnu: Added anonymous.cs to the compiler sources.
16771
16772 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * iterators.cs: Change the name of the proxy class to include two
16775         underscores.
16776
16777         * cs-parser.jay: Update grammar to include anonymous methods.
16778
16779         * anonymous.cs: new file.
16780
16781 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16782
16783         * class.cs (Field.Define): Add missing test for pointers and
16784         safety. 
16785
16786 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16787
16788         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16789         we use the stobj opcode.
16790
16791         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16792         since it wasn't the correct fix. 
16793
16794         It still is puzzling that we are required to use stobj for IntPtr
16795         which seems to be a ValueType.
16796
16797 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16798
16799         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16800         during regular simple name resolution.   Now, the trick is that
16801         instead of returning for processing the simplename, we do a
16802         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16803         contextual lookup type).   If a match is found, return that, if
16804         not, return for further composition.
16805
16806         This fixes long-standing 30485.
16807
16808         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16809         using the address to initialize an object, do an Stobj instead of
16810         using the regular Stelem.
16811
16812         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16813         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16814         Because if we are a BaseIndexerAccess that value will be true.
16815         Fixes 43643.
16816
16817         * statement.cs (GotoCase.Resolve): Return after reporting an
16818         error, do not attempt to continue. 
16819
16820         * expression.cs (PointerArithmetic.Emit): If our operand is a
16821         long, convert our constants to match the operand before
16822         multiplying.  Convert to I type before adding.   Fixes 43670.
16823
16824 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16825
16826         * enum.cs (ImplicitConversionExists) : Rename to
16827         ImplicitEnumConversionExists to remove ambiguity. 
16828
16829         * ecore.cs (NullCast): New type of cast expression class which
16830         basically is very similar to EmptyCast with the difference being
16831         it still is a constant since it is used only to cast a null to
16832         something else
16833         (eg. (string) null)
16834
16835         * convert.cs (ImplicitReferenceConversion): When casting a null
16836         literal, we return a NullCast.
16837
16838         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16839         should be around anymore.
16840
16841         The renaming (reported was slightly wrong). Corrections:
16842
16843         ConvertImplicitStandard -> ImplicitConversionStandard
16844         ConvertExplicitStandard -> ExplicitConversionStandard
16845
16846         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16847         before passing them in !
16848
16849         * convert.cs (ImplicitConversionStandard): When comparing for
16850         equal expr and target types, ensure that expr is not a
16851         NullLiteral.
16852
16853         In general, we must not be checking (expr_type ==
16854         target_type) in the top level conversion methods
16855         (ImplicitConversion, ExplicitConversion etc). This checking is
16856         done in the methods that they delegate to.
16857
16858 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16859
16860         * convert.cs: Move Error_CannotConvertType,
16861         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16862         ImplicitNumericConversion, ImplicitConversionExists,
16863         ImplicitUserConversionExists, StandardConversionExists,
16864         FindMostEncompassedType, FindMostSpecificSource,
16865         FindMostSpecificTarget, ImplicitUserConversion,
16866         ExplicitUserConversion, GetConversionOperators,
16867         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16868         TryImplicitIntConversion, Error_CannotConvertImplicit,
16869         ConvertImplicitRequired, ConvertNumericExplicit,
16870         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16871         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16872         its own file.
16873
16874         Perform the following renames:
16875
16876         StandardConversionExists -> ImplicitStandardConversionExists
16877         ConvertImplicit -> ImplicitConversion
16878         ConvertImplicitStandard -> ImplicitStandardConversion
16879         TryImplicitIntConversion -> ImplicitIntConversion
16880         ConvertImplicitRequired -> ImplicitConversionRequired
16881         ConvertNumericExplicit -> ExplicitNumericConversion
16882         ConvertReferenceExplicit -> ExplicitReferenceConversion
16883         ConvertExplicit -> ExplicitConversion
16884         ConvertExplicitStandard -> ExplicitStandardConversion
16885
16886 2003-05-19  Martin Baulig  <martin@ximian.com>
16887
16888         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16889         (TypeInfo): Added support for structs having structs as fields.
16890
16891         * ecore.cs (FieldExpr): Implement IVariable.
16892         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16893         VariableInfo for the field.
16894
16895 2003-05-18  Martin Baulig  <martin@ximian.com>
16896
16897         * expression.cs (This.DoResolve): Report a CS0027 if we're
16898         emitting a field initializer.
16899
16900 2003-05-18  Martin Baulig  <martin@ximian.com>
16901
16902         * expression.cs (This.ResolveBase): New public function.
16903         (This.DoResolve): Check for CS0188.
16904
16905         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16906         This.Resolve().
16907
16908         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16909         `instance_expression' to null if we don't have any non-static
16910         methods.
16911
16912 2003-05-18  Martin Baulig  <martin@ximian.com>
16913
16914         Reworked the way how local variables and parameters are handled by
16915         the flow analysis code.
16916
16917         * statement.cs (TypeInfo, VariableMap): New public classes.
16918         (VariableInfo): New public class.  This is now responsible for
16919         checking whether a variable has been assigned.  It is used for
16920         parameters and local variables.
16921         (Block.EmitMeta): Take the InternalParameters as argument; compute
16922         the layout of the flow vectors here.
16923         (Block.LocalMap, Block.ParameterMap): New public properties.
16924         (FlowBranching): The .ctor doesn't get the InternalParameters
16925         anymore since Block.EmitMeta() now computes the layout of the flow
16926         vector.
16927         (MyStructInfo): This class is now known as `StructInfo' and nested
16928         in `TypeInfo'; we don't access this directly anymore.
16929
16930         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16931         property and removed IsAssigned(), IsFieldAssigned(),
16932         SetAssigned() and SetFieldAssigned(); we now call them on the
16933         VariableInfo so we don't need to duplicate this code everywhere.
16934
16935         * expression.cs (ParameterReference): Added `Block block' argument
16936         to the .ctor.
16937         (LocalVariableReference, ParameterReference, This): The new
16938         VariableInfo class is now responsible for all the definite
16939         assignment stuff.
16940
16941         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16942         IsParameterAssigned, SetParameterAssigned): Removed.
16943
16944 2003-05-18  Martin Baulig  <martin@ximian.com>
16945
16946         * typemanager.cs (InitCoreTypes): Try calling
16947         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16948         the 3-args-version.  Corlib now also needs our `void_type'.
16949         (GetMethod): Added overloaded version which takes an optional
16950         `bool report_errors' to allow lookups of optional methods.
16951
16952 2003-05-12  Martin Baulig  <martin@ximian.com>
16953
16954         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16955         only used for locals and not for parameters.
16956
16957 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * support.cs (InternalParameters.ParameterType): Return the
16960         ExternalType of the parameter.
16961
16962         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16963         they were unused.
16964
16965 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16966
16967         * class.cs (MethodData.Define): Do not set the `newslot' on
16968         interface members, if they are also flagged as "override".
16969
16970         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16971         better code for ++i and i++.  This only works for static fields
16972         and local variables.
16973
16974         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16975         want to pull the DeclSpace out of the builder_to_declspace instead
16976         of the TypeBuilder (like in TypeContainer.FindMembers).
16977
16978         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16979         instead of LookupTypeContainer.  Fixes the crash on .NET for
16980         looking up interface members.
16981
16982         * const.cs: Create our own emit context during the Definition
16983         stage, so that constants are evaluated in the proper context, when
16984         a recursive definition happens.
16985
16986 2003-05-11  Martin Baulig  <martin@ximian.com>
16987
16988         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16989         new block for a switch section.
16990         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16991         the adding/lookup in the switch block.  Fixes #39828.
16992
16993 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16994
16995         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16996         functionality: I needed to convert the data after I had performed
16997         the add/sub operation into the operands type size.
16998
16999         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
17000         pass the type for the box operation, otherwise the resulting
17001         object would have been of type object.
17002
17003         (BoxedCast): Add constructor to specify the type to box as.
17004
17005 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
17006
17007         * iterators.cs: I was reusing the `count' variable inadvertently,
17008         take steps to not allow this to happen.
17009
17010 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
17011
17012         * attribute.cs (Attribute.Resolve): Params attributes are encoded
17013         by creating an array at the point where the params starts and
17014         putting all those arguments there, then adjusting the size of the
17015         array.
17016
17017 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
17018
17019         * expression.cs (New.AddressOf): Implement interface
17020         IMemoryLocation.  This is used when the `new' operator is used in
17021         the context of an invocation to a method on a value type.
17022
17023         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
17024         example. 
17025
17026         * namespace.cs: Also check the using aliases here.
17027
17028         * driver.cs: Move the test for using validity after the types have
17029         been entered, so we do a single pass that also includes the using
17030         aliases. 
17031
17032         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
17033         in the regular case.   CreateSiblingForFinally is doing extra
17034         error checking.
17035
17036         * attribute.cs (GetAttributeArgumentExpression): Store the result
17037         on an out value, and use the return value to indicate failure
17038         instead of using null (which is a valid return for Constant.GetValue).
17039
17040         * statement.cs: Perform the analysis flow for the increment
17041         portion after the statement, because this will be the real flow of
17042         execution.  Fixes #42385
17043
17044         * codegen.cs (EmitContext.EmitArgument,
17045         EmitContext.EmitStoreArgument): New helper functions when the
17046         RemapToProxy flag is set.
17047
17048         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
17049         function.
17050
17051         Add support for remapping parameters. 
17052
17053         * iterators.cs: Propagate parameter values;  Store parameter
17054         values in the proxy classes.
17055
17056 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
17059         need a proxy reference;  I do not know what I was thinking
17060
17061         * cs-parser.jay (constructor_initializer): catch another error,
17062         and display nice message.
17063
17064         (field_declaration): catch void field declaration
17065         to flag a better error. 
17066
17067         * class.cs (MemberBase.CheckBase): Report an error instead of a
17068         warning if a new protected member is declared in a struct. 
17069         (Field.Define): catch the error of readonly/volatile.
17070
17071         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
17072
17073         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
17074         volatile variable is taken
17075
17076 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * statement.cs (Fixed.Resolve): Report an error if we are not in
17079         an unsafe context.
17080
17081 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * typemanager.cs: reuse the code that handles type clashes for
17084         delegates and enumerations.
17085
17086         * class.cs (Report28): Always report.
17087
17088         * expression.cs (EncodeAsAttribute): Allow nulls here.
17089
17090 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
17093         the functionality for testing whether an expression is valid for
17094         an attribute here.  Also handle the case of arrays of elements
17095         being stored. 
17096
17097         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
17098         encoding a linear array into an array of objects that are suitable
17099         to be passed to an CustomAttributeBuilder.
17100
17101         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
17102
17103         * ecore.cs: (FieldExpr): Handle field remapping here.
17104
17105         * iteratators.cs: Pass the instance variable (if the method is an
17106         instance method) to the constructors, so we can access the field
17107         variables on the class.
17108
17109         TODO: Test this with structs.  I think the THIS variable on
17110         structs might have to be a pointer, and not a refenrece
17111
17112 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
17115         local variables to fields in a proxy class.
17116
17117         * iterators.cs (PopulateProxy): Rename our internal fields to
17118         <XXX>.  
17119         Create a <THIS> field if we are an instance method, so we can
17120         reference our parent container variables.
17121         (MapVariable): Called back from the EmitContext code to enter a
17122         new variable to field mapping into the proxy class (we just create
17123         a FieldBuilder).
17124
17125         * expression.cs
17126         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
17127         for using the remapped locals to fields.
17128
17129         I placed the code here, because that gives the same semantics to
17130         local variables, and only changes the Emit code.
17131
17132         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
17133         statements inside iterators.
17134         (VariableInfo): Add a FieldBuilder for the cases when we are
17135         remapping local variables to fields in a proxy class
17136
17137         * ecore.cs (SimpleNameResolve): Avoid testing two times for
17138         current_block != null.
17139
17140         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
17141         not cope with strings, as it has been moved to the
17142         TableSwitchEmit.  Fixed bug in switch generation.
17143
17144         * expression.cs (New.DoResolve): Provide more context for the user
17145         when reporting an error.
17146
17147         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
17148         pointers. 
17149
17150         * expression.cs (MemberAccess.DoResolve): When we get a type back,
17151         check the permissions for it.  Note than in a type-resolution
17152         context the check was already present in DeclSpace.ResolveType,
17153         but was missing from the MemberAccess.
17154
17155         (ArrayCreation.CheckIndices): warn if the user has
17156         more nested levels of expressions, but there are no more
17157         dimensions specified.  Avoids crash on bug 41906.
17158
17159 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
17160
17161         * statement.cs (Block): replace Implicit bool, for a generic
17162         flags.   
17163         New flag: `Unchecked'.  This is used during the EmitMeta phase
17164         (which is out-of-line with the regular Resolve/Emit process for a
17165         statement, as this is done ahead of time, but still gets a chance
17166         to call constant resolve).
17167
17168         (Block.Flags): new enum for adding a new flag.
17169
17170         (Block.EmitMeta): track the state of unchecked.
17171
17172         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17173         to enable constant resolution to work there as well.
17174
17175 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
17176
17177         * typemanager.cs (ienumerable_type): Also look up
17178         System.Collections.IEnumerable. 
17179
17180 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
17181
17182         TODO: Test more than one conditional per method.
17183
17184         * class.cs (Indexer.Define): Report the location where the user is
17185         referencing the unsupported feature.
17186
17187         (MethodData): Overload the use of `conditionals' to
17188         minimize the creation of needless ArrayLists.   This saves roughly
17189         212kb on my machine.
17190
17191         (Method): Implement the new IIteratorContainer interface.
17192         (Method.SetYields): Implement the method by setting the ModFlags
17193         to contain METHOD_YIELDS.
17194
17195         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17196         which just got set to null.
17197
17198         * iterators.cs: New file.
17199
17200         (Yield, YieldBreak): New statements.
17201
17202         * statement.cs (Return.Resolve): Flag an error if we are used in
17203         an iterator method.
17204
17205         * codegen.cs (InIterator): New flag set if the code is being
17206         compiled in an iterator method.
17207
17208         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
17209         internal modifier, and we just use it to avoid adding extra
17210         fields, as this is seldom used.  
17211
17212         * cs-parser.jay: Add yield_statement (yield and yield break).
17213
17214         * driver.cs: New flag -v2 to turn on version 2 features. 
17215
17216         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17217         hashtable when v2 is enabled.
17218
17219 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17222         there is already a namespace defined with this name.
17223
17224         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17225         people upgraded their corlibs.
17226
17227         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17228         always use fully qualified types, no need to use the compiler
17229         front end.
17230
17231         (TypeManager.IsNamespace): Use binarysearch.
17232
17233         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17234         AddDelegate): I did not quite use the new IsValid API properly: I
17235         have to pass the short-name and the fullname.  I was passing only
17236         the basename instead of the fullname sometimes. 
17237
17238         (TypeContainer.DefineType): call NamespaceClash.
17239
17240         * interface.cs (Interface.DefineType): use NamespaceClash before
17241         defining the type.
17242
17243         * delegate.cs (Delegate.DefineType): use NamespaceClash before
17244         defining the type.
17245
17246         * enum.cs: (Enum.DefineType): use NamespaceClash before
17247         defining the type.
17248
17249         * typemanager.cs (: 3-line patch that gives us some tasty 11%
17250         speed increase.  First, use the negative_hits cache when we get a
17251         negative.  Second, add the type with its full original name
17252         instead of the new . and + encoded name (reflection uses + to
17253         separate type from a nested type).  Use LookupTypeReflection
17254         directly which bypasses the type->name hashtable (that we already
17255         know does not contain the type.
17256
17257         * decl.cs (DeclSpace.ResolveTypeExpr): track the
17258         location/container type. 
17259
17260         * driver.cs: When passing utf8, use directly the UTF8Encoding.
17261
17262 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17265
17266         * delegate.cs (NewDelegate.Resolve): Test whether an instance
17267         method is being referenced in the method group from a static
17268         context, and report error 120 if so.
17269
17270         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17271         Error118. 
17272
17273         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17274         is created, we create the A namespace).
17275
17276         * cs-parser.jay: A namespace also introduces a DeclarationFound.
17277         Fixes #41591
17278
17279 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
17280
17281         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17282         invocation to ModuleBuilder.GetType with the same values will
17283         return a new type instance, so we need to cache its return
17284         values. 
17285
17286         * expression.cs (Binary.ResolveOperator): Only allow the compare
17287         operators on enums if they are of the same type.
17288
17289         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17290         types of ValueType on their own case.  Before we were giving them
17291         the same treatment as objects.
17292
17293         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17294         fullname.  Short name is used to compare against container name.
17295         Fullname is used to check against defined namespace names.
17296
17297         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17298         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17299
17300         (Method.CheckBase): Call parent.
17301         (MemberBase.CheckBase): Check for protected members on sealed
17302         classes.
17303         (PropertyBase.CheckBase): Call parent.
17304         (Field.Define): Call parent.
17305
17306         * report.cs: Negative error codes are now mapped to 8000 - code,
17307         so that the display is render more nicely.
17308
17309         * typemanager.cs: Do not use try/catch, instead report a regular
17310         error. 
17311
17312         (GetPointerType, GetReferenceType): These methods provide
17313         mechanisms to obtain the T* and T& from a T.  We had the code
17314         previously scattered around the code base, and it also used
17315         TypeManager.LookupType that would go through plenty of caches.
17316         This one goes directly to the type source.
17317
17318         In some places we did the Type.GetType followed by
17319         ModuleBuilder.GetType, but not in others, so this unifies the
17320         processing as well.
17321
17322         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17323         statements now that we have namespace information.
17324
17325         * typemanager.cs (IsNamespace): New method, returns whether the
17326         string presented is a namespace or not.
17327
17328         (ComputeNamespaces): New public entry point, computes the list of
17329         available namespaces, using the GetNamespaces API call in Mono, or
17330         the slower version in MS.NET.   
17331
17332         Now before we start the semantic analysis phase, we have a
17333         complete list of namespaces including everything that the user has
17334         provided.
17335
17336         Deleted old code to cache namespaces in .nsc files.
17337
17338 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
17339
17340         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17341         class/struct location definition Location for the implicit
17342         constructor location.
17343
17344         (Operator.Define): Use the location of the operator for the
17345         implicit Method definition.
17346
17347         (Constructor.Emit): use the constructor location for the implicit
17348         base initializer constructor.
17349
17350         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
17351         and the Expression class now contains two new methods:
17352
17353         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
17354         isolate type lookup from the rest of the resolution process.
17355
17356         Since we use Expressions to hold type definitions due to the way
17357         we parse the input we have historically overloaded Resolve to
17358         perform the Type lookups if a special flag is passed.  Now this is
17359         eliminated and two methods take their place. 
17360
17361         The differences in the two methods between xStep and xTerminal is
17362         that xStep is involved in our current lookup system that uses
17363         SimpleNames to compose a name, while xTerminal is used just to
17364         catch the case where the simplename lookup failed.
17365
17366 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
17367
17368         * expression.cs (ResolveMemberAccess): Remove redundant code.
17369         TypeExpr expressions are always born fully resolved.
17370
17371         * interface.cs (PopulateMethod): Do not lookup the types twice.
17372         We were doing it once during SemanticAnalysis and once during
17373         PopulateMethod.
17374
17375         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17376         in local variable type definitions, were being returned as a
17377         SimpleName (we decomposed everything into a string), that is
17378         because primary_expression was being used instead of a type in the
17379         grammar (reduce/reduce conflicts).
17380
17381         The part that was wrong is that we converted the expression into a
17382         string (an oversimplification in one hand, compounded with primary
17383         expressions doing string concatenation).
17384
17385         So things like:
17386
17387         A.B.C [] x;
17388
17389         Would return "A.B.C[]" as a SimpleName.  This stopped things like
17390         using clauses from working on this particular context.  And a type
17391         was being matched directly against "A.B.C[]".
17392
17393         We now use the correct approach, and allow for ComposedCast to be
17394         part of the unary expression.  So the "A.B.C []" become a composed
17395         cast of "A.B.C" (as a nested group of MemberAccess with a
17396         SimpleName at the end) plus the rank composition "[]". 
17397
17398         Also fixes 35567
17399
17400 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
17401
17402         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17403         for the access level checking.
17404
17405         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
17406         `TypeContainer container', because I kept getting confused when I
17407         was debugging this code.
17408
17409         * expression.cs (Indexers): Instead of tracking getters/setters,
17410         we now track them in parallel.  We create one arraylist less, but
17411         most importantly it is possible now for the LValue code to find a
17412         matching get for a set.
17413
17414         (IndexerAccess.DoResolveLValue): Update the code.
17415         GetIndexersForType has been modified already to extract all the
17416         indexers from a type.  The code assumed it did not.
17417
17418         Also make the code set the correct return type for the indexer.
17419         This was fixed a long time ago for properties, but was missing for
17420         indexers.  It used to be void_type.
17421
17422         (Binary.Emit): Test first for doubles instead of
17423         floats, as they are more common.
17424
17425         (Binary.EmitBranchable): Use the .un version of the branch opcodes
17426         when dealing with floats and the <=, >= operators.  This fixes bug
17427         #39314 
17428
17429         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17430         to load the array value by emitting a load on the foreach variable
17431         type.  This was incorrect.  
17432
17433         We now emit the code to load an element using the the array
17434         variable type, and then we emit the conversion operator.
17435
17436         Fixed #40176
17437
17438 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
17439
17440         * attribute.cs: Avoid allocation of ArrayLists in the common case.
17441
17442 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
17443
17444         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17445         test for protection before we test for signatures. 
17446
17447         (MethodSignature.ToString): implement.
17448
17449         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17450         to the case where we reduced into a LongConstant.
17451
17452         * decl.cs (CheckAccessLevel): If the type is an array, we can not
17453         depend on whether the information is acurrate, because the
17454         Microsoft runtime will always claim that the array type is public,
17455         regardless of the real state.
17456
17457         If the type is a pointer, another problem happens: the type is
17458         reported as non-public in Microsoft.  
17459
17460         In both cases we have to call CheckAccessLevel recursively with
17461         the underlying type as the argument to be tested.
17462
17463 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
17464
17465         * assign.cs (Assign.Emit): If we are dealing with a compound
17466         assignment expression, we should use the code path that stores the
17467         intermediate result in a temporary value.  This fixes #40903.
17468
17469         *expression.cs (Indirection.ToString): Provide ToString method for
17470         debugging. 
17471
17472 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
17473
17474         * class.cs: Null out fields holding references to Block objects so
17475         they can be garbage collected.
17476
17477         * expression.cs (OverloadResolve): Remove unused local.
17478
17479 2003-04-07  Martin Baulig  <martin@ximian.com>
17480
17481         * codegen.cs (EmitContext.CurrentFile): New public field.
17482         (EmitContext.Mark): Use the CurrentFile to check whether the
17483         location is in the correct file.
17484         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17485
17486 2003-04-07  Martin Baulig  <martin@ximian.com>
17487
17488         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17489
17490         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17491         location.  [FIXME: The location argument which gets passed to this
17492         method is sometimes wrong!]
17493
17494 2003-04-07  Nick Drochak <ndrochak@gol.com>
17495
17496         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17497
17498 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
17499
17500         * expression.cs (Indirection.EmitAssign): We were using the
17501         temporary, but returning immediately instead of continuing the
17502         EmitAssing flow.
17503
17504 2003-04-06  Martin Baulig  <martin@ximian.com>
17505
17506         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17507         if it's a nested child, but also deriving from the outer class.
17508         See test 190.cs.
17509
17510         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17511         nested child, but also deriving from the outer class.  See
17512         test-190.cs.
17513         (FilterWithClosure): We may access private members of the outer
17514         class if we're a nested child and deriving from the outer class.
17515         (RealMemberLookup): Only set `closure_private_ok' if the
17516         `original_bf' contained BindingFlags.NonPublic.
17517
17518 2003-04-05  Martin Baulig  <martin@ximian.com>
17519
17520         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17521
17522 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * class.cs (Event.Define): Do not allow abstract events to have
17525         initializers. 
17526
17527 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17530         block in event declarations.
17531
17532         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17533         value type, get its address.
17534
17535         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17536         leaving a class on the stack instead of a boolean value (int
17537         0/1).  Change the code so we compare against null, and then the
17538         result against zero.
17539
17540         * class.cs (TypeContainer.GetClassBases): We were checking for the
17541         parent class being sealed too late.
17542
17543         * expression.cs (Binary.Emit): For <= and >= when dealing with
17544         floating point values, use cgt.un and clt.un instead of cgt and
17545         clt alone.
17546
17547 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17548
17549         * statement.cs: Apply the same optimization as MS: skip the 
17550         GetEnumerator returning an IEnumerator, and use the one returning a 
17551         CharEnumerator instead. This allows us to avoid the try-finally block 
17552         and the boxing.
17553
17554 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17555
17556         * cs-parser.jay: Attributes cannot be applied to
17557                          namespaces. Fixes #40473
17558
17559 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17560
17561         * class.cs:
17562         (Add*): check if the name is valid using the full name for constants,
17563         fields, properties and events.
17564
17565 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17566
17567         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17568         char constants to be part of the enumeration.
17569
17570         * expression.cs (Conditional.DoResolve): Add support for operator
17571         true. Implements the missing functionality from 14.12
17572
17573         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17574         operator true/false as required by the spec.
17575
17576         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17577         implicit conversion to boolean.
17578
17579         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17580         also one where the type implements `operator true'. 
17581
17582         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17583         get an expression that will invoke operator true based on an
17584         expression.  
17585
17586         (GetConversionOperators): Removed the hack that called op_True
17587         here.  
17588
17589         (Expression.ResolveBoolean): Move this from Statement.
17590
17591 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17592
17593         * ecore.cs (FieldExpr): do not allow initialization of initonly
17594         fields on derived classes
17595
17596 2003-03-13  Martin Baulig  <martin@ximian.com>
17597
17598         * statement.cs (Block.Emit): Call ig.BeginScope() and
17599         ig.EndScope() when compiling with debugging info; call
17600         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17601
17602 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17603
17604         * expression.cs (Indexers): Do not construct immediately, allow
17605         for new members to be appended as we go.  Fixes 38143
17606
17607 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17608
17609         * expression.cs: save/restore context when resolving an unchecked
17610         expression.
17611
17612 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * cfold.cs: Catch division by zero in modulus operator during
17615         constant folding.
17616
17617 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17618
17619         * interface.cs (Interface.DefineMembers): Avoid defining members
17620         twice. 
17621
17622 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * driver.cs: handle the +/- options for -noconfig
17625
17626         * statement.cs (Unckeched.Resolve): Also track the state of
17627         unchecked in the Resolve phase.
17628
17629 2003-02-27  Martin Baulig  <martin@ximian.com>
17630
17631         * ecore.cs (Expression.MemberLookup): Don't create a
17632         MethodGroupExpr for something which is not a method.  Fixes #38291.
17633
17634 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17635
17636         * class.cs (MemberBase.CheckParameters): Also check that the type
17637         is unmanaged if it is a pointer.
17638
17639         * expression.cs (SizeOf.Resolve): Add location information.
17640
17641         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17642         a managed type is declared.
17643
17644         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17645         parameter modifiers as well.  Fixes bug 38606
17646
17647         * class.cs: Very sad.  Am backing out the speed up changes
17648         introduced by the ArrayList -> Array in the TypeContainer, as they
17649         were not actually that much faster, and introduced a bug (no error
17650         reports on duplicated methods).
17651
17652         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17653         source first, this will guarantee that we have a valid expression
17654         before calling in lower levels functions that will require a
17655         resolved object.  Then use this original_source in the
17656         target.ResolveLValue instead of the original source that was
17657         passed to us.
17658
17659         Another change.  Use target.Resolve instead of LValueResolve.
17660         Although we are resolving for LValues, we will let the Assign code
17661         take care of that (it will be called again from Resolve).  This
17662         basically allows code like this:
17663
17664         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17665         class Y { void A (X x) { x [0] += o; }
17666
17667         The problem was that the indexer was trying to resolve for
17668         set_Item (idx, object o) and never finding one.  The real set_Item
17669         was set_Item (idx, X).  By delaying the process we get the right
17670         semantics. 
17671
17672         Fixes bug 36505
17673
17674 2003-02-23  Martin Baulig  <martin@ximian.com>
17675
17676         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17677         while calling DoEmit ().
17678
17679         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17680         source files; if you use the #line directive inside a method, the
17681         compiler stops emitting line numbers for the debugger until it
17682         reaches the end of the method or another #line directive which
17683         restores the original file.
17684
17685 2003-02-23  Martin Baulig  <martin@ximian.com>
17686
17687         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17688
17689 2003-02-23  Martin Baulig  <martin@ximian.com>
17690
17691         * statement.cs (Block.AddChildVariableNames): We need to call this
17692         recursively, not just for our immediate children.
17693
17694 2003-02-23  Martin Baulig  <martin@ximian.com>
17695
17696         * class.cs (Event.Define): Always make the field private, like csc does.
17697
17698         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17699         actually work, fixes bug #37521.
17700
17701 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17702
17703         * delegate.cs: When creating the various temporary "Parameters"
17704         classes, make sure that we call the ComputeAndDefineParameterTypes
17705         on those new parameters (just like we do with the formal ones), to
17706         allow them to be resolved in the context of the DeclSpace.
17707
17708         This fixes the bug that Dick observed in Bugzilla #38530.
17709
17710 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * expression.cs (ResolveMemberAccess): When resolving a constant,
17713         do not attempt to pull a constant if the value was not able to
17714         generate a valid constant.
17715
17716         * const.cs (LookupConstantValue): Do not report more errors than required.
17717
17718 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17719
17720         * expression.cs: fixes bug #38328.
17721
17722 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17723
17724         * class.cs: Changed all the various members that can be part of a
17725         class from being an ArrayList to be an Array of the right type.
17726         During the DefineType type_list, interface_list, delegate_list and
17727         enum_list are turned into types, interfaces, delegates and enums
17728         arrays.  
17729
17730         And during the member population, indexer_list, event_list,
17731         constant_list, field_list, instance_constructor_list, method_list,
17732         operator_list and property_list are turned into their real arrays.
17733
17734         Although we could probably perform this operation earlier, for
17735         good error reporting we need to keep the lists and remove the
17736         lists for longer than required.
17737
17738         This optimization was triggered by Paolo profiling the compiler
17739         speed on the output of `gen-sample-program.pl' perl script. 
17740
17741         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17742         not crash in methods like MemberLookupFailed that use this field.  
17743
17744         This problem arises when the compiler fails to resolve a type
17745         during interface type definition for example.
17746
17747 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17748
17749         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17750         inherit from System.Object, so we have to stop at null, not only
17751         when reaching System.Object.
17752
17753 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17756         DeclaredOnly because the parent indexer might have had a different
17757         name, but did not loop until the top of the hierarchy was reached.
17758
17759         The problem this one fixes is 35492: when a class implemented an
17760         indexer from an interface, we were getting the interface method
17761         (which was abstract) and we were flagging an error (can not invoke
17762         abstract method).
17763
17764         This also keeps bug 33089 functioning, and test-148 functioning.
17765
17766         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17767         out if a method is special is to see if it is declared in a
17768         property or event, or whether it is one of the predefined operator
17769         names.   This should fix correctly #36804.
17770
17771 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17772
17773         The goal here is to remove the dependency on EmptyCast.Peel ().
17774         Killing it completely.
17775
17776         The problem is that currently in a number of places where
17777         constants are expected, we have to "probe" for an EmptyCast, and
17778         Peel, which is not the correct thing to do, as this will be
17779         repetitive and will likely lead to errors. 
17780
17781         The idea is to remove any EmptyCasts that are used in casts that
17782         can be reduced to constants, so we only have to cope with
17783         constants. 
17784
17785         This bug hunt was triggered by Bug 37363 and the desire to remove
17786         the duplicate pattern where we were "peeling" emptycasts to check
17787         whether they were constants.  Now constants will always be
17788         constants.
17789
17790         * ecore.cs: Use an enumconstant here instead of wrapping with
17791         EmptyCast.  
17792
17793         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17794         throwing me off.  By handling this we can get rid of a few hacks.
17795
17796         * statement.cs (Switch): Removed Peel() code.
17797
17798 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17799
17800         * class.cs: Location information for error 508
17801
17802         * expression.cs (New.DoResolve): Add a guard against double
17803         resolution of an expression.  
17804
17805         The New DoResolve might be called twice when initializing field
17806         expressions (see EmitFieldInitializers, the call to
17807         GetInitializerExpression will perform a resolve on the expression,
17808         and later the assign will trigger another resolution
17809
17810         This leads to bugs (#37014)
17811
17812         * delegate.cs: The signature for EndInvoke should contain any ref
17813         or out parameters as well.  We were not doing this in the past. 
17814
17815         * class.cs (Field.Define): Do not overwrite the type definition
17816         inside the `volatile' group.  Turns out that volatile enumerations
17817         were changing the type here to perform a validity test, which
17818         broke conversions. 
17819
17820 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17823         and structs, we do not want to load the instance variable
17824
17825         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17826         enum_type has to be handled like an object reference (implicit
17827         conversions exists from this to object), but the regular IsClass
17828         and IsValueType tests will never return true for this one.
17829
17830         Also we use TypeManager.IsValueType instead of type.IsValueType,
17831         just for consistency with the rest of the code (this is only
17832         needed if we ever use the construct exposed by test-180.cs inside
17833         corlib, which we dont today).
17834
17835 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17836
17837         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17838         just InternalCall.
17839
17840 2003-02-09  Martin Baulig  <martin@ximian.com>
17841
17842         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17843         (Namespace.DefineNamespaces): New static public method; this is
17844         called when we're compiling with debugging to add all namespaces
17845         to the symbol file.
17846
17847         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17848         pass it to the Namespace's .ctor.
17849
17850         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17851         and MethodBase arguments; pass the namespace ID to the symwriter;
17852         pass the MethodBase instead of the token to the symwriter.
17853         (SymbolWriter.DefineNamespace): New method to add a namespace to
17854         the symbol file.
17855
17856 2003-02-09  Martin Baulig  <martin@ximian.com>
17857
17858         * symbolwriter.cs: New file.  This is a wrapper around
17859         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17860         methods here in near future.
17861
17862 2003-02-09  Martin Baulig  <martin@ximian.com>
17863
17864         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17865         ILGenerator.MarkSequencePoint() which are actually used by the
17866         symbol writer.
17867
17868 2003-02-09  Martin Baulig  <martin@ximian.com>
17869
17870         * location.cs (SourceFile): New public sealed class.  This
17871         contains the name and an index which is used in the location's token.
17872         (Location): Reserve an appropriate number of bits in the token for
17873         the source file instead of walking over that list, this gives us a
17874         really huge performance improvement when compiling with debugging.
17875
17876         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17877         `SourceFile' argument instead of a string.
17878         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17879         but don't parse/tokenize here, we need to generate the list of all
17880         source files before we do that.
17881         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17882         the files.
17883
17884         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17885         instead of a string.
17886
17887         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17888         of a string.
17889
17890 2003-02-09  Martin Baulig  <martin@ximian.com>
17891
17892         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17893         filename on `#line default'.
17894
17895 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17896
17897         * statement.cs: don't clear the pinned var when the fixed statement
17898         returns from the method (fixes bug#37752).
17899
17900 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17901
17902         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17903         to IsValueType.
17904
17905 2003-02-07  Martin Baulig  <martin@ximian.com>
17906
17907         * driver.cs: Removed the `--debug-args' command line argument.
17908
17909         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17910         automatically by the AsssemblyBuilder.
17911         (CodeGen.InitializeSymbolWriter): We don't need to call any
17912         initialization function on the symbol writer anymore.  This method
17913         doesn't take any arguments.
17914
17915 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17918         from referenced assemblies as well.
17919
17920 2003-02-02  Martin Baulig  <martin@ximian.com>
17921
17922         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17923
17924 2003-02-02  Martin Baulig  <martin@ximian.com>
17925
17926         * class.cs (Constructor.Emit): Open the symbol writer before
17927         emitting the constructor initializer.
17928         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17929         single-stepping through constructor initializers.
17930
17931 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * class.cs: Handle error 549: do not allow virtual methods in
17934         sealed classes. 
17935
17936 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17937
17938         * decl.cs: Check access levels when resolving types
17939
17940 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17941
17942         * statement.cs: Add parameters and locals set in catch blocks that might 
17943         return to set vector
17944
17945 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * class.cs (Operator): Set the SpecialName flags for operators.
17948
17949         * expression.cs (Invocation.DoResolve): Only block calls to
17950         accessors and operators on SpecialName methods.
17951
17952         (Cast.TryReduce): Handle conversions from char constants.
17953
17954
17955 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17956
17957         * statement.cs: small memory and time optimization in FlowBranching.
17958
17959 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17960
17961         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17962         problem that the last fix but in the other sid (Set).
17963
17964         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17965         access when there is no indexer in the hierarchy.
17966
17967 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17968
17969         * class.cs: Combine some if statements.
17970
17971 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17972
17973         * driver.cs: fixed bug #37187.
17974
17975 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17976
17977         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17978         any indexer, it's needed to build a list with all the indexers in the
17979         hierarchy (AllGetters), else we have problems. Fixes #35653.
17980
17981 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17982
17983         * class.cs (MethodData.Define): It is wrong for an interface
17984         implementation to be static in both cases: explicit and implicit.
17985         We were only handling this in one case.
17986
17987         Improve the if situation there to not have negations.
17988
17989         * class.cs (Field.Define): Turns out that we do not need to check
17990         the unsafe bit on field definition, only on usage.  Remove the test.
17991
17992 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17993
17994         * driver.cs: use assembly.Location instead of Codebase (the latest
17995         patch made mcs fail when using MS assemblies).
17996
17997 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17998
17999         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
18000         get the path to *corlib.dll.
18001
18002 2003-01-21  Nick Drochak <ndrochak@gol.com>
18003
18004         * cs-tokenizer.cs:
18005         * pending.cs:
18006         * typemanager.cs: Remove compiler warnings
18007
18008 2003-01-20  Duncan Mak  <duncan@ximian.com>
18009
18010         * AssemblyInfo.cs: Bump the version number to 0.19.
18011
18012 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18013
18014         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
18015
18016 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
18017
18018         * class.cs (Constructor::Emit): Emit debugging info for constructors.
18019
18020 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
18021
18022         * cs-parser.jay: Small fix: we were not comparing the constructor
18023         name correctly.   Thanks to Zoltan for the initial pointer.
18024
18025 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
18026
18027         * cs-tokenizer.cs: Set file name when specified with #line
18028
18029 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
18030
18031         * cs-parser.jay: Only perform the constructor checks here if we
18032         are named like the class;  This will help provider a better
18033         error.  The constructor path is taken when a type definition is
18034         not found, but most likely the user forgot to add the type, so
18035         report that rather than the constructor error.
18036
18037 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
18038
18039         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
18040         allocations.
18041
18042 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18043
18044         * cs-parser.jay: Add cleanup call.
18045
18046 2003-01-13  Duncan Mak  <duncan@ximian.com>
18047
18048         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
18049         consistent with other methods.
18050
18051 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18052
18053         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
18054
18055 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
18056
18057         * attribute.cs: only set GuidAttr to true when we have a
18058         GuidAttribute.
18059
18060 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18061
18062         * ecore.cs:
18063         * expression.cs:
18064         * typemanager.cs: fixes to allow mcs compile corlib with the new
18065         Type.IsSubclassOf fix.
18066
18067 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * expression.cs (LocalVariableReference.DoResolve): Classify a
18070         constant as a value, not as a variable.   Also, set the type for
18071         the variable.
18072
18073         * cs-parser.jay (fixed_statement): take a type instead of a
18074         pointer_type, so we can produce a better error message later.
18075
18076         * statement.cs (Fixed.Resolve): Flag types that are not pointers
18077         as an error.  
18078
18079         (For.DoEmit): Make inifinite loops have a
18080         non-conditional branch back.
18081
18082         (Fixed.DoEmit): First populate the pinned variables, then emit the
18083         statement, then clear the variables.  Before I was emitting the
18084         code once for each fixed piece.
18085
18086
18087 2003-01-08  Martin Baulig  <martin@ximian.com>
18088
18089         * statement.cs (FlowBranching.MergeChild): A break in a
18090         SWITCH_SECTION does not leave a loop.  Fixes #36155.
18091
18092 2003-01-08  Martin Baulig  <martin@ximian.com>
18093
18094         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
18095         lives in the same number space than `param_map'.  Fixes #36154.
18096
18097 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
18098
18099         * cs-parser.jay (constructor_declaration): Set the
18100         Constructor.ModFlags before probing for it.  This makes the
18101         compiler report 514, 515 and 132 (the code was there, but got
18102         broken). 
18103
18104         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
18105         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
18106         (GotoCase.Resolve): Set `Returns' to ALWAYS.
18107
18108 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
18109
18110         * enum.cs: create the enum static fields using the enum type.
18111
18112 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
18113
18114         * class.cs: don't try to create the ParamBuilder for the return
18115         type if it's not needed (and handle it breaking for the ms runtime
18116         anyway).
18117
18118 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
18119
18120         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
18121
18122 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
18123
18124         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
18125         the command.   This showed up while compiling the JANET source
18126         code, which used \r as its only newline separator.
18127
18128 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
18129
18130         * class.cs (Method.Define): If we are an operator (because it
18131         reuses our code), then set the SpecialName and HideBySig.  #36128
18132
18133 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
18134
18135         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
18136         exception, report error 120 `object reference required'.
18137
18138         * driver.cs: Add --pause option, used during to measure the size
18139         of the process as it goes with --timestamp.
18140
18141         * expression.cs (Invocation.DoResolve): Do not allow methods with
18142         SpecialName to be invoked.
18143
18144 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
18147         number before adding it.
18148
18149 2002-12-21  Ravi Pratap  <ravi@ximian.com>
18150
18151         * ecore.cs (StandardImplicitConversion): When in an unsafe
18152         context, we allow conversion between void * to any other pointer
18153         type. This fixes bug #35973.
18154
18155 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
18156
18157         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
18158         is not thrown when extensionless outputs are used 
18159
18160 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18161
18162         * rootcontext.cs: fixed compilation of corlib.
18163
18164 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
18165
18166         * attribute.cs (Attributes.Contains): Add new method.
18167
18168         * class.cs (MethodCore.LabelParameters): if the parameter is an
18169         `out' parameter, check that no attribute `[In]' has been passed.
18170
18171         * enum.cs: Handle the `value__' name in an enumeration.
18172
18173 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
18174
18175         * decl.cs: Added special case to allow overrides on "protected
18176         internal" methods
18177
18178 2002-12-18  Ravi Pratap  <ravi@ximian.com>
18179
18180         * attribute.cs (Attributes.AddAttributeSection): Rename to this
18181         since it makes much more sense.
18182
18183         (Attributes.ctor): Don't require a Location parameter.
18184
18185         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18186
18187         * attribute.cs (ApplyAttributes): Remove extra Location parameters
18188         since we already have that information per attribute.
18189
18190         * everywhere : make appropriate changes.
18191
18192         * class.cs (LabelParameters): Write the code which actually
18193         applies attributes to the return type. We can't do this on the MS
18194         .NET runtime so we flag a warning in the case an exception is
18195         thrown.
18196
18197 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * const.cs: Handle implicit null conversions here too.
18200
18201 2002-12-17  Ravi Pratap  <ravi@ximian.com>
18202
18203         * class.cs (MethodCore.LabelParameters): Remove the extra
18204         Type [] parameter since it is completely unnecessary. Instead
18205         pass in the method's attributes so that we can extract
18206         the "return" attribute.
18207
18208 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
18209
18210         * cs-parser.jay (parse): Use Report.Error to flag errors instead
18211         of ignoring it and letting the compile continue.
18212
18213         * typemanager.cs (ChangeType): use an extra argument to return an
18214         error condition instead of throwing an exception.
18215
18216 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * expression.cs (Unary.TryReduce): mimic the code for the regular
18219         code path.  Perform an implicit cast in the cases where we can
18220         implicitly convert to one of the integral types, and then reduce
18221         based on that constant.   This fixes bug #35483.
18222
18223 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18224
18225         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18226
18227 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18228
18229         * namespace.cs: fixed bug #35489.
18230
18231 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
18232
18233         * class.cs: Remove some dead code.
18234
18235         * cs-parser.jay: Estimate the number of methods needed
18236         (RootContext.MethodCount);
18237
18238         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18239         numbers instead of StringBuilders.
18240
18241         * support.cs (PtrHashtable): Add constructor with initial size;
18242         We can now reduce reallocations of the method table.
18243
18244 2002-12-10  Ravi Pratap  <ravi@ximian.com>
18245
18246         * attribute.cs (ApplyAttributes): Keep track of the emitted
18247         attributes on a per-target basis. This fixes bug #35413.
18248
18249 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
18250
18251         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18252         default to the Windows 1252 encoding.
18253
18254         (UnixParseOption): Support version, thanks to Alp for the missing
18255         pointer. 
18256
18257         * AssemblyInfo.cs: Add nice assembly information.
18258
18259         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18260         (bug 35169).
18261
18262         * cs-parser.jay: Allow a trailing comma before the close bracked
18263         in the attribute_section production.
18264
18265         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18266         address of the instance was being taken, I will take this out,
18267         because we take the address of the object immediately here.
18268
18269 2002-12-09  Ravi Pratap  <ravi@ximian.com>
18270
18271         * typemanager.cs (AreMultipleAllowed): Take care of the most
18272         obvious case where attribute type is not in the current assembly -
18273         stupid me ;-)
18274
18275 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
18276
18277         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18278         definitions, instead of doing that afterwards.  
18279
18280         Also we use a nice little hack, depending on the constructor, we
18281         know if we are a "composed" name or a simple name.  Hence, we
18282         avoid the IndexOf test, and we avoid 
18283
18284         * codegen.cs: Add code to assist in a bug reporter to track down
18285         the source of a compiler crash. 
18286
18287 2002-12-07  Ravi Pratap  <ravi@ximian.com>
18288
18289         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18290         types have been emitted for a given element and flag an error
18291         if something which does not have AllowMultiple set is used more
18292         than once.
18293
18294         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18295         attribute types and their corresponding AllowMultiple properties
18296
18297         (AreMultipleAllowed): Check the property for a given type.
18298
18299         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18300         property in the case we have a TypeContainer.
18301
18302         (Attributes.AddAttribute): Detect duplicates and just skip on
18303         adding them. This trivial fix catches a pretty gross error in our
18304         attribute emission - global attributes were being emitted twice!
18305
18306         Bugzilla bug #33187 is now fixed.
18307
18308 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
18309
18310         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18311         instead of pp_and).
18312
18313         * expression.cs (Binary.ResolveOperator): I can only use the
18314         Concat (string, string, string) and Concat (string, string,
18315         string, string) if the child is actually a concatenation of
18316         strings. 
18317
18318 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
18319
18320         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18321         context where we need a 2-character lookahead.
18322
18323         * pending.cs (PendingImplementation): Rework so we can keep track
18324         of interface types all the time, and flag those which were
18325         implemented by parents as optional.
18326
18327 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
18328
18329         * expression.cs (Binary.ResolveOperator): Use
18330         String.Concat(string,string,string) or
18331         String.Concat(string,string,string,string) when possible. 
18332
18333         * typemanager: More helper methods.
18334
18335
18336 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18337
18338         * pending.cs: remove the bogus return from GetMissingInterfaces()
18339         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18340
18341 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18342
18343         * namespace.cs: avoid duplicated 'using xxx' being added to
18344         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18345         when we get more than one 'using' statement for the same namespace.
18346         Report a CS0105 warning for it.
18347
18348 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
18349
18350         * cs-tokenizer.cs (consume_identifier): use read directly, instead
18351         of calling getChar/putback, uses internal knowledge of it.    
18352
18353         (xtoken): Reorder tokenizer so most common patterns are checked
18354         first.  This reduces the compilation time in another 5% (from 8.11s
18355         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18356
18357         The parsing time is 22% of the compilation in mcs, and from that
18358         64% is spent on the tokenization process.  
18359
18360         I tried using a binary search for keywords, but this is slower
18361         than the hashtable.  Another option would be to do a couple of
18362         things:
18363
18364                 * Not use a StringBuilder, instead use an array of chars,
18365                   with a set value.  Notice that this way we could catch
18366                   the 645 error without having to do it *afterwards*.
18367
18368                 * We could write a hand-parser to avoid the hashtable
18369                   compares altogether.
18370
18371         The identifier consumption process takes 37% of the tokenization
18372         time.  Another 15% is spent on is_number.  56% of the time spent
18373         on is_number is spent on Int64.Parse:
18374
18375                 * We could probably choose based on the string length to
18376                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
18377                   computations. 
18378
18379         Another 3% is spend on wrapping `xtoken' in the `token' function.
18380
18381         Handle 0xa0 as whitespace (#34752)
18382
18383 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
18384
18385         * typemanager.cs (IsCLRType): New routine to tell whether a type
18386         is one of the builtin types.  
18387
18388         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
18389         typecode in more places instead of doing pointer comparissions.
18390         We could leverage some knowledge about the way the typecodes are
18391         laid out.
18392
18393         New code to cache namespaces in assemblies, it is currently not
18394         invoked, to be used soon.
18395
18396         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18397
18398         * expression.cs (Binary.ResolveOperator): specially handle
18399         strings, and do not perform user-defined operator overloading for
18400         built-in types.
18401
18402 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18405         internalcall as it is a pretty simple operation;  Avoid whenever
18406         possible to call Char.IsLetter.
18407
18408         (consume_identifier): Cut by half the number of
18409         hashtable calls by merging the is_keyword and GetKeyword behavior.
18410
18411         Do not short-circuit, because if we do, we
18412         report errors (ie, #if false && true would produce an invalid
18413         directive error);
18414
18415
18416 2002-11-24  Martin Baulig  <martin@ximian.com>
18417
18418         * expression.cs (Cast.TryReduce): If we're in checked syntax,
18419         check constant ranges and report a CS0221.  Fixes #33186.
18420
18421 2002-11-24  Martin Baulig  <martin@ximian.com>
18422
18423         * cs-parser.jay: Make this work for uninitialized variable
18424         declarations in the `for' initializer.  Fixes #32416.
18425
18426 2002-11-24  Martin Baulig  <martin@ximian.com>
18427
18428         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18429         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
18430
18431 2002-11-24  Martin Baulig  <martin@ximian.com>
18432
18433         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18434         argument; if true, we also check for user-defined conversions.
18435         This is only needed if both arguments are of a user-defined type.
18436         Fixes #30443, added test-175.cs.
18437         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18438
18439         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18440
18441 2002-11-24  Martin Baulig  <martin@ximian.com>
18442
18443         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18444         function to get the store opcode.
18445         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18446         only emit the Ldelema if the store opcode is Stobj.  You must run
18447         both test-34 and test-167 to test this.  Fixes #34529.
18448
18449 2002-11-23  Martin Baulig  <martin@ximian.com>
18450
18451         * ecore.cs (Expression.MemberLookup): Added additional
18452         `qualifier_type' argument which is used when we're being called
18453         from MemberAccess.DoResolve() and null if we're called from a
18454         SimpleName lookup.
18455         (Expression.MemberLookupFailed): New method to report errors; this
18456         does the CS1540 check and reports the correct error message.
18457
18458         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18459         argument for the CS1540 check and redone the way how we're dealing
18460         with private members.  See the comment in the source code for details.
18461         (FilterWithClosure): Reverted this back to revision 1.197; renamed
18462         `closure_start_type' to `closure_qualifier_type' and check whether
18463         it's not null.  It was not this filter being broken, it was just
18464         being called with the wrong arguments.
18465
18466         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18467         and pass it the correct `qualifier_type'; this also does the error
18468         handling for us.
18469
18470 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
18471
18472         * expression.cs (Invocation.EmitParams): If the we are dealing
18473         with a non-built-in value type, load its address as well.
18474
18475         (ArrayCreation): Use a a pretty constant instead
18476         of the hardcoded value 2.   Use 6 instead of 2 for the number of
18477         static initializers.  
18478
18479         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18480         because they are not really value types, just glorified integers. 
18481
18482         * driver.cs: Do not append .exe, the CSC compiler does not do it.
18483
18484         * ecore.cs: Remove redundant code for enumerations, make them use
18485         the same code path as everything else, fixes the casting issue
18486         with enumerations in Windows.Forms.
18487
18488         * attribute.cs: Do only cast to string if it is a string, the
18489         validation happens later.
18490
18491         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18492         people upgrade their corlibs.
18493
18494         * ecore.cs: Oops, enumerations were not following the entire code path
18495
18496 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
18497
18498         * typemanager.cs (FilterWithClosure): Commented out the test for
18499         1540 in typemanager.cs, as it has problems when accessing
18500         protected methods from a parent class (see test-174.cs). 
18501
18502         * attribute.cs (Attribute.ValidateGuid): new method.
18503         (Attribute.Resolve): Use above.
18504
18505 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18508
18509         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18510         handling for enumerations, as we only needed the TypeContainer
18511         functionality to begin with (this is required for the fix below to
18512         work for enums that reference constants in a container class for
18513         example). 
18514
18515         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18516
18517         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18518         a valid TypeBuilder to perform lookups on.o
18519
18520         * class.cs (InheritableMemberSignatureCompare): Use true in the
18521         call to GetGetMethod and GetSetMethod, because we are comparing
18522         the signature, and we need to get the methods *even* if they are
18523         private. 
18524
18525         (PropertyBase.CheckBase): ditto.
18526
18527         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18528         GotoCase.Resolve): Use Peel on EmpytCasts.
18529
18530         * ecore.cs (EmptyCast): drop child, add Peel method.
18531
18532 2002-11-17  Martin Baulig  <martin@ximian.com>
18533
18534         * ecore.cs (EmptyCast.Child): New public property.
18535
18536         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18537         label resolved to an EmptyCast.  Fixes #34162.
18538         (GotoCase.Resolve): Likewise.
18539         (Block.EmitMeta): Likewise.
18540
18541 2002-11-17  Martin Baulig  <martin@ximian.com>
18542
18543         * expression.cs (Invocation.BetterConversion): Prefer int over
18544         uint; short over ushort; long over ulong for integer literals.
18545         Use ImplicitConversionExists instead of StandardConversionExists
18546         since we also need to check for user-defined implicit conversions.
18547         Fixes #34165.  Added test-173.cs.
18548
18549 2002-11-16  Martin Baulig  <martin@ximian.com>
18550
18551         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18552         with the `true' and `false' literals.  Fixes #33151.
18553
18554 2002-11-16  Martin Baulig  <martin@ximian.com>
18555
18556         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18557         October 22nd; don't do the cs1540 check for static members.
18558
18559         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18560         now using our own filter here and doing the cs1540 check again.
18561
18562 2002-11-16  Martin Baulig  <martin@ximian.com>
18563
18564         * support.cs (InternalParameters): Don't crash if we don't have
18565         any fixed parameters.  Fixes #33532.
18566
18567 2002-11-16  Martin Baulig  <martin@ximian.com>
18568
18569         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18570         when looking up static methods to make this work on Windows.
18571         Fixes #33773.
18572
18573 2002-11-16  Martin Baulig  <martin@ximian.com>
18574
18575         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18576         a setter rather than using PropertyInfo.CanWrite.
18577
18578 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18579
18580         * class.cs: Allow acces to block member by subclasses. Fixes build
18581         breaker.
18582
18583 2002-11-14  Martin Baulig  <martin@ximian.com>
18584
18585         * class.cs (Constructor.Emit): Added the extern/block check.
18586         Fixes bug #33678.
18587
18588 2002-11-14  Martin Baulig  <martin@ximian.com>
18589
18590         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18591         iteration while looking for indexers, this is needed because the
18592         indexer may have a different name in our base classes.  Fixed the
18593         error reporting (no indexers at all, not get accessor, no
18594         overloaded match).  Fixes bug #33089.
18595         (IndexerAccess.DoResolveLValue): Likewise.
18596
18597 2002-11-14  Martin Baulig  <martin@ximian.com>
18598
18599         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18600         indexers.  Fixes the first part of bug #33089.
18601         (MethodSignature.InheritableMemberSignatureCompare): Added support
18602         for properties.
18603
18604 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18605
18606         * attribute.cs (Attribute.Resolve): Catch the
18607         NullReferenceException and report it since it isn't supposed to
18608         happen. 
18609
18610 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18611
18612         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18613         LogicalOr and LogicalAnd that can benefit from recursively
18614         handling EmitBranchable.  The code now should be nice for Paolo.
18615
18616 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18617
18618         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18619         the Type lookups, as we perform quite a number of lookups on
18620         non-Types.  This can be removed once we can deterministically tell
18621         whether we have a type or a namespace in advance.
18622
18623         But this might require special hacks from our corlib.
18624
18625         * TODO: updated.
18626
18627         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18628         and double which avoids a conversion from an integer to a double.
18629
18630         * expression.cs: tiny optimization, avoid calling IsConstant,
18631         because it effectively performs the lookup twice.
18632
18633 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18634
18635         But a bogus return here to keep the semantics of the old code
18636         until the Mono runtime is fixed.
18637
18638         * pending.cs (GetMissingInterfaces): New method used to remove all
18639         the interfaces that are already implemented by our parent
18640         classes from the list of pending methods. 
18641
18642         * interface.cs: Add checks for calls after ResolveTypeExpr.
18643
18644 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18645
18646         * class.cs (Class.Emit): Report warning 67: event not used if the
18647         warning level is beyond 3.
18648
18649         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18650         being a NullLiteral.
18651
18652         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18653         specifiers. 
18654
18655         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18656         path that might fail if a type can not be resolved.
18657
18658         * expression.cs (Binary.Emit): Emit unsigned versions of the
18659         operators. 
18660
18661         * driver.cs: use error 5.
18662
18663 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18664
18665         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18666
18667 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18668
18669         * cs-parser.jay (switch_section): A beautiful patch from Martin
18670         Baulig that fixed 33094.
18671
18672 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18673
18674         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18675         Check whether the base is abstract and report an error if so.
18676
18677         * expression.cs (IndexerAccess.DoResolveLValue,
18678         IndexerAccess.DoResolve): ditto. 
18679
18680         (Invocation.DoResolve): ditto.
18681
18682         (Invocation.FullMethodDesc): Improve the report string.
18683
18684         * statement.cs (Block): Eliminate IsVariableDefined as it is
18685         basically just a wrapper for GetVariableInfo.
18686
18687         * ecore.cs (SimpleName): Use new 
18688
18689         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18690         type, as we return the actual parameter ref/unref state on a
18691         different call.
18692
18693 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18694
18695         * support.cs: Return proper flags REF/OUT fixing the previous
18696         commit.  
18697
18698         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18699         not used to mean `ref' but `ref or out' in ParameterReference
18700
18701         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18702         full type signature instead of calling TypeManger.CSharpName
18703         ourselves. 
18704
18705         * support.cs (InternalParameters.ParameterDesc): Do not compare
18706         directly to the modflags, because REF/OUT will actually be bitsets
18707         if set. 
18708
18709         * delegate.cs (VerifyMethod): Check also the modifiers.
18710
18711         * cs-tokenizer.cs: Fix bug where floating point values with an
18712         exponent where a sign was missing was ignored.
18713
18714         * driver.cs: Allow multiple assemblies to be specified in a single
18715         /r: argument
18716
18717 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18720         because identifiers after a parenthesis would end up in this kind
18721         of production, and we needed to desamiguate it for having casts
18722         like:
18723
18724                 (UserDefinedType *) xxx
18725
18726 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18727
18728         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18729         we should set on the Bindingflags.NonPublic, but not turn on
18730         private_ok.  private_ok controls whether a Private member is
18731         returned (this is chekced on the filter routine), while the
18732         BindingFlags.NonPublic just controls whether private/protected
18733         will be allowed.   This fixes the problem part of the problem of
18734         private properties being allowed to be used in derived classes.
18735
18736         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18737         so we can call the children DoResolveLValue method (this will
18738         properly signal errors on lvalue assignments to base properties)
18739
18740         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18741         getter are null, and we have a property info, we know that this
18742         happened because the lookup failed, so we report an error 122 for
18743         protection level violation.
18744
18745         We also silently return if setter and getter are null in the
18746         resolve functions, this condition only happens if we have flagged
18747         the error before.  This is the other half of the problem. 
18748
18749         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18750         not have accessibility information, that is why we were returning
18751         true in the filter function in typemanager.cs.
18752
18753         To properly report 122 (property is inaccessible because of its
18754         protection level) correctly, we report this error in ResolveAccess
18755         by failing if both the setter and the getter are lacking (ie, the
18756         lookup failed). 
18757
18758         DoResolve and DoLResolve have been modified to check for both
18759         setter/getter being null and returning silently, the reason being
18760         that I did not want to put the knowledge about this error in upper
18761         layers, like:
18762
18763         int old = Report.Errors;
18764         x = new PropertyExpr (...);
18765         if (old != Report.Errors)
18766                 return null;
18767         else
18768                 return x;
18769
18770         So the property expr is returned, but it is invalid, so the error
18771         will be flagged during the resolve process. 
18772
18773         * class.cs: Remove InheritablePropertySignatureCompare from the
18774         class, as we no longer depend on the property signature to compute
18775         whether it is possible to implement a method or not.
18776
18777         The reason is that calling PropertyInfo.GetGetMethod will return
18778         null (in .NET, in Mono it works, and we should change this), in
18779         cases where the Get Method does not exist in that particular
18780         class.
18781
18782         So this code:
18783
18784         class X { public virtual int A { get { return 1; } } }
18785         class Y : X { }
18786         class Z : Y { public override int A { get { return 2; } } }
18787
18788         Would fail in Z because the parent (Y) would not have the property
18789         defined.  So we avoid this completely now (because the alternative
18790         fix was ugly and slow), and we now depend exclusively on the
18791         method names.
18792
18793         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18794         reference method, instead of using the property.
18795
18796         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18797         routines are gone now.
18798
18799         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18800         names, they were incorrectly named.
18801
18802         * cs-tokenizer.cs: Return are more gentle token on failure. 
18803
18804         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18805         had an out-of-sync index variable, which caused it to remove from
18806         the list of pending methods the wrong method sometimes.
18807
18808 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18811         CanWrite, because those refer to this particular instance of the
18812         property, and do not take into account the fact that we can
18813         override single members of a property.
18814
18815         Constructor requires an EmitContext.  The resolution process does
18816         not happen here, but we need to compute the accessors before,
18817         because the resolution does not always happen for properties.
18818
18819         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18820         subclass, before we did not update this flag, but we did update
18821         bindingflags. 
18822
18823         (GetAccessors): Drop this routine, as it did not work in the
18824         presence of partially overwritten set/get methods. 
18825
18826         Notice that this broke the cs1540 detection, but that will require
18827         more thinking. 
18828
18829 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18830
18831         * class.cs:
18832         * codegen.cs:
18833         * driver.cs: issue a warning instead of an error if we don't support
18834         debugging for the platform. Also ignore a couple of errors that may
18835         arise when trying to write the symbols. Undo my previous patch.
18836
18837 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18838
18839         * driver.cs: ignore /debug switch except for Unix platforms.
18840
18841 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18842
18843         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18844
18845 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18846
18847         * driver.cs: Do not make mcs-debug conditional, so we do not break
18848         builds that use it.
18849
18850         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18851         review this patch.  But basically after all the children variables
18852         have been merged, the value of "Breaks" was not being set to
18853         new_breaks for Switch blocks.  I think that it should be set after
18854         it has executed.  Currently I set this to the value of new_breaks,
18855         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18856         conservative, but I do not understand this code very well.
18857
18858         I did not break anything in the build, so that is good ;-)
18859
18860         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18861
18862 2002-10-20  Mark Crichton  <crichton@gimp.org>
18863
18864         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18865
18866 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18867
18868         * cfold.cs: Fixed compile blocker.
18869
18870 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * driver.cs: I was chekcing the key, not the file.
18873
18874 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18875
18876         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18877         message that we were generating - we just need to silently return
18878         a null.
18879
18880 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * class.cs (Event.Define): Change my previous commit, as this
18883         breaks the debugger.  This is a temporary hack, as it seems like
18884         the compiler is generating events incorrectly to begin with.
18885
18886         * expression.cs (Binary.ResolveOperator): Added support for 
18887         "U operator - (E x, E y)"
18888
18889         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18890         y)".
18891
18892         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18893         init-only variables, but this path did not take into account that
18894         there might be also instance readonly variables.  Correct this
18895         problem. 
18896
18897         This fixes bug 32253
18898
18899         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18900         delegates as well.
18901
18902         * driver.cs: Change the extension for modules to `netmodule'
18903
18904         * cs-parser.jay: Improved slightly the location tracking for
18905         the debugger symbols.
18906
18907         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18908         modifiers that were specified instead of the hardcoded value
18909         (FamAndAssem).  This was basically ignoring the static modifier,
18910         and others.  Fixes 32429.
18911
18912         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18913         fixed a bug in the process (32476)
18914
18915         * expression.cs (ArrayAccess.EmitAssign): Patch from
18916         hwang_rob@yahoo.ca that fixes bug 31834.3
18917
18918 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18919
18920         * driver.cs: Make the module extension .netmodule.
18921
18922 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * driver.cs: Report an error if the resource file is not found
18925         instead of crashing.
18926
18927         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18928         false, like Emit does.
18929
18930 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18931
18932         * typemanager.cs: Remove unused private member.  Also reported mcs
18933         bug to report this as a warning like csc.
18934
18935 2002-10-15  Martin Baulig  <martin@gnome.org>
18936
18937         * statement.cs (Statement.Emit): Made this a virtual method; emits
18938         the line number info and calls DoEmit().
18939         (Statement.DoEmit): New protected abstract method, formerly knows
18940         as Statement.Emit().
18941
18942         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18943
18944 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18945
18946         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18947         have fixed a remaining problem: not every AddXXXX was adding a
18948         fully qualified name.  
18949
18950         Now everyone registers a fully qualified name in the DeclSpace as
18951         being defined instead of the partial name.  
18952
18953         Downsides: we are slower than we need to be due to the excess
18954         copies and the names being registered this way.  
18955
18956         The reason for this is that we currently depend (on the corlib
18957         bootstrap for instance) that types are fully qualified, because
18958         we dump all the types in the namespace, and we should really have
18959         types inserted into the proper namespace, so we can only store the
18960         basenames in the defined_names array.
18961
18962 2002-10-10  Martin Baulig  <martin@gnome.org>
18963
18964         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18965         from bug #31834, see the bug report for a testcase which is
18966         miscompiled.
18967
18968 2002-10-10  Martin Baulig  <martin@gnome.org>
18969
18970         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18971         flow analysis code for this.
18972
18973         * statement.cs (Do, While, For): Tell the flow analysis code about
18974         infinite loops.
18975         (FlowBranching.UsageVector): Added support for infinite loops.
18976         (Block.Resolve): Moved the dead code elimination here and use flow
18977         analysis to do it.
18978
18979 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18980
18981         * class.cs (Field.Define): Catch cycles on struct type
18982         definitions. 
18983
18984         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18985         fields if the fields are static.  We only need to check instance
18986         fields. 
18987
18988         * expression.cs (As.DoResolve): Test for reference type.
18989
18990         * statement.cs (Using.ResolveExpression): Use
18991         ConvertImplicitRequired, not ConvertImplicit which reports an
18992         error on failture
18993         (Using.ResolveLocalVariableDecls): ditto.
18994
18995         * expression.cs (Binary.ResolveOperator): Report errors in a few
18996         places where we had to.
18997
18998         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18999
19000 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
19001
19002         * expression.cs: Use StoreFromPtr instead of extracting the type
19003         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
19004
19005         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
19006         an enumeration value to a System.Enum, but System.Enum is not a
19007         value type, but an class type, so we need to box.
19008
19009         (Expression.ConvertExplicit): One codepath could return
19010         errors but not flag them.  Fix this.  Fixes #31853
19011
19012         * parameter.cs (Resolve): Do not allow void as a parameter type.
19013
19014 2002-10-06  Martin Baulig  <martin@gnome.org>
19015
19016         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
19017         if it's a class type and not a struct.  Fixes #31815.
19018
19019 2002-10-06  Martin Baulig  <martin@gnome.org>
19020
19021         * statement.cs: Reworked the flow analysis code a bit to make it
19022         usable for dead code elimination.
19023
19024 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19025
19026         * cs-parser.jay: allow empty source files. Fixes bug #31781.
19027
19028 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
19029
19030         * expression.cs (ComposedCast.DoResolveType): A quick workaround
19031         to fix the test 165, will investigate deeper.
19032
19033 2002-10-04  Martin Baulig  <martin@gnome.org>
19034
19035         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
19036         finally blocks actually work.
19037         (Try.Resolve): We don't need to create a sibling for `finally' if
19038         there is no finally block.
19039
19040 2002-10-04  Martin Baulig  <martin@gnome.org>
19041
19042         * class.cs (Constructor.Define): The default accessibility for a
19043         non-default constructor is private, not public.
19044
19045 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
19046
19047         * class.cs (Constructor): Make AllowedModifiers public, add
19048         EXTERN.
19049
19050         * cs-parser.jay: Perform the modifiers test here, as the
19051         constructor for the Constructor class usually receives a zero
19052         because of the way we create it (first we create, later we
19053         customize, and we were never checking the modifiers).
19054
19055         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
19056         is a version of LookupTypeReflection that includes the type-name
19057         cache.  This can be used as a fast path for functions that know
19058         the fully qualified name and are only calling into *.GetType() to
19059         obtain a composed type.
19060
19061         This is also used by TypeManager.LookupType during its type
19062         composition.
19063
19064         (LookupType): We now also track the real type name, as sometimes
19065         we can get a quey for the real type name from things like
19066         ComposedCast.  This fixes bug 31422.
19067
19068         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
19069         complete type fullname, it does not have to go through the type
19070         resolution system to obtain the composed version of the type (for
19071         obtaining arrays or pointers).
19072
19073         (Conditional.Emit): Use the EmitBoolExpression to
19074         generate nicer code, as requested by Paolo.
19075
19076         (ArrayCreation.CheckIndices): Use the patch from
19077         hwang_rob@yahoo.ca to validate the array initializers. 
19078
19079 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
19080
19081         * class.cs (ConstructorInitializer.Emit): simplify code by using
19082         Invocation.EmitCall, and at the same time, fix the bugs in calling
19083         parent constructors that took variable arguments. 
19084
19085         * ecore.cs (Expression.ConvertNumericExplicit,
19086         Expression.ImplicitNumericConversion): Remove the code that
19087         manually wrapped decimal (InternalTypeConstructor call is now gone
19088         as well).
19089
19090         * expression.cs (Cast.TryReduce): Also handle decimal types when
19091         trying to perform a constant fold on the type.
19092
19093         * typemanager.cs (IsUnmanagedtype): Partially implemented.
19094
19095         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
19096         that only turned off an error report, and did nothing else. 
19097
19098 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
19099
19100         * driver.cs: Handle and ignore /fullpaths
19101
19102 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * expression.cs (Binary.ResolveOperator): Catch the case where
19105         DoNumericPromotions returns true, 
19106
19107         (Binary.DoNumericPromotions): Simplify the code, and the tests.
19108
19109 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
19110
19111         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
19112         report error 70.
19113
19114 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * ecore.cs (ConvertNumericExplicit): It is not enough that the
19117         conversion exists, but it is also required that the conversion be
19118         performed.  This manifested in "(Type64Enum) 2".  
19119
19120         * class.cs (TypeManager.AddMethod): The fix is not to change
19121         AddEnum, because that one was using a fully qualified name (every
19122         DeclSpace derivative does), but to change the AddMethod routine
19123         that was using an un-namespaced name.  This now correctly reports
19124         the duplicated name.
19125
19126         Revert patch until I can properly fix it.  The issue
19127         is that we have a shared Type space across all namespaces
19128         currently, which is wrong.
19129
19130         Options include making the Namespace a DeclSpace, and merge
19131         current_namespace/current_container in the parser.
19132
19133 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * cs-parser.jay: Improve error reporting when we get a different
19136         kind of expression in local_variable_type and
19137         local_variable_pointer_type. 
19138
19139         Propagate this to avoid missleading errors being reported.
19140
19141         * ecore.cs (ImplicitReferenceConversion): treat
19142         TypeManager.value_type as a target just like object_type.   As
19143         code like this:
19144
19145         ValueType v = 1;
19146
19147         Is valid, and needs to result in the int 1 being boxed before it
19148         is assigned to the value type v.
19149
19150         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
19151         to validate the enumeration name.
19152
19153         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
19154         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
19155         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
19156
19157         * ecore.cs (TryImplicitIntConversion): When doing an
19158         implicit-enumeration-conversion, check if the type is 64-bits and
19159         perform a conversion before passing to EnumConstant.
19160
19161 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
19162
19163         * decl.cs (Error_AmbiguousTypeReference); New routine used to
19164         report ambiguous type references.  Unlike the MS version, we
19165         report what the ambiguity is.   Innovation at work ;-)
19166
19167         (DeclSpace.FindType): Require a location argument to
19168         display when we display an ambiguous error.
19169
19170         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
19171
19172         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19173
19174         * expression.cs (EmitDynamicInitializers): Apply patch from
19175         hwang_rob@yahoo.ca that fixes the order in which we emit our
19176         initializers. 
19177
19178 2002-09-21  Martin Baulig  <martin@gnome.org>
19179
19180         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19181         delegate takes no arguments.
19182
19183 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
19184
19185         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19186         from integers.
19187
19188         * expression.cs: Extract the underlying type.
19189
19190         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19191
19192         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19193
19194 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
19195
19196         * class.cs (TypeContainer.DefineType): We can not use the nice
19197         PackingSize with the size set to 1 DefineType method, because it
19198         will not allow us to define the interfaces that the struct
19199         implements.
19200
19201         This completes the fixing of bug 27287
19202
19203         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19204         means also structs.  This fixes part of the problem. 
19205         (Expresion.ImplicitReferenceConversionExists): ditto.
19206
19207         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19208         error if there were no errors reported during the type lookup
19209         process, to avoid duplicates or redundant errors.  Without this
19210         you would get an ambiguous errors plus a type not found.  We have
19211         beaten the user enough with the first error.  
19212
19213         (DeclSparce.FindType): Emit a warning if we have an ambiguous
19214         reference. 
19215
19216         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19217         during the resolution process, stop the lookup, this avoids
19218         repeated error reports (same error twice).
19219
19220         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19221
19222         * typemanager.cs (LookupType): Redo the type lookup code to match
19223         the needs of System.Reflection.  
19224
19225         The issue is that System.Reflection requires references to nested
19226         types to begin with a "+" sign instead of a dot.  So toplevel
19227         types look like: "NameSpace.TopLevelClass", and nested ones look
19228         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19229         levels. 
19230
19231 2002-09-19  Martin Baulig  <martin@gnome.org>
19232
19233         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19234         says that a method always returns or always throws an exception,
19235         don't report the CS0161.
19236
19237         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19238         set `Returns = new_returns'.
19239
19240 2002-09-19  Martin Baulig  <martin@gnome.org>
19241
19242         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19243         to an enum constant, check for a CS0176.
19244
19245 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
19246
19247         * class.cs (TypeContainer.CheckPairedOperators): Now we check
19248         for operators that must be in pairs and report errors.
19249
19250         * ecore.cs (SimpleName.DoResolveType): During the initial type
19251         resolution process, when we define types recursively, we must
19252         check first for types in our current scope before we perform
19253         lookups in the enclosing scopes.
19254
19255         * expression.cs (MakeByteBlob): Handle Decimal blobs.
19256
19257         (Invocation.VerifyArgumentsCompat): Call
19258         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19259         I thought we were supposed to always call this, but there are a
19260         few places in the code where we dont do it.
19261
19262 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * driver.cs: Add support in -linkres and -resource to specify the
19265         name of the identifier.
19266
19267 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19268
19269         * ecore.cs (StandardConversionExists): Sync with the conversion
19270         code: allow anything-* to void* conversions.
19271
19272         (FindMostSpecificSource): Use an Expression argument
19273         instead of a Type, because we might be handed over a Literal which
19274         gets a few more implicit conversions that plain types do not.  So
19275         this information was being lost.
19276
19277         Also, we drop the temporary type-holder expression when not
19278         required.
19279
19280 2002-09-17  Martin Baulig  <martin@gnome.org>
19281
19282         * class.cs (PropertyBase.CheckBase): Don't check the base class if
19283         this is an explicit interface implementation.
19284
19285 2002-09-17  Martin Baulig  <martin@gnome.org>
19286
19287         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19288         different `IndexerName' attributes.
19289
19290         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19291         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19292         virtual CommonResolve().
19293
19294 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19295
19296         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19297         and convert that to the UnderlyingType.
19298
19299         * statement.cs (Foreach.Resolve): Indexers are just like variables
19300         or PropertyAccesses.
19301
19302         * cs-tokenizer.cs (consume_string): Track line numbers and columns
19303         inside quoted strings, we were not doing this before.
19304
19305 2002-09-16  Martin Baulig  <martin@gnome.org>
19306
19307         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19308         resolve it.  This is needed for the definite assignment check of the
19309         instance expression, fixes bug #29846.
19310         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19311
19312 2002-09-16  Nick Drochak  <ndrochak@gol.com>
19313
19314         * parameter.cs: Fix compile error.  Cannot reference static member
19315         from an instance object.  Is this an mcs bug?
19316
19317 2002-09-14  Martin Baulig  <martin@gnome.org>
19318
19319         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19320         multiple times.  Fixes bug #30295, added test-166.cs.
19321
19322 2002-09-14  Martin Baulig  <martin@gnome.org>
19323
19324         * statement.cs (Block.Emit): Don't emit unreachable code.
19325         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19326         `break' statements.
19327         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19328
19329 2002-09-14  Martin Baulig  <martin@gnome.org>
19330
19331         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19332         is set.
19333
19334 2002-09-14  Martin Baulig  <martin@gnome.org>
19335
19336         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19337         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19338         be false on the ms runtime.
19339
19340 2002-09-13  Martin Baulig  <martin@gnome.org>
19341
19342         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19343         the CS0038 error message.
19344
19345 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19348         constant inside, return it.
19349
19350 2002-09-12  Martin Baulig  <martin@gnome.org>
19351
19352         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19353         implicit conversion can be done between enum types.
19354
19355         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19356         check whether an implicit conversion to the current enum's UnderlyingType
19357         exists and report an error if not.
19358
19359         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19360         without debugging support.
19361
19362         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19363         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
19364
19365 2002-09-12  Martin Baulig  <martin@gnome.org>
19366
19367         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19368
19369         * ecore.cs (IMemberExpr.DeclaringType): New property.
19370         (SimpleName.SimpleNameResolve): Check whether we're accessing a
19371         nonstatic member of an outer type (CS0038).
19372
19373 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * driver.cs: Activate the using-error detector at warning level
19376         4 (at least for MS-compatible APIs).
19377
19378         * namespace.cs (VerifyUsing): Small buglett fix.
19379
19380         * pending.cs (PendingImplementation): pass the container pointer. 
19381
19382         * interface.cs (GetMethods): Allow for recursive definition.  Long
19383         term, I would like to move every type to support recursive
19384         definitions, not the current ordering mechanism that we have right
19385         now.
19386
19387         The situation is this: Attributes are handled before interfaces,
19388         so we can apply attributes to interfaces.  But some attributes
19389         implement interfaces, we will now handle the simple cases
19390         (recursive definitions will just get an error).  
19391
19392         * parameter.cs: Only invalidate types at the end if we fail to
19393         lookup all types.  
19394
19395 2002-09-09  Martin Baulig  <martin@gnome.org>
19396
19397         * ecore.cs (PropertyExpr.Emit): Also check for
19398         TypeManager.system_int_array_get_length so this'll also work when
19399         compiling corlib.  Fixes #30003.
19400
19401 2002-09-09  Martin Baulig  <martin@gnome.org>
19402
19403         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19404         and throw an exception if we can't get the type's size.  Fixed #30040,
19405         added test-165.cs.
19406
19407 2002-09-09  Martin Baulig  <martin@gnome.org>
19408
19409         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19410
19411         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19412         context.  Fixes bug #30027.
19413
19414         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19415         virtual functions.  Fixes bug #30043, added test-164.cs.
19416
19417 2002-09-08  Ravi Pratap  <ravi@ximian.com>
19418
19419         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19420
19421 2002-09-08  Nick Drochak  <ndrochak@gol.com>
19422
19423         * driver.cs: Use an object to get the windows codepage since it's not a
19424         static property.
19425
19426 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * statement.cs (For.Emit): for infinite loops (test == null)
19429         return whether there is a break inside, not always "true".
19430
19431         * namespace.cs (UsingEntry): New struct to hold the name of the
19432         using definition, the location where it is defined, and whether it
19433         has been used in a successful type lookup.
19434
19435         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19436         strings.
19437
19438         * decl.cs: ditto.
19439
19440 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19441
19442         * attribute.cs : Fix incorrect code which relied on catching
19443         a NullReferenceException to detect a null being passed in
19444         where an object was expected.
19445
19446 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
19447
19448         * statement.cs (Try): flag the catch variable as assigned
19449
19450         * expression.cs (Cast): Simplified by using ResolveType instead of
19451         manually resolving.
19452
19453         * statement.cs (Catch): Fix bug by using ResolveType.
19454
19455 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19456
19457         * expression.cs (BetterConversion): Special case for when we have
19458         a NullLiteral as the argument and we have to choose between string
19459         and object types - we choose string the way csc does.
19460
19461         * attribute.cs (Attribute.Resolve): Catch the
19462         NullReferenceException and report error #182 since the Mono
19463         runtime no more has the bug and having this exception raised means
19464         we tried to select a constructor which takes an object and is
19465         passed a null.
19466
19467 2002-09-05  Ravi Pratap  <ravi@ximian.com>
19468
19469         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19470         message (1502, 1503) when we can't locate a method after overload
19471         resolution. This is much more informative and closes the bug
19472         Miguel reported.
19473
19474         * interface.cs (PopulateMethod): Return if there are no argument
19475         types. Fixes a NullReferenceException bug.
19476
19477         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19478         expressions too. Previously we were checking only in one place for
19479         positional arguments leaving out named arguments.
19480
19481         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19482         type to the enum type is not allowed. Remove code corresponding to
19483         that.
19484
19485         (ConvertNumericExplicit): Allow explicit conversions from
19486         the underlying type to enum type. This precisely follows the spec
19487         and closes a bug filed by Gonzalo.
19488
19489 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19490
19491         * compiler.csproj:
19492         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19493
19494 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
19495
19496         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19497         it was important that we stored the right value after the
19498         reduction in `converted'.
19499
19500 2002-09-04  Martin Baulig  <martin@gnome.org>
19501
19502         * location.cs (Location.SymbolDocument): Use full pathnames for the
19503         source files.
19504
19505 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
19506
19507         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19508         of the expression resolve mechanism, because that will catch the
19509         SimpleName error failures.
19510
19511         (Conditional): If we can not resolve the
19512         expression, return, do not crash.
19513
19514 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19515
19516         * cs-tokenizer.cs:
19517         (location): display token name instead of its number.
19518
19519 2002-08-28  Martin Baulig  <martin@gnome.org>
19520
19521         * expression.cs (Binary.ResolveOperator): Don't silently return
19522         but return an error if an operator cannot be applied between two
19523         enum types.
19524
19525 2002-08-28  Martin Baulig  <martin@gnome.org>
19526
19527         * class.cs (Constructor.Define): Set the permission attributes
19528         correctly instead of making all constructors public.
19529
19530 2002-08-28  Martin Baulig  <martin@gnome.org>
19531
19532         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19533         for private members before reporting a CS0103; if we find anything,
19534         it's a CS0122.
19535
19536 2002-08-28  Martin Baulig  <martin@gnome.org>
19537
19538         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19539         to check whether `closure_start_type == closure_invocation_type',
19540         we also need to check whether `m.DeclaringType == closure_invocation_type'
19541         before bypassing the permission checks.  We might be accessing
19542         protected/private members from the base class.
19543         (TypeManager.RealMemberLookup): Only set private_ok if private
19544         members were requested via BindingFlags.NonPublic.
19545
19546         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19547
19548         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19549         MethodGroupExpr.IsExplicitImpl if appropriate.
19550         (Invocation.DoResolve): Don't report the CS0120 for explicit
19551         interface implementations.
19552
19553 2002-08-27  Martin Baulig  <martin@gnome.org>
19554
19555         * expression.cs (Invocation.DoResolve): If this is a static
19556         method and we don't have an InstanceExpression, we must report
19557         a CS0120.
19558
19559 2002-08-25  Martin Baulig  <martin@gnome.org>
19560
19561         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19562         `==' between a valuetype and an object.
19563
19564 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * ecore.cs (TypeExpr): Provide a ToString method.
19567
19568 2002-08-24  Martin Baulig  <martin@gnome.org>
19569
19570         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19571         now called proggie.dbg and it's a binary file.
19572
19573 2002-08-23  Martin Baulig  <martin@gnome.org>
19574
19575         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19576
19577 2002-08-23  Martin Baulig  <martin@gnome.org>
19578
19579         * struct.cs (MyStructInfo.ctor): Make this work with empty
19580         structs; it's not allowed to use foreach() on null.
19581
19582 2002-08-23  Martin Baulig  <martin@gnome.org>
19583
19584         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19585         writer the full pathname of the generated assembly.
19586
19587 2002-08-23  Martin Baulig  <martin@gnome.org>
19588
19589         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19590         A `finally' block never returns or breaks; improved handling of
19591         unreachable code.
19592
19593 2002-08-23  Martin Baulig  <martin@gnome.org>
19594
19595         * statement.cs (Throw.Resolve): Allow `throw null'.
19596
19597 2002-08-23  Martin Baulig  <martin@gnome.org>
19598
19599         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19600         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19601         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19602         MemberLookup would return a wrong event if this is an explicit
19603         interface implementation and the class has an event with the same
19604         name.
19605
19606 2002-08-23  Martin Baulig  <martin@gnome.org>
19607
19608         * statement.cs (Block.AddChildVariableNames): New public method.
19609         (Block.AddChildVariableName): Likewise.
19610         (Block.IsVariableNameUsedInChildBlock): Likewise.
19611         (Block.AddVariable): Check whether a variable name has already
19612         been used in a child block.
19613
19614         * cs-parser.jay (declare_local_variables): Mark all variable names
19615         from the current block as being used in a child block in the
19616         implicit block.
19617
19618 2002-08-23  Martin Baulig  <martin@gnome.org>
19619
19620         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19621         find the symbol writer.
19622
19623         * driver.cs: csc also allows the arguments to /define being
19624         separated by commas, not only by semicolons.
19625
19626 2002-08-23  Martin Baulig  <martin@gnome.org>
19627
19628         * interface.cs (Interface.GetMembers): Added static check for events.
19629
19630 2002-08-15  Martin Baulig  <martin@gnome.org>
19631
19632         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19633         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19634
19635         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19636         why the MethodData.EmitDestructor() change was necessary.
19637
19638 2002-08-20  Martin Baulig  <martin@gnome.org>
19639
19640         * class.cs (TypeContainer.FindMembers): Added static check for events.
19641
19642         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19643
19644         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19645         use Type.GetEvents(), not Type.FindMembers().
19646
19647 2002-08-20  Martin Baulig  <martin@gnome.org>
19648
19649         * decl.cs (MemberCache): Added a special method cache which will
19650         be used for method-only searched.  This ensures that a method
19651         search will return a MethodInfo with the correct ReflectedType for
19652         inherited methods.      
19653
19654 2002-08-20  Martin Baulig  <martin@gnome.org>
19655
19656         * decl.cs (DeclSpace.FindMembers): Made this public.
19657
19658 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19659
19660         * delegate.cs: fixed build on windows.
19661         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19662
19663 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19664
19665         * ecore.cs (StandardConversionExists): Return a false
19666         if we are trying to convert the void type to anything else
19667         since that is not allowed.
19668
19669         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19670         we flag error 70 in the event an event is trying to be accessed
19671         directly from outside the declaring type.
19672
19673 2002-08-20  Martin Baulig  <martin@gnome.org>
19674
19675         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19676         MemberCache from typemanager.cs to decl.cs.
19677
19678 2002-08-19  Martin Baulig  <martin@gnome.org>
19679
19680         * class.cs (TypeContainer): Implement IMemberContainer.
19681         (TypeContainer.DefineMembers): Create the MemberCache.
19682         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19683         return public members if BindingFlags.Public was given, check
19684         whether members are static.
19685
19686 2002-08-16  Martin Baulig  <martin@gnome.org>
19687
19688         * decl.cs (DeclSpace.Define): Splitted this in Define and
19689         DefineMembers.  DefineMembers is called first and initializes the
19690         MemberCache.
19691
19692         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19693         DefineMembers() on all our DeclSpaces.
19694
19695         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19696         but call DefineMembers() on all nested interfaces.  We call their
19697         Define() in our new Define() function.
19698
19699         * interface.cs (Interface): Implement IMemberContainer.
19700         (Interface.Define): Moved all code except the attribute stuf to
19701         DefineMembers().
19702         (Interface.DefineMembers): Initialize the member cache.
19703
19704         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19705         need this anymore since we can use MemberCache.FindMembers directly.
19706
19707 2002-08-19  Martin Baulig  <martin@gnome.org>
19708
19709         * typemanager.cs (MemberCache): When creating the cache for an
19710         interface type, add all inherited members.
19711         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19712         to `out bool used_cache' and documented it.
19713         (TypeManager.MemberLookup): If we already used the cache in the first
19714         iteration, we don't need to do the interfaces check.
19715
19716 2002-08-19  Martin Baulig  <martin@gnome.org>
19717
19718         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19719         here from IMemberFinder and don't implement this interface anymore.
19720         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19721
19722         * typemanager.cs (IMemberFinder): This interface is now only used by
19723         classes which actually support the member cache.
19724         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19725         since we only put DeclSpaces into this Hashtable.
19726         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19727         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19728
19729 2002-08-16  Martin Baulig  <martin@gnome.org>
19730
19731         * typemanager.cs (ICachingMemberFinder): Removed.
19732         (IMemberFinder.MemberCache): New property.
19733         (TypeManager.FindMembers): Merged this with RealFindMembers().
19734         This function will never be called from TypeManager.MemberLookup()
19735         so we can't use the cache here, just the IMemberFinder.
19736         (TypeManager.MemberLookup_FindMembers): Check whether the
19737         IMemberFinder has a MemberCache and call the cache's FindMembers
19738         function.
19739         (MemberCache): Rewrote larger parts of this yet another time and
19740         cleaned it up a bit.
19741
19742 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19743
19744         * driver.cs (LoadArgs): Support quoting.
19745
19746         (Usage): Show the CSC-like command line arguments.
19747
19748         Improved a few error messages.
19749
19750 2002-08-15  Martin Baulig  <martin@gnome.org>
19751
19752         * typemanager.cs (IMemberContainer.Type): New property.
19753         (IMemberContainer.IsInterface): New property.
19754
19755         The following changes are conditional to BROKEN_RUNTIME, which is
19756         defined at the top of the file.
19757
19758         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19759         class'es members, but add all members from TypeHandle.ObjectType
19760         if we're an interface.
19761         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19762         is the current type.
19763         (MemberCache.CacheEntry.Container): Removed this field.
19764         (TypeHandle.GetMembers): Include inherited members.
19765
19766 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19767
19768         * typemanager.cs: fixed compilation and added a comment on a field that
19769         is never used.
19770
19771 2002-08-15  Martin Baulig  <martin@gnome.org>
19772
19773         * class.cs (ConstructorInitializer.Resolve): In the
19774         Expression.MemberLookup call, use the queried_type as
19775         invocation_type.
19776
19777         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19778         declared' attribute, it's always true.
19779         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19780         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19781         temporary wrapper for FindMembers which tells MemberLookup whether
19782         members from the base classes are included in the return value.
19783         This will go away soon.
19784         (TypeManager.MemberLookup): Use this temporary hack here; once the
19785         new MemberCache is completed, we don't need to do the DeclaredOnly
19786         looping here anymore since the MemberCache will take care of this.
19787         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19788         (MemberCache): When creating the MemberCache for a class, get
19789         members from the current class and all its base classes.
19790         (MemberCache.CacheEntry.Container): New field.  This is a
19791         temporary hack until the Mono runtime is fixed to distinguish
19792         between ReflectedType and DeclaringType.  It allows us to use MCS
19793         with both the MS runtime and the unfixed Mono runtime without
19794         problems and without accecting performance.
19795         (MemberCache.SearchMembers): The DeclaredOnly looping from
19796         TypeManager.MemberLookup is now done here.      
19797
19798 2002-08-14  Martin Baulig  <martin@gnome.org>
19799
19800         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19801         Type.GetFields on dynamic types but get the fields from the
19802         corresponding TypeContainer.
19803         (MyStructInfo.GetStructInfo): Added check for enum types.
19804
19805         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19806         (MemberList.SyncRoot): Implemented.
19807         (TypeManager.FilterWithClosure): No need to check permissions if
19808         closure_start_type == closure_invocation_type, don't crash if
19809         closure_invocation_type is null.
19810
19811 2002-08-13  Martin Baulig  <martin@gnome.org>
19812
19813         Rewrote TypeContainer.FindMembers to use a member cache.  This
19814         gives us a speed increase of about 35% for the self-hosting MCS
19815         build and of about 15-20% for the class libs (both on GNU/Linux).
19816
19817         * report.cs (Timer): New class to get enhanced profiling.  This
19818         whole class is "TIMER" conditional since it remarkably slows down
19819         compilation speed.
19820
19821         * class.cs (MemberList): New class.  This is an IList wrapper
19822         which we're now using instead of passing MemberInfo[]'s around to
19823         avoid copying this array unnecessarily.
19824         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19825         (ICachingMemberFinder, IMemberContainer): New interface.
19826         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19827         has already been checked, otherwise use it for the name comparision.
19828         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19829         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19830         if possible.  Returns a MemberList, not a MemberInfo [].
19831         (TypeHandle): New class, implements IMemberContainer.  We create
19832         one instance of this class per type, it contains a MemberCache
19833         which is used to do the member lookups.
19834         (MemberCache): New class.  Each instance of this class contains
19835         all members of a type and a name-based hash table.
19836         (MemberCache.FindMembers): This is our new member lookup
19837         function.  First, it looks up all members of the requested name in
19838         the hash table.  Then, it walks this list and sorts out all
19839         applicable members and returns them.
19840
19841 2002-08-13  Martin Baulig  <martin@gnome.org>
19842
19843         In addition to a nice code cleanup, this gives us a performance
19844         increase of about 1.4% on GNU/Linux - not much, but it's already
19845         half a second for the self-hosting MCS compilation.
19846
19847         * typemanager.cs (IMemberFinder): New interface.  It is used by
19848         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19849         Enum, Delegate or Interface.
19850         (TypeManager.finder_to_member_finder): New PtrHashtable.
19851         (TypeManager.finder_to_container): Removed.
19852         (TypeManager.finder_to_delegate): Removed.
19853         (TypeManager.finder_to_interface): Removed.
19854         (TypeManager.finder_to_enum): Removed.
19855
19856         * interface.cs (Interface): Implement IMemberFinder.
19857
19858         * delegate.cs (Delegate): Implement IMemberFinder.
19859
19860         * enum.cs (Enum): Implement IMemberFinder.
19861
19862         * class.cs (TypeContainer): Implement IMemberFinder.
19863
19864 2002-08-12  Martin Baulig  <martin@gnome.org>
19865
19866         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19867
19868 2002-08-12  Martin Baulig  <martin@gnome.org>
19869
19870         * ecore.cs (ITypeExpression): New interface for expressions which
19871         resolve to a type.
19872         (TypeExpression): Renamed to TypeLookupExpression.
19873         (Expression.DoResolve): If we're doing a types-only lookup, the
19874         expression must implement the ITypeExpression interface and we
19875         call DoResolveType() on it.
19876         (SimpleName): Implement the new ITypeExpression interface.
19877         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19878         hack, the situation that we're only looking up types can't happen
19879         anymore when this method is called.  Moved the type lookup code to
19880         DoResolveType() and call it.
19881         (SimpleName.DoResolveType): This ITypeExpression interface method
19882         is now doing the types-only lookup.
19883         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19884         (ResolveFlags): Added MaskExprClass.
19885
19886         * expression.cs (MemberAccess): Implement the ITypeExpression
19887         interface.
19888         (MemberAccess.DoResolve): Added support for a types-only lookup
19889         when we're called via ITypeExpression.DoResolveType().
19890         (ComposedCast): Implement the ITypeExpression interface.
19891
19892         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19893         Expression.Resolve() with ResolveFlags.Type instead.
19894
19895 2002-08-12  Martin Baulig  <martin@gnome.org>
19896
19897         * interface.cs (Interface.Define): Apply attributes.
19898
19899         * attribute.cs (Attribute.ApplyAttributes): Added support for
19900         interface attributes.
19901
19902 2002-08-11  Martin Baulig  <martin@gnome.org>
19903
19904         * statement.cs (Block.Emit): Only check the "this" variable if we
19905         do not always throw an exception.
19906
19907         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19908         whether the property has a set accessor.
19909
19910 2002-08-11  Martin Baulig  <martin@gnome.org>
19911
19912         Added control flow analysis support for structs.
19913
19914         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19915         with control flow analysis turned off.
19916         (IVariable): New interface.
19917         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19918         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19919         (FieldExpr.DoResolve): Resolve the instance expression with flow
19920         analysis turned off and do the definite assignment check after the
19921         resolving when we know what the expression will resolve to.
19922
19923         * expression.cs (LocalVariableReference, ParameterReference):
19924         Implement the new IVariable interface, only call the flow analysis
19925         code if ec.DoFlowAnalysis is true.
19926         (This): Added constructor which takes a Block argument.  Implement
19927         the new IVariable interface.
19928         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19929         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19930         This does the definite assignment checks for struct members.
19931
19932         * class.cs (Constructor.Emit): If this is a non-static `struct'
19933         constructor which doesn't have any initializer, call
19934         Block.AddThisVariable() to tell the flow analysis code that all
19935         struct elements must be initialized before control returns from
19936         the constructor.
19937
19938         * statement.cs (MyStructInfo): New public class.
19939         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19940         argument to this indexer.  If non-zero, check an individual struct
19941         member, not the whole struct.
19942         (FlowBranching.CheckOutParameters): Check struct members.
19943         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19944         overloaded versions of these methods which take an additional
19945         `int field_idx' argument to check struct members.
19946         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19947         overloaded versions of these methods which take an additional
19948         `string field_name' argument to check struct member.s
19949         (VariableInfo): Implement the IVariable interface.
19950         (VariableInfo.StructInfo): New public property.  Returns the
19951         MyStructInfo instance of the variable if it's a struct or null.
19952         (Block.AddThisVariable): New public method.  This is called from
19953         Constructor.Emit() for non-static `struct' constructor which do
19954         not have any initializer.  It creates a special variable for the
19955         "this" instance variable which will be checked by the flow
19956         analysis code to ensure that all of the struct's fields are
19957         initialized before control returns from the constructor.
19958         (UsageVector): Added support for struct members.  If a
19959         variable/parameter is a struct with N members, we reserve a slot
19960         in the usage vector for each member.  A struct is considered fully
19961         initialized if either the struct itself (slot 0) or all its
19962         members are initialized.
19963
19964 2002-08-08  Martin Baulig  <martin@gnome.org>
19965
19966         * driver.cs (Driver.MainDriver): Only report an error CS5001
19967         if there were no compilation errors.
19968
19969         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19970         `UnsafeContext' property to determine whether the parent is in
19971         unsafe context rather than checking the parent's ModFlags:
19972         classes nested in an unsafe class are unsafe as well.
19973
19974 2002-08-08  Martin Baulig  <martin@gnome.org>
19975
19976         * statement.cs (UsageVector.MergeChildren): Distinguish between
19977         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19978         we return.  Added test17() and test18() to test-154.cs.
19979
19980 2002-08-08  Martin Baulig  <martin@gnome.org>
19981
19982         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19983         Family access, make sure the invoking type isn't a subclass of the
19984         queried type (that'd be a CS1540).
19985
19986         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19987         this method which takes an additional `Type invocation_type'.
19988
19989         * expression.cs (BaseAccess.DoResolve): Use the base type as
19990         invocation and query type.
19991         (MemberAccess.DoResolve): If the lookup failed and we're about to
19992         report a CS0122, try a lookup with the ec.ContainerType - if this
19993         succeeds, we must report a CS1540.
19994
19995 2002-08-08  Martin Baulig  <martin@gnome.org>
19996
19997         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19998         (MethodGroupExpr): Implement the IMemberExpr interface.
19999
20000         * expression (MemberAccess.ResolveMemberAccess): No need to have
20001         any special code for MethodGroupExprs anymore, they're now
20002         IMemberExprs.   
20003
20004 2002-08-08  Martin Baulig  <martin@gnome.org>
20005
20006         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
20007         Family, FamANDAssem and FamORAssem permissions.
20008         (TypeManager.IsSubclassOrNestedChildOf): New public method.
20009
20010 2002-08-08  Martin Baulig  <martin@gnome.org>
20011
20012         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
20013         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
20014         or loop block.
20015
20016 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
20017
20018         * driver.cs: implemented /resource option to embed managed resources.
20019
20020 2002-08-07  Martin Baulig  <martin@gnome.org>
20021
20022         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
20023         (FieldBase.HasFieldInitializer): New public property.
20024         (FieldBase.GetInitializerExpression): New public method.  Resolves and
20025         returns the field initializer and makes sure it is only resolved once.
20026         (TypeContainer.EmitFieldInitializers): Call
20027         FieldBase.GetInitializerExpression to get the initializer, this ensures
20028         that it isn't resolved multiple times.
20029
20030         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
20031         the resolving process (SimpleName/MemberLookup) that we're currently
20032         emitting a field initializer (which must not access any instance members,
20033         this is an error CS0236).
20034
20035         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
20036         argument, if the `IsFieldInitializer' flag is set, we must report and
20037         error CS0236 and not an error CS0120.   
20038
20039 2002-08-07  Martin Baulig  <martin@gnome.org>
20040
20041         * ecore.cs (IMemberExpr): New public interface.
20042         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
20043         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
20044         if the expression is an IMemberExpr.
20045
20046         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
20047         to be null, implicitly default to `this' if we're non-static in
20048         this case.  Simplified the code a lot by using the new IMemberExpr
20049         interface.  Also fixed bug #28176 here.
20050
20051 2002-08-06  Martin Baulig  <martin@gnome.org>
20052
20053         * cs-parser.jay (SimpleLookup): Removed.  We need to create
20054         ParameterReferences during semantic analysis so that we can do a
20055         type-only search when resolving Cast, TypeOf and SizeOf.
20056         (block): Pass the `current_local_parameters' to the Block's
20057         constructor.
20058
20059         * class.cs (ConstructorInitializer): Added `Parameters parameters'
20060         argument to the constructor.
20061         (ConstructorInitializer.Resolve): Create a temporary implicit
20062         block with the parameters.
20063
20064         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20065         references here if we aren't doing a type-only search.
20066
20067         * statement.cs (Block): Added constructor which takes a
20068         `Parameters parameters' argument.
20069         (Block.Parameters): New public property.
20070
20071         * support.cs (InternalParameters.Parameters): Renamed `parameters'
20072         to `Parameters' and made it public readonly.
20073
20074 2002-08-06  Martin Baulig  <martin@gnome.org>
20075
20076         * ecore.cs (Expression.Warning): Made this public as well.
20077
20078         * report.cs (Report.Debug): Print the contents of collections.
20079
20080 2002-08-06  Martin Baulig  <martin@gnome.org>
20081
20082         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
20083         used to tell Resolve() which kinds of expressions it may return.
20084         (Expression.Resolve): Added overloaded version of this method which
20085         takes a `ResolveFlags flags' argument.  This can be used to tell
20086         Resolve() which kinds of expressions it may return.  Reports a
20087         CS0118 on error.
20088         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
20089         ResolveFlags.SimpleName.
20090         (Expression.Error118): Added overloaded version of this method which
20091         takes a `ResolveFlags flags' argument.  It uses the flags to determine
20092         which kinds of expressions are allowed.
20093
20094         * expression.cs (Argument.ResolveMethodGroup): New public method.
20095         Resolves an argument, but allows a MethodGroup to be returned.
20096         This is used when invoking a delegate.
20097
20098         * TODO: Updated a bit.
20099
20100 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20101
20102         Fixed compilation with csc.
20103
20104         * ecore.cs: Expression.Error made public. Is this correct? Should
20105         Warning be made public too?
20106
20107         * expression.cs: use ea.Location instead of ea.loc.
20108         [FIXME:  Filed as bug #28607: MCS must report these errors.]
20109
20110 2002-08-06  Martin Baulig  <martin@gnome.org>
20111
20112         * ecore.cs (Expression.loc): Moved the location here instead of
20113         duplicating it in all derived classes.
20114         (Expression.Location): New public property.
20115         (Expression.Error, Expression.Warning): Made them non-static and
20116         removed the location argument.
20117         (Expression.Warning): Added overloaded version which takes an
20118         `int level' argument.
20119         (Expression.Error118): Make this non-static and removed the
20120         expression and location arguments.
20121         (TypeExpr): Added location argument to the constructor.
20122
20123         * expression.cs (StaticCallExpr): Added location argument to
20124         the constructor.
20125         (Indirection, PointerArithmetic): Likewise.
20126         (CheckedExpr, UnCheckedExpr): Likewise.
20127         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
20128         (StringPtr): Likewise.
20129
20130
20131 2002-08-05  Martin Baulig  <martin@gnome.org>
20132
20133         * expression.cs (BaseAccess.DoResolve): Actually report errors.
20134
20135         * assign.cs (Assign.DoResolve): Check whether the source
20136         expression is a value or variable.
20137
20138         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
20139         while resolving the corresponding blocks.
20140
20141         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
20142         an error, don't silently return null.
20143
20144         * statement.cs (Block.AddVariable): Do the error reporting here
20145         and distinguish between CS0128 and CS0136.
20146         (Block.DoResolve): Report all unused labels (warning CS0164).
20147         (LabeledStatement): Pass the location to the constructor.
20148         (LabeledStatement.HasBeenReferenced): New property.
20149         (LabeledStatement.Resolve): Set it to true here.
20150
20151         * statement.cs (Return.Emit): Return success even after reporting
20152         a type mismatch error (CS0126 or CS0127), this is what csc does and
20153         it avoids confusing the users with any consecutive errors.
20154
20155 2002-08-05  Martin Baulig  <martin@gnome.org>
20156
20157         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
20158
20159         * const.cs (Const.LookupConstantValue): Catch circular definitions.
20160
20161         * expression.cs (MemberAccess.DoResolve): Silently return if an
20162         error has already been reported.
20163
20164         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
20165         error has already been reported.
20166
20167 2002-08-05  Martin Baulig  <martin@gnome.org>
20168
20169         * statement.cs (UsageVector): Only initialize the `parameters'
20170         vector if we actually have any "out" parameters.
20171
20172 2002-08-05  Martin Baulig  <martin@gnome.org>
20173
20174         * expression.cs (Binary.ResolveOperator): When combining delegates,
20175         they must have the same type.
20176
20177 2002-08-05  Martin Baulig  <martin@gnome.org>
20178
20179         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20180         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20181         work with the ms runtime and we also don't need it: if we're a
20182         PropertyBuilder and not in the `indexer_arguments' hash, then we
20183         are a property and not an indexer.
20184
20185         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20186         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20187         since the latter one doesn't work with the ms runtime.
20188
20189 2002-08-03  Martin Baulig  <martin@gnome.org>
20190
20191         Fixed bugs #27998 and #22735.
20192
20193         * class.cs (Method.IsOperator): New public field.
20194         (Method.CheckBase): Report CS0111 if there's already a method
20195         with the same parameters in the current class.  Report CS0508 when
20196         attempting to change the return type of an inherited method.
20197         (MethodData.Emit): Report CS0179 if a method doesn't have a body
20198         and it's not marked abstract or extern.
20199         (PropertyBase): New abstract base class for Property and Indexer.
20200         (PropertyBase.CheckBase): Moved here from Property and made it work
20201         for indexers.
20202         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20203         the same so we can reuse it there.
20204         (Property, Indexer): Derive from PropertyBase.
20205         (MethodSignature.inheritable_property_signature_filter): New delegate
20206         to find properties and indexers.
20207
20208         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20209         argument and improved error reporting.
20210
20211         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20212         EmptyReadOnlyParameters and made it a property.
20213
20214         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20215         version of this method which takes a `PropertyInfo indexer'.
20216         (TypeManager.RegisterIndexer): New method.
20217
20218         * class.cs: Added myself as author of this file :-)
20219
20220 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20221
20222         * class.cs: fixed compilation on windoze.
20223
20224 2002-08-03  Martin Baulig  <martin@gnome.org>
20225
20226         * interface.cs (Interface.GetInterfaceBases): Check whether all
20227         base interfaces are at least as accessible than the current one.
20228
20229         * class.cs (TypeContainer.GetClassBases): Check whether base types
20230         are at least as accessible than the current type.
20231         (TypeContainer.AsAccessible): Implemented and made non-static.
20232         (MemberBase.CheckParameters): Report errors if the accessibility
20233         checks fail.
20234
20235         * delegate.cs (Delegate.Delegate): The default visibility is
20236         internal for top-level types and private for nested types.
20237         (Delegate.Define): Report errors if the accessibility checks fail.
20238
20239         * enum.cs (Enum.Enum): The default visibility is internal for
20240         top-level types and private for nested types.
20241         (Enum.DefineType): Compute the correct visibility.
20242
20243         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20244         function which takes a `bool is_toplevel' instead of a TypeContainer.
20245
20246         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20247         builtin type.
20248
20249 2002-08-02  Martin Baulig  <martin@gnome.org>
20250
20251         * expression.cs (LocalVariableReferenc): Added constructor which
20252         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20253         (LocalVariableReference.IsReadOnly): New property.
20254         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20255         variable is readonly, use our own readonly flag to do this; you can
20256         use the new constructor to get a writable reference to a read-only
20257         variable.
20258
20259         * cs-parser.jay (foreach_statement, using_statement): Get a writable
20260         reference to the local variable.
20261
20262 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * rootcontext.cs (ResolveCore): Also include System.Exception
20265
20266         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20267         we reach an EmptyStatement.
20268
20269         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20270         is also fine.
20271
20272         * expression.cs (Binary.ResolveOperator): Check error result in
20273         two places.
20274
20275         use brtrue/brfalse directly and avoid compares to null.
20276
20277 2002-08-02  Martin Baulig  <martin@gnome.org>
20278
20279         * class.cs (TypeContainer.Define): Define all nested interfaces here.
20280         Fixes bug #28407, added test-155.cs.
20281
20282 2002-08-01  Martin Baulig  <martin@gnome.org>
20283
20284         * class.cs (Event.EmitDefaultMethod): Make this work with static
20285         events.  Fixes #28311, added verify-3.cs.
20286
20287 2002-08-01  Martin Baulig  <martin@gnome.org>
20288
20289         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20290         `is_disposable' fields.
20291         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20292         `hm.is_disposable' if we're using the collection pattern.
20293         (Foreach.EmitCollectionForeach): Use the correct type for the
20294         enumerator's local variable, only emit the try/finally block if
20295         necessary (fixes #27713).
20296
20297 2002-08-01  Martin Baulig  <martin@gnome.org>
20298
20299         * ecore.cs (Expression.report118): Renamed to Error118 and made
20300         it public static.
20301
20302         * statement.cs (Throw.Resolve): Check whether the expression is of
20303         the correct type (CS0118) and whether the type derives from
20304         System.Exception (CS0155).
20305         (Catch.Resolve): New method.  Do the type lookup here and check
20306         whether it derives from System.Exception (CS0155).
20307         (Catch.CatchType, Catch.IsGeneral): New public properties.
20308
20309         * typemanager.cs (TypeManager.exception_type): Added.
20310
20311 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * driver.cs: Updated About function.
20314
20315 2002-07-31  Martin Baulig  <martin@gnome.org>
20316
20317         Implemented Control Flow Analysis.
20318
20319         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20320         (EmitContext.CurrentBranching): Added.
20321         (EmitContext.StartFlowBranching): Added.
20322         (EmitContext.EndFlowBranching): Added.
20323         (EmitContext.KillFlowBranching): Added.
20324         (EmitContext.IsVariableAssigned): Added.
20325         (EmitContext.SetVariableAssigned): Added.
20326         (EmitContext.IsParameterAssigned): Added.
20327         (EmitContext.SetParameterAssigned): Added.
20328         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20329         Added control flow analysis stuff here.
20330
20331         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20332         resolve the expression as lvalue.
20333         (LocalVariableReference.DoResolve): Check whether the variable has
20334         already been assigned.
20335         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20336         the parameter as assigned here.
20337         (ParameterReference.DoResolve): Check whether the parameter has already
20338         been assigned.
20339         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20340         expression as lvalue.
20341
20342         * statement.cs (FlowBranching): New class for the flow analysis code.
20343         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20344         (LabeledStatement.IsDefined): New public property.
20345         (LabeledStatement.AddUsageVector): New public method to tell flow
20346         analyis that the label may be reached via a forward jump.
20347         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20348         flow analysis.
20349         (VariableInfo.Number): New public field.  This is used by flow analysis
20350         to number all locals of a block.
20351         (Block.CountVariables): New public property.  This is the number of
20352         local variables in this block (including the locals from all parent
20353         blocks).
20354         (Block.EmitMeta): Number all the variables.
20355
20356         * statement.cs: Added flow analysis support to all classes.
20357
20358 2002-07-31  Martin Baulig  <martin@gnome.org>
20359
20360         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20361         To get debugging messages, compile mcs with /define:MCS_DEBUG and
20362         then use this argument.
20363
20364         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20365
20366         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20367         use this to specify /define options.
20368
20369 2002-07-29  Martin Baulig  <martin@gnome.org>
20370
20371         * statement.cs (Fixed): Moved all code that does variable lookups
20372         and resolvings from Emit to Resolve.
20373
20374         * statement.cs (For): Moved all code that does variable lookups
20375         and resolvings from Emit to Resolve.
20376
20377         * statement.cs (Using): Moved all code that does variable lookups
20378         and resolvings from Emit to Resolve.
20379
20380 2002-07-29  Martin Baulig  <martin@gnome.org>
20381
20382         * attribute.cs (Attribute.Resolve): Explicitly catch a
20383         System.NullReferenceException when creating the
20384         CustromAttributeBuilder and report a different warning message.
20385
20386 2002-07-29  Martin Baulig  <martin@gnome.org>
20387
20388         * support.cs (ParameterData.ParameterName): Added method to
20389         get the name of a parameter.
20390
20391         * typemanager.cs (TypeManager.IsValueType): New public method.
20392
20393 2002-07-29  Martin Baulig  <martin@gnome.org>
20394
20395         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
20396         is a flag which specifies that it's either ref or out.
20397         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20398         the out parameter to `out Parameter.Modifier mod', also set the
20399         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20400
20401         * support.cs (InternalParameters.ParameterModifier): Distinguish
20402         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20403         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20404
20405         * expression.cs (Argument.GetParameterModifier): Distinguish
20406         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20407         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20408
20409 2002-07-29  Martin Baulig  <martin@gnome.org>
20410
20411         * expression.cs (ParameterReference.ParameterReference): Added
20412         `Location loc' argument to the constructor.
20413
20414         * cs-parser.jay: Pass location to ParameterReference.
20415
20416 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
20417
20418         * statement.cs (Try): Initialize the location.
20419
20420         * cs-parser.jay: pass location to Try.
20421
20422         * expression.cs (Unary.Reduce): Change the prototype to return
20423         whether a constant fold could be performed or not.  The result is
20424         returned in an out parameters.  In the case of Indirection and
20425         AddressOf, we want to perform the full tests.
20426
20427 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * statement.cs (Statement.Emit): Flag dead code.
20430
20431 2002-07-27  Andrew Birkett  <andy@nobugs.org>
20432
20433         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20434
20435 2002-07-27  Martin Baulig  <martin@gnome.org>
20436
20437         * class.cs (MethodData.Define): Put back call to
20438         TypeManager.AddMethod(), accidentally commented this out.
20439
20440         * report.cs (Debug): New public method to print debugging information,
20441         this is `[Conditional ("DEBUG")]'.
20442
20443 2002-07-26  Martin Baulig  <martin@gnome.org>
20444
20445         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20446         (switch_statement): Push the current_block to the switch_stack and
20447         pop it again when we're done with the switch.
20448         (switch_section): The new block is a child of the current_block.
20449         Fixes bug #24007, added test-152.cs.
20450
20451 2002-07-27  Martin Baulig  <martin@gnome.org>
20452
20453         * expression.cs (Invocation.EmitArguments): When calling a varargs
20454         function with only its fixed arguments, we need to pass an empty
20455         array.
20456
20457 2002-07-27  Martin Baulig  <martin@gnome.org>
20458
20459         Mono 0.13 has been released.
20460
20461 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
20462
20463         * driver.cs: Rename --resource to --linkres, because that is what
20464         we do currently, we dont support --resource yet.
20465
20466         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20467
20468 2002-07-25  Martin Baulig  <martin@gnome.org>
20469
20470         * class.cs (MethodData): New public class.  This is a `method builder'
20471         class for a method or one accessor of a Property/Indexer/Event.
20472         (MethodData.GetMethodFlags): Moved here from MemberBase.
20473         (MethodData.ApplyAttributes): Likewise.
20474         (MethodData.ApplyObsoleteAttribute): Likewise.
20475         (MethodData.ApplyConditionalAttribute): Likewise.
20476         (MethodData.ApplyDllImportAttribute): Likewise.
20477         (MethodData.CheckAbstractAndExternal): Likewise.
20478         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20479         (MethodData.Emit): Formerly known as Method.Emit().
20480         (MemberBase): Moved everything which was specific to a single
20481         accessor/method to MethodData.
20482         (Method): Create a new MethodData and call Define() and Emit() on it.
20483         (Property, Indexer, Event): Create a new MethodData objects for each
20484         accessor and call Define() and Emit() on them.
20485
20486 2002-07-25  Martin Baulig  <martin@gnome.org>
20487
20488         Made MethodCore derive from MemberBase to reuse the code from there.
20489         MemberBase now also checks for attributes.
20490
20491         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20492         (MemberBase.GetMethodFlags): Moved here from class Method and marked
20493         as virtual.
20494         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20495         `CallingConventions cc' and `Attributes opt_attrs' arguments.
20496         (MemberBase.ApplyAttributes): New virtual method; applies the
20497         attributes to a method or accessor.
20498         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20499         (MemberBase.ApplyConditionalAttribute): Likewise.
20500         (MemberBase.ApplyDllImportAttribute): Likewise.
20501         (MemberBase.CheckAbstractAndExternal): Likewise.
20502         (MethodCore.ParameterTypes): This is now a property instead of a
20503         method, it's initialized from DoDefineParameters().
20504         (MethodCore.ParameterInfo): Removed the set accessor.
20505         (MethodCore.DoDefineParameters): New protected virtual method to
20506         initialize ParameterTypes and ParameterInfo.
20507         (Method.GetReturnType): We can now simply return the MemberType.
20508         (Method.GetMethodFlags): Override the MemberBase version and add
20509         the conditional flags.
20510         (Method.CheckBase): Moved some code from Define() here, call
20511         DoDefineParameters() here.
20512         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20513         here to avoid some larger code duplication.
20514         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20515         ensure that abstract and external accessors don't declare a body.
20516
20517         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20518         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20519         lookup in the attribute's parent classes, so we need to abort as soon
20520         as we found the first match.
20521         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20522         the attribute has no arguments.
20523
20524         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20525         of a Method.
20526
20527 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20528
20529         * cs-parser.jay: reverted previous patch.
20530
20531 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20532
20533         * cs-parser.jay: fixed bug #22119.
20534
20535 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20536
20537         * attribute.cs: fixed compilation. The error was:
20538         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20539         be assigned to before control leaves the current method."
20540         [FIXME:  Filed as bug #28186: MCS must report this error.]
20541
20542 2002-07-25  Martin Baulig  <martin@gnome.org>
20543
20544         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20545         method to pull the condition name ouf of a Conditional attribute.
20546         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20547         the obsolete message and error flag out of an Obsolete attribute.
20548
20549         * class.cs (Method.GetMethodFlags): New public method to get the
20550         TypeManager.MethodFlags for this method.
20551         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20552         private methods.
20553         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20554         if we're overriding a virtual function, set the new private variable
20555         `parent_method'; call the new TypeManager.AddMethod().
20556
20557         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20558         the MethodBuilder and the Method in a PtrHashtable.
20559         (TypeManager.builder_to_method): Added for this purpose.
20560         (TypeManager.MethodFlags): Added IsObsoleteError.
20561         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20562         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20563         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20564         the message from the attribute.
20565
20566 2002-07-24  Martin Baulig  <martin@gnome.org>
20567
20568         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20569         preprocessor directives, ensure that the argument to #define/#undef is
20570         exactly one identifier and that it's actually an identifier.
20571
20572         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20573         did not work ....
20574
20575 2002-07-24  Martin Baulig  <martin@gnome.org>
20576
20577         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20578         initialize it to TypeManager.object_type in the constructor.
20579         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20580         of the `hm.get_current' method if we're using the collection pattern.
20581         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20582         for the explicit conversion to make it work when we're using the collection
20583         pattern and the `Current' property has a different return type than `object'.
20584         Fixes #27713.
20585
20586 2002-07-24  Martin Baulig  <martin@gnome.org>
20587
20588         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20589         does not match, but don't report any errors.  This method is called in
20590         order for all methods in a MethodGroupExpr until a matching method is
20591         found, so we don't want to bail out if the first method doesn't match.
20592         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20593         matches, report the 123.  Fixes #28070.
20594
20595 2002-07-24  Martin Baulig  <martin@gnome.org>
20596
20597         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20598         TypeManager.TypeToCoreType() to the top of the method so the
20599         following equality checks will work.  Fixes #28107.
20600
20601 2002-07-24  Martin Baulig  <martin@gnome.org>
20602
20603         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20604         operand is of type uint, and the other operand is of type sbyte,
20605         short or int, the operands are converted to type long." -
20606         Actually do what this comment already told us.  Fixes bug #28106,
20607         added test-150.cs.
20608
20609 2002-07-24  Martin Baulig  <martin@gnome.org>
20610
20611         * class.cs (MethodBase): New abstract class.  This is now a base
20612         class for Property, Indexer and Event to avoid some code duplication
20613         in their Define() and DefineMethods() methods.
20614         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20615         generic methods for Define() and DefineMethods().
20616         (FieldBase): Derive from MemberBase, not MemberCore.
20617         (Property): Derive from MemberBase, not MemberCore.
20618         (Property.DefineMethod): Moved all the code from this method to the
20619         new MethodBase.DefineAccessor(), just call it with appropriate
20620         argumetnts.
20621         (Property.Define): Call the new Property.DoDefine(), this does some
20622         sanity checks and we don't need to duplicate the code everywhere.
20623         (Event): Derive from MemberBase, not MemberCore.
20624         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20625         accessors, this will also make them work with interface events.
20626         (Indexer): Derive from MemberBase, not MemberCore.
20627         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20628         (Indexer.Define): Use the new MethodBase functions.
20629
20630         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20631         argument to the constructor.
20632         (Interface.FindMembers): Added support for interface events.
20633         (Interface.PopluateEvent): Implemented.
20634
20635         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20636
20637 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20640         but this is required to check for a method name being the same as
20641         the containing class.  
20642
20643         Handle this now.
20644
20645 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20646
20647         * interface.cs: initialize variable.
20648
20649 2002-07-23  Martin Baulig  <martin@gnome.org>
20650
20651         Implemented the IndexerName attribute in interfaces.
20652
20653         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20654         name if this is an explicit interface implementation.
20655         (Indexer.InterfaceIndexerName): New public variable.  If we're
20656         implementing an interface indexer, this is the IndexerName in that
20657         interface.  Otherwise, it's the IndexerName.
20658         (Indexer.DefineMethod): If we're implementing interface indexer,
20659         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20660         and Pending.ImplementIndexer methods.
20661         (Indexer.Define): Also define the PropertyBuilder if we're
20662         implementing an interface indexer and this is neither an explicit
20663         interface implementation nor do the IndexerName match the one in
20664         the interface.
20665
20666         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20667         If a method is defined here, then we always need to create a proxy
20668         for it.  This is used when implementing interface indexers.
20669         (Pending.IsInterfaceIndexer): New public method.
20670         (Pending.ImplementIndexer): New public method.
20671         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20672         This is used when implementing interface indexers to define a proxy
20673         if necessary.
20674         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20675         define a proxy if necessary.
20676
20677         * interface.cs (Interface.IndexerName): New public variable.
20678         (Interface.PopulateIndexer): Set the IndexerName.
20679         (Interface.DefineIndexers): New private method.  Populate all the
20680         indexers and make sure their IndexerNames match.
20681
20682         * typemanager.cs (IndexerPropertyName): Added support for interface
20683         indexers.
20684
20685 2002-07-22  Martin Baulig  <martin@gnome.org>
20686
20687         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20688         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20689         ret if HasReturnLabel.
20690         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20691         variables.
20692
20693         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20694         and set the ec.LoopBeginTryCatchLevel.
20695         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20696         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20697         the current ec.TryCatchLevel, the branch goes out of an exception
20698         block.  In this case, we need to use Leave and not Br.
20699
20700 2002-07-22  Martin Baulig  <martin@gnome.org>
20701
20702         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20703         block unless the block does not always return or it is contained in
20704         another try { ... } catch { ... } block.  Fixes bug #26506.
20705         Added verify-1.cs to the test suite.
20706
20707 2002-07-22  Martin Baulig  <martin@gnome.org>
20708
20709         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20710         then we do not always return.  Fixes bug #24985.
20711
20712 2002-07-22  Martin Baulig  <martin@gnome.org>
20713
20714         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20715         lookup on a per-class level; ie. walk up the class hierarchy until we
20716         found at least one applicable method, then choose the best among them.
20717         Fixes bug #24463 and test-29.cs.
20718
20719 2002-07-22  Martin Baulig  <martin@gnome.org>
20720
20721         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20722         return types of the methods.  The return type is not part of the
20723         signature and we must not check it to make the `new' modifier work.
20724         Fixes bug #27999, also added test-147.cs.
20725         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20726
20727         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20728         on the method's return type.
20729
20730 2002-07-21  Martin Baulig  <martin@gnome.org>
20731
20732         * assign.cs: Make this work if the rightmost source is a constant and
20733         we need to do an implicit type conversion.  Also adding a few more tests
20734         to test-38.cs which should have caught this.
20735
20736         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20737         target in the makefile for this.  The makefile.gnu is primarily intended
20738         for end-users who don't want to debug the compiler.
20739
20740 2002-07-21  Martin Baulig  <martin@gnome.org>
20741
20742         * assign.cs: Improved the Assign class so it can now handle embedded
20743         assignments (X = Y = Z = something).  As a side-effect this'll now also
20744         consume less local variables.  test-38.cs now passes with MCS, added
20745         a few new test cases to that test.
20746
20747 2002-07-20  Martin Baulig  <martin@gnome.org>
20748
20749         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20750         instructions.  Fixes bug #27977, also added test-146.cs.
20751
20752 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20753
20754         * cs-tokenizer.cs: fixed getHex ().
20755
20756 2002-07-19  Martin Baulig  <martin@gnome.org>
20757
20758         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20759         not Type.GetType() to lookup the array type.  This is needed when
20760         we're constructing an array of a user-defined type.
20761         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20762         single-dimensional arrays, but also for single-dimensial arrays of
20763         type decimal.
20764
20765 2002-07-19  Martin Baulig  <martin@gnome.org>
20766
20767         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20768         this function is called, it's not allowed to share LocalBuilders
20769         among ILGenerators.
20770
20771 2002-07-19  Martin Baulig  <martin@gnome.org>
20772
20773         * expression.cs (Argument.Resolve): Report an error 118 when trying
20774         to pass a type as argument.
20775
20776 2002-07-18  Martin Baulig  <martin@gnome.org>
20777
20778         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20779         Conv_R_Un for the signed `long' type.
20780
20781 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20782
20783         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20784         `expr' for the temporary result, as that will fail if we do
20785         multiple resolves on the same expression.
20786
20787 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20790         ec.TypeContainer for looking up aliases. 
20791
20792         * class.cs (TypeContainer): Remove LookupAlias from here.
20793
20794         * decl.cs (DeclSpace); Move here.
20795
20796 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * class.cs (FindMembers): Only call filter if the constructor
20799         bulider is not null.
20800
20801         Also handle delegates in `NestedTypes' now.  Now we will perform
20802         type lookups using the standard resolution process.  This also
20803         fixes a bug.
20804
20805         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20806         This uses Expressions (the limited kind that can be parsed by the
20807         tree) instead of strings.
20808
20809         * expression.cs (ComposedCast.ToString): Implement, used to flag
20810         errors since now we have to render expressions.
20811
20812         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20813         FormArrayType. 
20814
20815         * ecore.cs (SimpleName.ToString): ditto.
20816
20817         * cs-parser.jay: Instead of using strings to assemble types, use
20818         Expressions to assemble the type (using SimpleName, ComposedCast,
20819         MemberAccess).  This should fix the type lookups in declarations,
20820         because we were using a different code path for this.
20821
20822         * statement.cs (Block.Resolve): Continue processing statements
20823         even when there is an error.
20824
20825 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * class.cs (Event.Define): Also remove the `remove' method from
20828         the list of pending items.
20829
20830         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20831         generate more compact code. 
20832
20833 2002-07-17  Martin Baulig  <martin@gnome.org>
20834
20835         * const.cs (Const.LookupConstantValue): Add support for constant
20836         `unchecked' and `checked' expressions.
20837         Also adding test case test-140.cs for this.
20838
20839 2002-07-17  Martin Baulig  <martin@gnome.org>
20840
20841         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20842         check whether mi.ReturnType implements the IEnumerator interface; the
20843         `==' and the IsAssignableFrom() will fail in this situation.
20844
20845 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20846
20847         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20848         here too.
20849
20850 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20851
20852         * expression.cs: fixed bug #27811.
20853
20854 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20857         Molaro: when we are a ref, the value already contains a pointer
20858         value, do not take the address of it.
20859
20860 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20861         * removed mb-parser.jay and mb-tokenizer.cs
20862
20863 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20864
20865         * expression.cs: check against the building corlib void type.
20866
20867 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20868
20869         * ecore.cs: fix for valuetype static readonly fields: when 
20870         initializing them, we need their address, not the address of a copy.
20871
20872 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20873
20874         * typemanager.cs: register also enum_type in corlib.
20875
20876 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20877
20878         * class.cs: allow calling this (but not base) initializers in structs.
20879
20880 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20881
20882         * ecore.cs: make sure we compare against the building base types
20883         in GetTypeSize ().
20884
20885 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20886
20887         * typemanager.cs: fix TypeToCoreType() to handle void and object
20888         (corlib gets no more typerefs after this change).
20889
20890 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20891
20892         * expression.cs (ArrayCreation.EmitArrayArguments): use
20893         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20894
20895         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20896         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20897         array indexes, the runtime actually forbids them.
20898
20899         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20900         for array arguments here.
20901
20902         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20903         instead of the default for ValueTypes.
20904
20905         (New.DoEmit): Use IsValueType instead of
20906         IsSubclassOf (value_type)
20907         (New.DoResolve): ditto.
20908         (Invocation.EmitCall): ditto.
20909
20910         * assign.cs (Assign): ditto.
20911
20912         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20913         Statements *are* currently doing part of their resolution during
20914         Emit.  
20915
20916         Expressions do always resolve during resolve, but statements are
20917         only required to propagate resolution to their children.
20918
20919 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20920
20921         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20922
20923         (LoadAssembly): Do not add the dll if it is already specified
20924
20925         (MainDriver): Add the System directory to the link path at the end,
20926         after all the other -L arguments. 
20927
20928         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20929         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20930         ldelem.u1) and using the opposite for sbytes.
20931
20932         This fixes Digger, and we can finally run it.
20933
20934         * driver.cs (UnixParseOption): Move the option parsing here.  
20935         (CSCParseOption): Implement CSC-like parsing of options.
20936
20937         We now support both modes of operation, the old Unix way, and the
20938         new CSC-like way.  This should help those who wanted to make cross
20939         platform makefiles.
20940
20941         The only thing broken is that /r:, /reference: and /lib: are not
20942         implemented, because I want to make those have the same semantics
20943         as the CSC compiler has, and kill once and for all the confussion
20944         around this.   Will be doing this tomorrow.
20945
20946         * statement.cs (Unsafe.Resolve): The state is checked during
20947         resolve, not emit, so we have to set the flags for IsUnsfe here.
20948
20949 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20950
20951         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20952         not catch the Error_ObjectRefRequired in SimpleName (as it is
20953         possible to have a class/instance variable name that later gets
20954         deambiguated), we have to check this here.      
20955
20956 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20957
20958         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20959         make static and put into Expression.
20960
20961         (Event.Define): Register the private field of the event with the 
20962         TypeManager so that GetFieldFromEvent can get at it.
20963
20964         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20965         keep track of the private field associated with an event which
20966         has no accessors.
20967
20968         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20969         private field.
20970
20971         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20972
20973 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20974
20975         * expression.cs (Binary.EmitBranchable): this routine emits the
20976         Binary expression in a branchable context.  This basically means:
20977         we need to branch somewhere, not just get the value on the stack.
20978
20979         This works together with Statement.EmitBoolExpression.
20980
20981         * statement.cs (Statement.EmitBoolExpression): Use
20982         EmitBranchable. 
20983
20984 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20985
20986         * statement.cs (For): Reduce the number of jumps in loops.
20987
20988         (For): Implement loop inversion for the For statement.
20989
20990         (Break): We can be breaking out of a Try/Catch controlled section
20991         (foreach might have an implicit try/catch clause), so we need to
20992         use Leave instead of Br.
20993
20994         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20995         now).  If the instace expression supports IMemoryLocation, we use
20996         the AddressOf method from the IMemoryLocation to extract the
20997         address instead of emitting the instance.
20998
20999         This showed up with `This', as we were emitting the instance
21000         always (Emit) instead of the Address of This.  Particularly
21001         interesting when This is a value type, as we dont want the Emit
21002         effect (which was to load the object).
21003
21004 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
21005
21006         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
21007
21008         * statement.cs (Checked): Set the CheckedState during the resolve
21009         process too, as the ConvCast operations track the checked state on
21010         the resolve process, and not emit.
21011
21012         * cs-parser.jay (namespace_member_declaration): Flag that we have
21013         found a declaration when we do.  This is used to flag error 1529
21014
21015         * driver.cs: Report ok when we display the help only.
21016
21017 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
21018
21019         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
21020
21021 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
21022
21023         * cs-tokenizer.cs (define): We also have to track locally the
21024         defines.  AllDefines is just used for the Conditional Attribute,
21025         but we also need the local defines for the current source code. 
21026
21027 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
21028
21029         * statement.cs (While, For, Do): These loops can exit through a
21030         Break statement, use this information to tell whether the
21031         statement is the last piece of code.
21032
21033         (Break): Flag that we break.
21034
21035         * codegen.cs (EmitContexts): New `Breaks' state variable.
21036
21037 2002-07-03  Martin Baulig  <martin@gnome.org>
21038
21039         * class.cs (TypeContainer.MethodModifiersValid): Allow override
21040         modifiers in method declarations in structs.  Otherwise, you won't
21041         be able to override things like Object.Equals().
21042
21043 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * class.cs (Method, Property, Indexer): Do not allow the public
21046         modifier to be used in explicit interface implementations.
21047
21048         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
21049         override modifiers in method declarations in structs
21050
21051 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
21052
21053         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
21054         integer or real overflow, report an error
21055
21056 2002-07-02  Martin Baulig  <martin@gnome.org>
21057
21058         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21059         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21060         to tell the runtime about our newly created System.Object and
21061         System.ValueType types.
21062
21063 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
21064
21065         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21066         struct instead of Ldarg/Starg.
21067
21068 2002-07-02  Martin Baulig  <martin@gnome.org>
21069
21070         * expression.cs (Indirection.Indirection): Call
21071         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
21072
21073 2002-07-02  Martin Baulig  <martin@gnome.org>
21074
21075         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
21076         ValueType, call TypeManager.TypeToCoreType() on it.
21077         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
21078         the OpCodes.Newarr argument.
21079
21080 2002-07-02  Martin Baulig  <martin@gnome.org>
21081
21082         * expression.cs (Invocation.EmitCall): When compiling corlib,
21083         replace all calls to the system's System.Array type to calls to
21084         the newly created one.
21085
21086         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
21087         System.Array methods.
21088         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
21089         from the system's System.Array type which must be replaced.
21090
21091 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
21092
21093         * typemanager.cs: load unverifiable_code_ctor so we can build
21094         corlib using the correct type. Avoid using GetTypeCode() with
21095         TypeBuilders.
21096         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
21097         TypeManager.object_type to allow building corlib.
21098
21099 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
21100
21101         * ecore.cs: handle System.Enum separately in LoadFromPtr().
21102
21103 2002-07-01  Martin Baulig  <martin@gnome.org>
21104
21105         * class.cs: Make the last change actually work, we need to check
21106         whether `ifaces != null' to avoid a crash.
21107
21108 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21109
21110         * class.cs: when we build structs without fields that implement
21111         interfaces, we need to add the interfaces separately, since there is
21112         no API to both set the size and add the interfaces at type creation
21113         time.
21114
21115 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21116
21117         * expression.cs: the dimension arguments to the array constructors
21118         need to be converted if they are a long.
21119
21120 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
21121
21122         * class.cs: don't emit ldarg.0 if there is no parent constructor
21123         (fixes showstopper for corlib).
21124
21125 2002-06-29  Martin Baulig  <martin@gnome.org>
21126
21127         MCS now compiles corlib on GNU/Linux :-)
21128
21129         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
21130         ie. check for MethodImplOptions.InternalCall.
21131
21132         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
21133         and TypeManager.attribute_type are null, so we must explicitly check
21134         whether parent is not null to find out whether it's an attribute type.
21135         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
21136         and SetBuilder, not only if the property is neither abstract nor external.
21137         This is necessary to set the MethodImplOptions on the accessor methods.
21138         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
21139         SetBuilder, see Property.Emit().
21140
21141         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
21142         populate "System.Object", "System.ValueType" and "System.Attribute" since
21143         they've already been populated from BootCorlib_PopulateCoreTypes().
21144
21145 2002-06-29  Martin Baulig  <martin@gnome.org>
21146
21147         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
21148         is the NullLiteral, we also need to make sure that target_type is not
21149         an enum type.   
21150
21151 2002-06-29  Martin Baulig  <martin@gnome.org>
21152
21153         * rootcontext.cs (RootContext.ResolveCore): We must initialize
21154         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
21155         before calling BootstrapCorlib_ResolveDelegate ().
21156
21157 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21158
21159         * statement.cs: fixed build-breaker. All tests passed ok.
21160
21161 2002-06-27  Martin Baulig  <martin@gnome.org>
21162
21163         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
21164         for System.Decimal when compiling corlib.
21165
21166 2002-06-27  Martin Baulig  <martin@gnome.org>
21167
21168         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
21169         switch blocks which contain nothing but a default clause.
21170
21171 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
21172
21173        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21174
21175 2002-06-27  Martin Baulig  <martin@gnome.org>
21176
21177         * ecore.cs (PropertyExpr.PropertyExpr): Call
21178         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21179
21180         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21181         is already a TypeBuilder.
21182
21183 2002-06-27  Martin Baulig  <martin@gnome.org>
21184
21185         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21186         `target_type == TypeManager.array_type', not IsAssignableFrom() in
21187         the "from an array-type to System.Array" case.  This makes it work
21188         when compiling corlib.
21189
21190 2002-06-27  Martin Baulig  <martin@gnome.org>
21191
21192         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21193         non-static PropertyExpr, set its InstanceExpression.  This makes
21194         the `ICollection.Count' property work in System/Array.cs.
21195
21196 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
21197
21198         * driver.cs: Made error handling more consistent.  Errors now
21199         tracked by Report class, so many methods which used to return int
21200         now return void.  Main() now prints success/failure and 
21201         errors/warnings message.
21202
21203         Renamed '--probe' compiler argument to '--expect-error'.  Removed
21204         the magic number return values (123 and 124).  Now, if the
21205         expected error occurs, the compiler exits with success (exit value
21206         0).  If the compilation completes without seeing that particular
21207         error, the compiler exits with failure (exit value 1).  The
21208         makefile in mcs/errors has been changed to handle the new behaviour.
21209
21210         * report.cs: Made 'expected error' number a property and renamed
21211         it from 'Probe' to 'ExpectedError'.
21212
21213         * genericparser.cs: Removed error handling support, since it is
21214         now all done by Report class.
21215
21216         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21217         class, so parse() no longer returns an int.
21218
21219         * namespace.cs: Use Report.Error instead of GenericParser.error
21220
21221 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
21222
21223         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21224         TypeContainer.AddOperator): At the front of the list put the
21225         explicit implementations, so they get resolved/defined first. 
21226
21227 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21230         interface type is implemented by this TypeContainer.  Used during
21231         explicit interface implementation.
21232
21233         (Property.Define, Indexer.Define, Method.Define): Validate that
21234         the given interface in the explicit implementation is one of the
21235         base classes for the containing type.
21236
21237         Also if we are explicitly implementing an interface, but there is
21238         no match in the pending implementation table, report an error.
21239
21240         (Property.Define): Only define the property if we are
21241         not explicitly implementing a property from an interface.  Use the
21242         correct name also for those properties (the same CSC uses,
21243         although that is really not needed).
21244
21245         (Property.Emit): Do not emit attributes for explicitly implemented
21246         properties, as there is no TypeBuilder.
21247
21248         (Indexer.Emit): ditto.
21249
21250         Hiding then means that we do not really *implement* a pending
21251         implementation, which makes code fail.
21252
21253 2002-06-22  Martin Baulig  <martin@gnome.org>
21254
21255         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21256         the return value of Object.GetType().  [FIXME: we need to do this whenever
21257         we get a type back from the reflection library].
21258
21259 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21260
21261         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21262
21263 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
21264
21265         * attribute.cs: Return null if we can not look up the type.
21266
21267         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21268         the interface types found.
21269
21270         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21271         interface types found.
21272
21273         * typemanager.cs (GetInterfaces): Make this routine returns alll
21274         the interfaces and work around the lame differences between
21275         System.Type and System.Reflection.Emit.TypeBuilder in the results
21276         result for GetInterfaces.
21277
21278         (ExpandInterfaces): Given an array of interface types, expand and
21279         eliminate repeated ocurrences of an interface.  This expands in
21280         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21281         be IA, IB, IC.
21282
21283 2002-06-21  Martin Baulig  <martin@gnome.org>
21284
21285         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21286         on System.Enum.
21287
21288 2002-06-21  Martin Baulig  <martin@gnome.org>
21289
21290         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
21291         and called with one of the core types, return the corresponding typebuilder for
21292         that type.
21293
21294         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21295         element type.
21296
21297 2002-06-21  Martin Baulig  <martin@gnome.org>
21298
21299         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21300         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21301         (Expression.ConvertReferenceExplicit): Likewise.
21302
21303         * expression.cs (ElementAccess.DoResolve): Likewise.
21304         (ElementAccess.DoResolveLValue): Likewise.
21305
21306 2002-06-10  Martin Baulig  <martin@gnome.org>
21307
21308         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21309         add the "value" parameter to the parameter list.
21310
21311         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21312         to our caller.
21313
21314 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21317         the argument to an int, uint, long or ulong, per the spec.  Also
21318         catch negative constants in array creation.
21319
21320 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21321
21322         * class.cs: do not allow the same interface to appear twice in
21323         the definition list.
21324
21325 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21326
21327         * ecore.cs: don't use ldlen with System.Array.
21328
21329 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21330
21331         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21332
21333 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21334
21335         * modifiers.cs: produce correct field attributes for protected
21336         internal. Easy fix so miguel can work on ther harder stuff:-)
21337
21338 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
21339
21340         * pending.cs: New file.  Move the code from class.cs here.
21341         Support clearning the pending flag for all methods (when not doing
21342         explicit interface implementation).
21343
21344 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21345
21346         * rootcontext.cs: added a couple more types needed to bootstrap.
21347
21348 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
21349
21350         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21351         constructor in the type, instead of any constructor in the type
21352         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
21353         a bug in the Mono runtime when applying the params attribute). 
21354
21355 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
21356         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21357
21358 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
21359
21360         * expression.cs (Unary.ResolveOperator): Use TypeManager
21361         to resolve the type.
21362
21363 2002-06-13  Ravi Pratap  <ravi@ximian.com>
21364
21365         * cs-parser.jay (enum_member_declaration): Pass in the attributes
21366         attached.
21367
21368         * enum.cs (AddEnumMember): Add support to store the attributes associated 
21369         with each member too.
21370
21371         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21372         field builders too - this takes care of the enum member case.
21373
21374 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
21375
21376         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21377         address-of operator on both value types and pointers.
21378
21379 2002-06-10  Martin Baulig  <martin@gnome.org>
21380
21381         * interface.cs (Interface.PopulateIndexer): Add the indexer's
21382         PropertyBuilder to the `property_builders' list.
21383
21384         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21385         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21386         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
21387         find any indexers which are inherited from an interface.
21388
21389 2002-06-09  Martin Baulig  <martin@gnome.org>
21390
21391         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21392         the same type as the constant if necessary.  There's also a test-130.cs
21393         for this.
21394
21395         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21396
21397         * typemanager.cs (TypeManager.ChangeType): Previously known as
21398         Enum.ChangeEnumType().
21399
21400 2002-06-09  Martin Baulig  <martin@gnome.org>
21401
21402         * expression.cs (Cast.TryReduce): Added support for consts.
21403
21404 2002-06-08  Ravi Pratap  <ravi@ximian.com>
21405
21406         * class.cs (Accessor): Hold attributes information so we can pass
21407         it along.
21408
21409         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21410         Modify to pass in attributes attached to the methods.
21411
21412         (add_accessor_declaration, remove_accessor_declaration): Ditto.
21413
21414         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21415         to handle the Accessor kind :-)
21416
21417         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21418
21419 2002-06-08  Martin Baulig  <martin@gnome.org>
21420
21421         * expression.cs (Unary.TryReduceNegative): Added support for
21422         ULongConstants.
21423
21424 2002-06-08  Martin Baulig  <martin@gnome.org>
21425
21426         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21427         name can't be found in the `defined_names' - the caller will do a
21428         MemberLookup in this case and thus find methods in System.Enum
21429         such as Enum.IsDefined().
21430
21431 2002-06-08  Martin Baulig  <martin@gnome.org>
21432
21433         * enum.cs (Enum.ChangeEnumType): This is a custom version of
21434         Convert.ChangeType() which works with TypeBuilder created types.
21435         (Enum.LookupEnumValue, Enum.Define): Use it here.
21436
21437         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21438         `TypeBuilder.BaseType != null' check.
21439         (TypeContainer.FindMembers): Only lookup parent members if we
21440         actually have a parent.
21441         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21442         (ConstructorInitializer.Resolve): Likewise.
21443
21444         * interface.cs (Interface.FindMembers): Added
21445         `TypeBuilder.BaseType != null' check.
21446
21447         * rootcontext.cs (RootContext.ResolveCore): Added
21448         "System.Runtime.CompilerServices.IndexerNameAttribute" to
21449         classes_second_stage.
21450
21451         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21452         debug_type and trace_type when compiling with --nostdlib.       
21453
21454 2002-06-07  Martin Baulig  <martin@gnome.org>
21455
21456         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21457         (AddField): Set it to true when adding a non-static field.
21458         (DefineType): Use `have_nonstatic_fields' to find out whether we
21459         have non-static fields, not `Fields != null'.
21460
21461 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
21462
21463         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21464         dereferencing a null on the static-field code path)
21465
21466 2002-05-30  Martin Baulig  <martin@gnome.org>
21467
21468         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21469         to take command line arguments.  Use reflection to call the new
21470         custom `Initialize' function on the symbol writer and pass it the
21471         command line arguments.
21472
21473         * driver.cs (--debug-args): New command line argument to pass command
21474         line arguments to the symbol writer.
21475
21476 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * assign.cs (DoResolve): Forgot to do the implicit conversion to
21479         the target type for indexers and properties.  Thanks to Joe for
21480         catching this.
21481
21482 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
21483
21484         * typemanager.cs (MethodFlags): returns the method flags
21485         (Obsolete/ShouldIgnore) that control warning emission and whether
21486         the invocation should be made, or ignored. 
21487
21488         * expression.cs (Invocation.Emit): Remove previous hack, we should
21489         not do this on matching a base type, we should do this based on an attribute
21490
21491         Only emit calls to System.Diagnostics.Debug and
21492         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21493         on the command line.
21494
21495         * rootcontext.cs: Global settings for tracing and debugging.
21496
21497         * cs-tokenizer.cs (define): New utility function to track
21498         defines.   Set the global settings for TRACE and DEBUG if found.
21499
21500 2002-05-25  Ravi Pratap  <ravi@ximian.com>
21501
21502         * interface.cs (Populate*): Pass in the TypeContainer as well as
21503         the DeclSpace as parameters so that we can create EmitContexts and
21504         then use that to apply attributes etc.
21505
21506         (PopulateMethod, PopulateEvent, PopulateProperty)
21507         (PopulateIndexer): Apply attributes everywhere.
21508
21509         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21510         etc.
21511
21512         (ApplyAttributes): Update accordingly.
21513
21514         We now apply interface attributes for all members too.
21515
21516 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21517
21518         * class.cs (Indexer.Define); Correctly check if we are explicit
21519         implementation (instead of checking the Name for a ".", we
21520         directly look up if the InterfaceType was specified).
21521
21522         Delay the creation of the PropertyBuilder.
21523
21524         Only create the PropertyBuilder if we are not an explicit
21525         interface implementation.   This means that explicit interface
21526         implementation members do not participate in regular function
21527         lookups, and hence fixes another major ambiguity problem in
21528         overload resolution (that was the visible effect).
21529
21530         (DefineMethod): Return whether we are doing an interface
21531         implementation. 
21532
21533         * typemanager.cs: Temporary hack until we get attributes in
21534         interfaces (Ravi is working on that) and we get IndexerName
21535         support in interfaces.
21536
21537         * interface.cs: Register the indexers as properties.
21538
21539         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21540         warning, I have verified that this is a bug in the .NET runtime
21541         (JavaScript suffers of the same problem).
21542
21543         * typemanager.cs (MemberLookup): When looking up members for
21544         interfaces, the parent of an interface is the implicit
21545         System.Object (so we succeed in searches of Object methods in an
21546         interface method invocation.  Example:  IEnumerable x;  x.ToString
21547         ()) 
21548
21549 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * class.cs (Event): Events should also register if they do
21552         implement the methods that an interface requires.
21553
21554         * typemanager.cs (MemberLookup); use the new GetInterfaces
21555         method. 
21556
21557         (GetInterfaces): The code used to lookup interfaces for a type is
21558         used in more than one place, factor it here. 
21559
21560         * driver.cs: Track the errors at the bottom of the file, we kept
21561         on going.
21562
21563         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21564         instance if the method we are calling is static!
21565
21566 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21567
21568         * attribute.cs (ApplyAttributes): Make this function filter out
21569         the IndexerName attribute (as that attribute in reality is never
21570         applied) and return the string constant for the IndexerName
21571         attribute. 
21572
21573         * class.cs (TypeContainer.Emit): Validate that all the indexers
21574         have the same IndexerName attribute, and if so, set the
21575         DefaultName attribute on the class. 
21576
21577         * typemanager.cs: The return value might contain other stuff (not
21578         only methods).  For instance, consider a method with an "Item"
21579         property and an Item method.
21580
21581         * class.cs: If there is a problem with the parameter types,
21582         return. 
21583
21584 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21585
21586         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21587         looks at user defined conversion after making a call to 
21588         StandardConversionExists - we need this for overload resolution.
21589
21590         * expression.cs : Update accordingly the various method calls.
21591
21592         This fixes 2 bugs filed against implicit user defined conversions 
21593
21594 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21595
21596         * statement.cs: Track the result of the assignment.
21597
21598 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21599
21600         * expression.cs (MemberAccess): Improved error reporting for
21601         inaccessible members.
21602
21603 2002-05-22  Martin Baulig  <martin@gnome.org>
21604
21605         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21606         itself with debugging support.
21607
21608 2002-05-22  Martin Baulig  <martin@gnome.org>
21609
21610         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21611         Removed, this isn't needed anymore.
21612
21613 2002-05-20  Martin Baulig  <martin@gnome.org>
21614
21615         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21616         be underlying type for an enum.
21617
21618 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21621         that splits out the loading of just the core types.
21622
21623         * rootcontext.cs (ResolveCore): Split the struct resolution in
21624         two, so we can load the enumeration underlying types before any
21625         enums are used.
21626
21627         * expression.cs (Is): Bandaid until we fix properly Switch (see
21628         bug #24985 for details).
21629
21630         * typemanager.cs (ImplementsInterface): The hashtable will contain
21631         a null if there are no interfaces implemented.
21632
21633 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21634
21635         * cs-parser.jay (indexer_declarator): It is fine to have array
21636         parameters
21637
21638 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * typemanager.cs: (RegisterBuilder): New function used to register
21641         TypeBuilders that implement interfaces.  Since
21642         TypeBuilder.GetInterfaces (as usual) does not work with lame
21643         Reflection.Emit. 
21644         (AddUserType): register interfaces.
21645
21646         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21647         dealing with TypeBuilder.  Also, arrays are showing up as
21648         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21649         methods can not be invoked on them!
21650
21651         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21652         (ImplicitReferenceConversionExists): Split out from
21653         StandardConversionExists. 
21654
21655         * expression.cs (As): We were only implementing one of the three
21656         cases for the as operator.  We now implement them all.
21657         (Is): Implement the various other cases for Is as well.
21658
21659         * typemanager.cs (CACHE): New define used to control if we want or
21660         not the FindMembers cache.  Seems to have a negative impact on
21661         performance currently
21662
21663         (MemberLookup): Nested types have full acess to
21664         enclosing type members
21665
21666         Remove code that coped with instance/static returns for events, we
21667         now catch this in RealFindMembers.
21668
21669         (RealFindMembers): only perform static lookup if the instance
21670         lookup did not return a type or an event.  
21671
21672 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21673
21674         * assign.cs (CompoundAssign): We pass more semantic information
21675         now to Compound Assignments than we did before: now we have all
21676         the information at hand, and now we resolve the target *before* we
21677         do the expression expansion, which allows the "CacheValue" method
21678         to have the effect we intended (before, a [x] += 1 would generate
21679         two differen ArrayAccess expressions from the ElementAccess,
21680         during the resolution process).
21681
21682         (CompoundAssign.DoResolve): Resolve target and original_source here.
21683
21684 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21685
21686         * expression.cs (ArrayAccess): dropped debugging information. 
21687
21688         * typemanager.cs: Small bug fix: I was always returning i_members,
21689         instead of one of i_members or s_members (depending on which had
21690         the content).
21691
21692         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21693         method is invoked before any code generation takes place, and it
21694         is a mechanism to inform that the expression will be invoked more
21695         than once, and that the method should use temporary values to
21696         avoid having side effects
21697
21698         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21699
21700         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21701         implementation.
21702
21703         * expression.cs (Indirection, ArrayAccess): Add support for
21704         CacheTemporaries in these two bad boys. 
21705
21706         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21707         ldobj or ldind_ref.  
21708         (StoreFromPtr): Handle stobj as well.
21709
21710         * expression.cs (UnaryMutator): Share more code.
21711
21712         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21713         down: I was not tracking the Filter function as well, which
21714         was affecting the results of the cache.
21715
21716 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21717
21718         * attribute.cs: Remove the hack to handle the CharSet property on
21719         StructLayouts. 
21720
21721 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21722
21723         * attribute.cs (DoResolve): More uglyness, we now only try to
21724         resolve the attribute partially, to extract the CharSet
21725         information (only if we are a StructLayout attribute).  Otherwise 
21726
21727         (GetExtraTypeInfo): Add some code to conditionally kill in the
21728         future this.   I am more and more convinced that the .NET
21729         framework has special code to handle the attribute setting on
21730         certain elements.
21731
21732         * expression.cs (IsParamsMethodApplicable): Revert my previous
21733         foreach change here, it was wrong.
21734
21735 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21736
21737         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21738         (pp_expr): do not abort on unknown input, just return.
21739         (eval): abort if there are pending chars.
21740
21741         * attribute.cs (Attribute.Resolve): Positional parameters are
21742         optional.  Deal with that case.
21743
21744         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21745         the Ansi/Unicode/Auto information for the type.
21746
21747         (TypeContainer.DefineType): instantiate the EmitContext here, as
21748         we will be using it during the type definition (to resolve
21749         attributes) and during the emit phase.
21750
21751         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21752         to pull type information out of the attributes
21753
21754         (Attribute.Resolve): track the constructor builder, and allow for
21755         multiple invocations (structs and classes will use this).
21756
21757         * ecore.cs (MemberLookupFinal): new version with all the
21758         parameters customizable.
21759
21760         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21761         constructors.  Return if the result value is null (as the error
21762         would have been flagged already by MemberLookupFinal)
21763
21764         Do not allow instances of abstract classes or interfaces to be
21765         created.
21766
21767         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21768         We have to compare the assembly property here when dealing with
21769         FamANDAssem and Assembly access modifiers, because we might be
21770         creating an assembly from *modules* (that means that we are not
21771         getting TypeBuilders for types defined in other modules that are
21772         part of this assembly).
21773
21774         (Method.Emit): If the method is marked abstract and has a body,
21775         emit an error. 
21776
21777         (TypeContainer.DefineMembers): If both the defined member and the
21778         parent name match are methods, then do not emit any warnings: let
21779         the Method.Define routine take care of flagging warnings.  But if
21780         there is a mismatch (method overrides something else, or method is
21781         overriwritten by something, then emit warning).
21782
21783         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21784         set to null, this means `do not check for the return type on the
21785         signature'. 
21786
21787         (Method.Define): set the return type for the method signature to
21788         null, so that we get methods with the same name and parameters and
21789         different return types.  This is used to flag warning 114 (you are
21790         hiding a method, and you probably want to use the new/override
21791         keywords instead).
21792
21793         * typemanager.cs (MemberLookup): Implemented proper access
21794         control, closing a long standing set of bug reports.  The problem
21795         was that the Framework only has two bits: Public and NonPublic,
21796         and NonPublic includes private and protected methods, but we need
21797         to enforce the FamANDAssem, FamOrAssem and Family. 
21798
21799 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21800
21801         * statement.cs (GotoCase): Return true: Ammounts to giving up
21802         knowledge on whether we return or not, and letting the other case
21803         be responsible for it.
21804
21805 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21806
21807         * driver.cs: Do not load directories for each file processed, only
21808         do it if there is a pattern.
21809
21810         * ecore.cs: Report readonly assigns here as well, as we might have
21811         been resolved only by MemberAccess.
21812
21813         (SimpleName.SimpleNameResolve): Also be useful for LValue
21814         resolution.   We need this to propagate assign to local readonly variables
21815
21816         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21817         do not want to reuse potential criteria memory.
21818
21819         * class.cs (MyEventBuilder): Set reflected_type;
21820
21821         * ecore.cs (Constantify): Added support for constifying bools.
21822
21823         (RootContext.LookupType): Added a cache for values looked up in
21824         the declaration space.
21825
21826         * typemanager.cs (FindMembers): Now is a front-end to
21827         RealFindMembers, and provides a two-level hashtable-based cache to
21828         the request.  
21829
21830         15% performance improvement: from 22.5 to 19.2 seconds.
21831
21832         * expression.cs (IsParamsMethodApplicable): use foreach.
21833         (Invocation.DoResolve): ditto.
21834         (New.DoResolve): ditto.
21835         (ArrayCreation.DoResolve): ditto.
21836
21837         * ecore.cs (FindMostEncompassingType): use foreach.
21838
21839         * delegate.cs (NewDelegate.DoResolve): Use foreach
21840
21841         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21842         (RemoveMethods): use foreach.
21843
21844         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21845         nested foreach statements instead of for, and also break out of
21846         the inner loop once a match is found.
21847
21848         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21849
21850 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21853         we actually unwrap the expression to allow for extra information
21854         to be extracted. 
21855
21856         * expression.cs: Use Shr_Un on unsigned operations. 
21857
21858 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21859
21860         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21861         applicable operators was not being considered correctly. This closes
21862         the bug Miguel reported.
21863
21864 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21865
21866         * attribute.cs: check that the type derives from System.Attribute
21867         and report the correct error in that case (moved the duplicate code to
21868         its own method, too).
21869
21870 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21871
21872         * attribute.cs: lookup attribute type name as the spec says: first the
21873         bare attribute name and then name + "Attribute" (nant compiles with
21874         mcs after this fix).
21875
21876 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21877
21878         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21879         Because of the way we parse things, we should try to see if a
21880         UIntConstant can fit in an integer.
21881
21882 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21883
21884         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21885         when we are in an explicit context.
21886
21887         (ConvertReferenceExplicit): When converting from Iface type S to Class
21888         T make sure the rules are implemented as an OR.
21889
21890         * parameter.cs (ParameterType): Make it a property for now although the
21891         purpose really isn't anything immediate.
21892
21893         * expression.cs (Is*Applicable): Do better checking on the parameter type
21894         of a ref/out parameter. The ones from the system assemblies are already 
21895         marked with the correct type so we don't need to do any correction.
21896
21897         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21898         the object type is standard too so include that.
21899
21900 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21901
21902         * ecore.cs (StandardConversionExists): Augment with missing code:
21903         deal with IntConstant, LongConstants and Enumerations.
21904
21905         * assign.cs: Report the error, instead of failing silently
21906
21907         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21908         typecontainer that they are declared, because the
21909         typecontainer/namespace will have the list of using clauses that
21910         need to be applied.
21911
21912         Assembly Attributes were escaping the normal registration
21913         mechanism. 
21914
21915         (EmitCode): Apply attributes within an EmitContext that represents
21916         the container they were declared on.
21917
21918         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21919
21920 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21921
21922         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21923         Revamp completely - make much cleaner as we now operate only
21924         on a set of Types.
21925
21926         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21927         to implement the logic detailed in the spec more correctly.
21928
21929         (UserDefinedConversion): Update accordingly.
21930
21931 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21932
21933         * statement.cs: Return flow analysis information up.
21934
21935         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21936         and the default.
21937
21938         (token): Do not consume an extra character before calling
21939         decimal_digits.
21940
21941 2002-05-06  Piers Haken <piersh@friskit.com>
21942
21943         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21944
21945 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21946
21947         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21948         EmitContext during the instance constructor initializer
21949         resolution, to stop access to instance variables.
21950
21951         This is mandated by the spec, last paragraph of the `constructor
21952         initializers' section. 
21953
21954 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * cs-parser.jay, class.cs (Accessor): new class used to represent
21957         an accessor (get or set).  In the past we used `null' to represent
21958         a missing accessor.  But this is ambiguous because there was no
21959         way to tell in abstract indexers/properties if one of them was
21960         specified.
21961
21962         Now there is a way of addressing that.
21963
21964         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21965         instead of FindMembers.
21966
21967         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21968         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21969
21970         * attribute.cs: Treat indexers and properties as the same in terms
21971         of applying attributes
21972
21973         * ecore.cs (FindMostEncompassedType): Use statically initialized
21974         EmptyExpressions()s like we do elsewhere to avoid creating useless
21975         objects (and we take this out of the tight loop).
21976
21977         (GetConversionOperators): Move the code to extract the actual
21978         operators to a separate routine to clean things up.
21979
21980 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21981
21982         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21983         events are always registered FieldBuilders.
21984
21985         * class.cs (FieldBase): New class shared by Fields 
21986
21987         * delegate.cs: If we are a toplevel delegate, use our full name.
21988         If we are a nested delegate, then only use our tail name.
21989
21990 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21991
21992         * expression.cs (IsApplicable): Ensure that we add the "&" to
21993         ref/out types before comparing it with the type of the argument.
21994
21995         (IsParamsMethodApplicable): Ditto.
21996
21997         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21998         silly me ;-)
21999
22000         * delegate.cs : Handle the case when we have more than one applicable
22001         method. Flag an error only when we finish checking all.
22002
22003 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
22004
22005         * expression.cs: Add support for boolean static initializers.
22006
22007 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
22008
22009         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
22010
22011         * parameter.cs (ComputeParameterTypes,
22012         ComputeAndDefineParameterTypes): Better error handling: now we
22013         clear the `types' cache if we fail during any of the type lookups.
22014         We also return the status code correctly to our caller
22015
22016         * delegate.cs: If we fail to define a delegate, abort the extra
22017         steps. 
22018
22019         * expression.cs (Binary.ResolveOperator): for
22020         operator==(object,object) and operator !=(object, object) we also
22021         have to verify that there is an implicit conversion from one to
22022         the other.
22023
22024         (ArrayAccess.DoResolve): Array Access can operate on
22025         non-variables. 
22026
22027 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * assign.cs (CompoundAssign): A new class used as a "flag" that
22030         the assignment actually is happening as part of a compound
22031         assignment operator.
22032
22033         During compound assignment, a few new rules exist to enable things
22034         like:
22035
22036         byte b |= 1 + 2
22037
22038         From the spec:
22039
22040         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
22041         to the type of x) if y is implicitly convertible to the type of x,
22042         and the operator is a builtin operator and the return type of the
22043         operator is explicitly convertible to the type of x. 
22044
22045         * rootcontext.cs: Reset warning level to 2.  4 catches various
22046         "interesting" features in mcs, we must clean this up at some
22047         point, but currently am trying to kill other bugs ;-)
22048
22049         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
22050         in container classes as well.  
22051
22052         * expression.cs (Binary.ResolveOperator): Handle string case
22053         before anything else (as operator overloading does emit an error
22054         before doing anything else).
22055
22056         This code could go away when we move to a table driven model, but
22057         i could not come up with a good plan last night.
22058
22059 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
22060
22061         * typemanager.cs (CSharpName): reimplementation using regex.
22062         * class.cs: added null check for fields in Emit
22063         * rootcontext.cs: set warninglevel to 4
22064
22065 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
22066
22067         * typemanager.cs (CSharpName): reimplemented with Lupus
22068         suggestion.
22069
22070 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
22071
22072         * statement.cs (If): correclty implement Resolve, because we were
22073         not catching sem errors in there.  The same process is needed
22074         everywhere else. 
22075         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
22076
22077
22078         (Statement.Warning_DeadCodeFound): Factorize code.
22079         (While): Report dead code here too.
22080
22081         (Statement): Added Resolve virtual method to allow
22082         for resolution split from the emit code.
22083
22084 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
22085
22086         * statement.cs (EmitBoolExpression): No longer try to resolve the
22087         expression here.    
22088         (MakeBoolean): New utility function that resolve, implicitly
22089         converts to boolean and tags the expression. 
22090
22091
22092         (If, Do): Implement dead code elimination.
22093         (While): Implement loop inversion
22094
22095         (Do, While, For, If): Resolve the expression prior to calling our
22096         code generation.
22097
22098 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
22099
22100         * class.cs:
22101           - added method Report28 (warning: program has more than one entry point)
22102           - added method IsEntryPoint, implements paragraph 10.1 of the spec
22103           - modified method Method.Define, the part at the end of the method
22104
22105         * rootcontext.cs: added static public Location EntryPointLocation;
22106           
22107         * ../errors/cs0028.cs : Add test case for the above warning.              
22108
22109         * typemanager.cs:
22110           - modified method CSharpName to allow arrays of primitive type to
22111             be printed nicely (e.g. instead of System.Int32[][] it now prints
22112             int[][])
22113           - added method CSharpSignature: returns the signature of a method
22114             in string format to be used in reporting errors, warnings, etc.
22115
22116         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
22117         with String.Empty.
22118
22119 2002-04-26  Ravi Pratap  <ravi@ximian.com>
22120
22121         * delegate.cs (Define): Fix extremely silly bug where I was
22122         setting the type of the 'object' parameter of the BeginInvoke
22123         method to System.IAsyncResult instead of System.Object ;-)
22124
22125 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
22126
22127         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
22128         here. 
22129
22130         (Constructor.Emit): return if we fail to initialize the
22131         constructor.  Another door closed!  
22132
22133         * expression.cs (New.DoResolve): Improve error message (from -6 to
22134         1501).  Use DeclaredOnly lookup to find the exact constructor.
22135
22136         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
22137         loop.  This is useful.
22138
22139         * cs-parser.jay: Adjust the default parameters so that destructors
22140         have the proper signature.
22141
22142 2002-04-26  Martin Baulig  <martin@gnome.org>
22143
22144         * driver.cs (LoadAssembly): If `assembly' contains any characters
22145         which are only valid in path names and not in assembly names
22146         (currently slash, backslash and point), use Assembly.LoadFrom ()
22147         instead of Assembly.Load () on the `assembly' (before iteration
22148         over the link_paths).
22149
22150 2002-04-26  Martin Baulig  <martin@gnome.org>
22151
22152         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
22153
22154 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
22155
22156         * class.cs (Property): use the new typemanager.MemberLookup
22157
22158         (TypeContainer.MemberLookup): Implement using the
22159         TypeManager.MemberLookup now. 
22160
22161         * typemanager.cs: Make MemberLookup a function of the TypeManager,
22162         and return MemberInfos, so that these can be used without an
22163         EmitContext (what we had before).
22164
22165 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * expression.cs: Fix the case where the argument to params if the
22168         type of the params.  I omitted handling this before.   Fixed
22169
22170 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22171
22172         * driver.cs: Call BootCorlib_PopulateCoreType
22173
22174         * class.cs (Property.CheckBase): Check for properties only, not
22175         for all members. 
22176
22177         * interface.cs: Temporary hack: try/catch around the
22178         CustomAttributeBuilder, because I am getting an exception that I
22179         do not understand.
22180
22181         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22182         types whose definitions are required to be there (attributes are
22183         defined before standard types).
22184
22185         Compute definitions as we boot the various types, as they are used
22186         immediately (value_type class will need object_type, but if we do
22187         not initialize object_type, we will pass a null, which will let
22188         the runtime pick the System.Object from the existing corlib, which
22189         is not what we want).
22190
22191 2002-04-22  Patrik Torstensson <totte@labs2.com>
22192
22193         * cs-tokenizer.cs: fixed a number of trim() issues.
22194
22195 2002-04-22  Ravi Pratap  <ravi@ximian.com>
22196
22197         * expression.cs (Argument.Type): Ensure that we return the correct
22198         type when we have out or ref parameters [in which case we 
22199         append a "&"].
22200
22201 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22202
22203         * class.cs (Property, Indexer): Allow extern modifier in there. 
22204
22205         * typemanager.cs (InitBaseTypes): Initializes object_type and
22206         value_type, since those will be used early on during the bootstrap
22207         process to compile corlib.
22208
22209         (InitCoreTypes): Move code from here to InitBaseTypes.
22210
22211 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
22212
22213         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22214         single-dimension arrays as using the ldlen opcode.  
22215
22216         Daniel Lewis discovered this optimization.  
22217
22218         * typemanager.cs: Add signature for System.Array::get_Length
22219
22220 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22221
22222         * statement.cs: report the error when the foreach does not apply to an
22223         array nor a collection.
22224
22225 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
22226
22227         * expression.cs: Add implicit conversions to the operator ~.
22228
22229         * constant.cs (DecimalConstant.Emit): Emit decimal value.
22230
22231         * typemanager.cs: Locate the decimal constructor.
22232
22233 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22234
22235         * attribute.cs: use the new property of TypeOf.
22236         * expression.cs: added 'get' property around typearg.
22237
22238         These changes fix a build breaker reported by NickD. Is this the
22239         correct way to fix?  If not, please, revert my changes and make it
22240         work :-).
22241
22242 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
22243
22244         * attribute.cs: Add support for typeof in attribute invocations.
22245         I am not sure that this is right though.
22246
22247 2002-04-14  Duncan Mak  <duncan@ximian.com>
22248
22249         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22250         Binary.Operator.Division case.
22251
22252 2002-04-13  Ravi Pratap  <ravi@ximian.com>
22253
22254         * class.cs (DefineType): Ensure that we do a proper check on
22255         attribute types and also register it with the TypeManager.
22256
22257         (TypeContainer.Targets): The default for attribute types is
22258         AttributeTargets.All.
22259
22260         * attribute.cs (ApplyAttributes): Registering the attribute type
22261         is done elsewhere, not when we discover we have a Usage attribute.
22262
22263 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22264
22265         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22266         and get rid of is_delegate parameter.
22267
22268         * everywhere : update.
22269
22270 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22271
22272         * cs-parser.jay (compilation_unit): Revamp completely to use
22273         some new ideas that I got from Rhys' grammar to solve the problems
22274         with assembly level attributes.
22275
22276         (outer_declaration): New grammar production.
22277
22278         (attribute_sections): Add.
22279
22280         (opt_attributes): Base on attribute_sections
22281
22282         (namespace_declaration): Allow opt_attributes to tackle the case
22283         when we have assembly level attributes - we are clever in this
22284         regard now ;-)
22285
22286         * attribute.cs (ApplyAttributes): Do not worry about assembly 
22287         attributes in the non-global context.
22288
22289         * rootcontext.cs (AddGlobalAttributes): Go back to using this
22290         instead of SetGlobalAttributes.
22291
22292         * class.cs, rootcontext.cs : Ensure we define and generate 
22293         attribute types before anything else.
22294
22295         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22296         and flag the new error -20 for the case when the attribute type
22297         does not have valid targets specified. csc does not catch this.
22298
22299         * ../errors/errors.txt : update for error # -20
22300
22301 2002-04-11  Ravi Pratap  <ravi@ximian.com>
22302
22303         * support.cs (InternalParameters.ParameterModifier): Do some null
22304         checking and return sane values.
22305
22306         * class.cs (Method.Define): If we are a PInvoke method, ensure
22307         that we are static and extern. Report error # 601
22308
22309         * ../errors/cs0601.cs : Add test case for the above error.
22310
22311 2002-04-07  Ravi Pratap  <ravi@ximian.com>
22312
22313         * rootcontext.cs (attribute_types): We need to keep type of
22314         all attribute types separately and emit code for them first.
22315
22316         (RegisterAttribute) : Implement.
22317
22318         * class.cs (DefineType): Check if the current Type is a custom
22319         attribute type and register it accordingly.
22320
22321         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22322         adding the first attribute twice and rename to
22323
22324         (SetGlobalAttributes): this.
22325
22326         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22327         lookups.
22328
22329         * attribute.cs (ApplyAttributes): Take an additional argument telling us
22330         if we are processing global arguments. Hmm, I am unsure of this.
22331
22332 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22333
22334         * expression.cs: added static array of strings to avoid calling
22335         Enum.ToString () for Operator in Binary. Significant recover of
22336         performance.
22337
22338 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
22339
22340         * class.cs (FindMembers): Allow the Builders of the various
22341         members to be null.  If they are skip them.  This only happens
22342         during the PInvoke declaration.
22343
22344 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
22345
22346         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22347         failure, so we do not keep going afterwards.
22348
22349         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22350         wanted to pass `false' as the `is_delegate' argument.  If this is
22351         the case, why not use delegate_type == null to mean `is_delegate =
22352         false' and anything else as is_delegate = true.
22353
22354 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
22355
22356         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22357         code for the section, not the beginning of the tests.
22358
22359 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * cfold.cs: Handle operator + (Enum x, Underlying x) 
22362
22363         * expression.cs (Binary): same.  Warn about errors where we have
22364         Enum/Enum in operator + as well.
22365
22366 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
22367
22368         * statement.cs:
22369                 - added support for switch(bool)
22370                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22371                 - add TableSwitchEmit() to handle table-based switch statements
22372
22373 2002-04-05  Ravi Pratap  <ravi@ximian.com>
22374
22375         * expression.cs (Invocation.OverloadResolve): Factor out code which
22376         does parameter compatibility checking with arguments so that we can 
22377         re-use the code even from Delegate.VerifyApplicability
22378
22379         (VerifyArgumentsCompat): Move above code here.
22380
22381         * delegate.cs (VerifyApplicability): Get rid of duplicate code
22382         and instead make a call to the above method.
22383
22384 2002-03-31  Ravi Pratap  <ravi@ximian.com>
22385
22386         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22387         We use it to keep track of classes which are attribute types.
22388
22389 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
22390
22391         * delegate.cs (Delegate.Define): Correctly define the types in the
22392         presence of fixed and array parameters.
22393
22394         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22395         doing FindMembers.
22396
22397         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22398         include NonPublic after the first iteration.
22399
22400         * class.cs (Indexer.CheckBase): Only check if both parents are
22401         non-null. 
22402
22403         * cs-parser.jay (accessor_body): If empty, set to null.
22404
22405         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22406         same code path here to resolve constants names that we did have in
22407         MemberAccess.DoResolve.  There is too much code duplicated here.
22408
22409 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
22410
22411         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22412
22413         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22414         to MakeUnionSet.
22415
22416         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22417         tokens, numbers and strings.
22418
22419         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22420         parenthesis.
22421
22422         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22423         asyncronous parameters and the regular parameters.  
22424
22425         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22426         specify the target directory.
22427
22428         * expression.cs: (This.DoResolve): Simplify
22429         (As.Emit): Optimize, do not generate IsInst if the expression is
22430         always of the given type.
22431
22432         (Is.DoResolve): Bug fix, we were reporting both always/never for
22433         the is expression.
22434
22435         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22436         creating too many unnecessary arrays.
22437
22438 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
22439
22440         * class.cs (EmitFieldInitializer): Use Assign expression to assign
22441         fields instead of rolling our own initializer.   Takes care of all
22442         implicit conversions, and drops unnecessary static checks/argument.
22443
22444 2002-03-31  Dick Porter  <dick@ximian.com>
22445
22446         * driver.cs: use the GetDirectories() return values properly, and
22447         use "/" as path separator.
22448
22449 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * expression.cs (Unary): Optimize - - expr into expr.
22452         (Binary): Optimize a + (-b) into a -b.
22453
22454         * codegen.cs (CodeGen): Made all methods static.
22455
22456 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
22457
22458         * rootcontext.cs: 
22459
22460         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22461         TypeBuilder property.
22462
22463         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22464         instead. 
22465
22466         * tree.cs: Removed the various RecordXXXX, and replaced with a
22467         single RecordDecl.  Removed all the accessor methods, and just
22468         left a single access point Type 
22469
22470         * enum.cs: Rename DefineEnum to DefineType.
22471
22472         * decl.cs: New abstract method `DefineType' used to unify the
22473         Defines for Enumerations, Interfaces, TypeContainers and
22474         Delegates.
22475
22476         (FindType): Moved LookupInterfaceOrClass here.  Moved the
22477         LookupBaseClasses method that used to live in class.cs and
22478         interface.cs here, and renamed to FindType.
22479
22480         * delegate.cs: Implement DefineType.  Take advantage of the
22481         refactored pattern for locating the parent builder without taking
22482         the parent_builder argument (which we know does not work if we are
22483         nested, and triggering a toplevel definition).
22484
22485 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22486
22487         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22488         accessibility of a member has changed during override and report
22489         an error if so.
22490
22491         * class.cs (Method.Define, Property.Define): Only complain on
22492         overrides if the method is private, any other accessibility is
22493         fine (and since we just checked the permission is the same, we are
22494         good to go).
22495
22496         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22497         and elif are processed always.  The other pre-processing
22498         directives are only processed if we are "taking" the path
22499
22500 2002-03-29  Martin Baulig  <martin@gnome.org>
22501
22502         * class.cs (Method.Emit): Only emit symbolic debugging info if the
22503         current location is not Null.
22504
22505         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22506         a separate method so we can profile it.
22507
22508         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22509         `span.Seconds' are just seconds, but no minutes or hours.
22510         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22511
22512 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22513
22514         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22515         Remove the gratuitous set of Final:
22516
22517                                 // If an interface implementation, then we can set Final.
22518                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22519                                     implementing.DeclaringType.IsInterface)
22520                                         flags |= MethodAttributes.Final;
22521
22522         I do not know what I was smoking when I used that.
22523
22524
22525         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22526         step into fixing the name resolution issues for delegates and
22527         unifying the toplevel name resolution.
22528
22529 2002-03-28  Martin Baulig  <martin@gnome.org>
22530
22531         * class.cs (Method.Emit): If we have a symbol writer, call its
22532         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22533         tell it about the current method.
22534
22535         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22536         writer that we're going to emit the first byte of IL code for a new
22537         statement (a new source line).
22538         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22539         EmitContext.Mark() before emitting any code.
22540
22541         * location.cs (SymbolDocument): Return null when we're Null.
22542
22543         * statement.cs (Statement): Moved the `Location loc' variable here.
22544         (Statement.EmitBoolExpression): If we have a symbol writer, call
22545         ec.Mark() before emitting any code to tell it that we're at the
22546         beginning of a new statement.
22547         (StatementExpression): Added `Location' argument to the constructor.
22548         (Block): Added public readonly variable `StartLocation' and public
22549         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22550         (Block): Added constructor which takes a start and end location.
22551         (Block.SetEndLocation): New method. This sets the end location.
22552         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22553         local variables we create.
22554         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22555         each statement and do also mark the begin and end of the block.
22556
22557         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22558         tell it the current lexer.Location, use Location.Null for the end of the
22559         block.
22560         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22561         current block, set its end location using SetEndLocation().
22562         (statement_expression): StatementExpression constructor now takes the
22563         lexer.Location as additional argument.
22564         (for_statement, declare_local_variables): Likewise.
22565         (declare_local_variables): When creating a new implicit block, use the
22566         new Block constructor and pass it the lexer.Location.
22567
22568 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22569
22570         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22571         members also on the parent interfaces recursively.
22572
22573 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * report.cs: Use new formats, since Gonzalo finished the missing
22576         bits. 
22577
22578         * expression.cs (Binary.ResolveOperator): added missing operator|
22579         operator& and operator^ for bool/bool.
22580
22581         * cs-parser.jay: CheckDef now takes a Location argument that is
22582         used to report errors more precisly (instead of reporting the end
22583         of a definition, we try to track something which is a lot closer
22584         to the source of the problem).
22585
22586         * cs-tokenizer.cs: Track global token use, so we can properly flag
22587         the use of #define/#undef after the first token has been seen.
22588
22589         Also, rename the reportXXXX to Error_DescriptiveName
22590
22591         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22592         TypeContainer, so that Enum and Interface can use this too.
22593
22594         * class.cs (TypeContainer.LookupInterfaceOrClass,
22595         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22596         `builder' argument.  Typically this was used to pass the parent
22597         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22598         the definition).  
22599
22600         The problem is that a nested class could trigger the definition of
22601         a toplevel class, and the builder would be obviously wrong in that
22602         case. 
22603
22604         So we drop this argument, and we compute dynamically the
22605         TypeBuilder/ModuleBuilder (the correct information was available
22606         to us anyways from DeclSpace.Parent)
22607
22608         * interface.cs (Interface.DefineInterface): Drop builder
22609         parameter cleanup like class.cs
22610
22611         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22612         like class.cs
22613
22614         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22615         values. 
22616
22617         (Try.Emit): Propagate the returns value from the statement.
22618
22619         (Return.Emit): Even if we are leavning 
22620
22621         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22622
22623         * modifiers.cs: Fix the computation of MethodAttributes flags.
22624
22625 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22626
22627         * driver.cs: allow compilation of files that start with '/'.
22628         Add a default case when checking the argument of --target.
22629
22630 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22631
22632         * interface.cs: Implement the same search algorithm for types in
22633         the interface code.
22634
22635         * delegate.cs: Do not allow multiple definition.
22636
22637         * Recovered ChangeLog that got accidentally amputated
22638
22639         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22640
22641         * rootcontext.cs: Load manually enum to allow core classes to
22642         contain enumerations.
22643
22644         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22645         Update to new static methods in TypeManager.
22646
22647         * typemanager.cs (GetMethod, GetConstructor): Use our
22648         implementation of FindMembers to find the members, since during
22649         corlib compilation, the types are TypeBuilders and GetMethod and
22650         GetConstructor do not work.
22651
22652         Make all methods in TypeManager static.
22653
22654         (InitCodeHelpers): Split the functionality from
22655         the InitCodeTypes function.
22656
22657         * driver.cs: Call InitCodeHelpers after we have populated the
22658         types. 
22659
22660         * cs-parser.jay (delegate_declaration): we did not used to compute
22661         the delegate name correctly for void delegates.
22662
22663 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22664
22665         * rootcontext.cs (RootContext): Init the interface_resolve_order
22666         and type_container_resolve_order always.
22667
22668         (ResolveCore, BootstrapCorlib_ResolveClass,
22669         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22670         compiler when compiling with --nostdlib
22671
22672         * class.cs (TypeContainer.DefineType): Check that our parent is
22673         not null.  This test is most important when we are bootstraping
22674         the core types.
22675
22676         * codegen.cs: Split out the symbol writing code.
22677
22678 2002-03-25  Martin Baulig  <martin@gnome.org>
22679
22680         * driver.cs (-g): Made -g an alias for --debug.
22681
22682 2002-03-24  Martin Baulig  <martin@gnome.org>
22683
22684         * codegen.cs (SymbolWriter): New public variable. Returns the
22685         current symbol writer.
22686         (CodeGen): Added `bool want_debugging_support' argument to the
22687          constructor. If true, tell the ModuleBuild that we want debugging
22688         support and ask it for the ISymbolWriter.
22689         (Save): If we have a symbol writer, call it's Close() method after
22690         saving the assembly.
22691
22692         * driver.c (--debug): New command line argument to create a
22693         debugger information file.
22694
22695         * location.cs (SymbolDocument): New public property. Returns an
22696         ISymbolDocumentWriter object for the current source file or null
22697         if we don't have a symbol writer.
22698
22699 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22700
22701         * driver.cs (LoadAssembly): Correctly return when all the paths
22702         have been tried and not before.
22703
22704         * statement.cs (Switch.Emit): return the actual coverage for this
22705         statement (returns/not-returns)
22706
22707         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22708         switch of the statement if we are the last switch section.  That
22709         kills two problems: try/catch problems (we used to emit an empty
22710         nop at the end) and switch statements where all branches would
22711         return. 
22712
22713 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22714
22715         * driver.cs: Add default assemblies (the equivalent to the
22716         Microsoft CSC.RSP file)
22717
22718         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22719         also update tokens_seen and set it to false.
22720
22721         * driver.cs: Implement --recurse for Mike.
22722
22723         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22724         correctly splitting out the paths.
22725
22726 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22727
22728         * interface.cs (Interface.PopulateProperty): Instead of using
22729         `parent' as the declaration space for the set parameters, use
22730         `this' 
22731
22732         * support.cs (InternalParameters): InternalParameters constructor
22733         takes a DeclSpace instead of a TypeContainer.
22734
22735         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22736         types are being initialized, load the address of it before calling
22737         the function.  
22738
22739         (New): Provide a mechanism to disable the generation of local
22740         value type temporaries when the caller will be providing us with
22741         an address to store it.
22742
22743         (ArrayCreation.EmitDynamicInitializers): Use it.
22744
22745 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22746
22747         * expression.cs (Invocation.EmitArguments): Only probe for array
22748         property if there is more than one argument.  Sorry about that.
22749
22750         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22751         empty param arrays.
22752
22753         * class.cs (Method.LabelParameters): Fix incorrect code path that
22754         prevented the `ParamArrayAttribute' from being applied to the
22755         params attribute.
22756
22757 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22758
22759         * support.cs (ReflectionParameters): Correctly compute whether the
22760         last argument is a params array.  Fixes the problem with
22761         string.Split ('a')
22762
22763         * typemanager.cs: Make the assemblies array always be non-null
22764         (empty, but non-null)
22765
22766         * tree.cs (RecordDecl): New function that abstracts the recording
22767         of names.  This reports error 101, and provides a pointer to the
22768         previous declaration.  Fixes a crash in the compiler.
22769
22770         * cs-parser.jay (constructor_declaration): Update to new grammar,
22771         and provide a constructor_body that can be empty.
22772
22773 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22774
22775         * driver.cs: Add support for --resources.
22776
22777         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22778         Make all types for the various array helper methods be integer.
22779
22780         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22781         CheckState to ConvCast.
22782
22783         (ConvCast): Now it takes a `checked' state argument, to avoid
22784         depending on the emit context for the conversion, and just using
22785         the resolve time setting.
22786
22787         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22788         instead of Invocation.EmitArguments.  We do not emit the original
22789         arguments, instead we emit those which have been converted to
22790         unsigned int expressions.
22791
22792         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22793
22794         * codegen.cs: ditto.
22795
22796         * expression.cs (LocalVariableReference): Drop the use of the
22797         Store function that depended on the variable index.
22798
22799         * statement.cs (VariableInfo): Drop the `Idx' property from this
22800         class, as this is not taking into account the indexes for
22801         temporaries tat we generate during the execution, getting the
22802         indexes wrong.
22803
22804         * class.cs: First emit class initializers, then call the parent
22805         constructor. 
22806
22807         * expression.cs (Binary): Fix opcode emision.
22808         (UnaryMutator.EmitCode): Support checked code generation
22809
22810         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22811         matches for events for both the Static and Instance scans,
22812         pointing to the same element.   Fix that.
22813
22814 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22815
22816         * rootcontext.cs (ResolveTree): Always set the
22817         interface_resolve_order, because nested interfaces will be calling
22818         into us.
22819
22820         * class.cs (GetInterfaceOrClass): Track the same resolution
22821         process used by TypeManager.LookupType.  This fixes the nested
22822         type lookups in class declarations (separate path from
22823         LookupType). 
22824
22825         (TypeContainer.DefineType): Also define nested interfaces.
22826         (TypeContainer.RegisterOrder): New public function used to
22827         register the order in which child interfaces need to be closed.
22828
22829         Nested interfaces need to be closed after their parents have been
22830         created. 
22831
22832         * interface.cs (InterfaceAttr): Put all the logic for computing
22833         the interface attribute here. 
22834
22835         (DefineInterface): Register our interface order with the
22836         RootContext or with the TypeContainer depending on the case.
22837
22838 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * cs-parser.jay: rework foreach statement to work with the new
22841         changes to the policy on SimpleNames.
22842
22843         * report.cs: support Stacktrace on warnings as well.
22844
22845         * makefile: drop --unsafe and /unsafe from the compile.
22846
22847 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22848
22849         * ecore.cs (StandardConversionExists): Modify to take an Expression
22850         as the first parameter. Ensure we do null -> reference type conversion
22851         checking.
22852
22853         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22854         temporary Expression objects.
22855
22856 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22857
22858         * interface.cs: workaround bug in method overloading resolution
22859         (there is already a bugzilla bug for it).
22860
22861 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22862
22863         We could also solve this problem by having a separate path for
22864         performing type lookups, instead of DoResolve, we could have a
22865         ResolveType entry point, and only participating pieces of the
22866         production (simplename, deref, array) would implement this. 
22867
22868         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22869         signal SimpleName to only resolve type names and not attempt to
22870         resolve anything else.
22871
22872         * expression.cs (Cast): Set the flag.
22873
22874         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22875
22876         * class.cs: Only report 108 if there is no `new' modifier.
22877
22878         * cs-parser.jay: rework foreach statement to work with the new
22879         changes to the policy on SimpleNames.
22880
22881         * report.cs: support Stacktrace on warnings as well.
22882
22883         * makefile: drop --unsafe and /unsafe from the compile.
22884
22885 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22886
22887         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22888         lookups here, instead of doing that at parse time.  This means
22889         that our grammar will not introduce `LocalVariableReferences' as
22890         expressions at this point.  That solves the problem of code like
22891         this:
22892
22893         class X {
22894            static void Main ()
22895            { int X = 1;
22896             { X x = null }}}
22897
22898         This is only half the fix.  The full fix requires parameters to
22899         also be handled in this way.
22900
22901         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22902         makes the use more obvious of the DeclSpace.  The
22903         ec.TypeContainer.TypeBuilder is now only used to pull the
22904         TypeBuilder for it.
22905
22906         My theory is that I can get rid of the TypeBuilder completely from
22907         the EmitContext, and have typecasts where it is used (from
22908         DeclSpace to where it matters).  
22909
22910         The only pending problem is that the code that implements Aliases
22911         is on TypeContainer, and probably should go in DeclSpace.
22912
22913         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22914         lookups here, instead of doing that at parse time.  This means
22915         that our grammar will not introduce `LocalVariableReferences' as
22916         expressions at this point.  That solves the problem of code like
22917         this:
22918
22919         class X {
22920            static void Main ()
22921            { int X = 1;
22922             { X x = null }}}
22923
22924         This is only half the fix.  The full fix requires parameters to
22925         also be handled in this way.
22926
22927         * class.cs (Property.DefineMethod): When implementing an interface
22928         method, set newslot, when implementing an abstract method, do not
22929         set the flag (before we tried never setting it, or always setting
22930         it, which is the difference).
22931         (Indexer.DefineMethod): same.
22932         (Method.DefineMethod): same.
22933
22934         * ecore.cs: Only set the status used flag if we get back a Field.
22935
22936         * attribute.cs: Temporary hack, so Paolo can keep working.
22937
22938 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22939
22940         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22941         the unmanaged type in the case we have a MarshalAs attribute.
22942
22943         (Resolve): Handle the case when we are parsing the special MarshalAs
22944         attribute [we need to store the unmanaged type to use later]
22945
22946         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22947         MarshalAs Attribute.
22948
22949         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22950         on parameters and accordingly set the marshalling info.
22951
22952 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * class.cs: Optimizing slightly by removing redundant code after
22955         we switched to the `NoTypes' return value.
22956         (Property.DefineMethod): use NoTypes here too.
22957
22958         This fixes the bug I introduced in my last batch of changes.
22959
22960 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22961
22962         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22963
22964         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22965         Enums since those are types too. 
22966
22967         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22968
22969         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22970         thanks to a call during the lookup process.
22971
22972 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22973
22974         * statement.cs (Foreach): Lots of work to accomodate a particular
22975         kind of foreach statement that I had not kept in mind.  It is
22976         possible to have foreachs on classes that provide a GetEnumerator
22977         method that return objects that implement the "pattern" for using
22978         a foreach, there is no need to support GetEnumerator
22979         specifically. 
22980
22981         This is needed to compile nant.
22982
22983         * decl.cs: Only report 114 if the member is not `Finalize' and if
22984         the warning level is at least 2.
22985
22986         * class.cs: Moved the compare function from Method to
22987         MethodSignature. 
22988
22989         (MethodSignature.InheritableMemberSignatureCompare): Add new
22990         filter function that is used to extract inheritable methods from a
22991         class. 
22992
22993         (Method.Define): Use the new `inheritable_method_signature_filter'
22994         delegate
22995
22996         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22997         command. 
22998
22999 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
23000
23001         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
23002
23003         * cs-parser.jay: Add opt_semicolon to the interface declaration.
23004
23005         * expression.cs: Pass location information to
23006         ConvertImplicitStandard. 
23007
23008         * class.cs: Added debugging code to track return values from
23009         interfaces. 
23010
23011 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
23012
23013         * expression.cs (Is.DoResolve): If either side of the `is' is an
23014         interface, do not flag the warning.
23015
23016         * ecore.cs (ImplicitReferenceConversion): We need a separate test
23017         for interfaces
23018
23019         * report.cs: Allow for --fatal to be used with --probe.
23020
23021         * typemanager.cs (NoTypes): Move the definition for the empty Type
23022         array here. 
23023
23024         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
23025         properties. 
23026         (TypeContainer.DefineProxy): New function used to proxy to parent
23027         implementations when implementing interfaces.
23028         (TypeContainer.ParentImplements): used to lookup if our parent
23029         implements a public function that is required by an interface.
23030         (TypeContainer.VerifyPendingMethods): Hook this up.
23031
23032         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
23033         `modules' and `assemblies' arraylists into arrays.  We only grow
23034         these are the very early start up of the program, so this improves
23035         the speedof LookupType (nicely measured).
23036
23037         * expression.cs (MakeByteBlob): Replaced unsafe code with
23038         BitConverter, as suggested by Paolo.
23039
23040         * cfold.cs (ConstantFold.Binary): Special case: perform constant
23041         folding of string concatenation, but if either side is a string,
23042         and the other is not, then return null, and let the runtime use
23043         the concatenation on the string plus the object (using
23044         `Object.ToString'). 
23045
23046 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
23047
23048         Constant Folding has been implemented now.
23049
23050         * expression.cs (Unary.Reduce): Do not throw an exception, catch
23051         the error instead on types that are not supported in one's
23052         complement. 
23053
23054         * constant.cs (Constant and all children): New set of functions to
23055         perform implict and explicit conversions.
23056
23057         * ecore.cs (EnumConstant): Implement the new functions to perform
23058         conversion by proxying to the child expression.
23059
23060         * codegen.cs: (ConstantCheckState): Constant evaluation has its
23061         own separate setting that can not be turned off from the command
23062         line using --unchecked or --checked and is only controlled using
23063         the checked/unchecked statements and expressions.  This setting is
23064         used by the constant folder to flag errors.
23065
23066         * expression.cs (CheckedExpr, UncheckedExpr): Set the
23067         ConstantCheckState as well.   
23068
23069         During Resolve, they also have to flag the state, because the
23070         constant folder runs completely in the Resolve phase.
23071
23072         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
23073         well.
23074
23075 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
23076
23077         * cfold.cs: New file, this file contains the constant folder.
23078
23079         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
23080         argument to track whether we are using the resulting address to
23081         load or store a value and provide better error messages. 
23082
23083         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
23084         new AddressOf arguments.
23085
23086         * statement.cs (Foreach.EmitCollectionForeach): Update
23087
23088         * expression.cs (Argument.Emit): Call AddressOf with proper
23089         arguments to track usage.
23090
23091         (New.DoEmit): Call AddressOf with new arguments.
23092
23093         (Unary.Emit): Adjust AddressOf call.
23094
23095 2002-03-01  Ravi Pratap  <ravi@ximian.com>
23096
23097         * cs-parser.jay (member_access): Change the case for pre-defined types
23098         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
23099         this suggestion.
23100
23101         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
23102         a method body.
23103
23104         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
23105         essentially like methods and apply attributes like MethodImplOptions to them too.
23106
23107         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
23108         not being null.
23109
23110         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
23111         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
23112         is the DeclSpace.
23113
23114         * Update code everywhere accordingly.
23115
23116         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
23117
23118         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
23119
23120 2002-02-28  Ravi Pratap  <ravi@ximian.com>
23121
23122         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
23123         try performing lookups against those instead of jumping straight into using
23124         the 'using' clauses.
23125
23126         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
23127
23128         (LookupType): Perform lookups in implicit parents too.
23129
23130         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
23131         sequence as RootContext.LookupType. 
23132
23133         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
23134         the various cases of namespace lookups into this method.
23135
23136 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
23139         in positional arguments)
23140
23141         * class.cs (Operator): Update the AllowedModifiers to contain
23142         extern. 
23143
23144         * cs-parser.jay: Update operator declaration to allow for the
23145         operator body to be empty.
23146
23147         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
23148         values. 
23149
23150 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
23151
23152         * class.cs (Method.Emit): Label parameters.
23153
23154         * driver.cs: Return 1 or 0 as the program exit code.
23155
23156 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * expression.cs: Special case the `null' object when trying to
23159         auto-compute the type, as anything can be explicitly converted to
23160         that. 
23161
23162         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
23163         spotting this Paolo.
23164
23165         (Expression.ImplicitNumericConversion): Perform comparissions of
23166         the type using the underlying type in the case of an enumeration
23167         rather than using the enumeration type for the compare.
23168
23169         Cope with the underlying == type case, which is not possible to
23170         catch before. 
23171
23172         (Expression.ConvertNumericExplicit): Perform comparissions of
23173         the type using the underlying type in the case of an enumeration
23174         rather than using the enumeration type for the compare.
23175
23176         * driver.cs: If the user does not supply an extension, assume .exe
23177
23178         * cs-parser.jay (if_statement): Rewrote so that we can track the
23179         location for the if statement.
23180
23181         * expression.cs (Binary.ConstantFold): Only concat strings when
23182         the operation is "+", not everything ;-)
23183
23184         * statement.cs (Statement.EmitBoolExpression): Take a location
23185         argument. 
23186         (If, While, Do): Track location.
23187
23188         * expression.cs (Binary.ResolveOperator): In the object + string
23189         case, I was missing a call to ConvertImplicit
23190
23191 2002-02-25  Ravi Pratap  <ravi@ximian.com>
23192
23193         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23194         Location arguments. Ensure we use RootContext.LookupType to do our work
23195         and not try to do a direct Type.GetType and ModuleBuilder.GetType
23196
23197         * interface.cs (PopulateMethod): Handle the type of the parameter being
23198         null gracefully.
23199
23200         * expression.cs (Invocation.BetterFunction): Handle the case when we 
23201         have a params method with no fixed arguments and a call is made with no
23202         arguments.
23203
23204 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
23205
23206         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23207         the verbatim-string-literal
23208
23209         * support.cs (InternalParameters.ParameterModifier): handle null
23210         fixed parameters.
23211         (InternalParameters.ParameterType): ditto.
23212
23213         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23214         duplicating the name of the variable parameter.
23215         (GetParameterByName): Fix bug where we were not looking up array
23216         paramters if they were the only present (thanks Paolo!).
23217         (GetParameterInfo): We only have an empty set of types if both
23218         fixed and array are set to null.
23219         (GetParameterInfo-idx): Handle FixedParameter == null
23220
23221         * cs-parser.jay: Handle the case where there is no catch
23222         statements (missing null test).
23223
23224 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
23225
23226         * driver.cs (MainDriver): Be conservative on our command line
23227         handling.
23228
23229         Catch DirectoryNotFoundException when calling GetFiles.
23230
23231         (SplitPathAndPattern): Used to split the input specification into
23232         a path and a pattern that we can feed to Directory.GetFiles.
23233
23234 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
23235
23236         * statement.cs (Fixed): Implement the last case of the Fixed
23237         statement (string handling).
23238
23239         * expression.cs (StringPtr): New class used to return a char * to
23240         a string;  Used by the Fixed statement.
23241
23242         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
23243
23244         * expression.cs (Binary.ResolveOperator): Remove redundant
23245         MemberLookup pn parent type.
23246         Optimize union call, we do not need a union if the types are the same.
23247         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23248         type.
23249
23250         Specialize the use of MemberLookup everywhere, instead of using
23251         the default settings. 
23252
23253         (StackAlloc): Implement stackalloc keyword.
23254
23255         * cs-parser.jay: Add rule to parse stackalloc.
23256
23257         * driver.cs: Handle /h, /help, /?
23258
23259         * expression.cs (MakeByteBlob): Removed the hacks we had in place
23260         before we supported unsafe code.
23261
23262         * makefile: add --unsafe to the self compilation of mcs.
23263
23264 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * expression.cs (PointerArithmetic): New class that is used to
23267         perform pointer arithmetic.
23268         (Binary.Resolve): Handle pointer arithmetic
23269         Handle pointer comparission.
23270         (ArrayPtr): Utility expression class that is used to take the
23271         address of an array.
23272
23273         (ElementAccess): Implement array access for pointers
23274
23275         * statement.cs (Fixed): Implement fixed statement for arrays, we
23276         are missing one more case before we are done.
23277
23278         * expression.cs (Indirection): Implement EmitAssign and set the
23279         ExprClass to Variable.  This allows pointer dereferences to be
23280         treated as variables, and to have values assigned to them.
23281
23282         * ecore.cs (Expression.StoreFromPtr): New utility function to
23283         store values dereferencing.
23284
23285 2002-02-20  Ravi Pratap  <ravi@ximian.com>
23286
23287         * expression.cs (Binary.ResolveOperator): Ensure that we are
23288         not trying to operate on a void type - this fixes the reported
23289         bug.
23290
23291         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23292         the parent implementation is sealed.
23293
23294         * ../errors/cs0239.cs : Add.
23295
23296         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23297
23298         * typemanager.cs (unverifiable_code_type): Corresponds to 
23299         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23300         which have unsafe code in them.
23301
23302         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
23303         unsafe context.
23304
23305 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
23306
23307         * cs-tokenizer.cs: Add support for @"litreal strings"
23308
23309         Make tokenizer accept pre-processor directives
23310         on any column (remove the old C-like limitation). 
23311
23312         * rootcontext.cs (EmitCode): Emit any global attributes.
23313         (AddGlobalAttributes): Used to keep track of assembly attributes. 
23314
23315         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23316
23317         * cs-parser.jay: Add support for global attributes.  
23318
23319 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
23320
23321         * expression.cs (Indirection): New helper class.  Unary will
23322         create Indirection classes to be able to implement the
23323         IMemoryLocation interface on it.
23324
23325 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
23326
23327         * cs-parser.jay (fixed_statement): reference the right statement.
23328
23329         * statement.cs (Fixed.Emit): Finish implementing the fixed
23330         statement for the &x case.
23331
23332 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
23333
23334         * class.cs (Property.Define, Method.Define): Remove newslot when
23335         `implementing'.  
23336
23337         * modifiers.cs: My use of NewSlot when `Abstract' was set was
23338         wrong.  NewSlot should only be used if the `new' keyword is present.
23339
23340         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23341         locating our system dir.  Sorry about this.
23342
23343 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23344
23345         * driver.cs (GetSystemDir): Compute correctly the location of our
23346         system assemblies.  I was using the compiler directory instead of
23347         the library directory.
23348
23349 2002-02-13  Ravi Pratap  <ravi@ximian.com>
23350
23351         * expression.cs (BetterFunction): Put back in what Miguel commented out
23352         since it is the correct fix. The problem is elsewhere ;-)
23353
23354         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23355         parameters of the parms method are themselves compatible or not !
23356
23357         (StandardConversionExists): Fix very dangerous bug where we were forgetting
23358         to check that a class implements an interface before saying that an implicit
23359         conversion was allowed. Use ImplementsInterface to do the checking.
23360
23361 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23362
23363         * class.cs (Method.Define): Track whether we are an explicit
23364         implementation or not.  And only call DefineMethodOverride if we
23365         are an explicit implementation.
23366
23367         (Property.DefineMethod): Ditto.
23368
23369 2002-02-11  Ravi Pratap  <ravi@ximian.com>
23370
23371         * expression.cs (BetterFunction): Catch hideous bug which was
23372          preventing us from detecting ambiguous calls due to implicit casts i.e
23373         cs0121.
23374
23375 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
23376
23377         * support.cs (Pair): Remove un-needed method.  I figured why I was
23378         getting the error in cs-parser.jay, the variable in a foreach loop
23379         is readonly, and the compiler does not really treat this as a variable.
23380
23381         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
23382         instead of EQUALS in grammar.  
23383
23384         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23385
23386         * expression.cs (Unary.DoResolve): Check whether the argument is
23387         managed or not.
23388
23389 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
23390
23391         * support.cs: Api for Pair to set a value.  Despite the fact that
23392         the variables are public the MS C# compiler refuses to compile
23393         code that accesses the field if the variable is part of a foreach
23394         statement. 
23395
23396         * statement.cs (Fixed): Begin implementation of the fixed
23397         statement.
23398
23399         (Block.AddVariable): Return the VariableInfo on success and null
23400         on failure instead of true/false. 
23401
23402         * cs-parser.jay (foreach): Catch errors on variables already
23403         defined (we were ignoring this value before) and properly unwind
23404         the block hierarchy
23405
23406         (fixed_statement): grammar for the fixed statement.
23407
23408 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
23409
23410         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23411         pointer types to be incretemented.
23412
23413         (SizeOf): Implement.
23414
23415         * cs-parser.jay (pointer_member_access): Implement
23416         expr->IDENTIFIER production.
23417
23418         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23419         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23420         on safe contexts.
23421
23422         (Unary): Implement indirection.
23423
23424         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23425         use in non-unsafe context).
23426
23427         (SimpleName.DoResolve): Check for pointers in field access on safe
23428         contexts. 
23429
23430         (Expression.LoadFromPtr): Factor the load-indirect code in this
23431         function.  This was duplicated in UnboxCast and ParameterReference
23432
23433 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
23434
23435         * expression.cs (ComposedCast): report an error if a pointer cast
23436         is used in a safe region.
23437
23438         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23439         pointer type casts in unsafe context.
23440
23441         * codegen.cs (EmitContext): Set up IsUnsafe.
23442
23443         * cs-parser.jay (non_expression_type): Add productions for pointer
23444         casts. 
23445
23446         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23447         code.  We should not use force into static mode if the method is
23448         not virtual.  Fixes bug in MIS
23449
23450         * statement.cs (Do.Emit, While.Emit, For.Emit,
23451         Statement.EmitBoolExpression): Add support to Do and While to
23452         propagate infinite loop as `I do return' semantics.
23453
23454         Improve the For case to also test for boolean constants.
23455
23456         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23457         to the list of attributes we can add.
23458
23459         Remove `EmitContext' argument.
23460
23461         * class.cs (Method.Define): Apply parameter attributes.
23462         (Constructor.Define): Apply parameter attributes.
23463         (MethodCore.LabelParameters): Move here the core of labeling
23464         parameters. 
23465
23466         * support.cs (ReflectionParameters.ParameterModifier,
23467         InternalParameters.ParameterModifier): Use IsByRef on the type and
23468         only return the OUT bit for these parameters instead of in/out/ref
23469         flags.
23470
23471         This is because I miss-understood things.  The ParameterInfo.IsIn
23472         and IsOut represent whether the parameter has the [In] and [Out]
23473         attributes set.  
23474
23475 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
23476
23477         * ecore.cs (FieldExpr.Emit): Release temporaries.
23478
23479         * assign.cs (LocalTemporary.Release): new function.
23480
23481         * codegen.cs (EmitContext.GetTemporaryStorage,
23482         EmitContext.FreeTemporaryStorage): Rework the way we deal with
23483         temporary storage.  Now we can "put back" localbuilders when we
23484         are done with them
23485
23486 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
23487
23488         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23489         need to make a copy of the variable to generate verifiable code.
23490
23491 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * driver.cs: Compute dynamically the system directory.
23494
23495         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23496         Slower, but more generally useful.  Used by the abstract
23497         registering implementation. 
23498
23499         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23500         the rules for the special rule on Type/instances.  First check if
23501         we have the same name, and if so, try that special static path
23502         rather than the instance path.
23503
23504 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
23505
23506         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23507         for, while and if.
23508
23509         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23510         Enum, ValueType, Delegate or Array for non-corlib compiles.
23511
23512         * cs-tokenizer.cs: Catch long identifiers (645)
23513
23514         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23515         piece of code.
23516
23517         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23518         fix, we were returning too early, so we were not registering
23519         pending methods from abstract classes.
23520
23521         Do not register pending methods if the class is abstract.
23522
23523         * expression.cs (Conditional.DoResolve): Report circular implicit
23524         conversions when we neecd to compute it for conditional
23525         expressions. 
23526
23527         (Is.DoResolve): If the expression is always of the provided type,
23528         flag warning 183.  If the expression can not ever be of the
23529         provided type flag warning 184.
23530
23531         * class.cs: Catch 169 as well.
23532
23533         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23534         read. 
23535
23536 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23537
23538         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23539
23540 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23541
23542         * interface.cs: (PopulateMethod): Check for pointers being defined
23543         only if the unsafe context is active.
23544         (PopulateProperty): ditto.
23545         (PopulateIndexer): ditto.
23546
23547         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23548         specified.  If pointers are present, make sure that they are
23549         present in an unsafe context.
23550         (Constructor, Constructor.Define): ditto.
23551         (Field, Field.Define): ditto.
23552         (Property, Property.Define): ditto.
23553         (Event, Event.Define): ditto.
23554
23555         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23556         hashtable if there are classes or structs defined.
23557
23558         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23559         code, as the constant resolution moved.
23560
23561         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23562         the metadata, so we can flag error 133. 
23563
23564         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23565         pointer is being declared in an unsafe context.
23566
23567 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23568
23569         * modifiers.cs (Modifiers.Check): Require a Location argument.
23570         Report error 227 for Unsafe use.
23571
23572         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23573
23574         * statement.cs (For.Emit): If the test is null, then report that
23575         we do `return', as we wont reach anything afterwards.
23576
23577         (Switch.SwitchGoverningType): Track the expression that matched
23578         the conversion.
23579
23580         * driver.cs: Allow negative numbers as an error code to flag.
23581
23582         * cs-parser.jay: Handle 1551.
23583
23584         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23585
23586 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23587
23588         * cs-parser.jay: Report 1518 (type declaration can only contain
23589         class, struct, interface, enum or delegate)
23590
23591         (switch_label): Report 1523 (keywords `case' or `default' must
23592         preced code)
23593
23594         (opt_switch_sections): Report 1522 (empty switch)
23595
23596         * driver.cs: Report 1515 (response file specified multiple times)
23597         Report 1516 (Source file specified multiple times).
23598
23599         * expression.cs (Argument.Resolve): Signal 1510
23600
23601         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23602         access not allowed in static code)
23603
23604 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23605
23606         * typemanager.cs (IsPointerType): Utility method which we are going
23607         to need a lot.
23608
23609         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23610         the object type, so we take care of that.
23611
23612         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23613
23614         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23615         added to non-params parameters :-)
23616
23617         * typemanager.cs (CSharpName): Include 'void' type too. 
23618
23619         (void_ptr_type): Include in the set of core types.
23620
23621         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23622         duplicating code.
23623
23624         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23625         an unsafe context.
23626
23627         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23628         completely forgotten about it.
23629
23630 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23631
23632         * cs-parser.jay (pointer_type): Add. This begins our implementation
23633         of parsing rules for unsafe code.
23634
23635         (unsafe_statement): Implement.
23636
23637         (embedded_statement): Modify to include the above.
23638
23639         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23640
23641         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23642         if the current context is an unsafe one.
23643
23644         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23645         are handled differently, we need separate rules for them.
23646
23647         (local_variable_declaration): Update to use local_variable_pointer_type
23648         to allow variable declarations of unmanaged pointer types.
23649
23650         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23651         in unsafe contexts.
23652
23653         * ../errors/cs0214.cs : Add.
23654
23655 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23656
23657         * makefile: remove 'response' file when cleaning.
23658
23659 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23660
23661         * cs-parser.jay: Report 1524.
23662
23663 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23664
23665         * typemanager.cs (RegisterMethod): drop checking if we have
23666         registered this from here
23667
23668 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23669
23670         * class.cs (Method.EmitDestructor): Implement calling our base
23671         destructor. 
23672
23673         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23674         value of InFinally.
23675
23676         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23677         this routine and will wrap the call in a try/catch block.  Deal
23678         with the case.
23679
23680 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23681
23682         * ecore.cs (Expression.MemberLookup): instead of taking a
23683         parameter `same_type' that was used to tell whether we could
23684         access private members we compute our containing type from the
23685         EmitContext.
23686
23687         (FieldExpr): Added partial support for volatile fields.  This does
23688         not work for volatile fields exposed from assemblies, as I can not
23689         figure out how to extract the modreq from it.
23690
23691         Updated all the source files to use this.
23692
23693         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23694         because it is referenced by MemberLookup very often. 
23695
23696 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23697
23698         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23699         TypeBuilder.GetCustomAttributes to retrieve what we need.
23700
23701         Get rid of redundant default_member_attr_type as this is the same as
23702         default_member_type which already exists.
23703
23704         * interface.cs, attribute.cs : Update accordingly.
23705
23706 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23707
23708         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23709         work for TYpeBuilders though.  Ravi, can you please fix this?
23710
23711         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23712
23713         * expression.cs (Argument.Emit): Handle the case of ref objects
23714         being passed to ref functions;  
23715
23716         (ParameterReference.EmitLoad): Loads the content of the pointer
23717         without dereferencing.
23718
23719 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23720
23721         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23722
23723 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23724
23725         * class.cs (Indexer.DefineMethod): Incorporate the interface
23726         type in the name of the method if we are doing explicit interface
23727         implementation.
23728
23729         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23730
23731         (BetterConversion): Fix extremely trivial bug where we were referring to
23732         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23733         again !
23734
23735         * ../errors/bug16.cs : Add although we have fixed it.
23736
23737 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23738
23739         * expression.cs (BaseIndexer): Begin implementation.
23740
23741         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23742
23743         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23744         production directly to remove a shift/reduce, and implement
23745         explicit interface implementation.
23746
23747         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23748         after a floating point suffix.
23749
23750         * expression.cs (DoNumericPromotions): Improved the conversion for
23751         uint/uint.  If we have a constant, we avoid doing a typecast to a
23752         larger type.
23753
23754         * class.cs (Indexer): Implement explicit interface implementation
23755         for indexers.
23756
23757 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23758
23759         * class.cs: make the default instance constructor public and hidebysig.
23760
23761 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23762
23763         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23764         so we can call it from elsewhere.
23765
23766         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23767         we emit it internally if the class has a defined indexer; otherwise the user
23768         emits it by decorating the class definition with the DefaultMemberAttribute.
23769
23770         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23771         attribute is not used on a type which defines an indexer.
23772
23773         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23774         character when we skip whitespace.
23775
23776         * ../errors/cs0646.cs : Add.
23777
23778 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23779
23780         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23781         again. 
23782
23783         * makefile: Add practical target `mcs3.exe' which builds the third
23784         generation compiler. 
23785
23786         * expression.cs (New): Fix structures constructor calling.
23787
23788         * class.cs (Property, Method, Indexer): Emit Final flag on the
23789         method if we are an interface implementation and we are not
23790         abstract. 
23791
23792         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23793         whether this property is referencing a `base' method.
23794
23795         * expression.cs (Invocation.EmitCall): take an extra argument:
23796         is_base, this is used to determine whether the `call' or
23797         `callvirt' opcode should be used.
23798
23799
23800         * delegate.cs: update EmitCall.
23801
23802         * class.cs (Method.Define): Set NewSlot for the cases where we are
23803         not implementing an interface method.
23804
23805         (Property.Define): ditto.
23806
23807 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23808
23809         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23810         'r'.  Allows mcs to parse itself fully.
23811
23812 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23813
23814         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23815         of the number of initializers that require the InitializeArray method.
23816
23817         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23818         update the above field where necessary.
23819
23820         (MakeByteBlob): Update accordingly.
23821
23822         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23823         greater than 2.
23824
23825         (EmitDynamicInitializers): Update in accordance with the new optimization.
23826
23827         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23828         same OpCode applies.
23829
23830         * cs-parser.jay : Fix some glaring errors I introduced.
23831
23832 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23833
23834         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23835         so that we can check for name clashes there too.
23836
23837         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23838         for interface indexers.
23839
23840         * interfaces.cs (Define): Emit the default member attribute.
23841
23842         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23843         variable was being referred to while setting the value ;-)
23844
23845 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23846
23847         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23848         byte-by-byte information when we know the data is zero.
23849
23850         Make the block always a multiple of 4, because
23851         DefineInitializedData has a bug.
23852
23853         * assign.cs: Fix, we should assign from the temporary, not from
23854         the source. 
23855
23856         * expression.cs (MakeByteBlob): Fix my incorrect code.
23857
23858 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23859
23860         * typemanager.cs (EnumToUnderlying): This function is used to get
23861         the underlying type from an enumeration, because it does not
23862         always work. 
23863
23864         * constant.cs: Use the I4_S form for values between -128 and 127.
23865
23866         * statement.cs (Block.LookupLabel): Looks up a label.
23867         (Block): Drop support for labeled blocks.
23868
23869         (LabeledStatement): New kind of statement that represents a label
23870         only.
23871
23872         (Goto): Finally implement this bad boy.
23873
23874         * cs-parser.jay: Update to reflect new mechanism to implement
23875         labels.
23876
23877 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23878
23879         * codegen.cs (EmitContext.This): a codegen property that keeps the
23880         a single instance of this instead of creating many different this
23881         instances. 
23882
23883         * delegate.cs (Delegate.DoResolve): Update to use the property;
23884
23885         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23886
23887         * expression.cs (BaseAccess.DoResolve): Ditto.
23888
23889 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23890
23891         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23892         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23893
23894         (InitCoreTypes): Update accordingly.
23895
23896         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23897         so we can quickly store the state.
23898
23899         (ApplyAttributes): Set the correct implementation flags
23900         for InternalCall methods.
23901
23902 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23903
23904         * expression.cs (EmitCall): if a method is not virtual, then do
23905         not use callvirt on it.
23906
23907         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23908         user defined stuff) requires the use of stobj, which takes an
23909         address on the stack instead of an array and an index.  So emit
23910         the Ldelema operation for it.
23911
23912         (EmitStoreOpcode): Use stobj for valuetypes.
23913
23914         (UnaryMutator.EmitCode): Use the right 1 value depending on
23915         whether we are dealing with int64/uint64, float or doubles.
23916
23917         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23918         constructors that I implemented last night.
23919
23920         (Constructor.IsDefault): Fix to work properly for static
23921         constructors.
23922
23923         * cs-parser.jay (CheckDef): report method signature errors.
23924         Update error number 103 to be 132.
23925
23926         * decl.cs: New AdditionResult enumeration value: MethodExists.
23927         Although we do this check for methods later on in the semantic
23928         analysis, catching repeated default constructors is so easy that
23929         we catch these here. 
23930
23931         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23932         promotions code.
23933
23934         (ParameterReference.EmitAssign, Emit): handle
23935         bools as bytes.
23936
23937         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23938         (ArrayAccess.EmitStoreOpcode): ditto.
23939
23940         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23941
23942         * expression.cs (MakeByteBlob): Complete all the missing types
23943         (uint, short, ushort, byte, sbyte)
23944
23945         * class.cs: Only init instance field initializers on instance
23946         constructors. 
23947
23948         Rename `constructors' to instance_constructors. 
23949
23950         (TypeContainer.AddConstructor): Only add constructors to the list
23951         if it is not static.
23952
23953         Make sure that we handle default_static_constructor independently
23954         everywhere where we handle instance_constructors
23955
23956 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23957
23958         * class.cs: Do not lookup or create a base initializer for a
23959         static constructor.
23960
23961         (ConstructorInitializer.Resolve): use the proper type to lookup
23962         for constructors.
23963
23964         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23965
23966         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23967         in DeclSpace. 
23968
23969         * decl.cs: CloseType is now an virtual method, the default
23970         implementation just closes this type.
23971
23972 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23973
23974         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23975         to PreserveSig by default. Also emit HideBySig on such methods.
23976
23977         Basically, set the defaults to standard values.
23978
23979         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23980         argument, if candidate is better, it can't be worse than the best !
23981
23982         (Invocation): Re-write bits to differentiate between methods being
23983         applicable in their expanded form and their normal form - for params
23984         methods of course.
23985
23986         Get rid of use_standard everywhere as only standard conversions are allowed
23987         in overload resolution. 
23988
23989         More spec conformance.
23990
23991 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23992
23993         * driver.cs: Add --timestamp, to see where the compiler spends
23994         most of its time.
23995
23996         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23997         `this' in static code.
23998
23999         (SimpleName.DoResolve): Implement in terms of a helper function
24000         that allows static-references to be passed upstream to
24001         MemberAccess.
24002
24003         (Expression.ResolveWithSimpleName): Resolve specially simple
24004         names when called by MemberAccess to implement the special
24005         semantics. 
24006
24007         (Expression.ImplicitReferenceConversion): Handle conversions from
24008         Null to reference types before others, as Null's type is
24009         System.Object. 
24010
24011         * expression.cs (Invocation.EmitCall): Handle the special case of
24012         calling methods declared on a reference type from a ValueType
24013         (Base classes System.Object and System.Enum)
24014
24015         (MemberAccess.Resolve): Only perform lookups on Enumerations if
24016         the left hand side is a TypeExpr, not on every enumeration. 
24017
24018         (Binary.Resolve): If types are reference types, then do a cast to
24019         object on operators != and == of both arguments.
24020
24021         * typemanager.cs (FindMembers): Extract instance and static
24022         members if requested.
24023
24024         * interface.cs (PopulateProperty): Use void_type instead of null
24025         as the return type for the setter method.
24026
24027         (PopulateIndexer): ditto.
24028
24029 2001-12-27  Ravi Pratap  <ravi@ximian.com>
24030
24031         * support.cs (ReflectionParameters): Fix minor bug where we
24032         were examining the wrong parameter for the ParamArray attribute.
24033
24034         Cope with requests for the type of the parameter at position
24035         greater than the params parameter's. We now return the element
24036         type of the params array as that makes more sense.
24037
24038         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
24039         accordingly as we no longer have to extract the element type
24040         ourselves.
24041
24042         (Invocation.OverloadResolve): Update.
24043
24044 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
24045
24046         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
24047         against IEnumerator, test whether the return value is a descendant
24048         of the IEnumerator interface.
24049
24050         * class.cs (Indexer.Define): Use an auxiliary method to implement
24051         the other bits of the method definition.  Begin support for
24052         explicit interface implementation.
24053
24054         (Property.DefineMethod): Use TypeManager.void_type instead of null
24055         for an empty return value.
24056
24057 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
24058
24059         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24060         dealing with a FieldExpr which is composed of a FieldBuilder, in
24061         the code path we did extract the constant, but we should have
24062         obtained the underlying value to be able to cast it (otherwise we
24063         end up in an infinite loop, this is what Ravi was running into).
24064
24065         (ArrayCreation.UpdateIndices): Arrays might be empty.
24066
24067         (MemberAccess.ResolveMemberAccess): Add support for section
24068         14.5.4.1 that deals with the special case of E.I when E is a type
24069         and something else, that I can be a reference to a static member.
24070
24071         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
24072         handle a particular array type to create byte blobs, it is just
24073         something we dont generate byteblobs for.
24074
24075         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
24076         arguments. 
24077
24078         * location.cs (Push): remove the key from the hashtable that we
24079         are about to add.   This happens for empty files.
24080
24081         * driver.cs: Dispose files after we have parsed them.
24082
24083         (tokenize): new function that only runs the tokenizer on its
24084         input, for speed testing.
24085
24086 2001-12-26  Ravi Pratap  <ravi@ximian.com>
24087
24088         * class.cs (Event.Define): Define the private field only if there
24089         are no accessors defined.
24090
24091         * expression.cs (ResolveMemberAccess): If there is no associated
24092         field with the event, that means we have an event defined with its
24093         own accessors and we should flag error cs0070 since transforming
24094         ourselves into a field is not valid in that case.
24095
24096         * ecore.cs (SimpleName.DoResolve): Same as above.
24097
24098         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
24099         and charset to sane values.
24100
24101 2001-12-25  Ravi Pratap  <ravi@ximian.com>
24102
24103         * assign.cs (DoResolve): Perform check on events only if they 
24104         are being accessed outside the declaring type.
24105
24106         * cs-parser.jay (event_declarations): Update rules to correctly
24107         set the type of the implicit parameter etc.
24108
24109         (add_accessor, remove_accessor): Set current local parameters.
24110
24111         * expression.cs (Binary): For delegate addition and subtraction,
24112         cast the return value from the method into the appropriate delegate
24113         type.
24114
24115 2001-12-24  Ravi Pratap  <ravi@ximian.com>
24116
24117         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
24118         of these as the workaround is unnecessary.
24119
24120         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
24121         delegate data - none of that is needed at all.
24122
24123         Re-write bits to extract the instance expression and the delegate method
24124         correctly.
24125
24126         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
24127         on delegates too.
24128
24129         * attribute.cs (ApplyAttributes): New method to take care of common tasks
24130         of attaching attributes instead of duplicating code everywhere.
24131
24132         * everywhere : Update code to do attribute emission using the above method.
24133
24134 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24135
24136         * expression.cs (IsParamsMethodApplicable): if there are not
24137         parameters, return immediately.
24138
24139         * ecore.cs: The 0 literal can be implicity converted to an enum
24140         type. 
24141
24142         (SimpleName.DoResolve): First lookup the type, then lookup the
24143         members. 
24144
24145         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
24146         want to get its address.  If the InstanceExpression is not
24147         addressable, store the result in a temporary variable, then get
24148         the address of it.
24149
24150         * codegen.cs: Only display 219 errors on warning level or above. 
24151
24152         * expression.cs (ArrayAccess): Make it implement the
24153         IMemoryLocation interface.
24154
24155         (Binary.DoResolve): handle the operator == (object a, object b)
24156         and operator != (object a, object b) without incurring into a
24157         BoxedCast (because 5 != o should never be performed).
24158
24159         Handle binary enumerator operators.
24160
24161         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
24162         value type, otherwise use Ldelem_ref.
24163
24164         Use precomputed names;
24165
24166         (AddressOf): Implement address of
24167
24168         * cs-parser.jay (labeled_statement): Fix recursive block
24169         addition by reworking the production.
24170
24171         * expression.cs (New.DoEmit): New has a special case:
24172                 
24173                  If we are dealing with a ValueType, we have a few
24174                  situations to deal with:
24175                 
24176                     * The target of New is a ValueType variable, that is
24177                       easy, we just pass this as the variable reference
24178                 
24179                     * The target of New is being passed as an argument,
24180                       to a boxing operation or a function that takes a
24181                       ValueType.
24182                 
24183                       In this case, we need to create a temporary variable
24184                       that is the argument of New.
24185
24186
24187 2001-12-23  Ravi Pratap  <ravi@ximian.com>
24188
24189         * rootcontext.cs (LookupType): Check that current_type is not null before
24190         going about looking at nested types.
24191
24192         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24193         not implement the IAssignMethod interface any more.
24194
24195         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24196         where we tranform them into FieldExprs if they are being resolved from within
24197         the declaring type.
24198
24199         * ecore.cs (SimpleName.DoResolve): Do the same here.
24200
24201         * assign.cs (DoResolve, Emit): Clean up code considerably. 
24202
24203         * ../errors/bug10.cs : Add.
24204
24205         * ../errors/cs0070.cs : Add.
24206
24207         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24208
24209         * assign.cs : Get rid of EventIsLocal everywhere.
24210
24211 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24212
24213         * ecore.cs (ConvertIntLiteral): finished the implementation.
24214
24215         * statement.cs (SwitchLabel): Convert the value we are using as a
24216         key before looking up the table.
24217
24218 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24219
24220         * codegen.cs (EmitTopBlock): Require a Location argument now.
24221
24222         * cs-parser.jay (constructor_declarator): We need to setup
24223         current_local_parameters before we parse the
24224         opt_constructor_initializer, to allow the variables to be bound
24225         to the constructor arguments.
24226
24227         * rootcontext.cs (LookupType): First lookup nested classes in our
24228         class and our parents before we go looking outside our class.
24229
24230         * expression.cs (ConstantFold): Extract/debox the values at the
24231         beginnning. 
24232
24233         * rootcontext.cs (EmitCode): Resolve the constants first before we
24234         resolve the types.  This is not really needed, but it helps debugging.
24235
24236         * statement.cs: report location.
24237
24238         * cs-parser.jay: pass location to throw statement.
24239
24240         * driver.cs: Small bug fix.
24241
24242         * report.cs: Updated format to be 4-zero filled digits.
24243
24244 2001-12-22  Ravi Pratap  <ravi@ximian.com>
24245
24246         * expression.cs (CheckIndices): Fix minor bug where the wrong
24247         variable was being referred to ;-)
24248
24249         (DoEmit): Do not call EmitStaticInitializers when the 
24250         underlying type is System.Object.
24251
24252 2001-12-21  Ravi Pratap  <ravi@ximian.com>
24253
24254         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24255         and do the usual workaround for SRE.
24256
24257         * class.cs (MyEventBuilder.EventType): New member to get at the type
24258         of the event, quickly.
24259
24260         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24261
24262         * assign.cs (Assign.DoResolve): Handle the case when the target
24263         is an EventExpr and perform the necessary checks.
24264
24265         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24266         interface.
24267
24268         (SimpleName.MemberStaticCheck): Include check for EventExpr.
24269
24270         (EventExpr): Set the type in the constructor itself since we 
24271         are meant to be born fully resolved.
24272
24273         (EventExpr.Define): Revert code I wrote earlier.
24274                 
24275         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24276         instance expression is null. The instance expression is a This in that case
24277         or a null, depending on whether it is a static method or not.
24278
24279         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24280         refers to more than one method.
24281
24282         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24283         and accordingly flag errors.
24284
24285 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24286
24287         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24288
24289 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24290
24291         * location.cs (ToString): Provide useful rutine.
24292
24293 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24294
24295         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24296         objects, return the actual integral boxed.
24297
24298         * statement.cs (SwitchLabel): define an ILLabel for each
24299         SwitchLabel. 
24300
24301         (Switch.CheckSwitch): If the value is a Literal, extract
24302         the underlying literal.
24303
24304         Also in the unused hashtable we had, add the SwitchLabel so we can
24305         quickly look this value up.
24306
24307         * constant.cs: Implement a bunch of new constants.  Rewrite
24308         Literal based on this.  Made changes everywhere to adapt to this.
24309
24310         * expression.cs (Expression.MakeByteBlob): Optimize routine by
24311         dereferencing array only once, and also copes with enumrations.
24312
24313         bytes are two bytes wide, not one.
24314
24315         (Cast): Perform constant conversions.
24316
24317         * ecore.cs (TryImplicitIntConversion): Return literals instead of
24318         wrappers to the literals here.
24319
24320         * expression.cs (DoNumericPromotions): long literals can converted
24321         to ulong implicity (this is taken care of elsewhere, but I was
24322         missing this spot).
24323
24324         * ecore.cs (Expression.Literalize): Make the return type Literal,
24325         to improve type checking.
24326
24327         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24328
24329 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24330
24331         * literal.cs: Revert code from ravi that checked the bounds.  The
24332         bounds are sane by the definition of the type itself. 
24333
24334         * typemanager.cs: Fix implementation of ImplementsInterface.  We
24335         need to actually look up in our parent hierarchy for interfaces
24336         implemented. 
24337
24338         * const.cs: Use the underlying type for enumerations
24339
24340         * delegate.cs: Compute the basename for the delegate creation,
24341         that should fix the delegate test case, and restore the correct
24342         Type Lookup semantics in rootcontext
24343
24344         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
24345         referencing a nested type with the Reflection API is using the "+"
24346         sign. 
24347
24348         * cs-parser.jay: Do not require EOF token at the end.
24349
24350 2001-12-20  Ravi Pratap  <ravi@ximian.com>
24351
24352         * rootcontext.cs (LookupType): Concatenate type names with
24353         a '.' instead of a '+' The test suite passes again.
24354
24355         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24356         field of the enumeration.
24357
24358         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24359         the case when the member is an EventExpr.
24360
24361         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24362         static has an associated instance expression.
24363
24364         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24365
24366         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24367
24368         * class.cs (Event.Define): Register event and perform appropriate checks
24369         for error #111.
24370
24371         We define the Add and Remove methods even if the use provides none because
24372         in that case, we provide default implementations ourselves.
24373
24374         Define a private field of the type of the event. This is done by the CSC compiler
24375         and we should be doing it too ;-)
24376
24377         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24378         More methods we use in code we generate.
24379
24380         (multicast_delegate_type, delegate_type): Two separate types since the distinction
24381         is important.
24382
24383         (InitCoreTypes): Update accordingly for the above.
24384
24385         * class.cs (Event.Emit): Generate code for default accessors that we provide
24386
24387         (EmitDefaultMethod): Do the job in the above.
24388
24389         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
24390         appropriate place.
24391
24392 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24393
24394         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24395         builders even if we were missing one.
24396
24397         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24398         pass the Basename as our class name instead of the Name.  The
24399         basename will be correctly composed for us.
24400
24401         * parameter.cs (Paramters): Now takes a Location argument.
24402
24403         * decl.cs (DeclSpace.LookupType): Removed convenience function and
24404         make all the code call directly LookupType in RootContext and take
24405         this chance to pass the Location information everywhere.
24406
24407         * Everywhere: pass Location information.
24408
24409 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
24410
24411         * class.cs (Constructor.Define): Updated way of detecting the
24412         length of the parameters.
24413
24414         (TypeContainer.DefineType): Use basename as the type name for
24415         nested types.
24416
24417         (TypeContainer.Define): Do not recursively define types here, as
24418         definition is taken care in order by the RootContext.
24419
24420         * tree.cs: Keep track of namespaces in a per-file basis.
24421
24422         * parameter.cs (Parameter.ComputeSignature): Update to use
24423         DeclSpace. 
24424
24425         (Parameters.GetSignature): ditto.
24426
24427         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24428         instead of a TypeContainer.
24429
24430         (Interface.SemanticAnalysis): Use `this' instead of our parent to
24431         resolve names.  Because we need to be resolve in our context, not
24432         our parents.
24433
24434         * driver.cs: Implement response files.
24435
24436         * class.cs (TypeContainer.DefineType): If we are defined, do not
24437         redefine ourselves.
24438
24439         (Event.Emit): Emit the code for add/remove handlers.
24440         (Event.Define): Save the MethodBuilders for add/remove.
24441
24442         * typemanager.cs: Use pair here too.
24443
24444         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24445         DictionaryEntry requires the first argument to be non-null.  
24446
24447         (enum_declaration): Compute full name for registering the
24448         enumeration.
24449
24450         (delegate_declaration): Instead of using
24451         formal_parameter_list, use opt_formal_parameter_list as the list
24452         can be empty.
24453
24454         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24455         (EventParsing): New property that controls whether `add' and
24456         `remove' are returned as tokens or identifiers (for events);
24457
24458 2001-12-19  Ravi Pratap  <ravi@ximian.com>
24459
24460         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24461         use MyEventBuilder only and let it wrap the real builder for us.
24462
24463         (MyEventBuilder): Revamp constructor etc.
24464
24465         Implement all operations that we perform on EventBuilder in precisely the same
24466         way here too.
24467
24468         (FindMembers): Update to use the EventBuilder member.
24469
24470         (Event.Emit): Update accordingly.
24471
24472 2001-12-18  Ravi Pratap  <ravi@ximian.com>
24473
24474         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24475         by calling the appropriate methods.
24476
24477         (GetCustomAttributes): Make stubs as they cannot possibly do anything
24478         useful.
24479
24480         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24481
24482 2001-12-17  Ravi Pratap  <ravi@ximian.com>
24483
24484         * delegate.cs (Delegate.Populate): Check that the return type
24485         and various parameters types are indeed accessible.
24486
24487         * class.cs (Constructor.Define): Same here.
24488
24489         (Field.Define): Ditto.
24490
24491         (Event.Define): Ditto.
24492
24493         (Operator.Define): Check that the underlying Method defined itself
24494         correctly - so it's MethodBuilder should not be null.
24495
24496         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24497         expression happens to be null.
24498
24499         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24500         members but as of now we don't seem to be able to do anything really useful with it.
24501
24502         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24503         not the EventBuilder.
24504
24505 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
24506
24507         * cs-tokenizer.cs: Add support for defines.
24508         Add support for #if, #elif, #else, #endif
24509
24510         (eval_var): evaluates a variable.
24511         (eval): stubbed for evaluating functions.
24512
24513         * cs-parser.jay: Pass the defines information
24514
24515         * driver.cs: Add --define command line option.
24516
24517         * decl.cs: Move MemberCore here.
24518
24519         Make it the base class for DeclSpace.  This allows us to catch and
24520         report 108 and 109 for everything now.
24521
24522         * class.cs (TypeContainer.Define): Extract all the members
24523         before populating and emit the warning 108 (new keyword required
24524         to override) instead of having each member implement this.
24525
24526         (MemberCore.Define): New abstract method, we will be using this in
24527         the warning reporting engine in Populate.
24528
24529         (Operator.Define): Adjust to new MemberCore protocol. 
24530
24531         * const.cs (Const): This does not derive from Expression, it is a
24532         temporary object we use to create fields, it is a MemberCore. 
24533
24534         * class.cs (Method.Define): Allow the entry point to be in a
24535         specific class.
24536
24537         * driver.cs: Rewrite the argument handler to clean it up a bit.
24538
24539         * rootcontext.cs: Made it just an auxiliary namespace feature by
24540         making everything static.
24541
24542         * driver.cs: Adapt code to use RootContext type name instead of
24543         instance variable.
24544
24545         * delegate.cs: Remove RootContext argument.
24546
24547         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24548         argument. 
24549
24550         * class.cs (Event.Define): The lookup can fail.
24551
24552         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24553
24554         * expression.cs: Resolve the this instance before invoking the code.
24555
24556 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24557
24558         * cs-parser.jay: Add a production in element_access that allows
24559         the thing to become a "type" reference.  This way we can parse
24560         things like "(string [])" as a type.
24561
24562         Note that this still does not handle the more complex rules of
24563         casts. 
24564
24565
24566         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24567
24568         * ecore.cs: (CopyNewMethods): new utility function used to
24569         assemble the list of methods from running FindMembers.
24570
24571         (MemberLookup): Rework FindMembers so that 
24572
24573 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24574
24575         * class.cs (TypeContainer): Remove Delegates who fail to be
24576         defined.
24577
24578         * delegate.cs (Populate): Verify that we dont get null return
24579         values.   TODO: Check for AsAccessible.
24580
24581         * cs-parser.jay: Use basename to emit error 574 (destructor should
24582         have the same name as container class), not the full name.
24583
24584         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24585         possible representation.  
24586
24587         Also implements integer type suffixes U and L.
24588
24589 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24590
24591         * expression.cs (ArrayCreation.DoResolve): We need to do the
24592         argument resolution *always*.
24593
24594         * decl.cs: Make this hold the namespace.  Hold the root context as
24595         well.
24596         (LookupType): Move here.
24597
24598         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24599
24600         * location.cs (Row, Name): Fixed the code, it was always returning
24601         references to the first file.
24602
24603         * interface.cs: Register properties defined through interfaces.
24604
24605         * driver.cs: Add support for globbing on the command line
24606
24607         * class.cs (Field): Make it derive from MemberCore as well.
24608         (Event): ditto.
24609
24610 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24611
24612         * class.cs (Event::Define): Check that the type of the event is a delegate
24613         type else flag error #66.
24614
24615         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24616         same.
24617
24618         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24619         values of EntryPoint, CharSet etc etc.
24620
24621         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24622
24623         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24624         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24625         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24626         which needs this to do its work.
24627
24628         * ../errors/cs0066.cs : Add.
24629
24630 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24631
24632         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24633         helper functions.
24634
24635         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24636         clears out the parameters field.
24637         (MemberSignatureCompare): Cleanup
24638
24639         (MemberCore): New base class used to share code between MethodCore
24640         and Property.
24641
24642         (RegisterRequiredImplementations) BindingFlags.Public requires
24643         either BindingFlags.Instace or Static.  Use instance here.
24644
24645         (Property): Refactored code to cope better with the full spec.
24646
24647         * parameter.cs (GetParameterInfo): Return an empty array instead
24648         of null on error.
24649
24650         * class.cs (Property): Abstract or extern properties have no bodies.
24651
24652         * parameter.cs (GetParameterInfo): return a zero-sized array.
24653
24654         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24655         method modifier validation to the typecontainer so we can reuse
24656         this on properties.
24657
24658         (MethodCore.ParameterTypes): return an empty sized array of types.
24659
24660         (Property.Define): Test property modifier validity.
24661
24662         Add tests for sealed/override too.
24663
24664         (Method.Emit): abstract or extern methods have no bodies.
24665
24666 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24667
24668         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24669         thing.
24670
24671         (Method::Define, ::Emit): Modify accordingly.
24672
24673         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24674
24675         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24676
24677         * makefile: Pass in /unsafe.
24678
24679 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24680
24681         * class.cs (MakeKey): Kill routine.
24682
24683         * class.cs (TypeContainer.Define): Correctly define explicit
24684         method implementations (they require the full interface name plus
24685         the method name).
24686
24687         * typemanager.cs: Deply the PtrHashtable here and stop using the
24688         lame keys.  Things work so much better.
24689
24690         This of course broke everyone who depended on `RegisterMethod' to
24691         do the `test for existance' test.  This has to be done elsewhere.
24692
24693         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24694         the object stupid Equals method (because, that like fails all over
24695         the place).  We still do not use it.
24696
24697         * class.cs (TypeContainer.SetRequiredInterface,
24698         TypeContainer.RequireMethods): Killed these two routines and moved
24699         all the functionality to RegisterRequiredImplementations.
24700
24701         (TypeContainer.RegisterRequiredImplementations): This routine now
24702         registers all the implementations required in an array for the
24703         interfaces and abstract methods.  We use an array of structures
24704         which can be computed ahead of time to reduce memory usage and we
24705         also assume that lookups are cheap as most classes will not
24706         implement too many interfaces.
24707
24708         We also avoid creating too many MethodSignatures.
24709
24710         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24711         clear the "pending" bit if we find that there are problems with
24712         the declaration.
24713
24714         (TypeContainer.VerifyPendingMethods): Update to report errors of
24715         methods that look like implementations but are not.
24716
24717         (TypeContainer.Define): Add support for explicit interface method
24718         implementation. 
24719
24720 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24721
24722         * typemanager.cs: Keep track of the parameters here instead of
24723         being a feature of the TypeContainer.
24724
24725         * class.cs: Drop the registration of parameters here, as
24726         InterfaceMethods are also interface declarations.
24727
24728         * delegate.cs: Register methods with the TypeManager not only with
24729         the TypeContainer.  This code was buggy.
24730
24731         * interface.cs: Full registation here.
24732
24733 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24734
24735         * expression.cs: Remove reducer for binary expressions, it can not
24736         be done this way.
24737
24738         * const.cs: Put here the code that used to go into constant.cs
24739
24740         * constant.cs: Put here the code for constants, this is a new base
24741         class for Literals.
24742
24743         * literal.cs: Make Literal derive from Constant.
24744
24745 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24746
24747         * statement.cs (Return.Emit): Report error 157 if the user
24748         attempts to return from a finally block.
24749
24750         (Return.Emit): Instead of emitting a return, jump to the end of
24751         the function.
24752
24753         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24754         LocalBuilder to store the result of the function.  ReturnLabel is
24755         the target where we jump.
24756
24757
24758 2001-12-09  Radek Doulik  <rodo@ximian.com>
24759
24760         * cs-parser.jay: remember alias in current namespace
24761
24762         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24763         namespaces
24764
24765         * class.cs (LookupAlias): lookup alias in my_namespace
24766
24767         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24768         aliases hashtable
24769         (LookupAlias): lookup alias in this and if needed in parent
24770         namespaces
24771
24772 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24773
24774         * support.cs: 
24775
24776         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24777         making things static.  I need this to avoid passing the
24778         TypeContainer when calling ParameterType.
24779
24780         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24781         that did string manipulation to compute the type and then call
24782         GetType.  Use Parameter.ParameterType instead.
24783
24784         * cs-tokenizer.cs: Consume the suffix for floating values.
24785
24786         * expression.cs (ParameterReference): figure out whether this is a
24787         reference parameter or not.  Kill an extra variable by computing
24788         the arg_idx during emission.
24789
24790         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24791         function that returns whether a parameter is an out/ref value or not.
24792
24793         (Parameter.ParameterType): The type of the parameter (base,
24794         without ref/out applied).
24795
24796         (Parameter.Resolve): Perform resolution here.
24797         (Parameter.ExternalType): The full type (with ref/out applied).
24798
24799         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24800         support for expressions on the using statement.
24801
24802 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24803
24804         * statement.cs (Using.EmitLocalVariableDecls): Split the
24805         localvariable handling of the using statement.
24806
24807         (Block.EmitMeta): Keep track of variable count across blocks.  We
24808         were reusing slots on separate branches of blocks.
24809
24810         (Try.Emit): Emit the general code block, we were not emitting it. 
24811
24812         Check the type of the declaration to be an IDisposable or
24813         something that can be implicity converted to it. 
24814
24815         Emit conversions if required.
24816
24817         * ecore.cs (EmptyExpression): New utility class.
24818         (Expression.ImplicitConversionExists): New utility function.
24819
24820 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24821
24822         * statement.cs (Using): Implement.
24823
24824         * expression.cs (LocalVariableReference): Support read only variables.
24825
24826         * statement.cs: Remove the explicit emit for the Leave opcode.
24827         (VariableInfo): Add a readonly field.
24828
24829 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24830
24831         * ecore.cs (ConvCast): new class used to encapsulate the various
24832         explicit integer conversions that works in both checked and
24833         unchecked contexts.
24834
24835         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24836         properly generate the overflow opcodes.
24837
24838 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24839
24840         * statement.cs: The correct type for the EmptyExpression is the
24841         element_type, not the variable type.  Ravi pointed this out.
24842
24843 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24844
24845         * class.cs (Method::Define): Handle PInvoke methods specially
24846         by using DefinePInvokeMethod instead of the usual one.
24847
24848         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24849         above to do the task of extracting information and defining the method.
24850
24851 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24852
24853         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24854         of the condition for string type.
24855
24856         (Emit): Move that here. 
24857
24858         (ArrayCreation::CheckIndices): Keep string literals in their expression
24859         form.
24860
24861         (EmitDynamicInitializers): Handle strings appropriately.
24862
24863 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24864
24865         * codegen.cs (EmitContext): Replace multiple variables with a
24866         single pointer to the current Switch statement.
24867
24868         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24869         EmitContext.
24870
24871 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24872
24873         * statement.cs 
24874
24875         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24876         default'.
24877
24878         (Foreach.Emit): Foreach on arrays was not setting
24879         up the loop variables (for break/continue).
24880
24881         (GotoCase): Semi-implented.
24882
24883 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24884
24885         * attribute.cs (CheckAttribute): Handle system attributes by using
24886         Attribute.GetAttributes to examine information we need.
24887
24888         (GetValidPlaces): Same here.
24889
24890         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24891
24892         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24893
24894         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24895
24896         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24897
24898         (Method::Emit): Handle the case when we are a PInvoke method.
24899
24900 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24901
24902         * expression.cs: Use ResolveWithSimpleName on compound names.
24903
24904 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24905
24906         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24907         before trying to reduce it.
24908
24909         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24910
24911         * constant.cs (LookupConstantValue): Implement.
24912
24913         (EmitConstant): Use the above in emitting the constant.
24914
24915         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24916         that are user-defined by doing a LookupConstantValue on them.
24917
24918         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24919         too, like above.
24920
24921 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24922
24923         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24924
24925         (BaseAccess.DoResolve): Implement.
24926
24927         (MemberAccess.DoResolve): Split this routine into a
24928         ResolveMemberAccess routine that can be used independently
24929
24930 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24931
24932         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24933         As that share bits of the implementation.  Is returns a boolean,
24934         while As returns the Type that is being probed.
24935
24936 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24937
24938         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24939         instead of a Literal - much easier.
24940
24941         (EnumInTransit): Remove - utterly useless :-)
24942
24943         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24944
24945         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24946
24947         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24948         chain when we have no associated expression.
24949
24950 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24951
24952         * constant.cs (Define): Use Location while reporting the errror.
24953
24954         Also emit a warning when 'new' is used and there is no inherited
24955         member to hide.
24956
24957         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24958         populated.
24959
24960         (LookupEnumValue): Implement to lookup an enum member's value and define it
24961         if necessary.
24962
24963         (Populate): Re-write accordingly to use the above routine.
24964
24965 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24966
24967         * expression.cs (This): Fix prototype for DoResolveLValue to
24968         override the base class DoResolveLValue.
24969
24970         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24971         declarations) 
24972
24973         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24974         (we need to load the address of the field here).  This fixes
24975         test-22. 
24976
24977         (FieldExpr.DoResolveLValue): Call the DoResolve
24978         function to initialize the Instance expression.
24979
24980         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24981         correctly the GetEnumerator operation on a value type.
24982
24983         * cs-parser.jay: Add more simple parsing error catches.
24984
24985         * statement.cs (Switch): Add support for string switches.
24986         Handle null specially.
24987
24988         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24989
24990 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24991
24992         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24993
24994         (declare_local_constant): New helper function.
24995
24996         * statement.cs (AddConstant): Keep a separate record of constants
24997
24998         (IsConstant): Implement to determine if a variable is a constant.
24999
25000         (GetConstantExpression): Implement.
25001
25002         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
25003
25004         * statement.cs (IsVariableDefined): Re-write.
25005
25006 2001-11-27  Ravi Pratap  <ravi@ximian.com>
25007
25008         * class.cs (TypeContainer::FindMembers): Look for constants
25009         in the case when we are looking for MemberTypes.Field
25010
25011         * expression.cs (MemberAccess::DoResolve): Check that in the
25012         case we are a FieldExpr and a Literal, we are not being accessed
25013         by an instance reference.
25014
25015         * cs-parser.jay (local_constant_declaration): Implement.
25016
25017         (declaration_statement): Implement for constant declarations.
25018
25019 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
25020
25021         * statement.cs (Switch): Catch double defaults.
25022
25023         (Switch): More work on the switch() statement
25024         implementation.  It works for integral values now, need to finish
25025         string support.
25026
25027
25028 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
25029
25030         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
25031         integer literals into other integer literals.  To be used by
25032         switch. 
25033
25034 2001-11-24  Ravi Pratap  <ravi@ximian.com>
25035
25036         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
25037         some memory.
25038
25039         (EmitDynamicInitializers): Cope with the above since we extract data
25040         directly from ArrayData now.
25041
25042         (ExpectInitializers): Keep track of whether initializers are mandatory
25043         or not.
25044
25045         (Bounds): Make it a hashtable to prevent the same dimension being 
25046         recorded for every element in that dimension.
25047
25048         (EmitDynamicInitializers): Fix bug which prevented the Set array method
25049         from being found.
25050
25051         Also fix bug which was causing the indices to be emitted in the reverse
25052         order.
25053
25054 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
25055
25056         * expression.cs (ArrayCreation): Implement the bits that Ravi left
25057         unfinished.  They do not work, because the underlying code is
25058         sloppy.
25059
25060 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25061
25062         * cs-parser.jay: Remove bogus fixme.
25063
25064         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25065         on Switch statement.
25066
25067 2001-11-23  Ravi Pratap  <ravi@ximian.com>
25068
25069         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
25070         the same. 
25071
25072         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
25073         parameter. Apparently, any expression is allowed. 
25074
25075         (ValidateInitializers): Update accordingly.
25076
25077         (CheckIndices): Fix some tricky bugs thanks to recursion.
25078
25079         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
25080         I was being completely brain-dead.
25081
25082         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
25083         and re-write acordingly.
25084
25085         (DelegateInvocation): Re-write accordingly.
25086
25087         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
25088
25089         (MakeByteBlob): Handle types more correctly.
25090
25091         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
25092         initialization from expressions but it is incomplete because I am a complete
25093         Dodo :-|
25094
25095 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25096
25097         * statement.cs (If.Emit): Fix a bug that generated incorrect code
25098         on If.  Basically, we have to return `true' (ie, we do return to
25099         our caller) only if both branches of the if return.
25100
25101         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
25102         short-circuit operators, handle them as short circuit operators. 
25103
25104         (Cast.DoResolve): Resolve type.
25105         (Cast.Cast): Take an expression as the target type.
25106
25107         * cs-parser.jay (cast_expression): Remove old hack that only
25108         allowed a limited set of types to be handled.  Now we take a
25109         unary_expression and we resolve to a type during semantic
25110         analysis.
25111
25112         Use the grammar productions from Rhys to handle casts (this is
25113         not complete like Rhys syntax yet, we fail to handle that corner
25114         case that C# has regarding (-x), but we will get there.
25115
25116 2001-11-22  Ravi Pratap  <ravi@ximian.com>
25117
25118         * class.cs (EmitFieldInitializer): Take care of the case when we have a
25119         field which is an array type.
25120
25121         * cs-parser.jay (declare_local_variables): Support array initialization too.
25122
25123         * typemanager.cs (MakeKey): Implement.
25124
25125         (everywhere): Use the above appropriately.
25126
25127         * cs-parser.jay (for_statement): Update for array initialization while
25128         declaring variables.
25129
25130         * ecore.cs : The error message was correct, it's the variable's names that
25131         were misleading ;-) Make the code more readable.
25132
25133         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
25134         the correct type etc.
25135
25136         (ConvertExplicit): Handle Enum types by examining the underlying type.
25137
25138 2001-11-21  Ravi Pratap  <ravi@ximian.com>
25139
25140         * parameter.cs (GetCallingConvention): Always return
25141         CallingConventions.Standard for now.
25142
25143 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * expression.cs (Binary.ResolveOperator): Update the values of `l'
25146         and `r' after calling DoNumericPromotions.
25147
25148         * ecore.cs: Fix error message (the types were in the wrong order).
25149
25150         * statement.cs (Foreach.ProbeCollectionType): Need to pass
25151         BindingFlags.Instance as well 
25152
25153         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
25154         implicit int literal conversion in an empty cast so that we
25155         propagate the right type upstream.
25156
25157         (UnboxCast): new class used to unbox value types.
25158         (Expression.ConvertExplicit): Add explicit type conversions done
25159         by unboxing.
25160
25161         (Expression.ImplicitNumericConversion): Oops, forgot to test for
25162         the target type before applying the implicit LongLiterals to ULong
25163         literal cast.
25164
25165 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
25166
25167         * cs-parser.jay (for_statement): Reworked the way For works: now
25168         we declare manually any variables that are introduced in
25169         for_initializer to solve the problem of having out-of-band code
25170         emition (that is what got for broken).
25171
25172         (declaration_statement): Perform the actual variable declaration
25173         that used to be done in local_variable_declaration here.
25174
25175         (local_variable_declaration): Do not declare anything, just pass
25176         the information on a DictionaryEntry
25177
25178 2001-11-20  Ravi Pratap  <ravi@ximian.com>
25179
25180         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25181         re-write of the logic to now make it recursive.
25182
25183         (UpdateIndices): Re-write accordingly.
25184
25185         Store element data in a separate ArrayData list in the above methods.
25186
25187         (MakeByteBlob): Implement to dump the array data into a byte array.
25188
25189 2001-11-19  Ravi Pratap  <ravi@ximian.com>
25190
25191         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25192         into CheckIndices.
25193
25194         * constant.cs (Define): Implement.
25195
25196         (EmitConstant): Re-write fully.
25197
25198         Pass in location info.
25199
25200         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25201         respectively.
25202
25203         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25204         DictionaryEntry since we need location info too.
25205
25206         (constant_declaration): Update accordingly.
25207
25208         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25209         code into another method : UpdateIndices.
25210
25211 2001-11-18  Ravi Pratap  <ravi@ximian.com>
25212
25213         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25214         some type checking etc.
25215
25216 2001-11-17  Ravi Pratap  <ravi@ximian.com>
25217
25218         * expression.cs (ArrayCreation::ValidateInitializers): Implement
25219         bits to provide dimension info if the user skips doing that.
25220
25221         Update second constructor to store the rank correctly.
25222
25223 2001-11-16  Ravi Pratap  <ravi@ximian.com>
25224
25225         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25226         and try to implement.
25227
25228         * ../errors/cs0150.cs : Add.
25229
25230         * ../errors/cs0178.cs : Add.
25231
25232 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
25233
25234         * statement.cs: Implement foreach on multi-dimensional arrays. 
25235
25236         * parameter.cs (Parameters.GetParameterByName): Also lookup the
25237         name of the params argument.
25238
25239         * expression.cs: Use EmitStoreOpcode to get the right opcode while
25240         initializing the array.
25241
25242         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25243         we can use this elsewhere.
25244
25245         * statement.cs: Finish implementation of foreach for single
25246         dimension arrays.
25247
25248         * cs-parser.jay: Use an out-of-band stack to pass information
25249         around, I wonder why I need this.
25250
25251         foreach_block: Make the new foreach_block the current_block.
25252
25253         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25254         function used to return a static Parameters structure.  Used for
25255         empty parameters, as those are created very frequently.
25256
25257         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25258
25259 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25260
25261         * interface.cs : Default modifier is private, not public. The
25262         make verify test passes again.
25263
25264 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25265
25266         * support.cs (ReflectionParameters): Fix logic to determine
25267         whether the last parameter is a params one. Test 9 passes again.
25268
25269         * delegate.cs (Populate): Register the builders we define with
25270         RegisterParameterForBuilder. Test 19 passes again.
25271
25272         * cs-parser.jay (property_declaration): Reference $6 instead
25273         of $$ to get at the location.
25274
25275         (indexer_declaration): Similar stuff.
25276
25277         (attribute): Ditto.
25278
25279         * class.cs (Property): Register parameters for the Get and Set methods
25280         if they exist. Test 23 passes again.
25281
25282         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25283         call to EmitArguments as we are sure there aren't any params arguments. 
25284         Test 32 passes again.
25285
25286         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25287         IndexOutOfRangeException. 
25288
25289         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25290         Test 33 now passes again.
25291
25292 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
25293
25294         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25295         broke a bunch of things.  Will have to come up with a better way
25296         of tracking locations.
25297
25298         * statement.cs: Implemented foreach for single dimension arrays.
25299
25300 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25301
25302         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25303         an error.  This removes the lookup from the critical path.
25304
25305         * cs-parser.jay: Removed use of temporary_loc, which is completely
25306         broken. 
25307
25308 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
25309
25310         * support.cs (ReflectionParameters.ParameterModifier): Report
25311         whether the argument is a PARAMS argument or not.
25312
25313         * class.cs: Set the attribute `ParamArrayAttribute' on the
25314         parameter argument.
25315
25316         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25317         and cons_param_array_attribute (ConstructorInfo for
25318         ParamArrayAttribute)., 
25319
25320         * codegen.cs: Emit the return using the `Return' statement, that
25321         way we can report the error correctly for missing return values. 
25322
25323         * class.cs (Method.Emit): Clean up.
25324
25325         * expression.cs (Argument.Resolve): Take another argument: the
25326         location where this argument is used.  Notice that this is not
25327         part of the "Argument" class as to reduce the size of the
25328         structure (we know the approximate location anyways).
25329
25330         Test if the argument is a variable-reference, if not, then
25331         complain with a 206.
25332
25333         (Argument.Emit): Emit addresses of variables.
25334
25335         (Argument.FullDesc): Simplify.
25336
25337         (Invocation.DoResolve): Update for Argument.Resolve.
25338
25339         (ElementAccess.DoResolve): ditto.
25340
25341         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25342         method should be virtual, as this method is always virtual.
25343
25344         (NewDelegate.DoResolve): Update for Argument.Resolve.
25345
25346         * class.cs (ConstructorInitializer.DoResolve): ditto.
25347
25348         * attribute.cs (Attribute.Resolve): ditto.
25349
25350 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
25351
25352         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25353
25354         * expression.cs (ParameterReference): Drop IStackStorage and implement
25355         IAssignMethod instead. 
25356
25357         (LocalVariableReference): ditto.
25358
25359         * ecore.cs (FieldExpr): Drop IStackStorage and implement
25360         IAssignMethod instead. 
25361
25362 2001-11-13  Miguel de Icaza <miguel@ximian.com>
25363
25364         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25365         enumerations that are used in heavily used structures derive from
25366         byte in a laughable and pathetic attempt to reduce memory usage.
25367         This is the kind of pre-optimzations that you should not do at
25368         home without adult supervision.
25369
25370         * expression.cs (UnaryMutator): New class, used to handle ++ and
25371         -- separatedly from the other unary operators.  Cleans up the
25372         code, and kills the ExpressionStatement dependency in Unary.
25373
25374         (Unary): Removed `method' and `Arguments' from this class, making
25375         it smaller, and moving it all to SimpleCall, so I can reuse this
25376         code in other locations and avoid creating a lot of transient data
25377         strucutres when not required.
25378
25379         * cs-parser.jay: Adjust for new changes.
25380
25381 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
25382
25383         * enum.cs (Enum.Populate): If there is a failure during
25384         definition, return
25385
25386         * cs-parser.jay (opt_enum_base): we used to catch type errors
25387         here, but this is really incorrect.  The type error should be
25388         catched during semantic analysis.
25389
25390 2001-12-11  Ravi Pratap  <ravi@ximian.com>
25391
25392         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25393         current_local_parameters as expected since I, in my stupidity, had forgotten
25394         to do this :-)
25395
25396         * attribute.cs (GetValidPlaces): Fix stupid bug.
25397
25398         * class.cs (Method::Emit): Perform check on applicability of attributes.
25399
25400         (Constructor::Emit): Ditto.
25401
25402         (Field::Emit): Ditto.
25403
25404         (Field.Location): Store location information.
25405
25406         (Property, Event, Indexer, Operator): Ditto.
25407
25408         * cs-parser.jay (field_declaration): Pass in location for each field.
25409
25410         * ../errors/cs0592.cs : Add.
25411
25412 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25413
25414         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25415
25416         (InitCoreTypes): Update accordingly.
25417
25418         (RegisterAttrType, LookupAttr): Implement.
25419
25420         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25421         info about the same.
25422
25423         (Resolve): Update to populate the above as necessary.
25424
25425         (Error592): Helper.
25426
25427         (GetValidPlaces): Helper to the above.
25428
25429         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25430
25431         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25432
25433 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25434
25435         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25436
25437         * ../errors/cs0617.cs : Add.
25438
25439 2001-11-11  Ravi Pratap  <ravi@ximian.com>
25440
25441         * enum.cs (Emit): Rename to Populate to be more consistent with what
25442         we expect it to do and when exactly it is called.
25443
25444         * class.cs, rootcontext.cs : Update accordingly.
25445
25446         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25447         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25448
25449         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25450
25451         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25452         of a fieldinfo using the above, when dealing with a FieldBuilder.
25453
25454 2001-11-10  Ravi Pratap  <ravi@ximian.com>
25455
25456         * ../errors/cs0031.cs : Add.
25457
25458         * ../errors/cs1008.cs : Add.
25459
25460         * ../errrors/cs0543.cs : Add.
25461
25462         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25463         enum type.
25464
25465         (FindMembers): Implement.
25466
25467         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25468         enums and delegates too.
25469
25470         (enum_types): Rename to builder_to_enum.
25471
25472         (delegate_types): Rename to builder_to_delegate.
25473
25474         * delegate.cs (FindMembers): Implement.
25475
25476 2001-11-09  Ravi Pratap  <ravi@ximian.com>
25477
25478         * typemanager.cs (IsEnumType): Implement.
25479
25480         * enum.cs (Emit): Re-write parts to account for the underlying type
25481         better and perform checking etc.
25482
25483         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25484         of the underlying type.
25485
25486         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25487         value
25488
25489         * enum.cs (error31): Helper to report error #31.
25490
25491         * cs-parser.jay (enum_declaration): Store location of each member too.
25492
25493         * enum.cs (member_to_location): New hashtable. 
25494
25495         (AddEnumMember): Update location hashtable.
25496
25497         (Emit): Use the location of each member while reporting errors.
25498
25499 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25500
25501         * cs-parser.jay: A for_initializer if is a
25502         local_variable_declaration really ammount to have an implicit
25503         block with the variable declaration and no initializer for for.
25504
25505         * statement.cs (For.Emit): Cope with null initializers.
25506
25507         This fixes the infinite loop on for initializers.
25508
25509 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25510
25511         * enum.cs: More cleanup.
25512
25513         * ecore.cs: Remove dead code.
25514
25515         * class.cs (Property.Emit): More simplification.
25516         (Event.Emit): ditto.
25517
25518         Reworked to have less levels of indentation.
25519
25520 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25521
25522         * class.cs (Property): Emit attributes.
25523
25524         (Field): Ditto.
25525
25526         (Event): Ditto.
25527
25528         (Indexer): Ditto.
25529
25530         (Operator): Ditto.
25531
25532         * enum.cs (Emit): Ditto.
25533
25534         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25535         Enums too.
25536
25537         * class.cs (Field, Event, etc.): Move attribute generation into the
25538         Emit method everywhere.
25539
25540         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25541         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25542         as we had no way of defining nested enums !
25543
25544         * rootcontext.cs : Adjust code accordingly.
25545
25546         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25547
25548 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25549
25550         * expression.cs (EvalConstantExpression): Move into ecore.cs
25551
25552         * enum.cs (Enum): Rename some members and make them public and readonly
25553         according to our convention.
25554
25555         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25556         nothing else.
25557
25558         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25559
25560         (Enum::Emit): Write a simple version for now which doesn't try to compute
25561         expressions. I shall modify this to be more robust in just a while.
25562
25563         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25564
25565         (TypeContainer::CloseType): Create the Enum types too.
25566
25567         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25568
25569         * expression.cs (EvalConstantExpression): Get rid of completely.
25570
25571         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25572         user-defined values and other cases.
25573
25574         (IsValidEnumLiteral): Helper function.
25575
25576         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25577         out there in the case we had a literal FieldExpr.
25578
25579         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25580
25581         (Literalize): Revamp a bit to take two arguments.
25582
25583         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25584
25585 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25586
25587         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25588
25589         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25590
25591         (Resolve): Use the above to ensure we have proper initializers.
25592
25593 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25594
25595         * expression.cs (Expression::EvalConstantExpression): New method to 
25596         evaluate constant expressions.
25597
25598         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25599
25600 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25601
25602         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25603         in an array.
25604
25605         (Binary.ResolveOperator): Handle operator != (object a, object b)
25606         and operator == (object a, object b);
25607
25608         (Binary.DoNumericPromotions): Indicate whether the numeric
25609         promotion was possible.
25610
25611         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25612         Implement.  
25613
25614         Made the ArrayAccess implement interface IAssignMethod instead of
25615         IStackStore as the order in which arguments are passed reflects
25616         this.
25617
25618         * assign.cs: Instead of using expr.ExprClass to select the way of
25619         assinging, probe for the IStackStore/IAssignMethod interfaces.
25620
25621         * typemanager.cs: Load InitializeArray definition.
25622
25623         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25624         static data that can be used to initialize arrays. 
25625
25626 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25627
25628         * expression.cs: Handle operator== and operator!= for booleans.
25629
25630         (Conditioal.Reduce): Implement reducer for the ?: operator.
25631
25632         (Conditional.Resolve): Implement dead code elimination.
25633
25634         (Binary.Resolve): Catch string literals and return a new
25635         concatenated string.
25636
25637         (Unary.Reduce): Implement reduction of unary expressions.
25638
25639         * ecore.cs: Split out the expression core handling here.
25640
25641         (Expression.Reduce): New method used to perform constant folding
25642         and CSE.  This is needed to support constant-expressions. 
25643
25644         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25645         targets, and optimize for !x.
25646
25647 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25648
25649         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25650         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25651         set custom atttributes.
25652
25653         * literal.cs (Literal::GetValue): New abstract method to return the actual
25654         value of the literal, cast as an object.
25655
25656         (*Literal): Implement GetValue method.
25657
25658         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25659         expressions to the arraylist but objects of type Argument.
25660
25661         * class.cs (TypeContainer::Emit): Emit our attributes too.
25662
25663         (Method::Emit, Constructor::Emit): Ditto.
25664
25665         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25666         to be ignoring earlier.
25667
25668 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25669
25670         * attribute.cs (AttributeSection::Define): Implement to do the business
25671         of constructing a CustomAttributeBuilder.
25672
25673         (Attribute): New trivial class. Increases readability of code.  
25674
25675         * cs-parser.jay : Update accordingly.
25676
25677         (positional_argument_list, named_argument_list, named_argument): New rules
25678
25679         (attribute_arguments): Use the above so that we are more correct.
25680
25681 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25682
25683         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25684         to perform all checks for a method with a params parameter.
25685
25686         (Invocation::OverloadResolve): Update to use the above method and therefore
25687         cope correctly with params method invocations.
25688
25689         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25690         params too.
25691
25692         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25693         constructors in our parent too because we can't afford to miss out on 
25694         protected ones ;-)
25695
25696         * attribute.cs (AttributeSection): New name for the class Attribute
25697
25698         Other trivial changes to improve readability.
25699
25700         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25701         use the new class names.
25702
25703 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25704
25705         * class.cs (Method::Define): Complete definition for params types too
25706
25707         (Indexer::Define): Ditto.
25708
25709         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25710         Cope everywhere with a request for info about the array parameter.
25711
25712 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25713
25714         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25715
25716         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25717         local_variable_type to extract the string corresponding to the type.
25718
25719         (local_variable_type): Fixup the action to use the new helper method.
25720
25721         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25722         go.
25723
25724         * expression.cs : Clean out code which uses the above.
25725
25726 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25727
25728         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25729         and bale out if necessary by returning a false.
25730
25731         (RegisterProperty): Ditto.
25732
25733         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25734         and print out appropriate error messages.
25735
25736         * interface.cs (everywhere): Ditto.
25737
25738         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25739         location to constructor.
25740
25741         * class.cs (Property, Event, Indexer): Update accordingly.
25742
25743         * ../errors/cs111.cs : Added.
25744
25745         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25746         of a method, as laid down by the spec.
25747
25748         (Invocation::OverloadResolve): Use the above method.
25749
25750 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25751
25752         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25753         now take a TypeContainer and a Parameters object.
25754
25755         (ParameterData): Modify return type of ParameterModifier method to be 
25756         Parameter.Modifier and not a string.
25757
25758         (ReflectionParameters, InternalParameters): Update accordingly.
25759
25760         * expression.cs (Argument::GetParameterModifier): Same here.
25761
25762         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25763         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25764         symbol in it at all so maybe this is only for now.
25765
25766 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25767
25768         * support.cs (InternalParameters): Constructor now takes an extra argument 
25769         which is the actual Parameters class.
25770
25771         (ParameterDesc): Update to provide info on ref/out modifiers.
25772
25773         * class.cs (everywhere): Update call to InternalParameters to pass in
25774         the second argument too.
25775
25776         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25777         to return the modifier info [ref/out etc]
25778
25779         (InternalParameters, ReflectionParameters): Implement the above.
25780
25781         * expression.cs (Argument::ParameterModifier): Similar function to return
25782         info about the argument's modifiers.
25783
25784         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25785         too.
25786
25787         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25788         a new SetFormalParameters object which we pass to InternalParameters.
25789
25790 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25791
25792         * expression.cs (NewArray): Merge into the ArrayCreation class.
25793
25794 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25795
25796         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25797         NewUserdefinedArray into one as there wasn't much of a use in having
25798         two separate ones.
25799
25800         * expression.cs (Argument): Change field's name to ArgType from Type.
25801
25802         (Type): New readonly property which returns the proper type, taking into 
25803         account ref/out modifiers.
25804
25805         (everywhere): Adjust code accordingly for the above.
25806
25807         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25808         whether we are emitting for a ref or out parameter.
25809
25810         * expression.cs (Argument::Emit): Use the above field to set the state.
25811
25812         (LocalVariableReference::Emit): Update to honour the flag and emit the
25813         right stuff.
25814
25815         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25816
25817         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25818
25819         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25820
25821         (ReflectionParameters, InternalParameters): Implement the above method.
25822
25823         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25824         reporting errors.
25825
25826         (Invocation::FullMethodDesc): Ditto. 
25827
25828 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25829
25830         * cs-parser.jay: Add extra production for the second form of array
25831         creation. 
25832
25833         * expression.cs (ArrayCreation): Update to reflect the above
25834         change. 
25835
25836         * Small changes to prepare for Array initialization.
25837
25838 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25839
25840         * typemanager.cs (ImplementsInterface): interface might be null;
25841         Deal with this problem;
25842
25843         Also, we do store negative hits on the cache (null values), so use
25844         this instead of calling t.GetInterfaces on the type everytime.
25845
25846 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25847
25848         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25849
25850         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25851         split functionality out into different classes.
25852
25853         (New::FormArrayType): Move into NewBuiltinArray.
25854
25855         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25856         quite useless.
25857
25858         (NewBuiltinArray): New class to handle creation of built-in arrays.
25859
25860         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25861         account creation of one-dimensional arrays.
25862
25863         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25864
25865         (NewUserdefinedArray::DoResolve): Implement.
25866
25867         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25868
25869         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25870         we maintain inside the TypeManager. This is necessary to perform lookups on the
25871         module builder.
25872
25873         (LookupType): Update to perform GetType on the module builders too.     
25874
25875         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25876
25877         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25878
25879 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25880
25881         * expression.cs (New::DoResolve): Implement guts of array creation.
25882
25883         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25884
25885 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25886
25887         * expression.cs: Fix bug I introduced lsat night that broke
25888         Delegates. 
25889
25890         (Expression.Resolve): Report a 246 error (can not resolve name)
25891         if we find a SimpleName in the stream.
25892
25893         (Expression.ResolveLValue): Ditto.
25894
25895         (Expression.ResolveWithSimpleName): This function is a variant of
25896         ResolveName, this one allows SimpleNames to be returned without a
25897         warning.  The only consumer of SimpleNames is MemberAccess
25898
25899 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25900
25901         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25902         might arrive here.  I have my doubts that this is correct.
25903
25904         * statement.cs (Lock): Implement lock statement.
25905
25906         * cs-parser.jay: Small fixes to support `lock' and `using'
25907
25908         * cs-tokenizer.cs: Remove extra space
25909
25910         * driver.cs: New flag --checked, allows to turn on integer math
25911         checking. 
25912
25913         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25914         Threading.Monitor.Exit 
25915
25916 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25917
25918         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25919         Expression Class to be IndexerAccess.
25920
25921         Notice that Indexer::DoResolve sets the eclass to Value.
25922
25923 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25924
25925         * class.cs (TypeContainer::Emit): Emit code for indexers.
25926
25927         * assign.cs (IAssignMethod): New interface implemented by Indexers
25928         and Properties for handling assignment.
25929
25930         (Assign::Emit): Simplify and reuse code. 
25931
25932         * expression.cs (IndexerAccess, PropertyExpr): Implement
25933         IAssignMethod, clean up old code. 
25934
25935 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25936
25937         * typemanager.cs (ImplementsInterface): New method to determine if a type
25938         implements a given interface. Provides a nice cache too.
25939
25940         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25941         method.
25942
25943         (ConvertReferenceExplicit): Ditto.
25944
25945         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25946         various methods, with correct names etc.
25947
25948         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25949         Operator.UnaryNegation.
25950
25951         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25952         we have a unary plus or minus operator.
25953
25954         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25955         UnaryMinus.
25956
25957         * everywhere : update accordingly.
25958
25959         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25960         respectively.
25961
25962         * class.cs (Method::Define): For the case where we are implementing a method
25963         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25964         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25965
25966 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25967
25968         * interface.cs (FindMembers): Implement to work around S.R.E
25969         lameness.
25970
25971         * typemanager.cs (IsInterfaceType): Implement.
25972
25973         (FindMembers): Update to handle interface types too.
25974
25975         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25976         use IsAssignableFrom as that is not correct - it doesn't work.
25977
25978         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25979         and accordingly override EmitStatement.
25980
25981         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25982         using the correct logic :-)
25983
25984 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25985
25986         * ../errors/cs-11.cs : Add to demonstrate error -11 
25987
25988 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25989
25990         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25991         then pass this as a hint to ResolveLValue.
25992
25993         * expression.cs (FieldExpr): Add Location information
25994
25995         (FieldExpr::LValueResolve): Report assignment to readonly
25996         variable. 
25997
25998         (Expression::ExprClassFromMemberInfo): Pass location information.
25999
26000         (Expression::ResolveLValue): Add new method that resolves an
26001         LValue. 
26002
26003         (Expression::DoResolveLValue): Default invocation calls
26004         DoResolve. 
26005
26006         (Indexers): New class used to keep track of indexers in a given
26007         Type. 
26008
26009         (IStackStore): Renamed from LValue, as it did not really describe
26010         what this did.  Also ResolveLValue is gone from this interface and
26011         now is part of Expression.
26012
26013         (ElementAccess): Depending on the element access type
26014
26015         * typemanager.cs: Add `indexer_name_type' as a Core type
26016         (System.Runtime.CompilerServices.IndexerNameAttribute)
26017
26018         * statement.cs (Goto): Take a location.
26019
26020 2001-10-18  Ravi Pratap  <ravi@ximian.com>
26021
26022         * delegate.cs (Delegate::VerifyDelegate): New method to verify
26023         if two delegates are compatible.
26024
26025         (NewDelegate::DoResolve): Update to take care of the case when
26026         we instantiate a delegate from another delegate.
26027
26028         * typemanager.cs (FindMembers): Don't even try to look up members
26029         of Delegate types for now.
26030
26031 2001-10-18  Ravi Pratap  <ravi@ximian.com>
26032
26033         * delegate.cs (NewDelegate): New class to take care of delegate
26034         instantiation.
26035
26036         * expression.cs (New): Split the delegate related code out into 
26037         the NewDelegate class.
26038
26039         * delegate.cs (DelegateInvocation): New class to handle delegate 
26040         invocation.
26041
26042         * expression.cs (Invocation): Split out delegate related code into
26043         the DelegateInvocation class.
26044
26045 2001-10-17  Ravi Pratap  <ravi@ximian.com>
26046
26047         * expression.cs (New::DoResolve): Implement delegate creation fully
26048         and according to the spec.
26049
26050         (New::DoEmit): Update to handle delegates differently.
26051
26052         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
26053         because of which we were printing out arguments in reverse order !
26054
26055         * delegate.cs (VerifyMethod): Implement to check if the given method
26056         matches the delegate.
26057
26058         (FullDelegateDesc): Implement.
26059
26060         (VerifyApplicability): Implement.
26061
26062         * expression.cs (Invocation::DoResolve): Update to accordingly handle
26063         delegate invocations too.
26064
26065         (Invocation::Emit): Ditto.
26066
26067         * ../errors/cs1593.cs : Added.
26068
26069         * ../errors/cs1594.cs : Added.
26070
26071         * delegate.cs (InstanceExpression, TargetMethod): New properties.
26072
26073 2001-10-16  Ravi Pratap  <ravi@ximian.com>
26074
26075         * typemanager.cs (intptr_type): Core type for System.IntPtr
26076
26077         (InitCoreTypes): Update for the same.
26078
26079         (iasyncresult_type, asynccallback_type): Ditto.
26080
26081         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
26082         correct.
26083
26084         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
26085         too.
26086
26087         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
26088         the builders for the 4 members of a delegate type :-)
26089
26090         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
26091         type.
26092
26093         * expression.cs (New::DoResolve): Implement guts for delegate creation.
26094
26095         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
26096
26097 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
26098
26099         * statement.cs (Break::Emit): Implement.   
26100         (Continue::Emit): Implement.
26101
26102         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26103         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26104         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26105         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
26106         end loop
26107
26108         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
26109         properties that track the label for the current loop (begin of the
26110         loop and end of the loop).
26111
26112 2001-10-15  Ravi Pratap  <ravi@ximian.com>
26113
26114         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
26115         use of emitting anything at all.
26116
26117         * class.cs, rootcontext.cs : Get rid of calls to the same.
26118
26119         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
26120
26121         (Populate): Define the constructor correctly and set the implementation
26122         attributes.
26123
26124         * typemanager.cs (delegate_types): New hashtable to hold delegates that
26125         have been defined.
26126
26127         (AddDelegateType): Implement.
26128
26129         (IsDelegateType): Implement helper method.
26130
26131         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
26132
26133         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
26134         and accordingly handle it.
26135
26136         * delegate.cs (Populate): Take TypeContainer argument.
26137         Implement bits to define the Invoke method. However, I still haven't figured out
26138         how to take care of the native int bit :-(
26139
26140         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
26141         Qualify the name of the delegate, not its return type !
26142
26143         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
26144         conversion.
26145
26146         (StandardConversionExists): Checking for array types turns out to be recursive.
26147
26148         (ConvertReferenceExplicit): Implement array conversion.
26149
26150         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
26151
26152 2001-10-12  Ravi Pratap  <ravi@ximian.com>
26153
26154         * cs-parser.jay (delegate_declaration): Store the fully qualified
26155         name as it is a type declaration.
26156
26157         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
26158         readonly.
26159
26160         (DefineDelegate): Renamed from Define. Does the same thing essentially,
26161         as TypeContainer::DefineType.
26162
26163         (Populate): Method in which all the definition of the various methods (Invoke)
26164         etc is done.
26165
26166         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
26167         see.
26168
26169         (CloseDelegate): Finally creates the delegate.
26170
26171         * class.cs (TypeContainer::DefineType): Update to define delegates.
26172         (Populate, Emit and CloseType): Do the same thing here too.
26173
26174         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26175         delegates in all these operations.
26176
26177 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
26178
26179         * expression.cs: LocalTemporary: a new expression used to
26180         reference a temporary that has been created.
26181
26182         * assign.cs: Handle PropertyAccess back here, so that we can
26183         provide the proper semantic access to properties.
26184
26185         * expression.cs (Expression::ConvertReferenceExplicit): Implement
26186         a few more explicit conversions. 
26187
26188         * modifiers.cs: `NEW' modifier maps to HideBySig.
26189
26190         * expression.cs (PropertyExpr): Make this into an
26191         ExpressionStatement, and support the EmitStatement code path. 
26192
26193         Perform get/set error checking, clean up the interface.
26194
26195         * assign.cs: recognize PropertyExprs as targets, and if so, turn
26196         them into toplevel access objects.
26197
26198 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
26199
26200         * expression.cs: PropertyExpr::PropertyExpr: use work around the
26201         SRE.
26202
26203         * typemanager.cs: Keep track here of our PropertyBuilders again to
26204         work around lameness in SRE.
26205
26206 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
26207
26208         * expression.cs (LValue::LValueResolve): New method in the
26209         interface, used to perform a second resolution pass for LValues. 
26210
26211         (This::DoResolve): Catch the use of this in static methods.
26212
26213         (This::LValueResolve): Implement.
26214
26215         (This::Store): Remove warning, assigning to `this' in structures
26216         is 
26217
26218         (Invocation::Emit): Deal with invocation of
26219         methods on value types.  We need to pass the address to structure
26220         methods rather than the object itself.  (The equivalent code to
26221         emit "this" for structures leaves the entire structure on the
26222         stack instead of a pointer to it). 
26223
26224         (ParameterReference::DoResolve): Compute the real index for the
26225         argument based on whether the method takes or not a `this' pointer
26226         (ie, the method is static).
26227
26228         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26229         value types returned from functions when we need to invoke a
26230         method on the sturcture.
26231
26232
26233 2001-10-11  Ravi Pratap  <ravi@ximian.com>
26234
26235         * class.cs (TypeContainer::DefineType): Method to actually do the business of
26236         defining the type in the Modulebuilder or Typebuilder. This is to take
26237         care of nested types which need to be defined on the TypeBuilder using
26238         DefineNestedMethod.
26239
26240         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
26241         methods in RootContext, only ported to be part of TypeContainer.
26242
26243         (TypeContainer::GetInterfaceOrClass): Ditto.
26244
26245         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26246
26247         * interface.cs (Interface::DefineInterface): New method. Does exactly
26248         what RootContext.CreateInterface did earlier, only it takes care of nested types 
26249         too.
26250
26251         (Interface::GetInterfaces): Move from RootContext here and port.
26252
26253         (Interface::GetInterfaceByName): Same here.
26254
26255         * rootcontext.cs (ResolveTree): Re-write.
26256
26257         (PopulateTypes): Re-write.
26258
26259         * class.cs (TypeContainer::Populate): Populate nested types too.
26260         (TypeContainer::Emit): Emit nested members too.
26261
26262         * typemanager.cs (AddUserType): Do not make use of the FullName property,
26263         instead just use the name argument passed in as it is already fully
26264         qualified.
26265
26266         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26267         to TypeContainer mapping to see if a type is user-defined.
26268
26269         * class.cs (TypeContainer::CloseType): Implement. 
26270
26271         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26272         the default constructor.
26273
26274         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26275         twice.
26276
26277         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26278
26279         * interface.cs (CloseType): Create the type here.
26280
26281         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26282         the hierarchy.
26283
26284         Remove all the methods which are now in TypeContainer.
26285
26286 2001-10-10  Ravi Pratap  <ravi@ximian.com>
26287
26288         * delegate.cs (Define): Re-write bits to define the delegate
26289         correctly.
26290
26291 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
26292
26293         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26294
26295         * expression.cs (ImplicitReferenceConversion): handle null as well
26296         as a source to convert to any reference type.
26297
26298         * statement.cs (Return): Perform any implicit conversions to
26299         expected return type.  
26300
26301         Validate use of return statement.  
26302
26303         * codegen.cs (EmitContext): Pass the expected return type here.
26304
26305         * class.cs (Method, Constructor, Property): Pass expected return
26306         type to EmitContext.
26307
26308 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
26309
26310         * expression.cs: Make DoResolve take an EmitContext instead of a
26311         TypeContainer.
26312
26313         Replaced `l' and `location' for `loc', for consistency.
26314
26315         (Error, Warning): Remove unneeded Tc argument.
26316
26317         * assign.cs, literal.cs, constant.cs: Update to new calling
26318         convention. 
26319
26320         * codegen.cs: EmitContext now contains a flag indicating whether
26321         code is being generated in a static method or not.
26322
26323         * cs-parser.jay: DecomposeQI, new function that replaces the old
26324         QualifiedIdentifier.  Now we always decompose the assembled
26325         strings from qualified_identifier productions into a group of
26326         memberaccesses.
26327
26328 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
26329
26330         * rootcontext.cs: Deal with field-less struct types correctly now
26331         by passing the size option to Define Type.
26332
26333         * class.cs: Removed hack that created one static field. 
26334
26335 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26336
26337         * statement.cs: Moved most of the code generation here. 
26338
26339 2001-10-09  Ravi Pratap  <ravi@ximian.com>
26340
26341         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26342         seem very right.
26343
26344         (ElementAccess): Remove useless bits for now - keep checks as the spec
26345         says.
26346
26347 2001-10-08  Ravi Pratap  <ravi@ximian.com>
26348
26349         * expression.cs (ElementAccess::DoResolve): Remove my crap code
26350         and start performing checks according to the spec.
26351
26352 2001-10-07  Ravi Pratap  <ravi@ximian.com>
26353
26354         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26355         rank_specifiers instead.
26356
26357         (rank_specifiers): Change the order in which the rank specifiers are stored
26358
26359         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26360
26361         * expression.cs (ElementAccess): Implement the LValue interface too.
26362
26363 2001-10-06  Ravi Pratap  <ravi@ximian.com>
26364
26365         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26366         except that user defined conversions are not included.
26367
26368         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
26369         perform the conversion of the return type, if necessary.
26370
26371         (New::DoResolve): Check whether we are creating an array or an object
26372         and accordingly do the needful.
26373
26374         (New::Emit): Same here.
26375
26376         (New::DoResolve): Implement guts of array creation.
26377
26378         (New::FormLookupType): Helper function.
26379
26380 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26381
26382         * codegen.cs: Removed most of the code generation here, and move the
26383         corresponding code generation bits to the statement classes. 
26384
26385         Added support for try/catch/finalize and throw.
26386
26387         * cs-parser.jay: Added support for try/catch/finalize.
26388
26389         * class.cs: Catch static methods having the flags override,
26390         virtual or abstract.
26391
26392         * expression.cs (UserCast): This user cast was not really doing
26393         what it was supposed to do.  Which is to be born in fully resolved
26394         state.  Parts of the resolution were being performed at Emit time! 
26395
26396         Fixed this code.
26397
26398 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26399
26400         * expression.cs: Implicity convert the result from UserCast.
26401
26402 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26403
26404         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26405         prevented it from working correctly. 
26406
26407         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26408         merely ConvertImplicit.
26409
26410 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26411
26412         * typemanager.cs: Make the LookupTypeContainer function static,
26413         and not per-instance.  
26414
26415         * class.cs: Make static FindMembers (the one that takes a Type
26416         argument). 
26417
26418         * codegen.cs: Add EmitForeach here.
26419
26420         * cs-parser.jay: Make foreach a toplevel object instead of the
26421         inline expansion, as we need to perform semantic analysis on it. 
26422
26423 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26424
26425         * expression.cs (Expression::ImplicitUserConversion): Rename to
26426         UserDefinedConversion.
26427
26428         (Expression::UserDefinedConversion): Take an extra argument specifying 
26429         whether we look for explicit user conversions too.
26430
26431         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26432
26433         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26434
26435         (ExplicitUserConversion): Make it a call to UserDefinedConversion
26436         with the appropriate arguments.
26437
26438         * cs-parser.jay (cast_expression): Record location too.
26439
26440         * expression.cs (Cast): Record location info.
26441
26442         (Expression::ConvertExplicit): Take location argument.
26443
26444         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26445         to determine if we are doing explicit conversions.
26446
26447         (UserCast::Emit): Update accordingly.
26448
26449         (Expression::ConvertExplicit): Report an error if everything fails.
26450
26451         * ../errors/cs0030.cs : Add.
26452
26453 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
26454
26455         * modifiers.cs: If the ABSTRACT keyword is present, also set the
26456         virtual and newslot bits. 
26457
26458         * class.cs (TypeContainer::RegisterRequiredImplementations):
26459         Record methods we need.
26460
26461         (TypeContainer::MakeKey): Helper function to make keys for
26462         MethodBases, since the Methodbase key is useless.
26463
26464         (TypeContainer::Populate): Call RegisterRequiredImplementations
26465         before defining the methods.   
26466
26467         Create a mapping for method_builders_to_methods ahead of time
26468         instead of inside a tight loop.
26469
26470         (::RequireMethods):  Accept an object as the data to set into the
26471         hashtable so we can report interface vs abstract method mismatch.
26472
26473 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26474
26475         * report.cs: Make all of it static.
26476
26477         * rootcontext.cs: Drop object_type and value_type computations, as
26478         we have those in the TypeManager anyways.
26479
26480         Drop report instance variable too, now it is a global.
26481
26482         * driver.cs: Use try/catch on command line handling.
26483
26484         Add --probe option to debug the error reporting system with a test
26485         suite. 
26486
26487         * report.cs: Add support for exiting program when a probe
26488         condition is reached.
26489
26490 2001-10-03  Ravi Pratap  <ravi@ximian.com>
26491
26492         * expression.cs (Binary::DoNumericPromotions): Fix the case when
26493         we do a forcible conversion regardless of type, to check if 
26494         ForceConversion returns a null.
26495
26496         (Binary::error19): Use location to report error.
26497
26498         (Unary::error23): Use location here too.
26499
26500         * ../errors/cs0019.cs : Check in.
26501
26502         * ../errors/cs0023.cs : Check in.
26503
26504         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26505         case of a non-null MethodInfo object with a length of 0 !
26506
26507         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26508         an applicable member - according to the spec :-)
26509         Also fix logic to find members in base types.
26510
26511         (Unary::ResolveOperator): Same here.
26512
26513         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26514         as I was getting thoroughly confused between this and error19 :-)
26515
26516         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26517         (::FindMostEncompassedType): Implement.
26518         (::FindMostEncompassingType): Implement.
26519         (::StandardConversionExists): Implement.
26520
26521         (UserImplicitCast): Re-vamp. We now need info about most specific
26522         source and target types so that we can do the necessary conversions.
26523
26524         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26525         mathematical union with no duplicates.
26526
26527 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26528
26529         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26530         in order from base classes to child classes, so that we can in
26531         child classes look up in our parent for method names and
26532         attributes (required for handling abstract, virtual, new, override
26533         constructs: we need to instrospect our base class, and if we dont
26534         populate the classes in order, the introspection might be
26535         incorrect.  For example, a method could query its parent before
26536         the parent has any methods and would determine that the parent has
26537         no abstract methods (while it could have had them)).
26538
26539         (RootContext::CreateType): Record the order in which we define the
26540         classes.
26541
26542 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26543
26544         * class.cs (TypeContainer::Populate): Also method definitions can
26545         fail now, keep track of this.
26546
26547         (TypeContainer::FindMembers): Implement support for
26548         DeclaredOnly/noDeclaredOnly flag.
26549
26550         (Constructor::Emit) Return the ConstructorBuilder.
26551
26552         (Method::Emit) Return the MethodBuilder. 
26553         Check for abstract or virtual methods to be public.
26554
26555         * rootcontext.cs (RootContext::CreateType): Register all the
26556         abstract methods required for the class to be complete and the
26557         interface methods that must be implemented. 
26558
26559         * cs-parser.jay: Report error 501 (method requires body if it is
26560         not marked abstract or extern).
26561
26562         * expression.cs (TypeOf::Emit): Implement.
26563
26564         * typemanager.cs: runtime_handle_type, new global type.
26565
26566         * class.cs (Property::Emit): Generate code for properties.
26567
26568 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26569
26570         * expression.cs (Unary::ResolveOperator): Find operators on base type
26571         too - we now conform exactly to the spec.
26572
26573         (Binary::ResolveOperator): Same here.
26574
26575         * class.cs (Operator::Define): Fix minor quirk in the tests.
26576
26577         * ../errors/cs0215.cs : Added.
26578
26579         * ../errors/cs0556.cs : Added.
26580
26581         * ../errors/cs0555.cs : Added.
26582
26583 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26584
26585         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26586         single integer which is really efficient
26587
26588 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26589
26590         *  expression.cs (Expression::ImplicitUserConversion): Use location
26591         even in the case when we are examining True operators.
26592  
26593         * class.cs (Operator::Define): Perform extensive checks to conform
26594         with the rules for operator overloading in the spec.
26595
26596         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26597         some of the other conversions mentioned in the spec.
26598
26599         * typemanager.cs (array_type): New static member for the System.Array built-in
26600         type.
26601
26602         (cloneable_interface): For System.ICloneable interface.
26603
26604         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26605         we start resolving the tree and populating types.
26606
26607         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26608  
26609 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26610
26611         * expression.cs (Expression::ExprClassFromMemberInfo,
26612         Expression::Literalize): Create literal expressions from
26613         FieldInfos which are literals.
26614
26615         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26616         type casts, because they were wrong.  The test suite in tests
26617         caught these ones.
26618
26619         (ImplicitNumericConversion): ushort to ulong requires a widening
26620         cast. 
26621
26622         Int32 constant to long requires widening cast as well.
26623
26624         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26625         for integers because the type on the stack is not i4.
26626
26627 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26628
26629         * expression.cs (report118): require location argument. 
26630
26631         * parameter.cs: Do not dereference potential null value.
26632
26633         * class.cs: Catch methods that lack the `new' keyword when
26634         overriding a name.  Report warnings when `new' is used without
26635         anything being there to override.
26636
26637         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26638
26639         * class.cs: Only add constructor to hashtable if it is non-null
26640         (as now constructors can fail on define).
26641
26642         (TypeManager, Class, Struct): Take location arguments.
26643
26644         Catch field instance initialization in structs as errors.
26645
26646         accepting_filter: a new filter for FindMembers that is static so
26647         that we dont create an instance per invocation.
26648
26649         (Constructor::Define): Catch errors where a struct constructor is
26650         parameterless 
26651
26652         * cs-parser.jay: Pass location information for various new
26653         constructs. 
26654
26655         * delegate.cs (Delegate): take a location argument.
26656
26657         * driver.cs: Do not call EmitCode if there were problesm in the
26658         Definition of the types, as many Builders wont be there. 
26659
26660         * decl.cs (Decl::Decl): Require a location argument.
26661
26662         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26663         into integers, and find the most appropiate integer for it.
26664
26665         * literal.cs: Implement ULongLiteral.
26666
26667         * rootcontext.cs: Provide better information about the location of
26668         failure when CreateType fails.
26669
26670 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26671
26672         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26673         as well.
26674
26675         * expression.cs (Binary::CheckShiftArguments): Add missing type
26676         computation.
26677         (Binary::ResolveOperator): Add type to the logical and and logical
26678         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26679         before.
26680
26681         (Binary::DoNumericPromotions): In the case where either argument
26682         is ulong (and most signed types combined with ulong cause an
26683         error) perform implicit integer constant conversions as well.
26684
26685 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26686
26687         * expression.cs (UserImplicitCast): Method should always be
26688         non-null. 
26689         (Invocation::BetterConversion): Simplified test for IntLiteral.
26690
26691         (Expression::ImplicitNumericConversion): Split this routine out.
26692         Put the code that performs implicit constant integer conversions
26693         here. 
26694
26695         (Expression::Resolve): Become a wrapper around DoResolve so we can
26696         check eclass and type being set after resolve.
26697
26698         (Invocation::Badness): Remove this dead function
26699
26700         (Binary::ResolveOperator): Do not compute the expensive argumnets
26701         unless we have a union for it.
26702
26703         (Probe::Emit): Is needs to do an isinst and then
26704         compare against null.
26705
26706         (::CanConvert): Added Location argument.  If the Location argument
26707         is null (Location.Null), then we do not report errors.  This is
26708         used by the `probe' mechanism of the Explicit conversion.  We do
26709         not want to generate an error for something that the user
26710         explicitly requested to be casted.  But the pipeline for an
26711         explicit cast first tests for potential implicit casts.
26712
26713         So for now, if the Location is null, it means `Probe only' to
26714         avoid adding another argument.   Might have to revise this
26715         strategy later.
26716
26717         (ClassCast): New class used to type cast objects into arbitrary
26718         classes (used in Explicit Reference Conversions).
26719
26720         Implement `as' as well.
26721
26722         Reverted all the patches from Ravi below: they were broken:
26723
26724                 * The use of `level' as a mechanism to stop recursive
26725                   invocations is wrong.  That was there just to catch the
26726                   bug with a strack trace but not as a way of addressing
26727                   the problem.
26728
26729                   To fix the problem we have to *understand* what is going
26730                   on and the interactions and come up with a plan, not
26731                   just get things going.
26732
26733                 * The use of the type conversion cache that I proposed
26734                   last night had an open topic: How does this work across
26735                   protection domains.  A user defined conversion might not
26736                   be public in the location where we are applying the
26737                   conversion, a different conversion might be selected
26738                   (ie, private A->B (better) but public B->A (worse),
26739                   inside A, A->B applies, but outside it, B->A will
26740                   apply).
26741
26742                 * On top of that (ie, even if the above is solved),
26743                   conversions in a cache need to be abstract.  Ie, `To
26744                   convert from an Int to a Short use an OpcodeCast', not
26745                   `To convert from an Int to a Short use the OpcodeCast on
26746                   the variable 5' (which is what this patch was doing).
26747
26748 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26749
26750         * expression.cs (Invocation::ConversionExists): Re-write to use
26751         the conversion cache
26752
26753         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26754         cache all conversions done, not just user-defined ones.
26755
26756         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26757         to determine if a conversion exists instead of acutually trying to 
26758         perform the conversion. It's faster too.
26759
26760         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26761         and only then attempt the implicit conversion.
26762
26763 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26764
26765         * expression.cs (ConvertImplicit): Use a cache for conversions
26766         already found. Check level of recursion and bail out if necessary.
26767
26768 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26769
26770         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26771         Export standard methods that we expect for string operations.
26772
26773         * statement.cs (Block::UsageWarning): Track usage of variables and
26774         report the errors for not used variables.
26775
26776         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26777         operator. 
26778
26779 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26780
26781         * codegen.cs: remove unnneded code 
26782
26783         * expression.cs: Removed BuiltinTypeAccess class
26784
26785         Fix the order in which implicit conversions are
26786         done.  
26787
26788         The previous fixed dropped support for boxed conversions (adding a
26789         test to the test suite now)
26790
26791         (UserImplicitCast::CanConvert): Remove test for source being null,
26792         that code is broken.  We should not feed a null to begin with, if
26793         we do, then we should track the bug where the problem originates
26794         and not try to cover it up here.
26795
26796         Return a resolved expression of type UserImplicitCast on success
26797         rather than true/false.  Ravi: this is what I was talking about,
26798         the pattern is to use a static method as a "constructor" for
26799         objects. 
26800
26801         Also, do not create arguments until the very last minute,
26802         otherwise we always create the arguments even for lookups that
26803         will never be performed. 
26804
26805         (UserImplicitCast::Resolve): Eliminate, objects of type
26806         UserImplicitCast are born in a fully resolved state. 
26807
26808         * typemanager.cs (InitCoreTypes): Init also value_type
26809         (System.ValueType). 
26810
26811         * expression.cs (Cast::Resolve): First resolve the child expression.
26812
26813         (LValue): Add new method AddressOf to be used by
26814         the `&' operator.  
26815
26816         Change the argument of Store to take an EmitContext instead of an
26817         ILGenerator, because things like FieldExpr need to be able to call
26818         their children expression to generate the instance code. 
26819
26820         (Expression::Error, Expression::Warning): Sugar functions for
26821         reporting errors.
26822
26823         (Expression::MemberLookup): Accept a TypeContainer instead of a
26824         Report as the first argument.
26825
26826         (Expression::ResolvePrimary): Killed.  I still want to improve
26827         this as currently the code is just not right.
26828
26829         (Expression::ResolveMemberAccess): Simplify, but it is still
26830         wrong. 
26831
26832         (Unary::Resolve): Catch errors in AddressOf operators.
26833
26834         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26835         index to a byte for the short-version, or the compiler will choose
26836         the wrong Emit call, which generates the wrong data.
26837
26838         (ParameterReference::Emit, ::Store): same.
26839
26840         (FieldExpr::AddressOf): Implement.
26841
26842         * typemanager.cs: TypeManager: made public variable instead of
26843         property.
26844
26845         * driver.cs: document --fatal.
26846
26847         * report.cs (ErrorMessage, WarningMessage): new names for the old
26848         Error and Warning classes.
26849
26850         * cs-parser.jay (member_access): Turn built-in access to types
26851         into a normal simplename
26852
26853 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26854
26855         * expression.cs (Invocation::BetterConversion): Fix to cope
26856         with q being null, since this was introducing a bug.
26857
26858         * expression.cs (ConvertImplicit): Do built-in conversions first.
26859
26860 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26861
26862         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26863
26864 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26865
26866         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26867         I had introduced long ago (what's new ?).
26868
26869         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26870         the work of all the checking. 
26871         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26872         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26873
26874         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26875         that is the right way. 
26876
26877         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26878         overloading resolution. Use everywhere instead of cutting and pasting code.
26879
26880         (Binary::ResolveOperator): Use MakeUnionSet.
26881
26882         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26883         we have to convert to bool types. Not complete yet.
26884
26885 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26886
26887         * typemanager.cs (TypeManager::CSharpName): support ushort.
26888
26889         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26890         to provide an expression that performsn an implicit constant int
26891         conversion (section 6.1.6).
26892         (Expression::ConvertImplicitRequired): Reworked to include
26893         implicit constant expression conversions.
26894
26895         (Expression::ConvertNumericExplicit): Finished.
26896
26897         (Invocation::Emit): If InstanceExpression is null, then it means
26898         that we perform a call on this.
26899
26900 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26901
26902         * expression.cs (Unary::Emit): Remove some dead code.
26903         (Probe): Implement Resolve and Emit for `is'.
26904         (Expression::ConvertImplicitRequired): Attempt to do constant
26905         expression conversions here.  Maybe should be moved to
26906         ConvertImplicit, but I am not sure.
26907         (Expression::ImplicitLongConstantConversionPossible,
26908         Expression::ImplicitIntConstantConversionPossible): New functions
26909         that tell whether is it possible to apply an implicit constant
26910         expression conversion.
26911
26912         (ConvertNumericExplicit): Started work on explicit numeric
26913         conversions.
26914
26915         * cs-parser.jay: Update operator constants.
26916
26917         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26918         (Parameters::GetSignature): Hook up VerifyArgs here.
26919         (Parameters::VerifyArgs): Verifies that no two arguments have the
26920         same name. 
26921
26922         * class.cs (Operator): Update the operator names to reflect the
26923         ones that the spec expects (as we are just stringizing the
26924         operator names).
26925
26926         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26927         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26928         previous usage did only work for our methods.
26929         (Expression::ConvertImplicit): Handle decimal implicit numeric
26930         conversions as well.
26931         (Expression::InternalTypeConstructor): Used to invoke constructors
26932         on internal types for default promotions.
26933
26934         (Unary::Emit): Implement special handling for the pre/post
26935         increment/decrement for overloaded operators, as they need to have
26936         the same semantics as the other operators.
26937
26938         (Binary::ResolveOperator): ditto.
26939         (Invocation::ConversionExists): ditto.
26940         (UserImplicitCast::Resolve): ditto.
26941
26942 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26943
26944         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26945         operator, return after emitting body. Regression tests pass again !
26946
26947         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26948         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26949         (Invocation::OverloadResolve): Ditto.
26950         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26951
26952         * everywhere : update calls to the above methods accordingly.
26953
26954 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26955
26956         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26957
26958         * expression.cs (ExpressionStatement): New base class used for
26959         expressions that can appear in statements, so that we can provide
26960         an alternate path to generate expression that do not leave a value
26961         on the stack.
26962
26963         (Expression::Emit, and all the derivatives): We no longer return
26964         whether a value is left on the stack or not.  Every expression
26965         after being emitted leaves a single value on the stack.
26966
26967         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26968         facilties of ExpressionStatement if possible.
26969
26970         * cs-parser.jay: Update statement_expression.
26971
26972 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26973
26974         * driver.cs: Change the wording of message
26975
26976 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26977
26978         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26979         the type of the expression to the return type of the method if
26980         we have an overloaded operator match ! The regression tests pass again !
26981         (Unary::ResolveOperator): Ditto.
26982
26983         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26984         to find "op_Implicit", not "implicit" ;-)
26985         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26986         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26987
26988         * everywhere : Correct calls to the above accordingly.
26989
26990         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26991         (ConvertImplicit): Do user-defined conversion if it exists.
26992
26993 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26994
26995         * assign.cs: track location.
26996         (Resolve): Use implicit conversions on assignment.
26997
26998         * literal.cs: Oops.  Not good, Emit of short access values should
26999         pass (Bytes) or the wrong argument will be selected.
27000
27001         * expression.cs (Unary::Emit): Emit code for -expr.
27002
27003         (Unary::ResolveOperator): Handle `Substract' for non-constants
27004         (substract from zero from the non-constants).
27005         Deal with Doubles as well. 
27006
27007         (Expression::ConvertImplicitRequired): New routine that reports an
27008         error if no implicit conversion exists. 
27009
27010         (Invocation::OverloadResolve): Store the converted implicit
27011         expressions if we make them
27012
27013 2001-09-24  Ravi Pratap  <ravi@ximian.com>
27014
27015         * class.cs (ConstructorInitializer): Take a Location argument.
27016         (ConstructorBaseInitializer): Same here.
27017         (ConstructorThisInitializer): Same here.
27018
27019         * cs-parser.jay : Update all calls accordingly.
27020
27021         * expression.cs (Unary, Binary, New): Take location argument.
27022         Update accordingly everywhere.
27023
27024         * cs-parser.jay : Update all calls to the above to take a location
27025         argument.
27026
27027         * class.cs : Ditto.
27028
27029 2001-09-24  Ravi Pratap  <ravi@ximian.com>
27030
27031         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
27032         (Invocation::BetterConversion): Same here
27033         (Invocation::ConversionExists): Ditto.
27034
27035         (Invocation::ConversionExists): Implement.
27036
27037 2001-09-22  Ravi Pratap  <ravi@ximian.com>
27038
27039         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
27040         Also take an additional TypeContainer argument.
27041
27042         * All over : Pass in TypeContainer as argument to OverloadResolve.
27043
27044         * typemanager.cs (CSharpName): Update to check for the string type and return
27045         that too.
27046
27047         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
27048         a given method.
27049
27050 2001-09-21  Ravi Pratap  <ravi@ximian.com>
27051
27052         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
27053         (Invocation::BetterFunction): Implement.
27054         (Invocation::BetterConversion): Implement.
27055         (Invocation::ConversionExists): Skeleton, no implementation yet.
27056
27057         Okay, things work fine !
27058
27059 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
27060
27061         * typemanager.cs: declare and load enum_type, delegate_type and
27062         void_type. 
27063
27064         * expression.cs (Expression::Emit): Now emit returns a value that
27065         tells whether a value is left on the stack or not.  This strategy
27066         might be reveted tomorrow with a mechanism that would address
27067         multiple assignments.
27068         (Expression::report118): Utility routine to report mismatches on
27069         the ExprClass.
27070
27071         (Unary::Report23): Report impossible type/operator combination
27072         utility function.
27073
27074         (Unary::IsIncrementableNumber): Whether the type can be
27075         incremented or decremented with add.
27076         (Unary::ResolveOperator): Also allow enumerations to be bitwise
27077         complemented. 
27078         (Unary::ResolveOperator): Implement ++, !, ~,
27079
27080         (Invocation::Emit): Deal with new Emit convetion.
27081
27082         * All Expression derivatives: Updated their Emit method to return
27083         whether they leave values on the stack or not.
27084
27085         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
27086         stack for expressions that are statements. 
27087
27088 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
27089
27090         * expression.cs (LValue): New interface.  Must be implemented by
27091         LValue objects.
27092         (LocalVariableReference, ParameterReference, FieldExpr): Implement
27093         LValue interface.
27094
27095         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
27096         interface for generating code, simplifies the code.
27097
27098 2001-09-20  Ravi Pratap  <ravi@ximian.com>
27099
27100         * expression.cs (everywhere): Comment out return statements in ::Resolve
27101         methods to avoid the warnings.
27102
27103 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
27104
27105         * driver.cs (parse): Report error 2001 if we can not open the
27106         source file.
27107
27108         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
27109         not resolve it.
27110
27111         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
27112         object. 
27113
27114         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
27115         otherwise nested blocks end up with the same index.
27116
27117         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
27118
27119         * expression.cs:  Instead of having FIXMEs in the Resolve
27120         functions, throw exceptions so it is obvious that we are facing a
27121         bug. 
27122
27123         * cs-parser.jay (invocation_expression): Pass Location information.
27124
27125         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
27126         Use a basename for those routines because .NET does not like paths
27127         on them. 
27128
27129         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
27130         already defined.
27131
27132 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
27133
27134         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
27135         are loading the correct data types (throws an exception if not).
27136         (TypeManager::InitCoreTypes): Use CoreLookupType
27137
27138         * expression.cs (Unary::ResolveOperator): return the child
27139         expression for expressions which are just +expr.
27140         (Unary::ResolveOperator): Return negative literals for -LITERAL
27141         expressions (otherwise they are Unary {Literal}).
27142         (Invocation::Badness): Take into account `Implicit constant
27143         expression conversions'.
27144
27145         * literal.cs (LongLiteral): Implement long literal class.
27146         (IntLiteral): export the `Value' of the intliteral. 
27147
27148 2001-09-19  Ravi Pratap  <ravi@ximian.com>
27149
27150         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
27151
27152         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
27153         instead of 'Operator'
27154
27155         * expression.cs (Binary::ResolveOperator): Update accordingly.
27156         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
27157         and 'Minus'
27158
27159         * cs-parser.jay (unary_expression): Update to use the new names.
27160
27161         * gen-treedump.cs (GetUnary): Same here.
27162
27163         * expression.cs (Unary::Resolve): Implement.
27164         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
27165         operators are found instead of making noise ;-)
27166         (Unary::ResolveOperator): New method to do precisely the same thing which
27167         Binary::ResolveOperator does for Binary expressions.
27168         (Unary.method, .Arguments): Add.
27169         (Unary::OperName): Implement.   
27170         (Unary::ForceConversion): Copy and Paste !
27171
27172         * class.cs (Operator::Define): Fix a small bug for the case when we have 
27173         a unary operator.
27174
27175         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27176         for the inbuilt operators. Only overloading works for now ;-)
27177
27178 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
27179
27180         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27181         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27182
27183         * expression.cs (This::Emit): Implement. 
27184         (This::Resolve): Implement.
27185         (TypeOf:Resolve): Implement.
27186         (Expression::ResolveSimpleName): Add an implicit this to instance
27187         field references. 
27188         (MemberAccess::Resolve): Deal with Parameters and Fields. 
27189         Bind instance variable to Field expressions.
27190         (FieldExpr::Instance): New field used to track the expression that
27191         represents the object instance.
27192         (FieldExpr::Resolve): Track potential errors from MemberLookup not
27193         binding 
27194         (FieldExpr::Emit): Implement.
27195
27196         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27197         the last instruction contains a return opcode to avoid generating
27198         the last `ret' instruction (this generates correct code, and it is
27199         nice to pass the peverify output).
27200
27201         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27202         initializer for static and instance variables.
27203         (Constructor::Emit): Allow initializer to be null in the case of
27204         static constructors.  Only emit initializer for instance
27205         constructors. 
27206
27207         (TypeContainer::FindMembers): Return a null array if there are no
27208         matches.
27209
27210         Also fix the code for the MemberTypes.Method branch, as it was not
27211         scanning that for operators (or tried to access null variables before).
27212
27213         * assign.cs (Assign::Emit): Handle instance and static fields. 
27214
27215         * TODO: Updated.
27216
27217         * driver.cs: Stop compilation if there are parse errors.
27218
27219         * cs-parser.jay (constructor_declaration): Provide default base
27220         initializer for non-static constructors.
27221         (constructor_declarator): Do not provide a default base
27222         initializers if none was specified.
27223         Catch the fact that constructors should not have parameters.
27224
27225         * class.cs: Do not emit parent class initializers for static
27226         constructors, that should be flagged as an error.
27227
27228 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27229
27230         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27231         Move back code into TypeContainer::Populate.
27232
27233 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27234
27235         * class.cs (TypeContainer::AddConstructor): Fix the check to
27236         compare against Name, not Basename. 
27237         (Operator::OpType): Change Plus and Minus to Add and Subtract.
27238
27239         * cs-parser.jay : Update accordingly.
27240
27241         * class.cs (TypeContainer::FindMembers): For the case where we are searching
27242         for methods, don't forget to look into the operators too.
27243         (RegisterMethodBuilder): Helper method to take care of this for
27244         methods, constructors and operators.
27245         (Operator::Define): Completely revamp.
27246         (Operator.OperatorMethod, MethodName): New fields.
27247         (TypeContainer::Populate): Move the registering of builders into
27248         RegisterMethodBuilder.
27249         (Operator::Emit): Re-write.
27250
27251         * expression.cs (Binary::Emit): Comment out code path to emit method
27252         invocation stuff for the case when we have a user defined operator. I am
27253         just not able to get it right !
27254
27255 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27256
27257         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27258         argument. 
27259
27260         (Expression::MemberLookup): Provide a version that allows to
27261         specify the MemberTypes and BindingFlags. 
27262
27263         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27264         so it was not fetching variable information from outer blocks.
27265
27266         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27267         Beforefieldinit as it was buggy.
27268
27269         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27270         that Ravi put here.  
27271
27272         * class.cs (Constructor::Emit): Only emit if block is not null.
27273         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27274         deal with this by semantically definining it as if the user had
27275         done it.
27276
27277         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27278         constructors as we now "emit" them at a higher level.
27279
27280         (TypeContainer::DefineDefaultConstructor): Used to define the
27281         default constructors if none was provided.
27282
27283         (ConstructorInitializer): Add methods Resolve and Emit. 
27284
27285         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27286
27287 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27288
27289         * class.cs (TypeContainer::EmitDefaultConstructor): Register
27290         the default constructor builder with our hashtable for methodbuilders
27291         to methodcores.
27292
27293         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27294         and argument_count is 0 in which case we have a match.
27295         (Binary::ResolveOperator): More null checking and miscellaneous coding
27296         style cleanup.
27297
27298 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27299
27300         * rootcontext.cs (IsNameSpace): Compare against null.
27301
27302         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27303
27304         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27305         and Unary::Operator.
27306
27307         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27308         accordingly.
27309
27310         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27311         we have overloaded operators.
27312         (Binary::ResolveOperator): Implement the part which does the operator overload
27313         resolution.
27314
27315         * class.cs (Operator::Emit): Implement.
27316         (TypeContainer::Emit): Emit the operators we have too.
27317
27318         * expression.cs (Binary::Emit): Update to emit the appropriate code for
27319         the case when we have a user-defined operator.
27320
27321 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27322
27323         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27324
27325 2001-09-16  Ravi Pratap  <ravi@ximian.com>
27326
27327         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27328         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27329         (Constructor::Emit): Implement.
27330         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27331         if we have no work to do. 
27332         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
27333         Emit method.
27334
27335         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27336         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27337
27338         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27339         of parent.parent.
27340
27341 2001-09-15  Ravi Pratap  <ravi@ximian.com>
27342
27343         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27344         in the source.
27345         (Tree::RecordNamespace): Method to do what the name says ;-)
27346         (Tree::Namespaces): Property to get at the namespaces hashtable.
27347
27348         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
27349         keep track.
27350
27351         * rootcontext.cs (IsNamespace): Fixed it :-)
27352
27353 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27354
27355         * class.cs (TypeContainer::FindMembers): Add support for
27356         constructors. 
27357         (MethodCore): New class that encapsulates both the shared aspects
27358         of a Constructor and a Method.  
27359         (Method, Constructor): Factored pieces into MethodCore.
27360
27361         * driver.cs: Added --fatal which makes errors throw exceptions.
27362         Load System assembly as well as part of the standard library.
27363
27364         * report.cs: Allow throwing exceptions on errors for debugging.
27365
27366         * modifiers.cs: Do not use `parent', instead use the real type
27367         container to evaluate permission settings.
27368
27369         * class.cs: Put Ravi's patch back in.  He is right, and we will
27370         have to cope with the
27371
27372 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27373
27374         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27375         FamORAssem, not FamANDAssem.
27376
27377 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27378
27379         * driver.cs: Added --parse option that only parses its input files
27380         and terminates.
27381
27382         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
27383         incorrect.  IsTopLevel is not used to tell whether an object is
27384         root_types or not (that can be achieved by testing this ==
27385         root_types).  But to see if this is a top-level *class* (not
27386         necessarly our "toplevel" container). 
27387
27388 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27389
27390         * enum.cs (Enum::Define): Modify to call the Lookup method on the
27391         parent instead of a direct call to GetType.
27392
27393 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27394
27395         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27396         Modifiers.TypeAttr. This should just be a call to that method.
27397
27398         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27399         object so that we can determine if we are top-level or not.
27400
27401         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
27402         TypeContainer too.
27403
27404         * enum.cs (Enum::Define): Ditto.
27405
27406         * modifiers.cs (FieldAttr): Re-write.
27407
27408         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27409         (TypeContainer::HaveStaticConstructor): New property to provide access
27410         to precisely that info.
27411
27412         * modifiers.cs (MethodAttr): Re-write.
27413         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27414
27415         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27416         of top-level types as claimed.
27417
27418 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27419
27420         * expression.cs (MemberLookup): Fruitless attempt to lookup
27421         constructors.  Maybe I need to emit default constructors?  That
27422         might be it (currently .NET emits this for me automatically).
27423         (Invocation::OverloadResolve): Cope with Arguments == null.
27424         (Invocation::EmitArguments): new function, shared by the new
27425         constructor and us.
27426         (Invocation::Emit): Handle static and instance methods.  Emit
27427         proper call instruction for virtual or non-virtual invocations.
27428         (New::Emit): Implement.
27429         (New::Resolve): Implement.
27430         (MemberAccess:Resolve): Implement.
27431         (MethodGroupExpr::InstanceExpression): used conforming to the spec
27432         to track instances.
27433         (FieldExpr::Resolve): Set type.
27434
27435         * support.cs: Handle empty arguments.
27436                 
27437         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27438         SimpleLookup): Auxiliary routines to help parse a qualifier
27439         identifier.  
27440
27441         Update qualifier_identifier rule.
27442
27443         * codegen.cs: Removed debugging messages.
27444
27445         * class.cs: Make this a global thing, this acts just as a "key" to
27446         objects that we might have around.
27447
27448         (Populate): Only initialize method_builders_to_methods once.
27449
27450         * expression.cs (PropertyExpr): Initialize type from the
27451         PropertyType. 
27452
27453         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27454         Resolve pattern.  Attempt to implicitly convert value to boolean.
27455         Emit code.
27456
27457         * expression.cs: Set the type for the int32/int32 argument case.
27458         (Binary::ResolveOperator): Set the return type to boolean for
27459         comparission operators
27460
27461         * typemanager.cs: Remove debugging print code.
27462
27463         (Invocation::Resolve): resolve type.
27464
27465         * class.cs: Allocate a MemberInfo of the correct size, as the code
27466         elsewhere depends on the test to reflect the correct contents.
27467
27468         (Method::) Keep track of parameters, due to System.Reflection holes
27469
27470         (TypeContainer::Populate): Keep track of MethodBuilders to Method
27471         mapping here.
27472
27473         (TypeContainer::FindMembers): Use ArrayList and then copy an array
27474         of the exact size and return that.
27475
27476         (Class::LookupMethodByBuilder): New function that maps
27477         MethodBuilders to its methods.  Required to locate the information
27478         on methods because System.Reflection bit us again.
27479
27480         * support.cs: New file, contains an interface ParameterData and
27481         two implementations: ReflectionParameters and InternalParameters
27482         used to access Parameter information.  We will need to grow this
27483         as required.
27484
27485         * expression.cs (Invocation::GetParameterData): implement a cache
27486         and a wrapper around the ParameterData creation for methods. 
27487         (Invocation::OverloadResolve): Use new code.
27488
27489 2001-09-13  Ravi Pratap  <ravi@ximian.com>
27490
27491         * class.cs (TypeContainer::EmitField): Remove and move into 
27492         (Field::Define): here and modify accordingly.
27493         (Field.FieldBuilder): New member.
27494         (TypeContainer::Populate): Update accordingly.
27495         (TypeContainer::FindMembers): Implement.
27496
27497 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27498
27499         * statement.cs: (VariableInfo::VariableType): New field to be
27500         initialized with the full type once it is resolved. 
27501
27502 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
27503
27504         * parameter.cs (GetParameterInfo): Use a type cache to compute
27505         things only once, and to reuse this information
27506
27507         * expression.cs (LocalVariableReference::Emit): Implement.
27508         (OpcodeCast::Emit): fix.
27509
27510         (ParameterReference::Resolve): Implement.
27511         (ParameterReference::Emit): Implement.
27512
27513         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27514         that are expressions need to stay as Expressions.
27515
27516         * typemanager.cs (CSharpName): Returns the C# name of a type if
27517         possible. 
27518
27519         * expression.cs (Expression::ConvertImplicit): New function that
27520         implements implicit type conversions.
27521
27522         (Expression::ImplicitReferenceConversion): Implements implicit
27523         reference conversions.
27524
27525         (EmptyCast): New type for transparent casts.
27526
27527         (OpcodeCast): New type for casts of types that are performed with
27528         a sequence of bytecodes.
27529
27530         (BoxedCast): New type used for casting value types into reference
27531         types.  Emits a box opcode.
27532
27533         (Binary::DoNumericPromotions): Implements numeric promotions of
27534         and computation of the Binary::Type.
27535
27536         (Binary::EmitBranchable): Optimization.
27537
27538         (Binary::Emit): Implement code emission for expressions.
27539
27540         * typemanager.cs (TypeManager): Added two new core types: sbyte
27541         and byte.
27542
27543 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27544
27545         * class.cs (TypeContainer::FindMembers): Method which does exactly
27546         what Type.FindMembers does, only we don't have to use reflection. No
27547         implementation yet.
27548
27549         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27550         typecontainer objects as we need to get at them.
27551         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27552
27553         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27554         typecontainer object.
27555
27556         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27557         of just a Report object.
27558
27559 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27560
27561         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27562         "remove_"
27563         (TypeContainer::Populate): Now define the delegates of the type too.
27564         (TypeContainer.Delegates): Property to access the list of delegates defined
27565         in the type.
27566
27567         * delegates.cs (Delegate::Define): Implement partially.
27568
27569         * modifiers.cs (TypeAttr): Handle more flags.
27570
27571 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27572
27573         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27574         and not <=
27575         (Operator::Define): Re-write logic to get types by using the LookupType method
27576         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27577         (Indexer::Define): Ditto.
27578         (Event::Define): Ditto.
27579         (Property::Define): Ditto.
27580
27581 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27582
27583         * class.cs (TypeContainer::Populate): Now define operators too. 
27584         (TypeContainer.Operators): New property to access the list of operators
27585         in a type.
27586         (Operator.OperatorMethodBuilder): New member to hold the method builder
27587         for the operator we are defining.
27588         (Operator::Define): Implement.
27589
27590 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27591
27592         * class.cs (Event::Define): Make the prefixes of the accessor methods
27593         addOn_ and removeOn_ 
27594
27595         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27596         of the location being passed in too. Ideally, this should go later since all
27597         error reporting should be done through the Report object.
27598
27599         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27600         (Populate): Iterate thru the indexers we have and define them too.
27601         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27602         for the get and set accessors.
27603         (Indexer::Define): Implement.
27604
27605 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27606
27607         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27608         my previous implementation, did not work.
27609
27610         * typemanager.cs: Add a couple of missing types (the longs).
27611
27612         * literal.cs: Use TypeManager.bool_type instead of getting it.
27613
27614         * expression.cs (EventExpr): New kind of expressions.
27615         (Expressio::ExprClassFromMemberInfo): finish
27616
27617 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27618
27619         * assign.cs: Emit stores to static fields differently.
27620
27621 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27622
27623         * Merge in changes and adjust code to tackle conflicts. Backed out my
27624         code in Assign::Resolve ;-) 
27625
27626 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27627
27628         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27629         instead Report.Error and also pass in the location.
27630         (CSharpParser::Lexer): New readonly property to return the reference
27631         to the Tokenizer object.
27632         (declare_local_variables): Use Report.Error with location instead of plain 
27633         old error.
27634         (CheckDef): Ditto.
27635
27636         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27637         (Operator.CheckBinaryOperator): Ditto.
27638
27639         * cs-parser.jay (operator_declarator): Update accordingly.
27640
27641         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27642         (CheckBinaryOperator): Same here.
27643
27644         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27645         on the name without any prefixes of namespace names etc. This is because we
27646         already might have something already fully qualified like 
27647         'System.Console.WriteLine'
27648
27649         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27650
27651 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27652
27653         * cs-tokenizer.cs (location): Return a string which also contains
27654         the file name.
27655
27656         * expression.cs (ElementAccess): New class for expressions of the
27657         type 'element access.'
27658         (BaseAccess): New class for expressions of the type 'base access.'
27659         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27660         respectively.
27661
27662         * cs-parser.jay (element_access): Implement action.
27663         (base_access): Implement actions.
27664         (checked_expression, unchecked_expression): Implement.
27665
27666         * cs-parser.jay (local_variable_type): Correct and implement.
27667         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27668
27669         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27670
27671         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27672         name and the specifiers.
27673
27674         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27675
27676         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27677         making them all public ;-)
27678
27679         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27680         class anyways.
27681
27682 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27683
27684         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27685         PropertyExprs.
27686         (FieldExpr, PropertyExprs): New resolved expressions.
27687         (SimpleName::MemberStaticCheck): Perform static checks for access
27688         to non-static fields on static methods. Maybe this should be
27689         generalized for MemberAccesses. 
27690         (SimpleName::ResolveSimpleName): More work on simple name
27691         resolution. 
27692
27693         * cs-parser.jay (primary_expression/qualified_identifier): track
27694         the parameter index.
27695
27696         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27697         (EmitContext::EmitBoolExpression): Chain to expression generation
27698         instead of temporary hack.
27699         (::EmitStatementExpression): Put generic expression code generation.
27700
27701         * assign.cs (Assign::Emit): Implement variable assignments to
27702         local variables, parameters and fields.
27703
27704 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27705
27706         * statement.cs (Block::GetVariableInfo): New method, returns the
27707         VariableInfo for a variable name in a block.
27708         (Block::GetVariableType): Implement in terms of GetVariableInfo
27709
27710         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27711         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27712
27713 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27714
27715         * cs-parser.jay (operator_declaration): Continue on my quest : update
27716         to take attributes argument.
27717         (event_declaration): Ditto.
27718         (enum_declaration): Ditto.
27719         (indexer_declaration): Ditto.
27720
27721         * class.cs (Operator::Operator): Update constructor accordingly.
27722         (Event::Event): Ditto.
27723
27724         * delegate.cs (Delegate::Delegate): Same here.
27725
27726         * enum.cs (Enum::Enum): Same here.
27727
27728 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27729
27730         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27731
27732         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27733
27734         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27735         being passed around as an arraylist.
27736         (Attributes::AddAttribute): Method to add attribute sections.
27737
27738         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27739         (struct_declaration): Update accordingly.
27740         (constant_declaration): Update.
27741         (field_declaration): Update.
27742         (method_header): Update.
27743         (fixed_parameter): Update.
27744         (parameter_array): Ditto.
27745         (property_declaration): Ditto.
27746         (destructor_declaration): Ditto.
27747
27748         * class.cs (Struct::Struct): Update constructors accordingly.
27749         (Class::Class): Ditto.
27750         (Field::Field): Ditto.
27751         (Method::Method): Ditto.
27752         (Property::Property): Ditto.
27753         (TypeContainer::OptAttribute): update property's return type.
27754
27755         * interface.cs (Interface.opt_attributes): New member.
27756         (Interface::Interface): Update to take the extra Attributes argument.
27757
27758         * parameter.cs (Parameter::Parameter): Ditto.
27759
27760         * constant.cs (Constant::Constant): Ditto.
27761
27762         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27763         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27764         the attributes as a parameter.
27765         (InterfaceProperty): Update constructor call.
27766         (InterfaceEvent): Ditto.
27767         (InterfaceMethod): Ditto.
27768         (InterfaceIndexer): Ditto.
27769
27770         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27771         pass the attributes too.
27772         (interface_event_declaration): Ditto.
27773         (interface_property_declaration): Ditto.
27774         (interface_method_declaration): Ditto.
27775         (interface_declaration): Ditto.
27776
27777 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27778
27779         * class.cs (Method::Define): Track the "static Main" definition to
27780         create an entry point. 
27781
27782         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27783         EntryPoint if we find it. 
27784
27785         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27786         (EmitContext::ig): Make this variable public.
27787
27788         * driver.cs: Make the default output file be the first file name
27789         with the .exe extension.  
27790
27791         Detect empty compilations
27792
27793         Handle various kinds of output targets.  Handle --target and
27794         rename -t to --dumper.
27795
27796         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27797         methods inherited from Expression return now an Expression.  This
27798         will is used during the tree rewriting as we resolve them during
27799         semantic analysis.
27800
27801         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27802         the spec.  Missing entirely is the information about
27803         accessability of elements of it.
27804
27805         (Expression::ExprClassFromMemberInfo): New constructor for
27806         Expressions that creates a fully initialized Expression based on
27807         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27808         a Type.
27809
27810         (Invocation::Resolve): Begin implementing resolution of invocations.
27811
27812         * literal.cs (StringLiteral):  Implement Emit.
27813
27814 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27815
27816         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27817         member.
27818
27819 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27820
27821         * cs-parser.jay (attribute_arguments): Implement actions.
27822         (attribute): Fix bug in production. Implement action.
27823         (attribute_list): Implement.
27824         (attribute_target): Implement.
27825         (attribute_target_specifier, opt_target_specifier): Implement
27826         (CheckAttributeTarget): New method to check if the attribute target
27827         is valid.
27828         (attribute_section): Implement.
27829         (opt_attributes): Implement.
27830
27831         * attribute.cs : New file to handle attributes.
27832         (Attribute): Class to hold attribute info.
27833
27834         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27835         (attribute_section): Modify production to use 2 different rules to 
27836         achieve the same thing. 1 s/r conflict down !
27837         Clean out commented, useless, non-reducing dimension_separator rules.
27838
27839         * class.cs (TypeContainer.attributes): New member to hold list
27840         of attributes for a type.
27841         (Struct::Struct): Modify to take one more argument, the attribute list.
27842         (Class::Class): Ditto.
27843         (Field::Field): Ditto.
27844         (Method::Method): Ditto.
27845         (Property::Property): Ditto.
27846
27847         * cs-parser.jay (struct_declaration): Update constructor call to
27848         pass in the attributes too.
27849         (class_declaration): Ditto.
27850         (constant_declaration): Ditto.
27851         (field_declaration): Ditto.
27852         (method_header): Ditto.
27853         (fixed_parameter): Ditto.
27854         (parameter_array): Ditto.
27855         (property_declaration): Ditto.
27856
27857         * constant.cs (Constant::Constant): Update constructor similarly.
27858         Use System.Collections.
27859
27860         * parameter.cs (Parameter::Parameter): Update as above.
27861
27862 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27863
27864         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27865         (TypeContainer.delegates): New member to hold list of delegates.
27866
27867         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27868         this time as I seem to be on crack ;-)
27869
27870 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27871
27872         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27873         tell whether an identifier represents a namespace.
27874
27875         * expression.cs (NamespaceExpr): A namespace expression, used only
27876         temporarly during expression resolution.
27877         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27878         utility functions to resolve names on expressions.
27879
27880 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27881
27882         * codegen.cs: Add hook for StatementExpressions. 
27883
27884         * class.cs: Fix inverted test for static flag in methods.
27885
27886 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27887
27888         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27889         to make it coincide with MS' number.
27890         (Operator::CheckBinaryOperator): Ditto.
27891
27892         * ../errors/errors.txt : Remove error numbers added earlier.
27893
27894         * ../errors/cs1019.cs : Test case for error # 1019
27895
27896         * ../errros/cs1020.cs : Test case for error # 1020
27897
27898         * cs-parser.jay : Clean out commented cruft.
27899         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27900         used anywhere - non-reducing rule.
27901         (namespace_declarations): Non-reducing rule - comment out.
27902
27903         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27904         with TypeContainer::AddEnum.
27905
27906         * delegate.cs : New file for delegate handling classes.
27907         (Delegate): Class for declaring delegates.
27908
27909         * makefile : Update.
27910
27911         * cs-parser.jay (delegate_declaration): Implement.
27912
27913 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27914
27915         * class.cs (Event::Define): Implement.
27916         (Event.EventBuilder): New member.
27917
27918         * class.cs (TypeContainer::Populate): Update to define all enums and events
27919         we have.
27920         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27921         readonly fields for all these cases ?
27922
27923 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27924
27925         * class.cs (Property): Revamp to use the convention of making fields readonly.
27926         Accordingly modify code elsewhere.
27927
27928         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27929         the Define method of the Property class.
27930
27931         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27932         trivial bug.
27933         (TypeContainer::Populate): Update to define all the properties we have. Also
27934         define all enumerations.
27935
27936         * enum.cs (Define): Implement.
27937
27938 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27939
27940         * cs-parser.jay (overloadable_operator): The semantic value is an
27941         enum of the Operator class.
27942         (operator_declarator): Implement actions.
27943         (operator_declaration): Implement.
27944
27945         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27946         validity of definitions.
27947         (Operator::CheckBinaryOperator): Static method to check for binary operators
27948         (TypeContainer::AddOperator): New method to add an operator to a type.
27949
27950         * cs-parser.jay (indexer_declaration): Added line to actually call the
27951         AddIndexer method so it gets added ;-)
27952
27953         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27954         already taken care of by the MS compiler ?  
27955
27956 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27957
27958         * class.cs (Operator): New class for operator declarations.
27959         (Operator::OpType): Enum for the various operators.
27960
27961 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27962
27963         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27964         ostensibly handle this in semantic analysis.
27965
27966         * cs-parser.jay (general_catch_clause): Comment out
27967         (specific_catch_clauses, specific_catch_clause): Ditto.
27968         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27969         (catch_args, opt_catch_args): New productions.
27970         (catch_clause): Rewrite to use the new productions above
27971         (catch_clauses): Modify accordingly.
27972         (opt_catch_clauses): New production to use in try_statement
27973         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27974         and re-write the code in the actions to extract the specific and
27975         general catch clauses by being a little smart ;-)
27976
27977         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27978         Hooray, try and catch statements parse fine !
27979
27980 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27981
27982         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27983         string from the hashtable of variables.
27984
27985         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27986         I end up making that mistake ;-)
27987         (catch_clauses): Fixed gross error which made Key and Value of the 
27988         DictionaryEntry the same : $1 !!
27989
27990 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27991
27992         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27993
27994         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27995         when the add and remove accessors are specified. 
27996
27997 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27998
27999         * cs-parser.jay (IndexerDeclaration): New helper class to hold
28000         information about indexer_declarator.
28001         (indexer_declarator): Implement actions.
28002         (parsing_indexer): New local boolean used to keep track of whether
28003         we are parsing indexers or properties. This is necessary because 
28004         implicit_parameters come into picture even for the get accessor in the 
28005         case of an indexer.
28006         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
28007
28008         * class.cs (Indexer): New class for indexer declarations.
28009         (TypeContainer::AddIndexer): New method to add an indexer to a type.
28010         (TypeContainer::indexers): New member to hold list of indexers for the
28011         type.
28012
28013 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
28014
28015         * cs-parser.jay (add_accessor_declaration): Implement action.
28016         (remove_accessor_declaration): Implement action.
28017         (event_accessors_declaration): Implement
28018         (variable_declarators): swap statements for first rule - trivial.
28019
28020         * class.cs (Event): New class to hold information about event
28021         declarations.
28022         (TypeContainer::AddEvent): New method to add an event to a type
28023         (TypeContainer::events): New member to hold list of events.
28024
28025         * cs-parser.jay (event_declaration): Implement actions.
28026
28027 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
28028
28029         * cs-parser.jay (dim_separators): Implement. Make it a string
28030         concatenating all the commas together, just as they appear.
28031         (opt_dim_separators): Modify accordingly
28032         (rank_specifiers): Update accordingly. Basically do the same
28033         thing - instead, collect the brackets here.
28034         (opt_rank_sepcifiers): Modify accordingly.
28035         (array_type): Modify to actually return the complete type string
28036         instead of ignoring the rank_specifiers.
28037         (expression_list): Implement to collect the expressions
28038         (variable_initializer): Implement. We make it a list of expressions
28039         essentially so that we can handle the array_initializer case neatly too.
28040         (variable_initializer_list): Implement.
28041         (array_initializer): Make it a list of variable_initializers
28042         (opt_array_initializer): Modify accordingly.
28043
28044         * expression.cs (New::NType): Add enumeration to help us
28045         keep track of whether we have an object/delegate creation
28046         or an array creation.
28047         (New:NewType, New::Rank, New::Indices, New::Initializers): New
28048         members to hold data about array creation.
28049         (New:New): Modify to update NewType
28050         (New:New): New Overloaded contructor for the array creation
28051         case.
28052
28053         * cs-parser.jay (array_creation_expression): Implement to call
28054         the overloaded New constructor.
28055
28056 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
28057
28058         * class.cs (TypeContainer::Constructors): Return member
28059         constructors instead of returning null.
28060
28061 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
28062
28063         * typemanager.cs (InitCoreTypes): Initialize the various core
28064         types after we have populated the type manager with the user
28065         defined types (this distinction will be important later while
28066         compiling corlib.dll)
28067
28068         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
28069         on Expression Classification.  Now all expressions have a method
28070         `Resolve' and a method `Emit'.
28071
28072         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
28073         generation from working.     Also add some temporary debugging
28074         code. 
28075
28076 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
28077
28078         * codegen.cs: Lots of code generation pieces.  This is only the
28079         beginning, will continue tomorrow with more touches of polish.  We
28080         handle the fundamentals of if, while, do, for, return.  Others are
28081         trickier and I need to start working on invocations soon.
28082
28083         * gen-treedump.cs: Bug fix, use s.Increment here instead of
28084         s.InitStatement. 
28085
28086         * codegen.cs (EmitContext): New struct, used during code
28087         emission to keep a context.   Most of the code generation will be
28088         here. 
28089
28090         * cs-parser.jay: Add embedded blocks to the list of statements of
28091         this block.  So code generation proceeds in a top down fashion.
28092
28093 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
28094
28095         * statement.cs: Add support for multiple child blocks.
28096
28097 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
28098
28099         * codegen.cs (EmitCode): New function, will emit the code for a
28100         Block of code given a TypeContainer and its ILGenerator. 
28101
28102         * statement.cs (Block): Standard public readonly optimization.
28103         (Block::Block constructors): Link children. 
28104         (Block::Child): Child Linker.
28105         (Block::EmitVariables): Emits IL variable declarations.
28106
28107         * class.cs: Drop support for MethodGroups here, delay until
28108         Semantic Analysis.
28109         (Method::): Applied the same simplification that I did before, and
28110         move from Properties to public readonly fields.
28111         (Method::ParameterTypes): Returns the parameter types for the
28112         function, and implements a cache that will be useful later when I
28113         do error checking and the semantic analysis on the methods is
28114         performed.
28115         (Constructor::GetCallingConvention): Renamed from CallingConvetion
28116         and made a method, optional argument tells whether this is a class
28117         or a structure to apply the `has-this' bit.
28118         (Method::GetCallingConvention): Implement, returns the calling
28119         convention. 
28120         (Method::Define): Defines the type, a second pass is performed
28121         later to populate the methods.
28122
28123         (Constructor::ParameterTypes): implement a cache similar to the
28124         one on Method::ParameterTypes, useful later when we do semantic
28125         analysis. 
28126
28127         (TypeContainer::EmitMethod):  New method.  Emits methods.
28128
28129         * expression.cs: Removed MethodGroup class from here.
28130
28131         * parameter.cs (Parameters::GetCallingConvention): new method.
28132
28133 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
28134
28135         * class.cs (TypeContainer::Populate): Drop RootContext from the
28136         argument. 
28137
28138         (Constructor::CallingConvention): Returns the calling convention.
28139         (Constructor::ParameterTypes): Returns the constructor parameter
28140         types. 
28141
28142         (TypeContainer::AddConstructor): Keep track of default constructor
28143         and the default static constructor.
28144
28145         (Constructor::) Another class that starts using `public readonly'
28146         instead of properties. 
28147
28148         (Constructor::IsDefault): Whether this is a default constructor. 
28149
28150         (Field::) use readonly public fields instead of properties also.
28151
28152         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
28153         track of static constructors;  If none is used, turn on
28154         BeforeFieldInit in the TypeAttributes. 
28155
28156         * cs-parser.jay (opt_argument_list): now the return can be null
28157         for the cases where there are no arguments. 
28158
28159         (constructor_declarator): If there is no implicit `base' or
28160         `this', then invoke the default parent constructor. 
28161
28162         * modifiers.cs (MethodAttr): New static function maps a set of
28163         modifiers flags into a MethodAttributes enum
28164         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
28165         MethodAttr, TypeAttr to represent the various mappings where the
28166         modifiers are used.
28167         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
28168
28169 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
28170
28171         * parameter.cs (GetParameterInfo): Fix bug where there would be no
28172         method arguments.
28173
28174         * interface.cs (PopulateIndexer): Implemented the code generator
28175         for interface indexers.
28176
28177 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
28178
28179         * interface.cs (InterfaceMemberBase): Now we track the new status
28180         here.  
28181
28182         (PopulateProperty): Implement property population.  Woohoo!  Got
28183         Methods and Properties going today. 
28184
28185         Removed all the properties for interfaces, and replaced them with
28186         `public readonly' fields. 
28187
28188 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
28189
28190         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28191         initialize their hashtables/arraylists only when they are needed
28192         instead of doing this always.
28193
28194         * parameter.cs: Handle refs and out parameters.
28195
28196         * cs-parser.jay: Use an ArrayList to construct the arguments
28197         instead of the ParameterCollection, and then cast that to a
28198         Parameter[] array.
28199
28200         * parameter.cs: Drop the use of ParameterCollection and use
28201         instead arrays of Parameters.
28202
28203         (GetParameterInfo): Use the Type, not the Name when resolving
28204         types. 
28205
28206 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
28207
28208         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28209         and instead use public readonly fields.
28210
28211         * class.cs: Put back walking code for type containers.
28212
28213 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
28214
28215         * class.cs (MakeConstant): Code to define constants.
28216
28217         * rootcontext.cs (LookupType): New function.  Used to locate types 
28218
28219
28220 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
28221
28222         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
28223         this System.Reflection code is.  Kudos to Microsoft
28224
28225         * typemanager.cs: Implement a type cache and avoid loading all
28226         types at boot time.  Wrap in LookupType the internals.  This made
28227         the compiler so much faster.  Wow.  I rule!
28228
28229         * driver.cs: Make sure we always load mscorlib first (for
28230         debugging purposes, nothing really important).
28231
28232         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
28233         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
28234
28235         * rootcontext.cs: Lookup types on their namespace;  Lookup types
28236         on namespaces that have been imported using the `using' keyword.
28237
28238         * class.cs (TypeContainer::TypeAttr): Virtualize.
28239         (Class::TypeAttr): Return attributes suitable for this bad boy.
28240         (Struct::TypeAttr): ditto.
28241         Handle nested classes.
28242         (TypeContainer::) Remove all the type visiting code, it is now
28243         replaced with the rootcontext.cs code
28244
28245         * rootcontext.cs (GetClassBases): Added support for structs. 
28246
28247 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
28248
28249         * interface.cs, statement.cs, class.cs, parameter.cs,
28250         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28251         Drop use of TypeRefs, and use strings instead.
28252
28253 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
28254
28255         * rootcontext.cs: 
28256
28257         * class.cs (Struct::Struct): set the SEALED flags after
28258         checking the modifiers.
28259         (TypeContainer::TypeAttr): new property, returns the
28260         TypeAttributes for a class.  
28261
28262         * cs-parser.jay (type_list): Oops, list production was creating a
28263         new list of base types.
28264
28265         * rootcontext.cs (StdLib): New property.
28266         (GetInterfaceTypeByName): returns an interface by type name, and
28267         encapsulates error handling here.
28268         (GetInterfaces): simplified.
28269         (ResolveTree): Encapsulated all the tree resolution here.
28270         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28271         types. 
28272
28273         * driver.cs: Add support for --nostdlib, to avoid loading the
28274         default assemblies.
28275         (Main): Do not put tree resolution here. 
28276
28277         * rootcontext.cs: Beginning of the class resolution.
28278
28279 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
28280
28281         * rootcontext.cs: Provide better error reporting. 
28282
28283         * cs-parser.jay (interface_base): set our $$ to be interfaces.
28284
28285         * rootcontext.cs (CreateInterface): Handle the case where there
28286         are no parent interfaces.
28287
28288         (CloseTypes): Routine to flush types at the end.
28289         (CreateInterface): Track types.
28290         (GetInterfaces): Returns an array of Types from the list of
28291         defined interfaces.
28292
28293         * typemanager.c (AddUserType): Mechanism to track user types (puts
28294         the type on the global type hash, and allows us to close it at the
28295         end). 
28296
28297 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
28298
28299         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28300         RecordInterface instead.
28301
28302         * cs-parser.jay: Updated to reflect changes above.
28303
28304         * decl.cs (Definition): Keep track of the TypeBuilder type that
28305         represents this type here.  Not sure we will use it in the long
28306         run, but wont hurt for now.
28307
28308         * driver.cs: Smaller changes to accomodate the new code.
28309
28310         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28311         when done. 
28312
28313         * rootcontext.cs (CreateInterface):  New method, used to create
28314         the System.TypeBuilder type for interfaces.
28315         (ResolveInterfaces): new entry point to resolve the interface
28316         hierarchy. 
28317         (CodeGen): Property, used to keep track of the code generator.
28318
28319 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
28320
28321         * cs-parser.jay: Add a second production for delegate_declaration
28322         with `VOID'.
28323
28324         (enum_body): Put an opt_comma here instead of putting it on
28325         enum_body or enum_member_declarations so we can handle trailing
28326         commas on enumeration members.  Gets rid of a shift/reduce.
28327
28328         (type_list): Need a COMMA in the middle.
28329
28330         (indexer_declaration): Tell tokenizer to recognize get/set
28331
28332         * Remove old targets.
28333
28334         * Re-add the parser target.
28335
28336 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28337
28338         * cs-parser.jay: Add precendence rules for a number of operators
28339         ot reduce the number of shift/reduce conflicts in the grammar.
28340
28341 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28342
28343         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28344         and put it here.
28345
28346         Get rid of old crufty code.
28347
28348         * rootcontext.cs: Use this to keep track of the parsed
28349         representation and the defined types available to the program. 
28350
28351         * gen-treedump.cs: adjust for new convention.
28352
28353         * type.cs: Split out the type manager, and the assembly builder
28354         from here. 
28355
28356         * typemanager.cs: the type manager will live here now.
28357
28358         * cil-codegen.cs: And the code generator here. 
28359
28360 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
28361
28362         * makefile: Fixed up for easy making.
28363
28364 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28365
28366         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28367         the 
28368
28369         (unary_expression): Expand pre_increment_expression and
28370         post_decrement_expression to reduce a shift/reduce.
28371
28372 2001-07-11  Simon Cozens
28373
28374         * cs-tokenizer.cs: Hex numbers should begin with a 0.
28375
28376         Improve allow_keyword_as_indent name.
28377
28378 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28379
28380         * Adjustments for Beta2. 
28381
28382 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
28383
28384         * decl.cs: Added `Define' abstract method.
28385         (InTransit): new property, used to catch recursive definitions. 
28386
28387         * interface.cs: Implement `Define'. 
28388
28389         * modifiers.cs: Map Modifiers.constants to
28390         System.Reflection.TypeAttribute flags.
28391
28392         * class.cs: Keep track of types and user-defined types.
28393         (BuilderInit): New method for creating an assembly
28394         (ResolveType): New function to launch the resolution process, only
28395         used by interfaces for now.
28396
28397         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28398         that are inserted into the name space. 
28399
28400 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
28401
28402         * ARGH.  I have screwed up my tree so many times due to the use of
28403         rsync rather than using CVS.  Going to fix this at once. 
28404
28405         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
28406         load types.
28407
28408 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
28409
28410         * Experiment successful: Use System.Type rather that our own
28411         version of Type.  
28412
28413 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
28414
28415         * cs-parser.jay: Removed nsAliases from here.
28416
28417         Use new namespaces, handle `using XXX;' 
28418
28419         * namespace.cs: Reimplemented namespace handling, use a recursive
28420         definition of the class.  Now we can keep track of using clauses
28421         and catch invalid using clauses.
28422
28423 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
28424
28425         * gen-treedump.cs: Adapted for all the renaming.
28426
28427         * expression.cs (Expression): this class now has a Type property
28428         which returns an expression Type.
28429
28430         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28431         `Type', as this has a different meaning now in the base
28432
28433 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
28434
28435         * interface.cs, class.cs: Removed from all the sources the
28436         references to signature computation, as we can not do method
28437         signature computation during the parsing time, as we are not
28438         trying to solve at that point distinguishing:
28439
28440         class X {
28441                 void a (Blah x) {}
28442                 void a (NS.Blah x) {}
28443         }
28444
28445         Which depending on the context might be valid or not, as we do not
28446         know if Blah is the same thing as NS.Blah at that point.
28447
28448         * Redid everything so the code uses TypeRefs now instead of
28449         Types.  TypeRefs are just temporary type placeholders, that need
28450         to be resolved.  They initially have a pointer to a string and the
28451         current scope in which they are used.  This is used later by the
28452         compiler to resolve the reference to an actual Type. 
28453
28454         * DeclSpace is no longer a CIR.Type, and neither are
28455         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
28456         are all DeclSpaces, but no Types. 
28457
28458         * type.cs (TypeRefManager): This implements the TypeRef manager,
28459         which keeps track of all the types that need to be resolved after
28460         the parsing has finished. 
28461
28462 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
28463
28464         * ARGH.  We are going to have to store `foreach' as a class rather
28465         than resolving it, as we need to verify error 1579 after name
28466         resolution.   *OR* we could keep a flag that says `This request to
28467         IEnumerator comes from a foreach statement' which we can then use
28468         to generate the error.
28469
28470 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
28471
28472         * class.cs (TypeContainer.AddMethod): we now add methods to the
28473         MethodGroup instead of the method hashtable.  
28474
28475         * expression.cs: Add MethodGroup abstraction, which gets us one
28476         step closer to the specification in the way we handle method
28477         declarations.  
28478
28479         * cs-parser.jay (primary_expression): qualified_identifier now
28480         tried to match up an identifier to a local variable reference or
28481         to a parameter reference.
28482
28483         current_local_parameters is now a parser global variable that
28484         points to the current parameters for the block, used during name
28485         lookup.
28486
28487         (property_declaration): Now creates an implicit `value' argument to
28488         the set accessor.
28489
28490 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
28491
28492         * parameter.cs: Do not use `param' arguments as part of the
28493         signature, per the spec.
28494
28495 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
28496
28497         * decl.cs: Base class for classes, structs and interfaces.  This
28498         is the "Declaration Space" 
28499
28500         * cs-parser.jay: Use CheckDef for checking declaration errors
28501         instead of having one on each function.
28502
28503         * class.cs: Factor out some code for handling error handling in
28504         accordance to the "Declarations" section in the "Basic Concepts"
28505         chapter in the ECMA C# spec.
28506
28507         * interface.cs: Make all interface member classes derive from
28508         InterfaceMemberBase.
28509
28510 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28511
28512         * Many things: all interfaces are parsed and generated in
28513         gen-treedump.  Support for member variables, constructors,
28514         destructors, properties, constants is there.
28515
28516         Beginning of the IL backend, but very little done, just there for
28517         testing purposes. 
28518
28519 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28520
28521         * cs-parser.jay: Fix labeled statement.
28522
28523         * cs-tokenizer.cs (escape): Escape " and ' always.
28524         ref_line, ref_name: keep track of the line/filename as instructed
28525         by #line by the compiler.
28526         Parse #line.
28527
28528 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28529
28530         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28531         to match the values in System.CodeDOM.
28532
28533         Divid renamed to Divide.
28534
28535         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28536         statements. 
28537         (Statements.set): remove.
28538
28539         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28540         statements. 
28541
28542         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28543         falseStatements always have valid values. 
28544
28545         * cs-parser.jay: Use System.CodeDOM now.
28546